Gate Layer is live! View your transactions on  Gate Layer Explorer .
gate
GT Price:$10.69-2.46%
Med Gas Fee:12.14 NANOGT
Account Details
Contract0x54fd4905716cad3d107676812bfdf2b43d623270

Overview

GT Balance

0 GT($0)

Token Holdings

0 Tokens

More Info

Contract Creator

Contract Source Code Verified (Exact Match)
Contract Name
Owner
Optimization

Yes, with

200

runs

Compiler
solidity
Compiler Version
v0.8.20+commit.a1b79de6.js
Other Settings

istanbul

evmVersion

MIT

License

</> Contract source code
//SPDX-License-Identifier:MIT

pragma solidity >=0.8.0 <0.9.0;

// import "hardhat/console.sol";

/**
 * @title Owner
 * @dev Set & change owner
 */
contract Owner {

    address private owner;

    // event for EVM logging
    event OwnerSet(address indexed oldOwner, address indexed newOwner);

    // modifier to check if caller is owner
    modifier isOwner() {
        // If the first argument of 'require' evaluates to 'false', execution terminates and all
        // changes to the state and to Ether balances are reverted.
        // This used to consume all gas in old EVM versions, but not anymore.
        // It is often a good idea to use 'require' to check if functions are called correctly.
        // As a second argument, you can also provide an explanation about what went wrong.
        require(msg.sender == owner, "Caller is not owner");
        _;
    }

    /**
     * @dev Set contract deployer as owner
     */
    constructor() {
        //console.log("Owner contract deployed by:", msg.sender);
        owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
        emit OwnerSet(address(0), owner);
    }

    /**
     * @dev Change owner
     * @param newOwner address of new owner
     */
    function changeOwner(address newOwner) public isOwner {
        require(newOwner != address(0), "New owner should not be the zero address");
        emit OwnerSet(owner, newOwner);
        owner = newOwner;
    }

    /**
     * @dev Return owner address 
     * @return address of owner
     */
    function getOwner() external view returns (address) {
        return owner;
    }
}
</> Contract Creation Bytecode
0x608060405234801561001057600080fd5b50600080546001600160a01b0319163390811782556040519091907f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735908290a36101ec8061005f6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063893d20e81461003b578063a6f9dae11461005a575b600080fd5b600054604080516001600160a01b039092168252519081900360200190f35b61006d610068366004610186565b61006f565b005b6000546001600160a01b031633146100c45760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b60448201526064015b60405180910390fd5b6001600160a01b03811661012b5760405162461bcd60e51b815260206004820152602860248201527f4e6577206f776e65722073686f756c64206e6f7420626520746865207a65726f604482015267206164647265737360c01b60648201526084016100bb565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561019857600080fd5b81356001600160a01b03811681146101af57600080fd5b939250505056fea2646970667358221220c96de7b91dcd2f150481229f25f0021aae64dea1484ff969abb963fd3cb2ed1364736f6c63430008140033
</> Contract ABI
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerSet","type":"event"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
</> Contract Deployment Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063893d20e81461003b578063a6f9dae11461005a575b600080fd5b600054604080516001600160a01b039092168252519081900360200190f35b61006d610068366004610186565b61006f565b005b6000546001600160a01b031633146100c45760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b60448201526064015b60405180910390fd5b6001600160a01b03811661012b5760405162461bcd60e51b815260206004820152602860248201527f4e6577206f776e65722073686f756c64206e6f7420626520746865207a65726f604482015267206164647265737360c01b60648201526084016100bb565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561019857600080fd5b81356001600160a01b03811681146101af57600080fd5b939250505056fea2646970667358221220c96de7b91dcd2f150481229f25f0021aae64dea1484ff969abb963fd3cb2ed1364736f6c63430008140033
logo
GateScan is a Block Explorer and Analytics Platform for GateChain