APE Price: $1.07 (+4.32%)

Contract

0x2bB8CBF6a38F4945d275B108b1a94cb10bcfD069

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Module64729392024-12-10 11:48:0835 days ago1733831288IN
0x2bB8CBF6...10bcfD069
0 APE0.0012541825.42069
Set Module64729352024-12-10 11:48:0135 days ago1733831281IN
0x2bB8CBF6...10bcfD069
0 APE0.0012541825.42069
Set Admin56967532024-11-28 7:53:4247 days ago1732780422IN
0x2bB8CBF6...10bcfD069
0 APE0.0007172425.42069

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Core

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
File 1 of 7 : Core.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "./managers/FallbackManager.sol";
import "./ICoreStorage.sol";

import "../helpers/Utils.sol";

/// @title Cyan Wallet Core - A Cyan wallet's core features.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
contract Core is ICoreStorage, IFallbackManager {
    struct Call {
        address to;
        uint256 value;
        bytes data;
    }

    constructor() ICoreStorage(msg.sender) {}

    /// @notice Initiates new wallet.
    /// @param owner Address of the wallet owner.
    function initiate(address owner) external {
        require(_owner == address(0x0), "Wallet already initialized.");
        require(owner != address(0x0), "Invalid owner address.");

        _owner = owner;
        emit SetOwner(owner);
    }

    /// @notice Main transaction handling method of the wallet.
    ///      Note: All the non-core transactions go through this method.
    /// @param to Destination contract address.
    /// @param value Native token value of the transaction.
    /// @param data Data payload of the transaction.
    /// @return Result of the transaction.
    function execute(
        address to,
        uint256 value,
        bytes calldata data
    ) public payable onlyDelegateCall onlyOwner returns (bytes memory) {
        require(address(this).balance >= value, "Not enough balance.");
        if (data.length == 0) {
            return Utils._execute(to, value, data);
        }

        bytes4 funcHash = Utils.parseFunctionSelector(data);
        address module = Core(_this).getModule(to, funcHash);
        require(module != address(0x0), "Not supported method.");

        (bool success, bytes memory result) = module.delegatecall(
            abi.encodeWithSignature("handleTransaction(address,uint256,bytes)", to, value, data)
        );
        if (!success) {
            assembly {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
        }
        return result;
    }

    function executeBatch(Call[] calldata data) external payable onlyDelegateCall onlyOwner {
        for (uint8 i = 0; i < data.length; ++i) {
            execute(data[i].to, data[i].value, data[i].data);
        }
    }

    /// @inheritdoc IModuleManager
    function executeModule(bytes calldata data) external override onlyDelegateCall onlyOperator returns (bytes memory) {
        bytes4 funcHash = Utils.parseFunctionSelector(data);
        address module = Core(_this).getInternalModule(funcHash);
        require(module != address(0x0), "Not supported method.");

        (bool success, bytes memory result) = module.delegatecall(data);
        if (!success) {
            assembly {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
        }
        return result;
    }

    /// @inheritdoc IFallbackManager
    function setFallbackHandler(address handler) external override noDelegateCall onlyAdmin {
        require(handler != address(0x0), "Invalid handler address.");
        _setFallbackHandler(handler);
    }

    fallback() external payable onlyDelegateCall {
        address handler = Core(_this).getFallbackHandler();
        assembly {
            if iszero(handler) {
                return(0, 0)
            }

            calldatacopy(0, 0, calldatasize())
            let success := delegatecall(gas(), handler, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            if gt(success, 0) {
                return(0, returndatasize())
            }

            revert(0, returndatasize())
        }
    }
}

File 2 of 7 : ICoreStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "./managers/DelegateCallManager.sol";
import "./managers/RoleManager.sol";
import "./managers/ModuleManager.sol";

/// @title Cyan Wallet Core Storage - A Cyan wallet's core storage features.
/// @dev This contract must be the very first parent of the Core contract and Module contracts.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract ICoreStorage is DelegateCallManager, IRoleManager, IModuleManager {
    constructor(address admin) IRoleManager(admin) {
        require(admin != address(0x0), "Invalid admin address.");
    }

    /// @inheritdoc IModuleManager
    function setModule(
        address target,
        bytes4 funcHash,
        address module
    ) external override noDelegateCall onlyAdmin {
        emit SetModule(target, funcHash, _modules[target][funcHash], module);
        _modules[target][funcHash] = module;
    }

    /// @inheritdoc IModuleManager
    function setInternalModule(bytes4 funcHash, address module) external override noDelegateCall onlyAdmin {
        emit SetInternalModule(funcHash, _internalModules[funcHash], module);
        _internalModules[funcHash] = module;
    }

    /// @inheritdoc IRoleManager
    function getOwner() external view override onlyDelegateCall returns (address) {
        return _owner;
    }

    /// @inheritdoc IRoleManager
    function setAdmin(address admin) external override noDelegateCall onlyAdmin {
        require(admin != address(0x0), "Invalid admin address.");
        _admin = admin;
        emit SetAdmin(admin);
    }

    /// @inheritdoc IRoleManager
    function getAdmin() external view override noDelegateCall returns (address) {
        return _admin;
    }

    /// @inheritdoc IRoleManager
    function setOperator(address operator, bool isActive) external override noDelegateCall onlyAdmin {
        require(operator != address(0x0), "Invalid operator address.");
        _operators[operator] = isActive;
        emit SetOperator(operator, isActive);
    }

    /// @inheritdoc IRoleManager
    function _checkOnlyAdmin() internal view override {
        if (address(this) != _this) {
            require(ICoreStorage(_this).getAdmin() == msg.sender, "Caller is not an admin.");
        } else {
            require(_admin == msg.sender, "Caller is not an admin.");
        }
    }

    /// @inheritdoc IRoleManager
    function isOperator(address operator) external view override noDelegateCall returns (bool result) {
        return _operators[operator];
    }

    /// @inheritdoc IRoleManager
    function _checkOnlyOperator() internal view override {
        require(ICoreStorage(_this).isOperator(msg.sender), "Caller is not an operator.");
    }

    /// @inheritdoc IRoleManager
    function _checkOnlyOwner() internal view override {
        require(_owner == msg.sender, "Caller is not an owner.");
    }
}

File 3 of 7 : DelegateCallManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

/// @title Manage the delegatecall to a contract
/// @notice Base contract that provides a modifier for managing delegatecall to methods in a child contract
abstract contract DelegateCallManager {
    /// @dev The address of this contract
    address payable internal immutable _this;

    constructor() {
        // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode.
        // In other words, this variable won't change when it's checked at runtime.
        _this = payable(address(this));
    }

    /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method,
    ///     and the use of immutable means the address bytes are copied in every place the modifier is used.
    function _checkNotDelegateCall() private view {
        require(address(this) == _this, "Only direct calls allowed.");
    }

    /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method,
    ///     and the use of immutable means the address bytes are copied in every place the modifier is used.
    function _checkOnlyDelegateCall() private view {
        require(address(this) != _this, "Cannot be called directly.");
    }

    /// @notice Prevents delegatecall into the modified method
    modifier noDelegateCall() {
        _checkNotDelegateCall();
        _;
    }

    /// @notice Prevents non delegatecall into the modified method
    modifier onlyDelegateCall() {
        _checkOnlyDelegateCall();
        _;
    }
}

File 4 of 7 : FallbackManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

/// @title Cyan Wallet Fallback Manager - A Cyan wallet's fallback manager.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract IFallbackManager {
    // keccak256("core.fallbackHandler.address")
    bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT =
        0x7734d301adfb6b9d8ff43068373ec4ffef29a42d1456fb5e0ba2ebb9f4793edb;

    event ChangedFallbackHandler(address handler);

    /// @notice Sets the fallback handler.
    /// @param handler Address of the fallback handler.
    function _setFallbackHandler(address handler) internal {
        bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
        assembly {
            sstore(slot, handler)
        }
        emit ChangedFallbackHandler(handler);
    }

    /// @notice Sets the fallback handler.
    /// @param handler Address of the fallback handler.
    function setFallbackHandler(address handler) external virtual;

    /// @notice Returns the fallback handler.
    /// @return handler Address of the fallback handler.
    function getFallbackHandler() external view returns (address handler) {
        bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
        assembly {
            handler := sload(slot)
        }
    }

    /// @notice Returns an native token balance of the wallet.
    /// return native token balance of the wallet.
    function getBalance() external view returns (uint256) {
        return address(this).balance;
    }

    /// @notice Allows the wallet to receive native token.
    receive() external payable {}
}

File 5 of 7 : ModuleManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

/// @title Cyan Wallet Module Manager Storage - A Cyan wallet's module manager's storage.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract ModuleManagerStorage {
    /// @notice Storing allowed contract methods.
    ///     Note: Target Contract Address => Sighash of method => Module address
    mapping(address => mapping(bytes4 => address)) internal _modules;

    /// @notice Storing internally allowed module methods.
    ///     Note: Sighash of module method => Module address
    mapping(bytes4 => address) internal _internalModules;
}

/// @title Cyan Wallet Module Manager - A Cyan wallet's module manager's functionalities.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract IModuleManager is ModuleManagerStorage {
    event SetModule(address target, bytes4 funcHash, address oldModule, address newModule);
    event SetInternalModule(bytes4 funcHash, address oldModule, address newModule);

    /// @notice Sets the handler module of the target's function.
    /// @param target Address of the target contract.
    /// @param funcHash Sighash of the target contract's method.
    /// @param module Address of the handler module.
    function setModule(
        address target,
        bytes4 funcHash,
        address module
    ) external virtual;

    /// @notice Returns a handling module of the target function.
    /// @param target Address of the target contract.
    /// @param funcHash Sighash of the target contract's method.
    /// @return module Handler module.
    function getModule(address target, bytes4 funcHash) external view returns (address) {
        return _modules[target][funcHash];
    }

    /// @notice Sets the internal handler module of the function.
    /// @param funcHash Sighash of the module method.
    /// @param module Address of the handler module.
    function setInternalModule(bytes4 funcHash, address module) external virtual;

    /// @notice Returns an internal handling module of the given function.
    /// @param funcHash Sighash of the module's method.
    /// @return module Handler module.
    function getInternalModule(bytes4 funcHash) external view returns (address) {
        return _internalModules[funcHash];
    }

    /// @notice Used to call module functions on the wallet.
    ///     Usually used to call locking function of the module on the wallet.
    /// @param data Data payload of the transaction.
    /// @return Result of the execution.
    function executeModule(bytes memory data) external virtual returns (bytes memory);
}

File 6 of 7 : RoleManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

/// @title Cyan Wallet Role Manager - A Cyan wallet's role manager's storage.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract RoleManagerStorage {
    address[3] internal _deprecatedOperators; // Deprecated
    address internal _admin;
    address internal _owner;
    mapping(address => bool) internal _operators;
}

/// @title Cyan Wallet Role Manager - A Cyan wallet's role manager's functionalities.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
abstract contract IRoleManager is RoleManagerStorage {
    event SetOwner(address owner);
    event SetAdmin(address admin);
    event SetOperator(address operator, bool isActive);

    modifier onlyOperator() {
        _checkOnlyOperator();
        _;
    }

    modifier onlyAdmin() {
        _checkOnlyAdmin();
        _;
    }

    modifier onlyOwner() {
        _checkOnlyOwner();
        _;
    }

    constructor(address admin) {
        require(admin != address(0x0), "Invalid admin address.");
        _admin = admin;
    }

    /// @notice Returns current owner of the wallet.
    /// @return Address of the current owner.
    function getOwner() external view virtual returns (address);

    /// @notice Changes the current admin.
    /// @param admin New admin address.
    function setAdmin(address admin) external virtual;

    /// @notice Returns current admin of the core contract.
    /// @return Address of the current admin.
    function getAdmin() external view virtual returns (address);

    /// @notice Sets the operator status.
    /// @param operator Operator address.
    /// @param isActive Is active or not.
    function setOperator(address operator, bool isActive) external virtual;

    /// @notice Checks whether the given address is an operator.
    /// @param operator Address that will be checked.
    /// @return result Boolean result.
    function isOperator(address operator) external view virtual returns (bool result);

    /// @notice Checks whether the message sender is an operator.
    function _checkOnlyOperator() internal view virtual;

    /// @notice Checks whether the message sender is an admin.
    function _checkOnlyAdmin() internal view virtual;

    /// @notice Checks whether the message sender is an owner.
    function _checkOnlyOwner() internal view virtual;
}

File 7 of 7 : Utils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

library Utils {
    /// @notice Executes a transaction to the given address.
    /// @param to Target address.
    /// @param value Native token value to be sent to the address.
    /// @param data Data to be sent to the address.
    /// @return result Result of the transaciton.
    function _execute(
        address to,
        uint256 value,
        bytes memory data
    ) internal returns (bytes memory result) {
        assembly {
            let success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0)

            mstore(result, returndatasize())
            returndatacopy(add(result, 0x20), 0, returndatasize())

            if eq(success, 0) {
                revert(add(result, 0x20), returndatasize())
            }
        }
    }

    /// @notice Recover signer address from signature.
    /// @param signedHash Arbitrary length data signed on the behalf of the wallet.
    /// @param signature Signature byte array associated with signedHash.
    /// @return Recovered signer address.
    function recoverSigner(bytes32 signedHash, bytes memory signature) internal pure returns (address) {
        uint8 v;
        bytes32 r;
        bytes32 s;
        // we jump 32 (0x20) as the first slot of bytes contains the length
        // we jump 65 (0x41) per signature
        // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }
        require(v == 27 || v == 28, "Bad v value in signature.");

        address recoveredAddress = ecrecover(signedHash, v, r, s);
        require(recoveredAddress != address(0), "ecrecover returned 0.");
        return recoveredAddress;
    }

    /// @notice Helper method to parse the function selector from data.
    /// @param data Any data to be parsed, mostly calldata of transaction.
    /// @return result Parsed function sighash.
    function parseFunctionSelector(bytes memory data) internal pure returns (bytes4 result) {
        require(data.length >= 4, "Invalid data.");
        assembly {
            result := mload(add(data, 0x20))
        }
    }

    /// @notice Parse uint256 from given data.
    /// @param data Any data to be parsed, mostly calldata of transaction.
    /// @param position Position in the data.
    /// @return result Uint256 parsed from given data.
    function getUint256At(bytes memory data, uint8 position) internal pure returns (uint256 result) {
        assembly {
            result := mload(add(data, add(position, 0x20)))
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 500
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"handler","type":"address"}],"name":"ChangedFallbackHandler","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"SetAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"funcHash","type":"bytes4"},{"indexed":false,"internalType":"address","name":"oldModule","type":"address"},{"indexed":false,"internalType":"address","name":"newModule","type":"address"}],"name":"SetInternalModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes4","name":"funcHash","type":"bytes4"},{"indexed":false,"internalType":"address","name":"oldModule","type":"address"},{"indexed":false,"internalType":"address","name":"newModule","type":"address"}],"name":"SetModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"SetOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"SetOwner","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Core.Call[]","name":"data","type":"tuple[]"}],"name":"executeBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"executeModule","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFallbackHandler","outputs":[{"internalType":"address","name":"handler","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"funcHash","type":"bytes4"}],"name":"getInternalModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes4","name":"funcHash","type":"bytes4"}],"name":"getModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"initiate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"}],"name":"setFallbackHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"funcHash","type":"bytes4"},{"internalType":"address","name":"module","type":"address"}],"name":"setInternalModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes4","name":"funcHash","type":"bytes4"},{"internalType":"address","name":"module","type":"address"}],"name":"setModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a060405234801561001057600080fd5b50306080523380806100695760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e0000000000000000000060448201526064015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0392831617905581166100d35760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e000000000000000000006044820152606401610060565b5060805161172a6101206000396000818161010a0152818161042b015281816107d201528181610a3301528181610f1401528181610f8c01528181610fbd0152611102015261172a6000f3fe6080604052600436106100f75760003560e01c8063a93b06c81161008a578063ca3d159811610059578063ca3d1598146103a1578063cf11655e146103c1578063d46b758f146103e1578063f08a032314610401576100fe565b8063a93b06c8146102d2578063a9d62ca4146102ff578063ad241e571461034e578063b61d27f61461038e576100fe565b80636e9960c3116100c65780636e9960c31461023c578063704b6c0214610269578063856dfd9914610289578063893d20e8146102bd576100fe565b806312065fe0146101b757806334fcd5be146101d7578063558a7297146101ec5780636d70f7ae1461020c576100fe565b366100fe57005b610106610421565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663856dfd996040518163ffffffff1660e01b8152600401602060405180830381865afa158015610166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018a91906112ad565b90508061019357005b3660008037600080366000845af43d6000803e80156101b1573d6000f35b503d6000fd5b3480156101c357600080fd5b506040514781526020015b60405180910390f35b6101ea6101e53660046112d1565b6104a0565b005b3480156101f857600080fd5b506101ea610207366004611354565b61056c565b34801561021857600080fd5b5061022c61022736600461138d565b610636565b60405190151581526020016101ce565b34801561024857600080fd5b50610251610663565b6040516001600160a01b0390911681526020016101ce565b34801561027557600080fd5b506101ea61028436600461138d565b61067d565b34801561029557600080fd5b507f7734d301adfb6b9d8ff43068373ec4ffef29a42d1456fb5e0ba2ebb9f4793edb54610251565b3480156102c957600080fd5b50610251610738565b3480156102de57600080fd5b506102f26102ed3660046113f3565b610752565b6040516101ce9190611459565b34801561030b57600080fd5b5061025161031a3660046114a4565b6001600160a01b0391821660009081526006602090815260408083206001600160e01b031994909416835292905220541690565b34801561035a57600080fd5b506102516103693660046114d9565b6001600160e01b0319166000908152600760205260409020546001600160a01b031690565b6102f261039c3660046114f4565b61090a565b3480156103ad57600080fd5b506101ea6103bc36600461138d565b610bc0565b3480156103cd57600080fd5b506101ea6103dc366004611550565b610cbd565b3480156103ed57600080fd5b506101ea6103fc366004611599565b610d8d565b34801561040d57600080fd5b506101ea61041c36600461138d565b610e3d565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361049e5760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c6564206469726563746c792e00000000000060448201526064015b60405180910390fd5b565b6104a8610421565b6104b0610eaf565b60005b60ff81168211156105675761055683838360ff168181106104d6576104d66115c5565b90506020028101906104e891906115db565b6104f690602081019061138d565b84848460ff1681811061050b5761050b6115c5565b905060200281019061051d91906115db565b6020013585858560ff16818110610536576105366115c5565b905060200281019061054891906115db565b61039c9060408101906115fb565b5061056081611642565b90506104b3565b505050565b610574610f09565b61057c610f81565b6001600160a01b0382166105d25760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206f70657261746f7220616464726573732e000000000000006044820152606401610495565b6001600160a01b038216600081815260056020908152604091829020805460ff19168515159081179091558251938452908301527f1618a22a3b00b9ac70fd5a82f1f5cdd8cb272bd0f1b740ddf7c26ab05881dd5b91015b60405180910390a15050565b6000610640610f09565b506001600160a01b03811660009081526005602052604090205460ff165b919050565b600061066d610f09565b506003546001600160a01b031690565b610685610f09565b61068d610f81565b6001600160a01b0381166106e35760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e000000000000000000006044820152606401610495565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a1906020015b60405180910390a150565b6000610742610421565b506004546001600160a01b031690565b606061075c610421565b6107646110ed565b60006107a584848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111c192505050565b60405163ad241e5760e01b81526001600160e01b0319821660048201529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ad241e5790602401602060405180830381865afa158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d91906112ad565b90506001600160a01b03811661088d5760405162461bcd60e51b81526020600482015260156024820152742737ba1039bab83837b93a32b21036b2ba3437b21760591b6044820152606401610495565b600080826001600160a01b031687876040516108aa92919061166f565b600060405180830381855af49150503d80600081146108e5576040519150601f19603f3d011682016040523d82523d6000602084013e6108ea565b606091505b509150915081610900576040513d6000823e3d81fd5b9695505050505050565b6060610914610421565b61091c610eaf565b8347101561096c5760405162461bcd60e51b815260206004820152601360248201527f4e6f7420656e6f7567682062616c616e63652e000000000000000000000000006044820152606401610495565b60008290036109bd576109b6858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061120d92505050565b9050610bb8565b60006109fe84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111c192505050565b604051632a758b2960e21b81526001600160a01b0388811660048301526001600160e01b0319831660248301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063a9d62ca490604401602060405180830381865afa158015610a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9e91906112ad565b90506001600160a01b038116610aee5760405162461bcd60e51b81526020600482015260156024820152742737ba1039bab83837b93a32b21036b2ba3437b21760591b6044820152606401610495565b600080826001600160a01b031689898989604051602401610b12949392919061167f565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663ab6a377b60e01b17905251610b5c91906116c5565b600060405180830381855af49150503d8060008114610b97576040519150601f19603f3d011682016040523d82523d6000602084013e610b9c565b606091505b509150915081610bb2576040513d6000823e3d81fd5b93505050505b949350505050565b6004546001600160a01b031615610c195760405162461bcd60e51b815260206004820152601b60248201527f57616c6c657420616c726561647920696e697469616c697a65642e00000000006044820152606401610495565b6001600160a01b038116610c6f5760405162461bcd60e51b815260206004820152601660248201527f496e76616c6964206f776e657220616464726573732e000000000000000000006044820152606401610495565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb59060200161072d565b610cc5610f09565b610ccd610f81565b6001600160a01b0383811660008181526006602090815260408083206001600160e01b03198816808552908352928190205481519485529184019290925283169082015290821660608201527f7a918cf06e04dca75516da6c3c1e488f81731084503b12b4f9178334db2062759060800160405180910390a16001600160a01b0392831660009081526006602090815260408083206001600160e01b03199590951683529390529190912080546001600160a01b03191691909216179055565b610d95610f09565b610d9d610f81565b6001600160e01b031982166000818152600760209081526040918290205482519384526001600160a01b0390811691840191909152831682820152517fcea1641417243d86bc34fedce6a14c3028ef8c2418d22a084a3f8c385795e36b9181900360600190a16001600160e01b031991909116600090815260076020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b610e45610f09565b610e4d610f81565b6001600160a01b038116610ea35760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642068616e646c657220616464726573732e00000000000000006044820152606401610495565b610eac8161123b565b50565b6004546001600160a01b0316331461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e206f776e65722e0000000000000000006044820152606401610495565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461049e5760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c79206469726563742063616c6c7320616c6c6f7765642e0000000000006044820152606401610495565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461109357336001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e9960c36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103d91906112ad565b6001600160a01b03161461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e0000000000000000006044820152606401610495565b6003546001600160a01b0316331461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e0000000000000000006044820152606401610495565b6040516336b87bd760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636d70f7ae90602401602060405180830381865afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117591906116d7565b61049e5760405162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206973206e6f7420616e206f70657261746f722e0000000000006044820152606401610495565b60006004825110156112055760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103230ba309760991b6044820152606401610495565b506020015190565b606060008083516020850186885af13d82523d6000602084013e80611233573d60208301fd5b509392505050565b7f7734d301adfb6b9d8ff43068373ec4ffef29a42d1456fb5e0ba2ebb9f4793edb8181556040516001600160a01b03831681527f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b09060200161062a565b6001600160a01b0381168114610eac57600080fd5b6000602082840312156112bf57600080fd5b81516112ca81611298565b9392505050565b600080602083850312156112e457600080fd5b823567ffffffffffffffff808211156112fc57600080fd5b818501915085601f83011261131057600080fd5b81358181111561131f57600080fd5b8660208260051b850101111561133457600080fd5b60209290920196919550909350505050565b8015158114610eac57600080fd5b6000806040838503121561136757600080fd5b823561137281611298565b9150602083013561138281611346565b809150509250929050565b60006020828403121561139f57600080fd5b81356112ca81611298565b60008083601f8401126113bc57600080fd5b50813567ffffffffffffffff8111156113d457600080fd5b6020830191508360208285010111156113ec57600080fd5b9250929050565b6000806020838503121561140657600080fd5b823567ffffffffffffffff81111561141d57600080fd5b611429858286016113aa565b90969095509350505050565b60005b83811015611450578181015183820152602001611438565b50506000910152565b6020815260008251806020840152611478816040850160208701611435565b601f01601f19169190910160400192915050565b80356001600160e01b03198116811461065e57600080fd5b600080604083850312156114b757600080fd5b82356114c281611298565b91506114d06020840161148c565b90509250929050565b6000602082840312156114eb57600080fd5b6112ca8261148c565b6000806000806060858703121561150a57600080fd5b843561151581611298565b935060208501359250604085013567ffffffffffffffff81111561153857600080fd5b611544878288016113aa565b95989497509550505050565b60008060006060848603121561156557600080fd5b833561157081611298565b925061157e6020850161148c565b9150604084013561158e81611298565b809150509250925092565b600080604083850312156115ac57600080fd5b6115b58361148c565b9150602083013561138281611298565b634e487b7160e01b600052603260045260246000fd5b60008235605e198336030181126115f157600080fd5b9190910192915050565b6000808335601e1984360301811261161257600080fd5b83018035915067ffffffffffffffff82111561162d57600080fd5b6020019150368190038213156113ec57600080fd5b600060ff821660ff810361166657634e487b7160e01b600052601160045260246000fd5b60010192915050565b8183823760009101908152919050565b6001600160a01b038516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b600082516115f1818460208701611435565b6000602082840312156116e957600080fd5b81516112ca8161134656fea2646970667358221220d7fe9bce2cba3609e063ce9f85b985b65855bc61519225695da2114d2d43cd3f64736f6c63430008130033

Deployed Bytecode

0x6080604052600436106100f75760003560e01c8063a93b06c81161008a578063ca3d159811610059578063ca3d1598146103a1578063cf11655e146103c1578063d46b758f146103e1578063f08a032314610401576100fe565b8063a93b06c8146102d2578063a9d62ca4146102ff578063ad241e571461034e578063b61d27f61461038e576100fe565b80636e9960c3116100c65780636e9960c31461023c578063704b6c0214610269578063856dfd9914610289578063893d20e8146102bd576100fe565b806312065fe0146101b757806334fcd5be146101d7578063558a7297146101ec5780636d70f7ae1461020c576100fe565b366100fe57005b610106610421565b60007f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd0696001600160a01b031663856dfd996040518163ffffffff1660e01b8152600401602060405180830381865afa158015610166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018a91906112ad565b90508061019357005b3660008037600080366000845af43d6000803e80156101b1573d6000f35b503d6000fd5b3480156101c357600080fd5b506040514781526020015b60405180910390f35b6101ea6101e53660046112d1565b6104a0565b005b3480156101f857600080fd5b506101ea610207366004611354565b61056c565b34801561021857600080fd5b5061022c61022736600461138d565b610636565b60405190151581526020016101ce565b34801561024857600080fd5b50610251610663565b6040516001600160a01b0390911681526020016101ce565b34801561027557600080fd5b506101ea61028436600461138d565b61067d565b34801561029557600080fd5b507f7734d301adfb6b9d8ff43068373ec4ffef29a42d1456fb5e0ba2ebb9f4793edb54610251565b3480156102c957600080fd5b50610251610738565b3480156102de57600080fd5b506102f26102ed3660046113f3565b610752565b6040516101ce9190611459565b34801561030b57600080fd5b5061025161031a3660046114a4565b6001600160a01b0391821660009081526006602090815260408083206001600160e01b031994909416835292905220541690565b34801561035a57600080fd5b506102516103693660046114d9565b6001600160e01b0319166000908152600760205260409020546001600160a01b031690565b6102f261039c3660046114f4565b61090a565b3480156103ad57600080fd5b506101ea6103bc36600461138d565b610bc0565b3480156103cd57600080fd5b506101ea6103dc366004611550565b610cbd565b3480156103ed57600080fd5b506101ea6103fc366004611599565b610d8d565b34801561040d57600080fd5b506101ea61041c36600461138d565b610e3d565b6001600160a01b037f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd06916300361049e5760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c6564206469726563746c792e00000000000060448201526064015b60405180910390fd5b565b6104a8610421565b6104b0610eaf565b60005b60ff81168211156105675761055683838360ff168181106104d6576104d66115c5565b90506020028101906104e891906115db565b6104f690602081019061138d565b84848460ff1681811061050b5761050b6115c5565b905060200281019061051d91906115db565b6020013585858560ff16818110610536576105366115c5565b905060200281019061054891906115db565b61039c9060408101906115fb565b5061056081611642565b90506104b3565b505050565b610574610f09565b61057c610f81565b6001600160a01b0382166105d25760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206f70657261746f7220616464726573732e000000000000006044820152606401610495565b6001600160a01b038216600081815260056020908152604091829020805460ff19168515159081179091558251938452908301527f1618a22a3b00b9ac70fd5a82f1f5cdd8cb272bd0f1b740ddf7c26ab05881dd5b91015b60405180910390a15050565b6000610640610f09565b506001600160a01b03811660009081526005602052604090205460ff165b919050565b600061066d610f09565b506003546001600160a01b031690565b610685610f09565b61068d610f81565b6001600160a01b0381166106e35760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e000000000000000000006044820152606401610495565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a1906020015b60405180910390a150565b6000610742610421565b506004546001600160a01b031690565b606061075c610421565b6107646110ed565b60006107a584848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111c192505050565b60405163ad241e5760e01b81526001600160e01b0319821660048201529091506000906001600160a01b037f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069169063ad241e5790602401602060405180830381865afa158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d91906112ad565b90506001600160a01b03811661088d5760405162461bcd60e51b81526020600482015260156024820152742737ba1039bab83837b93a32b21036b2ba3437b21760591b6044820152606401610495565b600080826001600160a01b031687876040516108aa92919061166f565b600060405180830381855af49150503d80600081146108e5576040519150601f19603f3d011682016040523d82523d6000602084013e6108ea565b606091505b509150915081610900576040513d6000823e3d81fd5b9695505050505050565b6060610914610421565b61091c610eaf565b8347101561096c5760405162461bcd60e51b815260206004820152601360248201527f4e6f7420656e6f7567682062616c616e63652e000000000000000000000000006044820152606401610495565b60008290036109bd576109b6858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061120d92505050565b9050610bb8565b60006109fe84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111c192505050565b604051632a758b2960e21b81526001600160a01b0388811660048301526001600160e01b0319831660248301529192506000917f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069169063a9d62ca490604401602060405180830381865afa158015610a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9e91906112ad565b90506001600160a01b038116610aee5760405162461bcd60e51b81526020600482015260156024820152742737ba1039bab83837b93a32b21036b2ba3437b21760591b6044820152606401610495565b600080826001600160a01b031689898989604051602401610b12949392919061167f565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663ab6a377b60e01b17905251610b5c91906116c5565b600060405180830381855af49150503d8060008114610b97576040519150601f19603f3d011682016040523d82523d6000602084013e610b9c565b606091505b509150915081610bb2576040513d6000823e3d81fd5b93505050505b949350505050565b6004546001600160a01b031615610c195760405162461bcd60e51b815260206004820152601b60248201527f57616c6c657420616c726561647920696e697469616c697a65642e00000000006044820152606401610495565b6001600160a01b038116610c6f5760405162461bcd60e51b815260206004820152601660248201527f496e76616c6964206f776e657220616464726573732e000000000000000000006044820152606401610495565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb59060200161072d565b610cc5610f09565b610ccd610f81565b6001600160a01b0383811660008181526006602090815260408083206001600160e01b03198816808552908352928190205481519485529184019290925283169082015290821660608201527f7a918cf06e04dca75516da6c3c1e488f81731084503b12b4f9178334db2062759060800160405180910390a16001600160a01b0392831660009081526006602090815260408083206001600160e01b03199590951683529390529190912080546001600160a01b03191691909216179055565b610d95610f09565b610d9d610f81565b6001600160e01b031982166000818152600760209081526040918290205482519384526001600160a01b0390811691840191909152831682820152517fcea1641417243d86bc34fedce6a14c3028ef8c2418d22a084a3f8c385795e36b9181900360600190a16001600160e01b031991909116600090815260076020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b610e45610f09565b610e4d610f81565b6001600160a01b038116610ea35760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642068616e646c657220616464726573732e00000000000000006044820152606401610495565b610eac8161123b565b50565b6004546001600160a01b0316331461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e206f776e65722e0000000000000000006044820152606401610495565b306001600160a01b037f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069161461049e5760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c79206469726563742063616c6c7320616c6c6f7765642e0000000000006044820152606401610495565b306001600160a01b037f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069161461109357336001600160a01b03167f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd0696001600160a01b0316636e9960c36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103d91906112ad565b6001600160a01b03161461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e0000000000000000006044820152606401610495565b6003546001600160a01b0316331461049e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e0000000000000000006044820152606401610495565b6040516336b87bd760e11b81523360048201527f0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd0696001600160a01b031690636d70f7ae90602401602060405180830381865afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117591906116d7565b61049e5760405162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206973206e6f7420616e206f70657261746f722e0000000000006044820152606401610495565b60006004825110156112055760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103230ba309760991b6044820152606401610495565b506020015190565b606060008083516020850186885af13d82523d6000602084013e80611233573d60208301fd5b509392505050565b7f7734d301adfb6b9d8ff43068373ec4ffef29a42d1456fb5e0ba2ebb9f4793edb8181556040516001600160a01b03831681527f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b09060200161062a565b6001600160a01b0381168114610eac57600080fd5b6000602082840312156112bf57600080fd5b81516112ca81611298565b9392505050565b600080602083850312156112e457600080fd5b823567ffffffffffffffff808211156112fc57600080fd5b818501915085601f83011261131057600080fd5b81358181111561131f57600080fd5b8660208260051b850101111561133457600080fd5b60209290920196919550909350505050565b8015158114610eac57600080fd5b6000806040838503121561136757600080fd5b823561137281611298565b9150602083013561138281611346565b809150509250929050565b60006020828403121561139f57600080fd5b81356112ca81611298565b60008083601f8401126113bc57600080fd5b50813567ffffffffffffffff8111156113d457600080fd5b6020830191508360208285010111156113ec57600080fd5b9250929050565b6000806020838503121561140657600080fd5b823567ffffffffffffffff81111561141d57600080fd5b611429858286016113aa565b90969095509350505050565b60005b83811015611450578181015183820152602001611438565b50506000910152565b6020815260008251806020840152611478816040850160208701611435565b601f01601f19169190910160400192915050565b80356001600160e01b03198116811461065e57600080fd5b600080604083850312156114b757600080fd5b82356114c281611298565b91506114d06020840161148c565b90509250929050565b6000602082840312156114eb57600080fd5b6112ca8261148c565b6000806000806060858703121561150a57600080fd5b843561151581611298565b935060208501359250604085013567ffffffffffffffff81111561153857600080fd5b611544878288016113aa565b95989497509550505050565b60008060006060848603121561156557600080fd5b833561157081611298565b925061157e6020850161148c565b9150604084013561158e81611298565b809150509250925092565b600080604083850312156115ac57600080fd5b6115b58361148c565b9150602083013561138281611298565b634e487b7160e01b600052603260045260246000fd5b60008235605e198336030181126115f157600080fd5b9190910192915050565b6000808335601e1984360301811261161257600080fd5b83018035915067ffffffffffffffff82111561162d57600080fd5b6020019150368190038213156113ec57600080fd5b600060ff821660ff810361166657634e487b7160e01b600052601160045260246000fd5b60010192915050565b8183823760009101908152919050565b6001600160a01b038516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b600082516115f1818460208701611435565b6000602082840312156116e957600080fd5b81516112ca8161134656fea2646970667358221220d7fe9bce2cba3609e063ce9f85b985b65855bc61519225695da2114d2d43cd3f64736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.