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
Contract0x1ef3d447d4272d905c4489ee62ba9a0d8d48ba5f

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.28+commit.7893614a.js
Other Settings

cancun

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
0x6080604052348015600e575f5ffd5b505f80546001600160a01b0319163390811782556040519091907f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735908290a36101e28061005a5f395ff3fe608060405234801561000f575f5ffd5b5060043610610034575f3560e01c8063893d20e814610038578063a6f9dae114610056575b5f5ffd5b5f54604080516001600160a01b039092168252519081900360200190f35b61006961006436600461017f565b61006b565b005b5f546001600160a01b031633146100bf5760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b60448201526064015b60405180910390fd5b6001600160a01b0381166101265760405162461bcd60e51b815260206004820152602860248201527f4e6577206f776e65722073686f756c64206e6f7420626520746865207a65726f604482015267206164647265737360c01b60648201526084016100b6565b5f80546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f6020828403121561018f575f5ffd5b81356001600160a01b03811681146101a5575f5ffd5b939250505056fea26469706673582212207cfeb727eaccac11dd30a5bef9da389de32c483387b9570bd81185e65cda899b64736f6c634300081c0033
</> 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
0x608060405234801561000f575f5ffd5b5060043610610034575f3560e01c8063893d20e814610038578063a6f9dae114610056575b5f5ffd5b5f54604080516001600160a01b039092168252519081900360200190f35b61006961006436600461017f565b61006b565b005b5f546001600160a01b031633146100bf5760405162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b60448201526064015b60405180910390fd5b6001600160a01b0381166101265760405162461bcd60e51b815260206004820152602860248201527f4e6577206f776e65722073686f756c64206e6f7420626520746865207a65726f604482015267206164647265737360c01b60648201526084016100b6565b5f80546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f6020828403121561018f575f5ffd5b81356001600160a01b03811681146101a5575f5ffd5b939250505056fea26469706673582212207cfeb727eaccac11dd30a5bef9da389de32c483387b9570bd81185e65cda899b64736f6c634300081c0033
logo
GateScan is a Block Explorer and Analytics Platform for GateChain