Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Nominate Owner | 21553553 | 43 hrs ago | IN | 0 ETH | 0.0003524 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
20132693 | 200 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x5A157635...4858dafc4 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SingleCapacitor
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2023-12-23 */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.19; /** * @title ICapacitor * @dev Interface for a Capacitor contract that stores and manages messages in packets */ interface ICapacitor { /** * @notice adds the packed message to a packet * @dev this should be only executable by socket * @param packedMessage the message packed with payload, fees and config */ function addPackedMessage(bytes32 packedMessage) external; /** * @notice returns the latest packet details which needs to be sealed * @return root root hash of the latest packet which is not yet sealed * @return packetCount latest packet id which is not yet sealed */ function getNextPacketToBeSealed() external view returns (bytes32 root, uint64 packetCount); /** * @notice returns the root of packet for given id * @param id the id assigned to packet * @return root root hash corresponding to given id */ function getRootByCount(uint64 id) external view returns (bytes32 root); /** * @notice returns the maxPacketLength * @return maxPacketLength of the capacitor */ function getMaxPacketLength() external view returns (uint256 maxPacketLength); /** * @notice seals the packet * @dev indicates the packet is ready to be shipped and no more messages can be added now. * @dev this should be called by socket only * @param batchSize_ used with packet batching capacitors * @return root root hash of the packet * @return packetCount id of the packed sealed */ function sealPacket( uint256 batchSize_ ) external returns (bytes32 root, uint64 packetCount); } /** * @title Ownable * @dev The Ownable contract provides a simple way to manage ownership of a contract * and allows for ownership to be transferred to a nominated address. */ abstract contract Ownable { address private _owner; address private _nominee; event OwnerNominated(address indexed nominee); event OwnerClaimed(address indexed claimer); error OnlyOwner(); error OnlyNominee(); /** * @dev Sets the contract's owner to the address that is passed to the constructor. */ constructor(address owner_) { _claimOwner(owner_); } /** * @dev Modifier that restricts access to only the contract's owner. * Throws an error if the caller is not the owner. */ modifier onlyOwner() { if (msg.sender != _owner) revert OnlyOwner(); _; } /** * @dev Returns the current owner of the contract. */ function owner() external view returns (address) { return _owner; } /** * @dev Returns the current nominee for ownership of the contract. */ function nominee() external view returns (address) { return _nominee; } /** * @dev Allows the current owner to nominate a new owner for the contract. * Throws an error if the caller is not the owner. * Emits an `OwnerNominated` event with the address of the nominee. */ function nominateOwner(address nominee_) external { if (msg.sender != _owner) revert OnlyOwner(); _nominee = nominee_; emit OwnerNominated(_nominee); } /** * @dev Allows the nominated owner to claim ownership of the contract. * Throws an error if the caller is not the nominee. * Sets the nominated owner as the new owner of the contract. * Emits an `OwnerClaimed` event with the address of the new owner. */ function claimOwner() external { if (msg.sender != _nominee) revert OnlyNominee(); _claimOwner(msg.sender); } /** * @dev Internal function that sets the owner of the contract to the specified address * and sets the nominee to address(0). */ function _claimOwner(address claimer_) internal { _owner = claimer_; _nominee = address(0); emit OwnerClaimed(claimer_); } } /** * @title AccessControl * @dev This abstract contract implements access control mechanism based on roles. * Each role can have one or more addresses associated with it, which are granted * permission to execute functions with the onlyRole modifier. */ abstract contract AccessControl is Ownable { /** * @dev A mapping of roles to a mapping of addresses to boolean values indicating whether or not they have the role. */ mapping(bytes32 => mapping(address => bool)) private _permits; /** * @dev Emitted when a role is granted to an address. */ event RoleGranted(bytes32 indexed role, address indexed grantee); /** * @dev Emitted when a role is revoked from an address. */ event RoleRevoked(bytes32 indexed role, address indexed revokee); /** * @dev Error message thrown when an address does not have permission to execute a function with onlyRole modifier. */ error NoPermit(bytes32 role); /** * @dev Constructor that sets the owner of the contract. */ constructor(address owner_) Ownable(owner_) {} /** * @dev Modifier that restricts access to addresses having roles * Throws an error if the caller do not have permit */ modifier onlyRole(bytes32 role) { if (!_permits[role][msg.sender]) revert NoPermit(role); _; } /** * @dev Checks and reverts if an address do not have a specific role. * @param role_ The role to check. * @param address_ The address to check. */ function _checkRole(bytes32 role_, address address_) internal virtual { if (!_hasRole(role_, address_)) revert NoPermit(role_); } /** * @dev Grants a role to a given address. * @param role_ The role to grant. * @param grantee_ The address to grant the role to. * Emits a RoleGranted event. * Can only be called by the owner of the contract. */ function grantRole( bytes32 role_, address grantee_ ) external virtual onlyOwner { _grantRole(role_, grantee_); } /** * @dev Revokes a role from a given address. * @param role_ The role to revoke. * @param revokee_ The address to revoke the role from. * Emits a RoleRevoked event. * Can only be called by the owner of the contract. */ function revokeRole( bytes32 role_, address revokee_ ) external virtual onlyOwner { _revokeRole(role_, revokee_); } /** * @dev Internal function to grant a role to a given address. * @param role_ The role to grant. * @param grantee_ The address to grant the role to. * Emits a RoleGranted event. */ function _grantRole(bytes32 role_, address grantee_) internal { _permits[role_][grantee_] = true; emit RoleGranted(role_, grantee_); } /** * @dev Internal function to revoke a role from a given address. * @param role_ The role to revoke. * @param revokee_ The address to revoke the role from. * Emits a RoleRevoked event. */ function _revokeRole(bytes32 role_, address revokee_) internal { _permits[role_][revokee_] = false; emit RoleRevoked(role_, revokee_); } /** * @dev Checks whether an address has a specific role. * @param role_ The role to check. * @param address_ The address to check. * @return A boolean value indicating whether or not the address has the role. */ function hasRole( bytes32 role_, address address_ ) external view returns (bool) { return _hasRole(role_, address_); } function _hasRole( bytes32 role_, address address_ ) internal view returns (bool) { return _permits[role_][address_]; } } /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } } /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument. mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } } error ZeroAddress(); /** * @title RescueFundsLib * @dev A library that provides a function to rescue funds from a contract. */ library RescueFundsLib { /** * @dev The address used to identify ETH. */ address public constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); /** * @dev thrown when the given token address don't have any code */ error InvalidTokenAddress(); /** * @dev Rescues funds from a contract. * @param token_ The address of the token contract. * @param rescueTo_ The address of the user. * @param amount_ The amount of tokens to be rescued. */ function rescueFunds( address token_, address rescueTo_, uint256 amount_ ) internal { if (rescueTo_ == address(0)) revert ZeroAddress(); if (token_ == ETH_ADDRESS) { SafeTransferLib.safeTransferETH(rescueTo_, amount_); } else { if (token_.code.length == 0) revert InvalidTokenAddress(); SafeTransferLib.safeTransfer(ERC20(token_), rescueTo_, amount_); } } } // contains role hashes used in socket dl for various different operations // used to rescue funds bytes32 constant RESCUE_ROLE = keccak256("RESCUE_ROLE"); // used to withdraw fees bytes32 constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE"); // used to trip switchboards bytes32 constant TRIP_ROLE = keccak256("TRIP_ROLE"); // used to un trip switchboards bytes32 constant UN_TRIP_ROLE = keccak256("UN_TRIP_ROLE"); // used by governance bytes32 constant GOVERNANCE_ROLE = keccak256("GOVERNANCE_ROLE"); //used by executors which executes message at destination bytes32 constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); // used by transmitters who seal and propose packets in socket bytes32 constant TRANSMITTER_ROLE = keccak256("TRANSMITTER_ROLE"); // used by switchboard watchers who work against transmitters bytes32 constant WATCHER_ROLE = keccak256("WATCHER_ROLE"); // used by fee updaters responsible for updating fees at switchboards, transmit manager and execution manager bytes32 constant FEES_UPDATER_ROLE = keccak256("FEES_UPDATER_ROLE"); /** * @title BaseCapacitor * @dev Abstract base contract for the Capacitors. Implements shared functionality and provides * access control. */ abstract contract BaseCapacitor is ICapacitor, AccessControl { /// address of socket address public immutable socket; /// an incrementing count for the next packet that is being created uint64 internal _nextPacketCount; /// tracks the count of next packet that will be sealed uint64 internal _nextSealCount; /// maps the packet count with the root hash of that packet mapping(uint64 => bytes32) internal _roots; // Error triggered when not called by socket error OnlySocket(); /** * @dev Throws if called by any account other than the socket. */ modifier onlySocket() { if (msg.sender != socket) revert OnlySocket(); _; } /** * @dev Initializes the contract with the specified socket address. * @param socket_ The address of the socket contract. * @param owner_ The address of the owner of the capacitor contract. */ constructor(address socket_, address owner_) AccessControl(owner_) { socket = socket_; _grantRole(RESCUE_ROLE, owner_); } /** * @dev Returns the count of the latest packet that finished filling. * @dev Returns 0 in case 0 or 1 packets are filled, hence this case should be considered by the caller * @return lastFilledPacket count of the latest packet. */ function getLastFilledPacket() external view returns (uint256 lastFilledPacket) { return _nextPacketCount == 0 ? 0 : _nextPacketCount - 1; } /** * @dev Rescues funds from the contract. * @param token_ The address of the token to rescue. * @param rescueTo_ The address of the user to rescue tokens for. * @param amount_ The amount of tokens to rescue. */ function rescueFunds( address token_, address rescueTo_, uint256 amount_ ) external onlyRole(RESCUE_ROLE) { RescueFundsLib.rescueFunds(token_, rescueTo_, amount_); } } /** * @title SingleCapacitor * @notice A capacitor that adds a single message to each packet. * @dev This contract inherits from the `BaseCapacitor` contract, which provides the * basic storage and common function implementations. */ contract SingleCapacitor is BaseCapacitor { // Error triggered when no new packet/message is there to be sealed error NoPendingPacket(); /** * @notice emitted when a new message is added to a packet * @param packedMessage the message packed with payload, fees and config * @param packetCount an incremental id assigned to each new packet created on this capacitor * @param newRootHash Hash of full packet. Same as packedMessage since this capacitor has one message per packet. */ event MessageAdded( bytes32 packedMessage, uint64 packetCount, bytes32 newRootHash ); /** * @dev Initializes the contract with the specified socket address. * @param socket_ The address of the socket contract. * @param owner_ The address of the owner of the capacitor contract. */ constructor( address socket_, address owner_ ) BaseCapacitor(socket_, owner_) {} /** * @inheritdoc ICapacitor */ function getMaxPacketLength() external pure override returns (uint256) { return 1; } /** * @inheritdoc ICapacitor */ function addPackedMessage( bytes32 packedMessage_ ) external override onlySocket { uint64 packetCount = _nextPacketCount++; _roots[packetCount] = packedMessage_; // as it is a single capacitor, here root and packed message are same emit MessageAdded(packedMessage_, packetCount, packedMessage_); } /** * @inheritdoc ICapacitor */ function sealPacket( uint256 ) external override onlySocket returns (bytes32, uint64) { uint64 packetCount = _nextSealCount++; if (_roots[packetCount] == bytes32(0)) revert NoPendingPacket(); bytes32 root = _roots[packetCount]; return (root, packetCount); } /** * @inheritdoc ICapacitor */ function getNextPacketToBeSealed() external view override returns (bytes32, uint64) { uint64 toSeal = _nextSealCount; return (_roots[toSeal], toSeal); } /** * @dev Returns the root hash of the packet with the specified count. * @param count_ The count of the packet. * @return The root hash of the packet. */ function getRootByCount( uint64 count_ ) external view override returns (bytes32) { return _roots[count_]; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"socket_","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidTokenAddress","type":"error"},{"inputs":[],"name":"NoPendingPacket","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NoPermit","type":"error"},{"inputs":[],"name":"OnlyNominee","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"OnlySocket","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"packedMessage","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"packetCount","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"newRootHash","type":"bytes32"}],"name":"MessageAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"}],"name":"OwnerClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nominee","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"grantee","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"revokee","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[{"internalType":"bytes32","name":"packedMessage_","type":"bytes32"}],"name":"addPackedMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getLastFilledPacket","outputs":[{"internalType":"uint256","name":"lastFilledPacket","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxPacketLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getNextPacketToBeSealed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"count_","type":"uint64"}],"name":"getRootByCount","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"grantee_","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"address_","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nominee_","type":"address"}],"name":"nominateOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"address","name":"rescueTo_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"revokee_","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"sealPacket","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"socket","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636ccae054116100975780639471651e116100665780639471651e14610215578063d1af313c1461025d578063d547741f14610287578063d7c9eaac1461029a57600080fd5b80636ccae054146101ae5780638da5cb5b146101c157806391d14854146101df578063920ee8a81461020257600080fd5b80632ff9f2c9116100d35780632ff9f2c91461017a5780633bd1adec1461018b5780635b94db27146101935780636afc0f38146101a657600080fd5b806320f99c0a146100fa57806322c8f6cd1461013e5780632f2ff15d14610165575b600080fd5b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101147f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f981565b610178610173366004610bbd565b6102ad565b005b60015b604051908152602001610135565b61017861030c565b6101786101a1366004610be9565b610368565b61017d610428565b6101786101bc366004610c04565b61046d565b60005473ffffffffffffffffffffffffffffffffffffffff16610114565b6101f26101ed366004610bbd565b610510565b6040519015158152602001610135565b610178610210366004610c40565b61054b565b60035468010000000000000000900467ffffffffffffffff16600081815260046020526040902054905b6040805192835267ffffffffffffffff909116602083015201610135565b61017d61026b366004610c59565b67ffffffffffffffff1660009081526004602052604090205490565b610178610295366004610bbd565b610655565b61023f6102a8366004610c40565b6106b0565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fe576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61030882826107da565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461035d576040517f7c91ccdd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61036633610860565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b9576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b60035460009067ffffffffffffffff161561045b576003546104569060019067ffffffffffffffff16610cb2565b61045e565b60005b67ffffffffffffffff16905090565b3360009081527f4933f7bec34ee32db93e9f5cd7e0519781b395282211f4f6857489046ea38f7660205260409020547fc4c453d647953c0fd35db5a34ee76e60fb4abc3a8fb891a25936b70b38f292539060ff166104ff576040517f962f6333000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b61050a8484846108d8565b50505050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff165b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f916146105ba576040517f503284dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003805460009167ffffffffffffffff90911690826105d883610cda565b82546101009290920a67ffffffffffffffff818102199093169183160217909155811660008181526004602090815260409182902086905581518681529081019290925281018490529091507f9ed9683bfff0f737f91f20945e98c912976d94e76860b05b48b15bc0d589be1f9060600160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106a6576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61030882826109cd565b6000803373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f91614610722576040517f503284dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380546000916801000000000000000090910467ffffffffffffffff1690600861074c83610cda565b82546101009290920a67ffffffffffffffff81810219909316918316021790915581166000908152600460205260409020549091506107b7576040517fa902392300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660009081526004602052604090205492509050915091565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905551909184917f2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f39190a35050565b6000805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216811783556001805490921690915560405190917ffbe19c9b601f5ee90b44c7390f3fa2319eba01762d34ee372aeafd59b25c7f8791a250565b73ffffffffffffffffffffffffffffffffffffffff8216610925576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff8416016109715761096c8282610a50565b505050565b8273ffffffffffffffffffffffffffffffffffffffff163b6000036109c2576040517f1eb00b0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61096c838383610ac5565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551909184917f155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a529190a35050565b600080600080600085875af190508061096c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c45440000000000000000000000000060448201526064016104f6565b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c4544000000000000000000000000000000000060448201526064016104f6565b803573ffffffffffffffffffffffffffffffffffffffff81168114610bb857600080fd5b919050565b60008060408385031215610bd057600080fd5b82359150610be060208401610b94565b90509250929050565b600060208284031215610bfb57600080fd5b61054482610b94565b600080600060608486031215610c1957600080fd5b610c2284610b94565b9250610c3060208501610b94565b9150604084013590509250925092565b600060208284031215610c5257600080fd5b5035919050565b600060208284031215610c6b57600080fd5b813567ffffffffffffffff8116811461054457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b67ffffffffffffffff828116828216039080821115610cd357610cd3610c83565b5092915050565b600067ffffffffffffffff808316818103610cf757610cf7610c83565b600101939250505056fea2646970667358221220b9f71a2e32431258ee47c912363c1c97f6fc74ba7c52ff82519c322aa60e43a564736f6c63430008130033
Deployed Bytecode Sourcemap
26075:2526:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2924:85;2993:8;;;;2924:85;;;190:42:1;178:55;;;160:74;;148:2;133:18;2924:85:0;;;;;;;;23892:31;;;;;6175:150;;;;;;:::i;:::-;;:::i;:::-;;27116:98;27205:1;27116:98;;;851:25:1;;;839:2;824:18;27116:98:0;705:177:1;3727:132:0;;;:::i;3244:183::-;;;;;;:::i;:::-;;:::i;25170:186::-;;;:::i;25612:211::-;;;;;;:::i;:::-;;:::i;2745:81::-;2785:7;2812:6;;;2745:81;;7778:155;;;;;;:::i;:::-;;:::i;:::-;;;1576:14:1;;1569:22;1551:41;;1539:2;1524:18;7778:155:0;1411:187:1;27271:354:0;;;;;;:::i;:::-;;:::i;28053:216::-;28205:14;;;;;;;28156:7;28238:14;;;:6;:14;;;;;;;28053:216;;;;1960:25:1;;;2033:18;2021:31;;;2016:2;2001:18;;1994:59;1933:18;28053:216:0;1788:271:1;28462:136:0;;;;;;:::i;:::-;28576:14;;28549:7;28576:14;;;:6;:14;;;;;;;28462:136;6595:152;;;;;;:::i;:::-;;:::i;27682:314::-;;;;;;:::i;:::-;;:::i;6175:150::-;2617:6;;;;2603:10;:20;2599:44;;2632:11;;;;;;;;;;;;;;2599:44;6290:27:::1;6301:5;6308:8;6290:10;:27::i;:::-;6175:150:::0;;:::o;3727:132::-;3787:8;;;;3773:10;:22;3769:48;;3804:13;;;;;;;;;;;;;;3769:48;3828:23;3840:10;3828:11;:23::i;:::-;3727:132::o;3244:183::-;3323:6;;;;3309:10;:20;3305:44;;3338:11;;;;;;;;;;;;;;3305:44;3360:8;:19;;;;;;;;;;;;;3395:24;;;;-1:-1:-1;;3395:24:0;3244:183;:::o;25170:186::-;25300:16;;25251:24;;25300:16;;:21;:48;;25328:16;;:20;;25347:1;;25328:16;;:20;:::i;:::-;25300:48;;;25324:1;25300:48;25293:55;;;;25170:186;:::o;25612:211::-;5528:10;5513:14;:26;;;:14;;:26;:14;:26;;;22705:24;;5513:26;;5508:54;;5548:14;;;;;;;;851:25:1;;;824:18;;5548:14:0;;;;;;;;5508:54;25761::::1;25788:6;25796:9;25807:7;25761:26;:54::i;:::-;25612:211:::0;;;;:::o;7778:155::-;7876:4;8064:15;;;:8;:15;;;;;;;;:25;;;;;;;;;;;;;7900;7893:32;7778:155;-1:-1:-1;;;7778:155:0:o;27271:354::-;24462:10;:20;24476:6;24462:20;;24458:45;;24491:12;;;;;;;;;;;;;;24458:45;27398:16:::1;:18:::0;;27377::::1;::::0;27398::::1;::::0;;::::1;::::0;27377;27398::::1;::::0;::::1;:::i;:::-;::::0;;::::1;::::0;;;::::1;;::::0;;::::1;;::::0;;::::1;::::0;;::::1;;;::::0;;;27427:19;::::1;-1:-1:-1::0;27427:19:0;;;:6:::1;:19;::::0;;;;;;;;:36;;;27560:57;;3511:25:1;;;3552:18;;;3545:59;;;;3620:18;;3613:34;;;27427:19:0;;-1:-1:-1;27560:57:0::1;::::0;3499:2:1;3484:18;27560:57:0::1;;;;;;;27366:259;27271:354:::0;:::o;6595:152::-;2617:6;;;;2603:10;:20;2599:44;;2632:11;;;;;;;;;;;;;;2599:44;6711:28:::1;6723:5;6730:8;6711:11;:28::i;27682:314::-:0;27765:7;;24462:10;:20;24476:6;24462:20;;24458:45;;24491:12;;;;;;;;;;;;;;24458:45;27814:14:::1;:16:::0;;27793:18:::1;::::0;27814:16;;;::::1;;;::::0;:14:::1;:16;::::0;::::1;:::i;:::-;::::0;;::::1;::::0;;;::::1;;::::0;;::::1;;::::0;;::::1;::::0;;::::1;;;::::0;;;27845:19;::::1;-1:-1:-1::0;27845:19:0;;;:6:::1;:19;::::0;;;;;;;-1:-1:-1;27841:63:0::1;;27887:17;;;;;;;;;;;;;;27841:63;27932:19;::::0;::::1;27917:12;27932:19:::0;;;:6:::1;:19;::::0;;;;;;-1:-1:-1;27939:11:0;-1:-1:-1;27682:314:0;;;:::o;6973:157::-;7046:15;;;;:8;:15;;;;;;;;:25;;;;;;;;;;;:32;;;;7074:4;7046:32;;;7094:28;7046:25;;7055:5;;7094:28;;7046:15;7094:28;6973:157;;:::o;4021:154::-;4080:6;:17;;;;;;;;;;;;;;4108:21;;;;;;;;4145:22;;4080:17;;4145:22;;;4021:154;:::o;22095:469::-;22226:23;;;22222:49;;22258:13;;;;;;;;;;;;;;22222:49;22288:21;;;;;22284:273;;22326:51;22358:9;22369:7;22326:31;:51::i;:::-;22095:469;;;:::o;22284:273::-;22414:6;:18;;;22436:1;22414:23;22410:57;;22446:21;;;;;;;;;;;;;;22410:57;22482:63;22517:6;22526:9;22537:7;22482:28;:63::i;7363:159::-;7465:5;7437:15;;;:8;:15;;;;;;;;:25;;;;;;;;;;;:33;;;;;;7486:28;7437:25;;7446:5;;7486:28;;7465:5;7486:28;7363:159;;:::o;15749:349::-;15822:12;16026:1;16023;16020;16017;16009:6;16005:2;15998:5;15993:35;15982:46;;16059:7;16051:39;;;;;;;3860:2:1;16051:39:0;;;3842:21:1;3899:2;3879:18;;;3872:30;3938:21;3918:18;;;3911:49;3977:18;;16051:39:0;3658:343:1;18116:1637:0;18233:12;18408:4;18402:11;18553:66;18534:17;18527:93;18676:42;18672:2;18668:51;18664:1;18645:17;18641:25;18634:86;18807:6;18802:2;18783:17;18779:26;18772:42;19669:2;19666:1;19662:2;19643:17;19640:1;19633:5;19626;19621:51;19185:16;19178:24;19172:2;19154:16;19151:24;19147:1;19143;19137:8;19134:15;19130:46;19127:76;18924:763;18913:774;;;19718:7;19710:35;;;;;;;4208:2:1;19710:35:0;;;4190:21:1;4247:2;4227:18;;;4220:30;4286:17;4266:18;;;4259:45;4321:18;;19710:35:0;4006:339:1;245:196;313:20;;373:42;362:54;;352:65;;342:93;;431:1;428;421:12;342:93;245:196;;;:::o;446:254::-;514:6;522;575:2;563:9;554:7;550:23;546:32;543:52;;;591:1;588;581:12;543:52;627:9;614:23;604:33;;656:38;690:2;679:9;675:18;656:38;:::i;:::-;646:48;;446:254;;;;;:::o;887:186::-;946:6;999:2;987:9;978:7;974:23;970:32;967:52;;;1015:1;1012;1005:12;967:52;1038:29;1057:9;1038:29;:::i;1078:328::-;1155:6;1163;1171;1224:2;1212:9;1203:7;1199:23;1195:32;1192:52;;;1240:1;1237;1230:12;1192:52;1263:29;1282:9;1263:29;:::i;:::-;1253:39;;1311:38;1345:2;1334:9;1330:18;1311:38;:::i;:::-;1301:48;;1396:2;1385:9;1381:18;1368:32;1358:42;;1078:328;;;;;:::o;1603:180::-;1662:6;1715:2;1703:9;1694:7;1690:23;1686:32;1683:52;;;1731:1;1728;1721:12;1683:52;-1:-1:-1;1754:23:1;;1603:180;-1:-1:-1;1603:180:1:o;2064:284::-;2122:6;2175:2;2163:9;2154:7;2150:23;2146:32;2143:52;;;2191:1;2188;2181:12;2143:52;2230:9;2217:23;2280:18;2273:5;2269:30;2262:5;2259:41;2249:69;;2314:1;2311;2304:12;2720:184;2772:77;2769:1;2762:88;2869:4;2866:1;2859:15;2893:4;2890:1;2883:15;2909:183;2977:18;3028:10;;;3016;;;3012:27;;3051:12;;;3048:38;;;3066:18;;:::i;:::-;3048:38;2909:183;;;;:::o;3097:209::-;3135:3;3163:18;3216:2;3209:5;3205:14;3243:2;3234:7;3231:15;3228:41;;3249:18;;:::i;:::-;3298:1;3285:15;;3097:209;-1:-1:-1;;;3097:209:1:o
Swarm Source
ipfs://b9f71a2e32431258ee47c912363c1c97f6fc74ba7c52ff82519c322aa60e43a5
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.