Address io1dl7x35wsnjhra4plxeskwpeqxdemnhvwrdd65s

Contract Overview

Balance:
0 IOTX

IOTX Value:
$ 0

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
85c6580952cf96ae4d95b501c9a10ee43179a7368b4352d2d0a247a7913a7c3e 23896297 2023-12-22 14:42:40 +0000 UTC 5 months ago io1e7nw00zex33s64hl0am8faxw5zvupqv2rdhve3  IN    Contract: SmartBulb 0 IOTX 0.016114
9c83a41dc17a33ab06b3ec423a9f92b2a2c4710ffa4497c771c66039f772fff1 23896293 2023-12-22 14:42:20 +0000 UTC 5 months ago io1e7nw00zex33s64hl0am8faxw5zvupqv2rdhve3  IN    Contract: SmartBulb 0 IOTX 0.016158
68abafc868bd54c1fc40ee7e075c0defa08b21b272c998776d5c8b597c2ed6a4 23896285 2023-12-22 14:41:35 +0000 UTC 5 months ago io1e7nw00zex33s64hl0am8faxw5zvupqv2rdhve3  IN    Contract: SmartBulb 0 IOTX 0.016114
e3ad75e3cc2a6e9c59e26602af735bc7646f4a40f867ed10c30991dc04007e54 23896281 2023-12-22 14:41:15 +0000 UTC 5 months ago io1e7nw00zex33s64hl0am8faxw5zvupqv2rdhve3  IN    Contract: SmartBulb 0 IOTX 0.016158
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SmartBulb

Compiler Version
v0.8.5+commit.a4f2e591

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: contracts/light.sol



pragma solidity 0.8.5;
// import the "Ownable" interface from OpenZepplin, that implements
//the "onlyOwner" m¨difier we use to make sure the contract owner

// can ¨perate the with the light
// Title Simple Smart Bulb
// @dev Very Simple smart contract to manage the state of a smart light
// @Author PGG, RedAlertLabs
contract SmartBulb is Ownable {

    // Keeps the status of the smart bulb : true = Light is ON!
    bool public BlueLightState;
    bool public GreenLightState;
    

    // Toggles the state of the blue smart bulb,
    // Only the contract Owner account can call this function!
    function toggleBlueLight() public onlyOwner {

         BlueLightState = !BlueLightState; 

    }
    // Toggles the state of the blue smart bulb,
    // Only the contract Owner account can call this function!
    function toggleGreenLight() public onlyOwner { 

        GreenLightState = !GreenLightState; 

    }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"BlueLightState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GreenLightState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleBlueLight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleGreenLight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Contract Creation Code

608060405234801561001057600080fd5b506004361061007d5760003560e01c806388ac65d11161005b57806388ac65d1146100c85780638da5cb5b146100d2578063c26fe869146100f0578063f2fde38b146100fa5761007d565b80634a69ab39146100825780634c0d5cba146100a0578063715018a6146100be575b600080fd5b61008a610116565b6040516100979190610470565b60405180910390f35b6100a8610129565b6040516100b59190610470565b60405180910390f35b6100c661013c565b005b6100d0610150565b005b6100da610184565b6040516100e79190610455565b60405180910390f35b6100f86101ad565b005b610114600480360381019061010f91906103c4565b6101e1565b005b600060159054906101000a900460ff1681565b600060149054906101000a900460ff1681565b610144610265565b61014e60006102e3565b565b610158610265565b600060159054906101000a900460ff1615600060156101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6101b5610265565b600060149054906101000a900460ff1615600060146101000a81548160ff021916908315150217905550565b6101e9610265565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102509061048b565b60405180910390fd5b610262816102e3565b50565b61026d6103a7565b73ffffffffffffffffffffffffffffffffffffffff1661028b610184565b73ffffffffffffffffffffffffffffffffffffffff16146102e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d8906104ab565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6000813590506103be81610597565b92915050565b6000602082840312156103da576103d961051a565b5b60006103e8848285016103af565b91505092915050565b6103fa816104dc565b82525050565b610409816104ee565b82525050565b600061041c6026836104cb565b91506104278261051f565b604082019050919050565b600061043f6020836104cb565b915061044a8261056e565b602082019050919050565b600060208201905061046a60008301846103f1565b92915050565b60006020820190506104856000830184610400565b92915050565b600060208201905081810360008301526104a48161040f565b9050919050565b600060208201905081810360008301526104c481610432565b9050919050565b600082825260208201905092915050565b60006104e7826104fa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6105a0816104dc565b81146105ab57600080fd5b5056fea264697066735822122098f043f6b3a3f8c7239be6304393961ddb6fda0410df5a52193207f0b11354f764736f6c63430008050033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.