More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 9,577 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Step | 39258033 | 9 mins ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39257960 | 16 mins ago | IN | 0 xDAI | 0.00006403 | ||||
Step | 39257884 | 22 mins ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39257507 | 54 mins ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39255404 | 3 hrs ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39255328 | 4 hrs ago | IN | 0 xDAI | 0.00006397 | ||||
Step | 39254799 | 4 hrs ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39254721 | 4 hrs ago | IN | 0 xDAI | 0.00006398 | ||||
Step | 39254497 | 5 hrs ago | IN | 0 xDAI | 0.00006393 | ||||
Step | 39254349 | 5 hrs ago | IN | 0 xDAI | 0.00006397 | ||||
Step | 39254199 | 5 hrs ago | IN | 0 xDAI | 0.00006394 | ||||
Step | 39254126 | 5 hrs ago | IN | 0 xDAI | 0.00006393 | ||||
Step | 39254051 | 5 hrs ago | IN | 0 xDAI | 0.00006395 | ||||
Step | 39253842 | 6 hrs ago | IN | 0 xDAI | 0.00006399 | ||||
Step | 39253681 | 6 hrs ago | IN | 0 xDAI | 0.00006398 | ||||
Step | 39253604 | 6 hrs ago | IN | 0 xDAI | 0.00006397 | ||||
Step | 39253454 | 6 hrs ago | IN | 0 xDAI | 0.00006395 | ||||
Step | 39253304 | 6 hrs ago | IN | 0 xDAI | 0.00006397 | ||||
Step | 39253228 | 6 hrs ago | IN | 0 xDAI | 0.00006392 | ||||
Step | 39252711 | 7 hrs ago | IN | 0 xDAI | 0.00006393 | ||||
Step | 39252486 | 8 hrs ago | IN | 0 xDAI | 0.00006397 | ||||
Step | 39252411 | 8 hrs ago | IN | 0 xDAI | 0.00006389 | ||||
Step | 39252262 | 8 hrs ago | IN | 0 xDAI | 0.00006395 | ||||
Step | 39252115 | 8 hrs ago | IN | 0 xDAI | 0.00006393 | ||||
Step | 39252041 | 8 hrs ago | IN | 0 xDAI | 0.00006389 |
View more zero value Internal Transactions in Advanced View mode
Loading...
Loading
Contract Name:
SpectreProxy
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// The Licensed Work is (c) 2023 Sygma // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "../interfaces/ISpectre.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; /** @title Proxies calls to Spectre https://github.com/ChainSafe/Spectre/blob/main/contracts/src/Spectre.sol to enable multiple domain support @author ChainSafe Systems. */ contract SpectreProxy is AccessControl { uint8 public constant STATE_ROOT_INDEX = 34; uint8 public constant STATE_ROOT_DEPTH = 5; // source domainID => slot => state root mapping(uint8 => mapping(uint256 => bytes32)) public stateRoots; // source domainID => spectre contract address mapping(uint8 => address) public spectreContracts; event CommitteeRotated(uint8 sourceDomainID, uint256 slot); event StateRootSubmitted(uint8 sourceDomainID, uint256 slot, bytes32 stateRoot); error SenderNotAdmin(); error ArrayLengthsDoNotMatch(); error SpectreAddressNotFound(); error InvalidMerkleProof(); modifier onlyAdmin() { _onlyAdmin(); _; } function _onlyAdmin() private view { if (!hasRole(DEFAULT_ADMIN_ROLE, _msgSender())) revert SenderNotAdmin(); } /** @notice Initializes spectre proxy and sets initial spectre addresses. @param domainIDS List of to be domain IDs. @param spectreAddresses List of spectre addresses. */ constructor(uint8[] memory domainIDS, address[] memory spectreAddresses) { if (domainIDS.length != spectreAddresses.length) revert ArrayLengthsDoNotMatch(); for (uint8 i = 0; i < domainIDS.length; i++) { spectreContracts[domainIDS[i]] = spectreAddresses[i]; } _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** @notice Admin function that sets the spectre address for a domain @param sourceDomainID Domain ID of the source chain @param spectreAddress Address of the contract */ function adminSetSpectreAddress(uint8 sourceDomainID, address spectreAddress) external onlyAdmin { spectreContracts[sourceDomainID] = spectreAddress; } /** @notice Proxy for the Spectre rotate function that supports multiple domains @param sourceDomainID DomainID of the network for which the proof is submitted @param rotateProof The proof for the rotation @param stepInput The input to the sync step @param stepProof The proof for the sync step */ function rotate( uint8 sourceDomainID, bytes calldata rotateProof, ISpectre.SyncStepInput calldata stepInput, bytes calldata stepProof ) external { address spectreAddress = spectreContracts[sourceDomainID]; if (spectreAddress == address(0)) revert SpectreAddressNotFound(); ISpectre spectre = ISpectre(spectreAddress); spectre.rotate(rotateProof, stepInput, stepProof); emit CommitteeRotated(sourceDomainID, stepInput.attestedSlot); } /** @notice Proxy for the Spectre step function that proves and stores the execution state root @param input The input to the sync step. Defines the slot and attestation to verify @param stepProof The proof for the sync step @param stateRoot The execution state root for the step slot @param stateRootProof Indexed merkle proof for the state root */ function step( uint8 sourceDomainID, ISpectre.SyncStepInput calldata input, bytes calldata stepProof, bytes32 stateRoot, bytes[] calldata stateRootProof ) external { address spectreAddress = spectreContracts[sourceDomainID]; if (spectreAddress == address(0)) revert SpectreAddressNotFound(); ISpectre spectre = ISpectre(spectreAddress); spectre.step(input, stepProof); bytes32 executionRoot = spectre.executionPayloadRoots(input.finalizedSlot); if (!verifyMerkleBranch(stateRoot, executionRoot, stateRootProof, STATE_ROOT_INDEX)) { revert InvalidMerkleProof(); } stateRoots[sourceDomainID][input.finalizedSlot] = stateRoot; emit StateRootSubmitted(sourceDomainID, input.finalizedSlot, stateRoot); } /** @notice Returns a state root. @param sourceDomainID ID of chain state root originated from. @param slot slot number of the state root. @return State root for the given domain ID and slot. */ function getStateRoot(uint8 sourceDomainID, uint256 slot) public view returns (bytes32) { return stateRoots[sourceDomainID][slot]; } function verifyMerkleBranch( bytes32 leaf, bytes32 root, bytes[] calldata proof, uint8 index ) internal pure returns (bool) { bytes32 value = leaf; for (uint256 i = 0; i < STATE_ROOT_DEPTH; i++) { if ((index / (2**i)) % 2 == 1) { value = sha256(abi.encodePacked(proof[i], value)); } else { value = sha256(abi.encodePacked(value, proof[i])); } } return value == root; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// The Licensed Work is (c) 2023 Sygma // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; /** @title Interface for Spectre (https://github.com/ChainSafe/Spectre/blob/main/contracts/src/Spectre.sol) contract @author ChainSafe Systems. */ interface ISpectre { struct SyncStepInput { uint64 attestedSlot; uint64 finalizedSlot; uint64 participation; bytes32 finalizedHeaderRoot; bytes32 executionPayloadRoot; } /// @notice Verify that a sync committee has attested to a block that finalizes /// the given header root and execution payload /// @param input The input to the sync step. Defines the slot and attestation to verify /// @param proof The proof for the sync step function step(SyncStepInput calldata input, bytes calldata proof) external; /// @notice Use the current sync committee to verify the transition to a new sync committee /// @param rotateProof The proof for the rotation /// @param stepInput The input to the sync step. /// @param stepProof The proof for the sync step function rotate( bytes calldata rotateProof, SyncStepInput calldata stepInput, bytes calldata stepProof ) external; /// @notice Fetches the execution payload root for the given slot /// @param slot Beacon chain slot for requesting execution payload root /// @return Execution payload root for given slot function executionPayloadRoots(uint256 slot) external view returns (bytes32); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint8[]","name":"domainIDS","type":"uint8[]"},{"internalType":"address[]","name":"spectreAddresses","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthsDoNotMatch","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"SenderNotAdmin","type":"error"},{"inputs":[],"name":"SpectreAddressNotFound","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"}],"name":"CommitteeRotated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"stateRoot","type":"bytes32"}],"name":"StateRootSubmitted","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATE_ROOT_DEPTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATE_ROOT_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"internalType":"address","name":"spectreAddress","type":"address"}],"name":"adminSetSpectreAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"internalType":"uint256","name":"slot","type":"uint256"}],"name":"getStateRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"internalType":"bytes","name":"rotateProof","type":"bytes"},{"components":[{"internalType":"uint64","name":"attestedSlot","type":"uint64"},{"internalType":"uint64","name":"finalizedSlot","type":"uint64"},{"internalType":"uint64","name":"participation","type":"uint64"},{"internalType":"bytes32","name":"finalizedHeaderRoot","type":"bytes32"},{"internalType":"bytes32","name":"executionPayloadRoot","type":"bytes32"}],"internalType":"struct ISpectre.SyncStepInput","name":"stepInput","type":"tuple"},{"internalType":"bytes","name":"stepProof","type":"bytes"}],"name":"rotate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"spectreContracts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"stateRoots","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"sourceDomainID","type":"uint8"},{"components":[{"internalType":"uint64","name":"attestedSlot","type":"uint64"},{"internalType":"uint64","name":"finalizedSlot","type":"uint64"},{"internalType":"uint64","name":"participation","type":"uint64"},{"internalType":"bytes32","name":"finalizedHeaderRoot","type":"bytes32"},{"internalType":"bytes32","name":"executionPayloadRoot","type":"bytes32"}],"internalType":"struct ISpectre.SyncStepInput","name":"input","type":"tuple"},{"internalType":"bytes","name":"stepProof","type":"bytes"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes[]","name":"stateRootProof","type":"bytes[]"}],"name":"step","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001730380380620017308339810160408190526200003491620002b8565b80518251146200005757604051631405877960e11b815260040160405180910390fd5b60005b82518160ff161015620000f957818160ff16815181106200007f576200007f62000390565b602002602001015160026000858460ff1681518110620000a357620000a362000390565b602002602001015160ff1660ff16815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508080620000f090620003a6565b9150506200005a565b50620001076000336200010f565b5050620003d5565b6200011b82826200011f565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200011b576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200017b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620002005762000200620001bf565b604052919050565b60006001600160401b03821115620002245762000224620001bf565b5060051b60200190565b600082601f8301126200024057600080fd5b8151602062000259620002538362000208565b620001d5565b82815260059290921b840181019181810190868411156200027957600080fd5b8286015b84811015620002ad5780516001600160a01b03811681146200029f5760008081fd5b83529183019183016200027d565b509695505050505050565b60008060408385031215620002cc57600080fd5b82516001600160401b0380821115620002e457600080fd5b818501915085601f830112620002f957600080fd5b815160206200030c620002538362000208565b82815260059290921b840181019181810190898411156200032c57600080fd5b948201945b838610156200035d57855160ff811681146200034d5760008081fd5b8252948201949082019062000331565b918801519196509093505050808211156200037757600080fd5b5062000386858286016200022e565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff811415620003cc57634e487b7160e01b600052601160045260246000fd5b60010192915050565b61134b80620003e56000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806332e3f10711610097578063a217fddf11610066578063a217fddf14610252578063b100b8991461025a578063d3cb25f014610262578063d547741f1461028d57600080fd5b806332e3f1071461020657806336568abe1461021957806365146f1b1461022c57806391d148541461023f57600080fd5b8063248a9ca3116100d3578063248a9ca31461017a57806325cf93201461019d5780632f2ff15d146101de578063304fd0fc146101f357600080fd5b806301ffc9a7146100fa5780630542b6c014610122578063075da95e14610160575b600080fd5b61010d610108366004610bd4565b6102a0565b60405190151581526020015b60405180910390f35b610152610130366004610c14565b60ff919091166000908152600160209081526040808320938352929052205490565b604051908152602001610119565b610168600581565b60405160ff9091168152602001610119565b610152610188366004610c3e565b60009081526020819052604090206001015490565b6101c66101ab366004610c57565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610119565b6101f16101ec366004610c89565b6102d7565b005b6101f1610201366004610d16565b610301565b6101f1610214366004610de4565b61050f565b6101f1610227366004610c89565b61054a565b6101f161023a366004610e0e565b6105cd565b61010d61024d366004610c89565b6106d0565b610152600081565b610168602281565b610152610270366004610c14565b600160209081526000928352604080842090915290825290205481565b6101f161029b366004610c89565b6106f9565b60006001600160e01b03198216637965db0b60e01b14806102d157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102f28161071e565b6102fc838361072b565b505050565b60ff87166000908152600260205260409020546001600160a01b03168061033b57604051636244a80360e01b815260040160405180910390fd5b604051632cf53e6f60e01b815281906001600160a01b03821690632cf53e6f9061036d908b908b908b90600401610f37565b600060405180830381600087803b15801561038757600080fd5b505af115801561039b573d6000803e3d6000fd5b506000925050506001600160a01b03821663c22fc36a6103c160408c0160208d01610f61565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610f7c565b905061043a8682878760226107af565b6104575760405163582f497d60e11b815260040160405180910390fd5b85600160008c60ff1660ff16815260200190815260200160002060008b60200160208101906104869190610f61565b67ffffffffffffffff168152602001908152602001600020819055507f567295ac9cc25b7a091d4916c2bcd7380e3caef45e463cda23bc7a7cccbc8dc58a8a60200160208101906104d79190610f61565b6040805160ff909316835267ffffffffffffffff9091166020830152810188905260600160405180910390a150505050505050505050565b610517610937565b60ff91909116600090815260026020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03811633146105bf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105c98282610961565b5050565b60ff86166000908152600260205260409020546001600160a01b03168061060757604051636244a80360e01b815260040160405180910390fd5b6040516326f4033960e01b815281906001600160a01b038216906326f403399061063d908a908a908a908a908a90600401610f95565b600060405180830381600087803b15801561065757600080fd5b505af115801561066b573d6000803e3d6000fd5b507f9e2a94b27168bb1b8a970dbe3493b236ffd18d947638cb5c2df75b5a8e72b49892508a91506106a190506020880188610f61565b6040805160ff909316835267ffffffffffffffff90911660208301520160405180910390a15050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000828152602081905260409020600101546107148161071e565b6102fc8383610961565b61072881336109c6565b50565b61073582826106d0565b6105c9576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561076b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600085815b600581101561092a5760026107c982826110cf565b6107d69060ff87166110f1565b6107e09190611105565b600114156108825760028686838181106107fc576107fc611119565b905060200281019061080e919061112f565b8460405160200161082193929190611176565b60408051601f198184030181529082905261083b916111b8565b602060405180830381855afa158015610858573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061087b9190610f7c565b9150610918565b60028287878481811061089757610897611119565b90506020028101906108a9919061112f565b6040516020016108bb939291906111d4565b60408051601f19818403018152908290526108d5916111b8565b602060405180830381855afa1580156108f2573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906109159190610f7c565b91505b80610922816111ee565b9150506107b4565b5090941495945050505050565b6109426000336106d0565b61095f5760405163a6c827a960e01b815260040160405180910390fd5b565b61096b82826106d0565b156105c9576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6109d082826106d0565b6105c9576109dd81610a1f565b6109e8836020610a31565b6040516020016109f9929190611209565b60408051601f198184030181529082905262461bcd60e51b82526105b69160040161127e565b60606102d16001600160a01b03831660145b60606000610a408360026112b1565b610a4b9060026112d0565b67ffffffffffffffff811115610a6357610a636112e8565b6040519080825280601f01601f191660200182016040528015610a8d576020820181803683370190505b509050600360fc1b81600081518110610aa857610aa8611119565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ad757610ad7611119565b60200101906001600160f81b031916908160001a9053506000610afb8460026112b1565b610b069060016112d0565b90505b6001811115610b7e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610b3a57610b3a611119565b1a60f81b828281518110610b5057610b50611119565b60200101906001600160f81b031916908160001a90535060049490941c93610b77816112fe565b9050610b09565b508315610bcd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105b6565b9392505050565b600060208284031215610be657600080fd5b81356001600160e01b031981168114610bcd57600080fd5b803560ff81168114610c0f57600080fd5b919050565b60008060408385031215610c2757600080fd5b610c3083610bfe565b946020939093013593505050565b600060208284031215610c5057600080fd5b5035919050565b600060208284031215610c6957600080fd5b610bcd82610bfe565b80356001600160a01b0381168114610c0f57600080fd5b60008060408385031215610c9c57600080fd5b82359150610cac60208401610c72565b90509250929050565b600060a08284031215610cc757600080fd5b50919050565b60008083601f840112610cdf57600080fd5b50813567ffffffffffffffff811115610cf757600080fd5b602083019150836020828501011115610d0f57600080fd5b9250929050565b6000806000806000806000610120888a031215610d3257600080fd5b610d3b88610bfe565b9650610d4a8960208a01610cb5565b955060c088013567ffffffffffffffff80821115610d6757600080fd5b610d738b838c01610ccd565b909750955060e08a013594506101008a0135915080821115610d9457600080fd5b818a0191508a601f830112610da857600080fd5b813581811115610db757600080fd5b8b60208260051b8501011115610dcc57600080fd5b60208301945080935050505092959891949750929550565b60008060408385031215610df757600080fd5b610e0083610bfe565b9150610cac60208401610c72565b6000806000806000806101008789031215610e2857600080fd5b610e3187610bfe565b9550602087013567ffffffffffffffff80821115610e4e57600080fd5b610e5a8a838b01610ccd565b9097509550859150610e6f8a60408b01610cb5565b945060e0890135915080821115610e8557600080fd5b50610e9289828a01610ccd565b979a9699509497509295939492505050565b803567ffffffffffffffff81168114610c0f57600080fd5b67ffffffffffffffff80610ecf83610ea4565b16835280610edf60208401610ea4565b16602084015280610ef260408401610ea4565b1660408401525060608181013590830152608090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b610f418185610ebc565b60c060a08201526000610f5860c083018486610f0e565b95945050505050565b600060208284031215610f7357600080fd5b610bcd82610ea4565b600060208284031215610f8e57600080fd5b5051919050565b60e081526000610fa960e083018789610f0e565b610fb66020840187610ebc565b82810360c0840152610fc9818587610f0e565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561102657816000190482111561100c5761100c610fd5565b8085161561101957918102915b93841c9390800290610ff0565b509250929050565b60008261103d575060016102d1565b8161104a575060006102d1565b8160018114611060576002811461106a57611086565b60019150506102d1565b60ff84111561107b5761107b610fd5565b50506001821b6102d1565b5060208310610133831016604e8410600b84101617156110a9575081810a6102d1565b6110b38383610feb565b80600019048211156110c7576110c7610fd5565b029392505050565b6000610bcd838361102e565b634e487b7160e01b600052601260045260246000fd5b600082611100576111006110db565b500490565b600082611114576111146110db565b500690565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261114657600080fd5b83018035915067ffffffffffffffff82111561116157600080fd5b602001915036819003821315610d0f57600080fd5b82848237909101908152602001919050565b60005b838110156111a357818101518382015260200161118b565b838111156111b2576000848401525b50505050565b600082516111ca818460208701611188565b9190910192915050565b838152818360208301376000910160200190815292915050565b600060001982141561120257611202610fd5565b5060010190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611241816017850160208801611188565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611272816028840160208801611188565b01602801949350505050565b602081526000825180602084015261129d816040850160208701611188565b601f01601f19169190910160400192915050565b60008160001904831182151516156112cb576112cb610fd5565b500290565b600082198211156112e3576112e3610fd5565b500190565b634e487b7160e01b600052604160045260246000fd5b60008161130d5761130d610fd5565b50600019019056fea26469706673582212207572282b763c71b87cc225c6a0377599585553be9e412dc79cdf281ff4811ced64736f6c634300080b00330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806332e3f10711610097578063a217fddf11610066578063a217fddf14610252578063b100b8991461025a578063d3cb25f014610262578063d547741f1461028d57600080fd5b806332e3f1071461020657806336568abe1461021957806365146f1b1461022c57806391d148541461023f57600080fd5b8063248a9ca3116100d3578063248a9ca31461017a57806325cf93201461019d5780632f2ff15d146101de578063304fd0fc146101f357600080fd5b806301ffc9a7146100fa5780630542b6c014610122578063075da95e14610160575b600080fd5b61010d610108366004610bd4565b6102a0565b60405190151581526020015b60405180910390f35b610152610130366004610c14565b60ff919091166000908152600160209081526040808320938352929052205490565b604051908152602001610119565b610168600581565b60405160ff9091168152602001610119565b610152610188366004610c3e565b60009081526020819052604090206001015490565b6101c66101ab366004610c57565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610119565b6101f16101ec366004610c89565b6102d7565b005b6101f1610201366004610d16565b610301565b6101f1610214366004610de4565b61050f565b6101f1610227366004610c89565b61054a565b6101f161023a366004610e0e565b6105cd565b61010d61024d366004610c89565b6106d0565b610152600081565b610168602281565b610152610270366004610c14565b600160209081526000928352604080842090915290825290205481565b6101f161029b366004610c89565b6106f9565b60006001600160e01b03198216637965db0b60e01b14806102d157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102f28161071e565b6102fc838361072b565b505050565b60ff87166000908152600260205260409020546001600160a01b03168061033b57604051636244a80360e01b815260040160405180910390fd5b604051632cf53e6f60e01b815281906001600160a01b03821690632cf53e6f9061036d908b908b908b90600401610f37565b600060405180830381600087803b15801561038757600080fd5b505af115801561039b573d6000803e3d6000fd5b506000925050506001600160a01b03821663c22fc36a6103c160408c0160208d01610f61565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610f7c565b905061043a8682878760226107af565b6104575760405163582f497d60e11b815260040160405180910390fd5b85600160008c60ff1660ff16815260200190815260200160002060008b60200160208101906104869190610f61565b67ffffffffffffffff168152602001908152602001600020819055507f567295ac9cc25b7a091d4916c2bcd7380e3caef45e463cda23bc7a7cccbc8dc58a8a60200160208101906104d79190610f61565b6040805160ff909316835267ffffffffffffffff9091166020830152810188905260600160405180910390a150505050505050505050565b610517610937565b60ff91909116600090815260026020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03811633146105bf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105c98282610961565b5050565b60ff86166000908152600260205260409020546001600160a01b03168061060757604051636244a80360e01b815260040160405180910390fd5b6040516326f4033960e01b815281906001600160a01b038216906326f403399061063d908a908a908a908a908a90600401610f95565b600060405180830381600087803b15801561065757600080fd5b505af115801561066b573d6000803e3d6000fd5b507f9e2a94b27168bb1b8a970dbe3493b236ffd18d947638cb5c2df75b5a8e72b49892508a91506106a190506020880188610f61565b6040805160ff909316835267ffffffffffffffff90911660208301520160405180910390a15050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000828152602081905260409020600101546107148161071e565b6102fc8383610961565b61072881336109c6565b50565b61073582826106d0565b6105c9576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561076b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600085815b600581101561092a5760026107c982826110cf565b6107d69060ff87166110f1565b6107e09190611105565b600114156108825760028686838181106107fc576107fc611119565b905060200281019061080e919061112f565b8460405160200161082193929190611176565b60408051601f198184030181529082905261083b916111b8565b602060405180830381855afa158015610858573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061087b9190610f7c565b9150610918565b60028287878481811061089757610897611119565b90506020028101906108a9919061112f565b6040516020016108bb939291906111d4565b60408051601f19818403018152908290526108d5916111b8565b602060405180830381855afa1580156108f2573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906109159190610f7c565b91505b80610922816111ee565b9150506107b4565b5090941495945050505050565b6109426000336106d0565b61095f5760405163a6c827a960e01b815260040160405180910390fd5b565b61096b82826106d0565b156105c9576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6109d082826106d0565b6105c9576109dd81610a1f565b6109e8836020610a31565b6040516020016109f9929190611209565b60408051601f198184030181529082905262461bcd60e51b82526105b69160040161127e565b60606102d16001600160a01b03831660145b60606000610a408360026112b1565b610a4b9060026112d0565b67ffffffffffffffff811115610a6357610a636112e8565b6040519080825280601f01601f191660200182016040528015610a8d576020820181803683370190505b509050600360fc1b81600081518110610aa857610aa8611119565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ad757610ad7611119565b60200101906001600160f81b031916908160001a9053506000610afb8460026112b1565b610b069060016112d0565b90505b6001811115610b7e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610b3a57610b3a611119565b1a60f81b828281518110610b5057610b50611119565b60200101906001600160f81b031916908160001a90535060049490941c93610b77816112fe565b9050610b09565b508315610bcd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105b6565b9392505050565b600060208284031215610be657600080fd5b81356001600160e01b031981168114610bcd57600080fd5b803560ff81168114610c0f57600080fd5b919050565b60008060408385031215610c2757600080fd5b610c3083610bfe565b946020939093013593505050565b600060208284031215610c5057600080fd5b5035919050565b600060208284031215610c6957600080fd5b610bcd82610bfe565b80356001600160a01b0381168114610c0f57600080fd5b60008060408385031215610c9c57600080fd5b82359150610cac60208401610c72565b90509250929050565b600060a08284031215610cc757600080fd5b50919050565b60008083601f840112610cdf57600080fd5b50813567ffffffffffffffff811115610cf757600080fd5b602083019150836020828501011115610d0f57600080fd5b9250929050565b6000806000806000806000610120888a031215610d3257600080fd5b610d3b88610bfe565b9650610d4a8960208a01610cb5565b955060c088013567ffffffffffffffff80821115610d6757600080fd5b610d738b838c01610ccd565b909750955060e08a013594506101008a0135915080821115610d9457600080fd5b818a0191508a601f830112610da857600080fd5b813581811115610db757600080fd5b8b60208260051b8501011115610dcc57600080fd5b60208301945080935050505092959891949750929550565b60008060408385031215610df757600080fd5b610e0083610bfe565b9150610cac60208401610c72565b6000806000806000806101008789031215610e2857600080fd5b610e3187610bfe565b9550602087013567ffffffffffffffff80821115610e4e57600080fd5b610e5a8a838b01610ccd565b9097509550859150610e6f8a60408b01610cb5565b945060e0890135915080821115610e8557600080fd5b50610e9289828a01610ccd565b979a9699509497509295939492505050565b803567ffffffffffffffff81168114610c0f57600080fd5b67ffffffffffffffff80610ecf83610ea4565b16835280610edf60208401610ea4565b16602084015280610ef260408401610ea4565b1660408401525060608181013590830152608090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b610f418185610ebc565b60c060a08201526000610f5860c083018486610f0e565b95945050505050565b600060208284031215610f7357600080fd5b610bcd82610ea4565b600060208284031215610f8e57600080fd5b5051919050565b60e081526000610fa960e083018789610f0e565b610fb66020840187610ebc565b82810360c0840152610fc9818587610f0e565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561102657816000190482111561100c5761100c610fd5565b8085161561101957918102915b93841c9390800290610ff0565b509250929050565b60008261103d575060016102d1565b8161104a575060006102d1565b8160018114611060576002811461106a57611086565b60019150506102d1565b60ff84111561107b5761107b610fd5565b50506001821b6102d1565b5060208310610133831016604e8410600b84101617156110a9575081810a6102d1565b6110b38383610feb565b80600019048211156110c7576110c7610fd5565b029392505050565b6000610bcd838361102e565b634e487b7160e01b600052601260045260246000fd5b600082611100576111006110db565b500490565b600082611114576111146110db565b500690565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261114657600080fd5b83018035915067ffffffffffffffff82111561116157600080fd5b602001915036819003821315610d0f57600080fd5b82848237909101908152602001919050565b60005b838110156111a357818101518382015260200161118b565b838111156111b2576000848401525b50505050565b600082516111ca818460208701611188565b9190910192915050565b838152818360208301376000910160200190815292915050565b600060001982141561120257611202610fd5565b5060010190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611241816017850160208801611188565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611272816028840160208801611188565b01602801949350505050565b602081526000825180602084015261129d816040850160208701611188565b601f01601f19169190910160400192915050565b60008160001904831182151516156112cb576112cb610fd5565b500290565b600082198211156112e3576112e3610fd5565b500190565b634e487b7160e01b600052604160045260246000fd5b60008161130d5761130d610fd5565b50600019019056fea26469706673582212207572282b763c71b87cc225c6a0377599585553be9e412dc79cdf281ff4811ced64736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ 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.