My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x721328c8036467e57e8d346ff5c2f75164186eae97e09c8f53fbf059b64bce02 | 0x60806040 | 5856407 | 776 days 18 hrs ago | Livepeer: Deployer | IN | Create: MerkleSnapshot | 0 ETH | 0.003965253875 ETH |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
MerkleSnapshot
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./zeppelin/Pausable.sol"; abstract contract IController is Pausable { event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash); function setContractInfo( bytes32 _id, address _contractAddress, bytes20 _gitCommitHash ) external virtual; function updateController(bytes32 _id, address _controller) external virtual; function getContract(bytes32 _id) public view virtual returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; interface IManager { event SetController(address controller); event ParameterUpdate(string param); function setController(address _controller) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./IManager.sol"; import "./IController.sol"; contract Manager is IManager { // Controller that contract is registered with IController public controller; // Check if sender is controller modifier onlyController() { _onlyController(); _; } // Check if sender is controller owner modifier onlyControllerOwner() { _onlyControllerOwner(); _; } // Check if controller is not paused modifier whenSystemNotPaused() { _whenSystemNotPaused(); _; } // Check if controller is paused modifier whenSystemPaused() { _whenSystemPaused(); _; } constructor(address _controller) { controller = IController(_controller); } /** * @notice Set controller. Only callable by current controller * @param _controller Controller contract address */ function setController(address _controller) external onlyController { controller = IController(_controller); emit SetController(_controller); } function _onlyController() private view { require(msg.sender == address(controller), "caller must be Controller"); } function _onlyControllerOwner() private view { require(msg.sender == controller.owner(), "caller must be Controller owner"); } function _whenSystemNotPaused() private view { require(!controller.paused(), "system is paused"); } function _whenSystemPaused() private view { require(controller.paused(), "system is not paused"); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../zeppelin/MerkleProof.sol"; import "../Manager.sol"; contract MerkleSnapshot is Manager { mapping(bytes32 => bytes32) public snapshot; constructor(address _controller) Manager(_controller) {} function setSnapshot(bytes32 _id, bytes32 _root) external onlyControllerOwner { snapshot[_id] = _root; } function verify( bytes32 _id, bytes32[] calldata _proof, bytes32 _leaf ) external view returns (bool) { return MerkleProof.verify(_proof, snapshot[_id], _leaf); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev These functions deal with verification of Merkle trees (hash trees), */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./Ownable.sol"; /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"param","type":"string"}],"name":"ParameterUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"controller","type":"address"}],"name":"SetController","type":"event"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_id","type":"bytes32"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setSnapshot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"snapshot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_id","type":"bytes32"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"bytes32","name":"_leaf","type":"bytes32"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516105e63803806105e683398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610553806100936000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630a02831c1461005c5780631ac79c41146100845780635824adf4146100b257806392eefe9b146100c7578063f77c4791146100da575b600080fd5b61006f61006a3660046103c5565b610105565b60405190151581526020015b60405180910390f35b6100a461009236600461044a565b60016020526000908152604090205481565b60405190815260200161007b565b6100c56100c0366004610463565b61015b565b005b6100c56100d536600461049d565b610175565b6000546100ed906001600160a01b031681565b6040516001600160a01b03909116815260200161007b565b600061015284848080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508a81526001602052604090205492508691506101d19050565b95945050505050565b610163610280565b60009182526001602052604090912055565b61017d61036b565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709060200160405180910390a150565b600081815b85518110156102755760008682815181106101f3576101f36104c1565b60200260200101519050808311610235576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610262565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061026d816104d7565b9150506101d6565b509092149392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102cc57600080fd5b505afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190610500565b6001600160a01b0316336001600160a01b0316146103695760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572206f776e65720060448201526064015b60405180910390fd5b565b6000546001600160a01b031633146103695760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572000000000000006044820152606401610360565b600080600080606085870312156103db57600080fd5b84359350602085013567ffffffffffffffff808211156103fa57600080fd5b818701915087601f83011261040e57600080fd5b81358181111561041d57600080fd5b8860208260051b850101111561043257600080fd5b95986020929092019750949560400135945092505050565b60006020828403121561045c57600080fd5b5035919050565b6000806040838503121561047657600080fd5b50508035926020909101359150565b6001600160a01b038116811461049a57600080fd5b50565b6000602082840312156104af57600080fd5b81356104ba81610485565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156104f957634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561051257600080fd5b81516104ba8161048556fea26469706673582212202da4c90c63220e0d052d25f4ca91345e2094ec9200198586debdb9e16f6a666a64736f6c63430008090033000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630a02831c1461005c5780631ac79c41146100845780635824adf4146100b257806392eefe9b146100c7578063f77c4791146100da575b600080fd5b61006f61006a3660046103c5565b610105565b60405190151581526020015b60405180910390f35b6100a461009236600461044a565b60016020526000908152604090205481565b60405190815260200161007b565b6100c56100c0366004610463565b61015b565b005b6100c56100d536600461049d565b610175565b6000546100ed906001600160a01b031681565b6040516001600160a01b03909116815260200161007b565b600061015284848080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508a81526001602052604090205492508691506101d19050565b95945050505050565b610163610280565b60009182526001602052604090912055565b61017d61036b565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709060200160405180910390a150565b600081815b85518110156102755760008682815181106101f3576101f36104c1565b60200260200101519050808311610235576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610262565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061026d816104d7565b9150506101d6565b509092149392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102cc57600080fd5b505afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190610500565b6001600160a01b0316336001600160a01b0316146103695760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572206f776e65720060448201526064015b60405180910390fd5b565b6000546001600160a01b031633146103695760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572000000000000006044820152606401610360565b600080600080606085870312156103db57600080fd5b84359350602085013567ffffffffffffffff808211156103fa57600080fd5b818701915087601f83011261040e57600080fd5b81358181111561041d57600080fd5b8860208260051b850101111561043257600080fd5b95986020929092019750949560400135945092505050565b60006020828403121561045c57600080fd5b5035919050565b6000806040838503121561047657600080fd5b50508035926020909101359150565b6001600160a01b038116811461049a57600080fd5b50565b6000602082840312156104af57600080fd5b81356104ba81610485565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156104f957634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561051257600080fd5b81516104ba8161048556fea26469706673582212202da4c90c63220e0d052d25f4ca91345e2094ec9200198586debdb9e16f6a666a64736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4
-----Decoded View---------------
Arg [0] : _controller (address): 0xD8E8328501E9645d16Cf49539efC04f734606ee4
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.