Address io1fhdcers5rgtslsf0j5r6nga0sys8tk393nn4hu

Contract Overview

Balance:
0 IOTX

IOTX Value:
$ 0

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
89f72c6aa34b73aa61256143994b481b8a0c6bc2a5d0c1caf3e5c0b0a8400f57 23192403 2023-11-09 14:19:15 +0000 UTC 6 months ago io12f24uv7v7ydvhff6h9882gzvp2jcqncxfalufj  IN    Contract: SmartBulb 0 IOTX 0.016114
02383963c991828616920f5fbdab35267e8e8f1706409144763dedcec05f63b1 23192382 2023-11-09 14:17:25 +0000 UTC 6 months ago io1ugvxcdfufh7n87p84lydk4fp0dpdpcalafe63a  IN    Contract: SmartBulb 0 IOTX 0.013132
3bf758deab95fdb99d4eb011a1852cf8541bc34f8c2cb10581b8cb21f3f0f578 23192319 2023-11-09 14:11:50 +0000 UTC 6 months ago io12f24uv7v7ydvhff6h9882gzvp2jcqncxfalufj  IN    Contract: SmartBulb 0 IOTX 0.016114
f8351f1e0a3f8224129ca1a1e1f16cfb2c817465c999b29e6366d5626e3555c7 23192311 2023-11-09 14:11:10 +0000 UTC 6 months ago io12f24uv7v7ydvhff6h9882gzvp2jcqncxfalufj  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: artifacts/turnonlight.sol



pragma solidity 0.8.5; 
 
// import the "Ownable" interface from OpenZepplin, that implements 
//the "onlyOwner" modifier we use to make sure the contract owner  
// can operate 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; 
     
    // For Safety, lets initialize the state to false (Light is OFF) 
    constructor ()  onlyOwner { 
        BlueLightState = false;  
        GreenLightState = false;  
         
    } 
     
    // 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

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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

608060405234801561001057600080fd5b506004361061007d5760003560e01c806388ac65d11161005b57806388ac65d1146100c85780638da5cb5b146100d2578063c26fe869146100f0578063f2fde38b146100fa5761007d565b80634a69ab39146100825780634c0d5cba146100a0578063715018a6146100be575b600080fd5b61008a610116565b6040516100979190610470565b60405180910390f35b6100a8610129565b6040516100b59190610470565b60405180910390f35b6100c661013c565b005b6100d0610150565b005b6100da610184565b6040516100e79190610455565b60405180910390f35b6100f86101ad565b005b610114600480360381019061010f91906103c4565b6101e1565b005b600060159054906101000a900460ff1681565b600060149054906101000a900460ff1681565b610144610265565b61014e60006102e3565b565b610158610265565b600060159054906101000a900460ff1615600060156101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6101b5610265565b600060149054906101000a900460ff1615600060146101000a81548160ff021916908315150217905550565b6101e9610265565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102509061048b565b60405180910390fd5b610262816102e3565b50565b61026d6103a7565b73ffffffffffffffffffffffffffffffffffffffff1661028b610184565b73ffffffffffffffffffffffffffffffffffffffff16146102e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d8906104ab565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6000813590506103be81610597565b92915050565b6000602082840312156103da576103d961051a565b5b60006103e8848285016103af565b91505092915050565b6103fa816104dc565b82525050565b610409816104ee565b82525050565b600061041c6026836104cb565b91506104278261051f565b604082019050919050565b600061043f6020836104cb565b915061044a8261056e565b602082019050919050565b600060208201905061046a60008301846103f1565b92915050565b60006020820190506104856000830184610400565b92915050565b600060208201905081810360008301526104a48161040f565b9050919050565b600060208201905081810360008301526104c481610432565b9050919050565b600082825260208201905092915050565b60006104e7826104fa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6105a0816104dc565b81146105ab57600080fd5b5056fea26469706673582212202746edabe2c1787e9655bbbec407b9cab0d82280e200a8809234d0a55508daf164736f6c63430008050033

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.