FRAX Price: $1.02 (+5.55%)

Contract

0x0F00F1a6A32e644815C5686aD7dc305A54B11200

Overview

FRAX Balance | FXTL Balance

0 FRAX | 541 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Execute309857152026-01-19 0:22:215 days ago1768782141IN
0x0F00F1a6...A54B11200
0 FRAX0.000189890.00100036
Execute309853762026-01-19 0:11:035 days ago1768781463IN
0x0F00F1a6...A54B11200
0 FRAX0.000185680.00100036
Execute309796222026-01-18 20:59:155 days ago1768769955IN
0x0F00F1a6...A54B11200
0 FRAX0.00000380.00100025
Execute309394882026-01-17 22:41:276 days ago1768689687IN
0x0F00F1a6...A54B11200
0 FRAX0.000004580.00100025
Execute309113742026-01-17 7:04:197 days ago1768633459IN
0x0F00F1a6...A54B11200
0 FRAX0.000004160.00100025
Execute309091062026-01-17 5:48:437 days ago1768628923IN
0x0F00F1a6...A54B11200
0 FRAX0.000003620.00100025
Execute308564032026-01-16 0:31:578 days ago1768523517IN
0x0F00F1a6...A54B11200
0 FRAX0.000005260.00100025
Execute308558092026-01-16 0:12:098 days ago1768522329IN
0x0F00F1a6...A54B11200
0 FRAX0.000005440.00100025
Execute308534222026-01-15 22:52:358 days ago1768517555IN
0x0F00F1a6...A54B11200
0 FRAX0.000005340.00100025
Execute308525182026-01-15 22:22:278 days ago1768515747IN
0x0F00F1a6...A54B11200
0 FRAX0.000005750.00100026
Execute308517382026-01-15 21:56:278 days ago1768514187IN
0x0F00F1a6...A54B11200
0 FRAX0.000006790.00100025
Execute308390472026-01-15 14:53:259 days ago1768488805IN
0x0F00F1a6...A54B11200
0 FRAX0.000113210.00100035
Execute307208522026-01-12 21:13:3511 days ago1768252415IN
0x0F00F1a6...A54B11200
0 FRAX0.000005110.00100025
Execute306841602026-01-12 0:50:3112 days ago1768179031IN
0x0F00F1a6...A54B11200
0 FRAX0.000004410.00100025
Execute306348622026-01-10 21:27:1513 days ago1768080435IN
0x0F00F1a6...A54B11200
0 FRAX0.000003950.00100025
Execute305560802026-01-09 1:41:1115 days ago1767922871IN
0x0F00F1a6...A54B11200
0 FRAX0.000004630.00100025
Execute305551462026-01-09 1:10:0315 days ago1767921003IN
0x0F00F1a6...A54B11200
0 FRAX0.000003820.00100025
Execute305037942026-01-07 20:38:1916 days ago1767818299IN
0x0F00F1a6...A54B11200
0 FRAX0.000011250.00100025
Execute303491602026-01-04 6:43:5120 days ago1767509031IN
0x0F00F1a6...A54B11200
0 FRAX0.000004030.00100025
Execute302695402026-01-02 10:29:5122 days ago1767349791IN
0x0F00F1a6...A54B11200
0 FRAX0.000010030.00100025
Execute301462602025-12-30 14:00:3125 days ago1767103231IN
0x0F00F1a6...A54B11200
0 FRAX0.000011860.00100025
Set Threshold301023562025-12-29 13:37:0326 days ago1767015423IN
0x0F00F1a6...A54B11200
0 FRAX0.00000420.00100025
Set Threshold299324882025-12-25 15:14:4730 days ago1766675687IN
0x0F00F1a6...A54B11200
0 FRAX0.000011490.00100025
Set Receivers Co...299324842025-12-25 15:14:3930 days ago1766675679IN
0x0F00F1a6...A54B11200
0 FRAX0.000003270.00100025
Grant Role287078812025-11-27 6:54:3358 days ago1764226473IN
0x0F00F1a6...A54B11200
0 FRAX0.00000460.00100025
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Receiver

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2025 - all rights reserved
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
import "../interfaces/IReceiver.sol";

contract Receiver is IReceiver, AccessControlEnumerable {

    using Address for address;
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableMap for EnumerableMap.Bytes32ToUintMap;

    /// @dev bridge role id
    bytes32 public constant RECEIVER_ROLE = keccak256("RECEIVER_ROLE");
    /// @dev operator role id
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
    /// @dev hash -> receiver's addresses from where hash received
    mapping(bytes32 => EnumerableSet.AddressSet) internal _receivesCount;
    /// @dev hash -> data
    mapping(bytes32 => bytes) public payload;
    /// @dev protocol -> threshold
    EnumerableMap.Bytes32ToUintMap private _threshold;
    /// @dev hash -> execute status
    mapping(bytes32 => bool) public executedData;
    /// @dev receivers count
    uint8 public receiversCount;

    event ThresholdSet(bytes32[] sender, uint64[] chainIdFrom, uint8[] threshold);
    event ReceiverCountSet(uint8 receiverCount);
    event RequestExecuted(bytes32 requestId);
    event Received(address receiver, bytes32 requestId, bool isHash);

    constructor() {
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        receiversCount = 1;
    }

    /**
     * @notice Sets multiple sender's threshold. Must be the same on the sender's side.
     *
     * @param sender The protocol contract addresses;
     * @param chainIdFrom The chain id from for the given contract addresses.
     * @param threshold_ The thresholds for the given contract addresses.
     */
    function setThreshold(bytes32[] memory sender, uint64[] memory chainIdFrom, uint8[] memory threshold_) external onlyRole(OPERATOR_ROLE) {
        uint8 length = uint8(sender.length);
        require(length == threshold_.length, "Receiver: wrong count");
        require(length == chainIdFrom.length, "Receiver: wrong count");
        for (uint8 i; i < length; ++i) {
            require(threshold_[i] >= 1, "Receiver: wrong threshold");
            require(threshold_[i] <= receiversCount, "Receiver: wrong threshold");
            _threshold.set(_packKey(sender[i], chainIdFrom[i]), threshold_[i]);
        }
        emit ThresholdSet(sender, chainIdFrom, threshold_);
    }

    /**
     * @notice Sets enabled bridges count.
     *
     * @param receiversCount_ The bridges count.
     */
    function setReceiversCount(uint8 receiversCount_) external onlyRole(OPERATOR_ROLE) {
        require(receiversCount_ >= 1, "Receiver: wrong receivers count");
        uint256 thresholdLength_ = thresholdLength();
        uint8 threshold_;
        for(uint32 i; i < thresholdLength_; ++i) {
            (, threshold_) = thresholdAt(i);
            require(threshold_ <= receiversCount_, "Receiver: threshold bigger than receiversCount");
        }
        receiversCount = receiversCount_;
        emit ReceiverCountSet(receiversCount_);
    }

    /**
     * @notice Get threshold for given address.
     *
     * @param sender sender address
     */
    function getThreshold(bytes32 sender, uint64 chainIdFrom) public view returns (uint8) {
        (bool exists, uint256 value) = _threshold.tryGet(_packKey(sender, chainIdFrom));
        require(exists, "Receiver: Threshold not set");
        return uint8(value);
    }

    /**
     * @notice Get threshold at index.
     *
     * @param index index
     */
    function thresholdAt(uint256 index) public view returns (bytes32, uint8) {
        (bytes32 key, uint256 value) = _threshold.at(index);
        return (key, uint8(value));
    }

    function thresholdLength() public view returns (uint256) {
        return _threshold.length();
    }

    /**
     * @dev Receive full data.
     * 
     * @param sender Source sender
     * @param receivedData Received data
     */
    function receiveData(bytes32 sender, uint64 chainIdFrom, bytes memory receivedData, bytes32 requestId) external onlyRole(RECEIVER_ROLE) {
        uint8 threshold_ = getThreshold(sender, chainIdFrom);
        require(threshold_ > 0, "Receiver: threshold is not set");

        bytes32 hashKey = _generateHashKey(keccak256(receivedData), sender, requestId);
        if(!_receivesCount[hashKey].contains(msg.sender)) {
            _receivesCount[hashKey].add(msg.sender);
        }

        uint256 targetThreshold = getThreshold(sender, chainIdFrom);
        if(targetThreshold == 1) {
            uint256 currentThreshold = _receivesCount[hashKey].length();
            _execute(currentThreshold, targetThreshold, receivedData, hashKey, requestId);  
        } else {
            if (payload[hashKey].length == 0) {
                payload[hashKey] = receivedData;
            }
        }
        emit Received(msg.sender, requestId, false);
    }

    /**
     * @dev Receive hash of data
     * 
     * @param sender Source sender
     * @param receivedHash Received hash
     */
    function receiveHash(bytes32 sender, uint64 chainIdFrom, bytes32 receivedHash, bytes32 requestId) external onlyRole(RECEIVER_ROLE) {
        uint8 threshold_ = getThreshold(sender, chainIdFrom);
        require(threshold_ > 0, "Receiver: threshold is not set");
        bytes32 hashKey = _generateHashKey(receivedHash, sender, requestId);
        require(!_receivesCount[hashKey].contains(msg.sender), "Receiver: already received");
        _receivesCount[hashKey].add(msg.sender);
        emit Received(msg.sender, requestId, true);
    }

    /**
     * @dev Execute if enough threshold
     * 
     * @param hash_ hash
     * @param sender_ source chain bridge caller
     * @param requestId_ request id
     */
    function execute(bytes32 hash_, bytes32 sender_, uint64 chainIdFrom, bytes32 requestId_) public {
        bytes32 hashKey = _generateHashKey(hash_, sender_, requestId_);
        bytes memory receivedData = payload[hashKey];
        require(receivedData.length != 0, "Receiver: data not received");
        if (!_execute(_receivesCount[hashKey].length(), getThreshold(sender_, chainIdFrom), receivedData, hashKey, requestId_)) {
            revert("Receiver: not executed");
        }
    }

    /**
     * @dev Returns list of receivers
     * 
     * @param hash_ hash
     * @param sender_ sender address
     * @param requestId_ request id
     */
    function hashReceivers(bytes32 hash_, bytes32 sender_, bytes32 requestId_) public view returns (address[] memory) {
        bytes32 hashKey = _generateHashKey(hash_, sender_, requestId_);
        return _receivesCount[hashKey].values();
    }

    /**
     * @dev Make threshold check and after two calls to executor contract. First for check, second for execute.
     * 
     * @param currentThreshold current threshold
     * @param targetThreshold target threshold
     * @param receivedData data, which fill be decoded and executed
     * @param hashKey hash key consisting of hash, protocol and requestId
     */
    function _execute(
        uint256 currentThreshold, 
        uint256 targetThreshold, 
        bytes memory receivedData, 
        bytes32 hashKey,
        bytes32 requestId
    ) internal returns(bool) {
        require(executedData[hashKey] == false, "Receiver: already executed");
        if (currentThreshold >= targetThreshold) {
            if (receivedData.length == 0) {
                return false;
            }
            executedData[hashKey] = true;
            (
                bytes memory data,
                bytes memory check,
                uint256 nonce,
                bytes32 executor_
            ) = abi.decode(receivedData, (bytes, bytes, uint256, bytes32));
            address executor = address(uint160(uint256(executor_)));
            bytes memory result = executor.functionCall(check);
            require(abi.decode(result, (bool)), "Receiver: check failed");
            executor.functionCall(data, "Receiver: receive failed");
            _eraseEnumerableSet(_receivesCount[hashKey]);
            delete _receivesCount[hashKey];
            delete payload[hashKey];
            emit RequestExecuted(requestId);
            return true;
        }
    }

    function _eraseEnumerableSet(EnumerableSet.AddressSet storage set) internal {
        for (uint256 i = set.length(); i > 0; i--) {
            set.remove(set.at(i - 1));
        }
    }

    function _generateHashKey(bytes32 hash_, bytes32 sender_, bytes32 requestId_) internal pure returns(bytes32) {
        return keccak256(abi.encode(hash_, sender_, requestId_));
    }

    function _packKey(bytes32 sender_, uint64 chainId_) internal pure returns(bytes32) {
        return keccak256(abi.encode(sender_, chainId_));
    }
}

// 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 (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

// 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 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// 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));
    }
}

File 13 of 15 : EnumerableMap.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableMap.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.

pragma solidity ^0.8.0;

import "./EnumerableSet.sol";

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * The following map types are supported:
 *
 * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0
 * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableMap.
 * ====
 */
library EnumerableMap {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct Bytes32ToBytes32Map {
        // Storage of keys
        EnumerableSet.Bytes32Set _keys;
        mapping(bytes32 => bytes32) _values;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) {
        map._values[key] = value;
        return map._keys.add(key);
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {
        delete map._values[key];
        return map._keys.remove(key);
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {
        return map._keys.contains(key);
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {
        return map._keys.length();
    }

    /**
     * @dev Returns the key-value pair stored at position `index` in the map. O(1).
     *
     * Note that there are no guarantees on the ordering of entries inside the
     * array, and it may change when more entries are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) {
        bytes32 key = map._keys.at(index);
        return (key, map._values[key]);
    }

    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) {
        bytes32 value = map._values[key];
        if (value == bytes32(0)) {
            return (contains(map, key), bytes32(0));
        } else {
            return (true, value);
        }
    }

    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key");
        return value;
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToBytes32Map storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), errorMessage);
        return value;
    }

    /**
     * @dev Return the an array containing all the keys
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) {
        return map._keys.values();
    }

    // UintToUintMap

    struct UintToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(value));
    }

    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the map. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key)));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(UintToUintMap storage map, uint256 key, string memory errorMessage) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key), errorMessage));
    }

    /**
     * @dev Return the an array containing all the keys
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(UintToUintMap storage map) internal view returns (uint256[] memory) {
        bytes32[] memory store = keys(map._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the map. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), address(uint160(uint256(value))));
    }

    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, address(uint160(uint256(value))));
    }

    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        UintToAddressMap storage map,
        uint256 key,
        string memory errorMessage
    ) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage))));
    }

    /**
     * @dev Return the an array containing all the keys
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) {
        bytes32[] memory store = keys(map._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressToUintMap

    struct AddressToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) {
        return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
    }

    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(AddressToUintMap storage map, address key) internal returns (bool) {
        return remove(map._inner, bytes32(uint256(uint160(key))));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(AddressToUintMap storage map, address key) internal view returns (bool) {
        return contains(map._inner, bytes32(uint256(uint160(key))));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(AddressToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the map. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (address(uint160(uint256(key))), uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key))));
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        AddressToUintMap storage map,
        address key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage));
    }

    /**
     * @dev Return the an array containing all the keys
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(AddressToUintMap storage map) internal view returns (address[] memory) {
        bytes32[] memory store = keys(map._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // Bytes32ToUintMap

    struct Bytes32ToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) {
        return set(map._inner, key, bytes32(value));
    }

    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {
        return remove(map._inner, key);
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {
        return contains(map._inner, key);
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(Bytes32ToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the map. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (key, uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, key);
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {
        return uint256(get(map._inner, key));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToUintMap storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, key, errorMessage));
    }

    /**
     * @dev Return the an array containing all the keys
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) {
        bytes32[] memory store = keys(map._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2025 - all rights reserved
pragma solidity ^0.8.20;


interface IReceiver {
    function receiveData(bytes32 sender, uint64 chainIdFrom, bytes memory receivedData, bytes32 requestId) external;
    function receiveHash(bytes32 sender, uint64 chainIdFrom, bytes32 receivedHash, bytes32 requestId) external;
}

Settings
{
  "evmVersion": "shanghai",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
    "project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
    "project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
    "project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/"
  ]
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"isHash","type":"bool"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"receiverCount","type":"uint8"}],"name":"ReceiverCountSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"RequestExecuted","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":"bytes32[]","name":"sender","type":"bytes32[]"},{"indexed":false,"internalType":"uint64[]","name":"chainIdFrom","type":"uint64[]"},{"indexed":false,"internalType":"uint8[]","name":"threshold","type":"uint8[]"}],"name":"ThresholdSet","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECEIVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash_","type":"bytes32"},{"internalType":"bytes32","name":"sender_","type":"bytes32"},{"internalType":"uint64","name":"chainIdFrom","type":"uint64"},{"internalType":"bytes32","name":"requestId_","type":"bytes32"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"executedData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"chainIdFrom","type":"uint64"}],"name":"getThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"hash_","type":"bytes32"},{"internalType":"bytes32","name":"sender_","type":"bytes32"},{"internalType":"bytes32","name":"requestId_","type":"bytes32"}],"name":"hashReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"payload","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"chainIdFrom","type":"uint64"},{"internalType":"bytes","name":"receivedData","type":"bytes"},{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"receiveData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"chainIdFrom","type":"uint64"},{"internalType":"bytes32","name":"receivedHash","type":"bytes32"},{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"receiveHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"receiversCount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"receiversCount_","type":"uint8"}],"name":"setReceiversCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"sender","type":"bytes32[]"},{"internalType":"uint64[]","name":"chainIdFrom","type":"uint64[]"},{"internalType":"uint8[]","name":"threshold_","type":"uint8[]"}],"name":"setThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"thresholdAt","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"thresholdLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801562000010575f80fd5b506200001d5f3362000030565b6008805460ff1916600117905562000167565b6200003c82826200005a565b5f828152600160205260409020620000559082620000f9565b505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16620000f5575f828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000b43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b5f6200010f836001600160a01b03841662000118565b90505b92915050565b5f8181526001830160205260408120546200015f57508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915562000112565b505f62000112565b6123a180620001755f395ff3fe608060405234801561000f575f80fd5b5060043610610147575f3560e01c806391d14854116100bf578063ca15c87311610079578063ca15c8731461032e578063d547741f14610341578063e314214d14610354578063e9feaf061461035c578063f137538b1461036f578063f5b541a614610382575f80fd5b806391d14854146102a75780639d5e3c9d146102ba5780639e17403b146102cd5780639f165a87146102f4578063a217fddf14610314578063c1d8212d1461031b575f80fd5b80632f4c1eec116101105780632f4c1eec146101ed578063360ed9c21461021757806336568abe146102365780633f73016f1461024957806358fe64ee146102695780639010d07c1461027c575f80fd5b80622809bd1461014b57806301ffc9a714610182578063164aa5c314610195578063248a9ca3146101aa5780632f2ff15d146101da575b5f80fd5b61016d610159366004611a1f565b60076020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61016d610190366004611a36565b6103a9565b6101a86101a3366004611a72565b6103d3565b005b6101cc6101b8366004611a1f565b5f9081526020819052604090206001015490565b604051908152602001610179565b6101a86101e8366004611a8b565b61054d565b6102006101fb366004611a1f565b610576565b6040805192835260ff909116602083015201610179565b6008546102249060ff1681565b60405160ff9091168152602001610179565b6101a8610244366004611a8b565b610591565b61025c610257366004611ac4565b61060f565b6040516101799190611aed565b6101a8610277366004611b50565b61063f565b61028f61028a366004611b88565b61079c565b6040516001600160a01b039091168152602001610179565b61016d6102b5366004611a8b565b6107ba565b6101a86102c8366004611ba8565b6107e2565b6101cc7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c606081565b610307610302366004611a1f565b610955565b6040516101799190611c2f565b6101cc5f81565b610224610329366004611c41565b6109ec565b6101cc61033c366004611a1f565b610a5d565b6101a861034f366004611a8b565b610a73565b6101cc610a97565b6101a861036a366004611da1565b610aa7565b6101a861037d366004611e9d565b610d23565b6101cc7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b5f6001600160e01b03198216635a05180f60e01b14806103cd57506103cd82610ebc565b92915050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296103fd81610ef0565b60018260ff1610156104565760405162461bcd60e51b815260206004820152601f60248201527f52656365697665723a2077726f6e672072656365697665727320636f756e740060448201526064015b60405180910390fd5b5f61045f610a97565b90505f805b828163ffffffff161015610501576104818163ffffffff16610576565b92505060ff80861690831611156104f15760405162461bcd60e51b815260206004820152602e60248201527f52656365697665723a207468726573686f6c6420626967676572207468616e2060448201526d1c9958d95a5d995c9cd0dbdd5b9d60921b606482015260840161044d565b6104fa81611f47565b9050610464565b506008805460ff191660ff86169081179091556040519081527fad69f39a472e811a67d908edb2289cef7e7c483f98be25cd00456eeb3ffd0c2a9060200160405180910390a150505050565b5f8281526020819052604090206001015461056781610ef0565b6105718383610efd565b505050565b5f808080610585600486610f1e565b90969095509350505050565b6001600160a01b03811633146106015760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161044d565b61060b8282610f3b565b5050565b60605f61061d858585610f5c565b5f81815260026020526040902090915061063690610f93565b95945050505050565b7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c606061066981610ef0565b5f61067486866109ec565b90505f8160ff16116106c85760405162461bcd60e51b815260206004820152601e60248201527f52656365697665723a207468726573686f6c64206973206e6f74207365740000604482015260640161044d565b5f6106d4858886610f5c565b5f8181526002602052604090209091506106ee9033610f9f565b1561073b5760405162461bcd60e51b815260206004820152601a60248201527f52656365697665723a20616c7265616479207265636569766564000000000000604482015260640161044d565b5f8181526002602052604090206107529033610fc0565b50604080513381526020810186905260018183015290517f05a8cf3f8b7b63de36cba6657ba54e06272d840f8a36a13a9f9d46721bca06a19181900360600190a150505050505050565b5f8281526001602052604081206107b39083610fd4565b9392505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f6107ee858584610f5c565b5f8181526003602052604081208054929350909161080b90611f69565b80601f016020809104026020016040519081016040528092919081815260200182805461083790611f69565b80156108825780601f1061085957610100808354040283529160200191610882565b820191905f5260205f20905b81548152906001019060200180831161086557829003601f168201915b5050505050905080515f036108d95760405162461bcd60e51b815260206004820152601b60248201527f52656365697665723a2064617461206e6f742072656365697665640000000000604482015260640161044d565b5f828152600260205260409020610908906108f390610fdf565b6108fd87876109ec565b60ff16838587610fe8565b61094d5760405162461bcd60e51b8152602060048201526016602482015275149958d95a5d995c8e881b9bdd08195e1958dd5d195960521b604482015260640161044d565b505050505050565b60036020525f90815260409020805461096d90611f69565b80601f016020809104026020016040519081016040528092919081815260200182805461099990611f69565b80156109e45780601f106109bb576101008083540402835291602001916109e4565b820191905f5260205f20905b8154815290600101906020018083116109c757829003601f168201915b505050505081565b5f805f610a046109fc86866111e3565b600490611228565b9150915081610a555760405162461bcd60e51b815260206004820152601b60248201527f52656365697665723a205468726573686f6c64206e6f74207365740000000000604482015260640161044d565b949350505050565b5f8181526001602052604081206103cd90610fdf565b5f82815260208190526040902060010154610a8d81610ef0565b6105718383610f3b565b5f610aa26004611236565b905090565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ad181610ef0565b8351825160ff821614610b1e5760405162461bcd60e51b8152602060048201526015602482015274149958d95a5d995c8e881ddc9bdb99c818dbdd5b9d605a1b604482015260640161044d565b83518160ff1614610b695760405162461bcd60e51b8152602060048201526015602482015274149958d95a5d995c8e881ddc9bdb99c818dbdd5b9d605a1b604482015260640161044d565b5f5b8160ff168160ff161015610ce0576001848260ff1681518110610b9057610b90611fa1565b602002602001015160ff161015610be55760405162461bcd60e51b8152602060048201526019602482015278149958d95a5d995c8e881ddc9bdb99c81d1a1c995cda1bdb19603a1b604482015260640161044d565b600854845160ff918216918691908416908110610c0457610c04611fa1565b602002602001015160ff161115610c595760405162461bcd60e51b8152602060048201526019602482015278149958d95a5d995c8e881ddc9bdb99c81d1a1c995cda1bdb19603a1b604482015260640161044d565b610ccf610c9e878360ff1681518110610c7457610c74611fa1565b6020026020010151878460ff1681518110610c9157610c91611fa1565b60200260200101516111e3565b858360ff1681518110610cb357610cb3611fa1565b602002602001015160ff1660046112409092919063ffffffff16565b50610cd981611fb5565b9050610b6b565b507fb3a8c333726ed3eddc241dca233e7a10992b103dcbdddf41ca3b65cbfb604e35858585604051610d149392919061200f565b60405180910390a15050505050565b7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c6060610d4d81610ef0565b5f610d5886866109ec565b90505f8160ff1611610dac5760405162461bcd60e51b815260206004820152601e60248201527f52656365697665723a207468726573686f6c64206973206e6f74207365740000604482015260640161044d565b5f610dbf85805190602001208886610f5c565b5f818152600260205260409020909150610dd99033610f9f565b610df6575f818152600260205260409020610df49033610fc0565b505b5f610e0188886109ec565b60ff16905080600103610e3a575f828152600260205260408120610e2490610fdf565b9050610e33818389868a610fe8565b5050610e73565b5f8281526003602052604090208054610e5290611f69565b90505f03610e73575f828152600360205260409020610e7187826120ea565b505b60408051338152602081018790525f8183015290517f05a8cf3f8b7b63de36cba6657ba54e06272d840f8a36a13a9f9d46721bca06a19181900360600190a15050505050505050565b5f6001600160e01b03198216637965db0b60e01b14806103cd57506301ffc9a760e01b6001600160e01b03198316146103cd565b610efa813361124c565b50565b610f0782826112a5565b5f8281526001602052604090206105719082610fc0565b5f808080610f2c8686611328565b909450925050505b9250929050565b610f458282611351565b5f82815260016020526040902061057190826113b5565b6040805160208082019590955280820193909352606080840192909252805180840390920182526080909201909152805191012090565b60605f6107b3836113c9565b6001600160a01b0381165f90815260018301602052604081205415156107b3565b5f6107b3836001600160a01b038416611422565b5f6107b3838361146e565b5f6103cd825490565b5f8281526007602052604081205460ff16156110465760405162461bcd60e51b815260206004820152601a60248201527f52656365697665723a20616c7265616479206578656375746564000000000000604482015260640161044d565b8486106106365783515f0361105c57505f610636565b5f8381526007602090815260408220805460ff19166001179055855182918291829161108e918a018101908a016121e8565b92965090945092509050805f6110ad6001600160a01b03831686611494565b9050808060200190518101906110c39190612257565b6111085760405162461bcd60e51b8152602060048201526016602482015275149958d95a5d995c8e8818da1958dac819985a5b195960521b604482015260640161044d565b60408051808201909152601881527f52656365697665723a2072656365697665206661696c656400000000000000006020820152611152906001600160a01b0384169088906114d7565b505f898152600260205260409020611169906114e5565b5f89815260026020526040812090818161118382826119b9565b5050505f8a815260036020526040812061119e9250906119d4565b6040518881527fe2a752598b97815acff854b1d0b6d5c7f33b848bcbb541df9b760382872824679060200160405180910390a15060019b9a5050505050505050505050565b5f828260405160200161120a92919091825267ffffffffffffffff16602082015260400190565b60405160208183030381529060405280519060200120905092915050565b5f808080610f2c868661152a565b5f6103cd82611562565b5f610a5584848461156c565b61125682826107ba565b61060b5761126381611588565b61126e83602061159a565b60405160200161127f929190612276565b60408051601f198184030181529082905262461bcd60e51b825261044d91600401611c2f565b6112af82826107ba565b61060b575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112e43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f80806113358585610fd4565b5f81815260029690960160205260409095205494959350505050565b61135b82826107ba565b1561060b575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f6107b3836001600160a01b038416611730565b6060815f0180548060200260200160405190810160405280929190818152602001828054801561141657602002820191905f5260205f20905b815481526020019060010190808311611402575b50505050509050919050565b5f81815260018301602052604081205461146757508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556103cd565b505f6103cd565b5f825f01828154811061148357611483611fa1565b905f5260205f200154905092915050565b60606107b383835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250611813565b6060610a5584845f85611813565b5f6114ef82610fdf565b90505b801561060b576115176115106115096001846122ea565b8490610fd4565b83906113b5565b5080611522816122fd565b9150506114f2565b5f8181526002830160205260408120548190806115575761154b85856118ea565b92505f9150610f349050565b600192509050610f34565b5f6103cd82610fdf565b5f8281526002840160205260408120829055610a5584846118f5565b60606103cd6001600160a01b03831660145b60605f6115a8836002612312565b6115b3906002612329565b67ffffffffffffffff8111156115cb576115cb611c6b565b6040519080825280601f01601f1916602001820160405280156115f5576020820181803683370190505b509050600360fc1b815f8151811061160f5761160f611fa1565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061163d5761163d611fa1565b60200101906001600160f81b03191690815f1a9053505f61165f846002612312565b61166a906001612329565b90505b60018111156116e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061169e5761169e611fa1565b1a60f81b8282815181106116b4576116b4611fa1565b60200101906001600160f81b03191690815f1a90535060049490941c936116da816122fd565b905061166d565b5083156107b35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161044d565b5f818152600183016020526040812054801561180a575f6117526001836122ea565b85549091505f90611765906001906122ea565b90508181146117c4575f865f01828154811061178357611783611fa1565b905f5260205f200154905080875f0184815481106117a3576117a3611fa1565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806117d5576117d561233c565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506103cd565b5f9150506103cd565b6060824710156118745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161044d565b5f80866001600160a01b0316858760405161188f9190612350565b5f6040518083038185875af1925050503d805f81146118c9576040519150601f19603f3d011682016040523d82523d5f602084013e6118ce565b606091505b50915091506118df87838387611900565b979650505050505050565b5f6107b38383611978565b5f6107b38383611422565b6060831561196e5782515f03611967576001600160a01b0385163b6119675760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161044d565b5081610a55565b610a55838361198f565b5f81815260018301602052604081205415156107b3565b81511561199f5781518083602001fd5b8060405162461bcd60e51b815260040161044d9190611c2f565b5080545f8255905f5260205f2090810190610efa9190611a07565b5080546119e090611f69565b5f825580601f106119ef575050565b601f0160209004905f5260205f2090810190610efa91905b5b80821115611a1b575f8155600101611a08565b5090565b5f60208284031215611a2f575f80fd5b5035919050565b5f60208284031215611a46575f80fd5b81356001600160e01b0319811681146107b3575f80fd5b803560ff81168114611a6d575f80fd5b919050565b5f60208284031215611a82575f80fd5b6107b382611a5d565b5f8060408385031215611a9c575f80fd5b8235915060208301356001600160a01b0381168114611ab9575f80fd5b809150509250929050565b5f805f60608486031215611ad6575f80fd5b505081359360208301359350604090920135919050565b602080825282518282018190525f9190848201906040850190845b81811015611b2d5783516001600160a01b031683529284019291840191600101611b08565b50909695505050505050565b803567ffffffffffffffff81168114611a6d575f80fd5b5f805f8060808587031215611b63575f80fd5b84359350611b7360208601611b39565b93969395505050506040820135916060013590565b5f8060408385031215611b99575f80fd5b50508035926020909101359150565b5f805f8060808587031215611bbb575f80fd5b8435935060208501359250611bd260408601611b39565b9396929550929360600135925050565b5f5b83811015611bfc578181015183820152602001611be4565b50505f910152565b5f8151808452611c1b816020860160208601611be2565b601f01601f19169290920160200192915050565b602081525f6107b36020830184611c04565b5f8060408385031215611c52575f80fd5b82359150611c6260208401611b39565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611ca857611ca8611c6b565b604052919050565b5f67ffffffffffffffff821115611cc957611cc9611c6b565b5060051b60200190565b5f82601f830112611ce2575f80fd5b81356020611cf7611cf283611cb0565b611c7f565b82815260059290921b84018101918181019086841115611d15575f80fd5b8286015b84811015611d3757611d2a81611b39565b8352918301918301611d19565b509695505050505050565b5f82601f830112611d51575f80fd5b81356020611d61611cf283611cb0565b82815260059290921b84018101918181019086841115611d7f575f80fd5b8286015b84811015611d3757611d9481611a5d565b8352918301918301611d83565b5f805f60608486031215611db3575f80fd5b833567ffffffffffffffff80821115611dca575f80fd5b818601915086601f830112611ddd575f80fd5b81356020611ded611cf283611cb0565b82815260059290921b8401810191818101908a841115611e0b575f80fd5b948201945b83861015611e2957853582529482019490820190611e10565b97505087013592505080821115611e3e575f80fd5b611e4a87838801611cd3565b93506040860135915080821115611e5f575f80fd5b50611e6c86828701611d42565b9150509250925092565b5f67ffffffffffffffff821115611e8f57611e8f611c6b565b50601f01601f191660200190565b5f805f8060808587031215611eb0575f80fd5b84359350611ec060208601611b39565b9250604085013567ffffffffffffffff811115611edb575f80fd5b8501601f81018713611eeb575f80fd5b8035611ef9611cf282611e76565b818152886020838501011115611f0d575f80fd5b816020840160208301375f91810160200191909152949793965093946060013593505050565b634e487b7160e01b5f52601160045260245ffd5b5f63ffffffff808316818103611f5f57611f5f611f33565b6001019392505050565b600181811c90821680611f7d57607f821691505b602082108103611f9b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b5f60ff821660ff8103611fca57611fca611f33565b60010192915050565b5f8151808452602080850194508084015f5b8381101561200457815160ff1687529582019590820190600101611fe5565b509495945050505050565b606080825284519082018190525f906020906080840190828801845b828110156120475781518452928401929084019060010161202b565b505050838103828501528551808252868301918301905f5b8181101561208557835167ffffffffffffffff168352928401929184019160010161205f565b505084810360408601526120998187611fd3565b98975050505050505050565b601f821115610571575f81815260208120601f850160051c810160208610156120cb5750805b601f850160051c820191505b8181101561094d578281556001016120d7565b815167ffffffffffffffff81111561210457612104611c6b565b612118816121128454611f69565b846120a5565b602080601f83116001811461214b575f84156121345750858301515b5f19600386901b1c1916600185901b17855561094d565b5f85815260208120601f198616915b828110156121795788860151825594840194600190910190840161215a565b508582101561219657878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f82601f8301126121b5575f80fd5b81516121c3611cf282611e76565b8181528460208386010111156121d7575f80fd5b610a55826020830160208701611be2565b5f805f80608085870312156121fb575f80fd5b845167ffffffffffffffff80821115612212575f80fd5b61221e888389016121a6565b95506020870151915080821115612233575f80fd5b50612240878288016121a6565b604087015160609097015195989097509350505050565b5f60208284031215612267575f80fd5b815180151581146107b3575f80fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f83516122ad816017850160208801611be2565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516122de816028840160208801611be2565b01602801949350505050565b818103818111156103cd576103cd611f33565b5f8161230b5761230b611f33565b505f190190565b80820281158282048414176103cd576103cd611f33565b808201808211156103cd576103cd611f33565b634e487b7160e01b5f52603160045260245ffd5b5f8251612361818460208701611be2565b919091019291505056fea2646970667358221220fef76ef9ff9949e3b294087e29f922091de124db235cbaeaabf071e9b93cec0564736f6c63430008140033

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610147575f3560e01c806391d14854116100bf578063ca15c87311610079578063ca15c8731461032e578063d547741f14610341578063e314214d14610354578063e9feaf061461035c578063f137538b1461036f578063f5b541a614610382575f80fd5b806391d14854146102a75780639d5e3c9d146102ba5780639e17403b146102cd5780639f165a87146102f4578063a217fddf14610314578063c1d8212d1461031b575f80fd5b80632f4c1eec116101105780632f4c1eec146101ed578063360ed9c21461021757806336568abe146102365780633f73016f1461024957806358fe64ee146102695780639010d07c1461027c575f80fd5b80622809bd1461014b57806301ffc9a714610182578063164aa5c314610195578063248a9ca3146101aa5780632f2ff15d146101da575b5f80fd5b61016d610159366004611a1f565b60076020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61016d610190366004611a36565b6103a9565b6101a86101a3366004611a72565b6103d3565b005b6101cc6101b8366004611a1f565b5f9081526020819052604090206001015490565b604051908152602001610179565b6101a86101e8366004611a8b565b61054d565b6102006101fb366004611a1f565b610576565b6040805192835260ff909116602083015201610179565b6008546102249060ff1681565b60405160ff9091168152602001610179565b6101a8610244366004611a8b565b610591565b61025c610257366004611ac4565b61060f565b6040516101799190611aed565b6101a8610277366004611b50565b61063f565b61028f61028a366004611b88565b61079c565b6040516001600160a01b039091168152602001610179565b61016d6102b5366004611a8b565b6107ba565b6101a86102c8366004611ba8565b6107e2565b6101cc7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c606081565b610307610302366004611a1f565b610955565b6040516101799190611c2f565b6101cc5f81565b610224610329366004611c41565b6109ec565b6101cc61033c366004611a1f565b610a5d565b6101a861034f366004611a8b565b610a73565b6101cc610a97565b6101a861036a366004611da1565b610aa7565b6101a861037d366004611e9d565b610d23565b6101cc7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b5f6001600160e01b03198216635a05180f60e01b14806103cd57506103cd82610ebc565b92915050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296103fd81610ef0565b60018260ff1610156104565760405162461bcd60e51b815260206004820152601f60248201527f52656365697665723a2077726f6e672072656365697665727320636f756e740060448201526064015b60405180910390fd5b5f61045f610a97565b90505f805b828163ffffffff161015610501576104818163ffffffff16610576565b92505060ff80861690831611156104f15760405162461bcd60e51b815260206004820152602e60248201527f52656365697665723a207468726573686f6c6420626967676572207468616e2060448201526d1c9958d95a5d995c9cd0dbdd5b9d60921b606482015260840161044d565b6104fa81611f47565b9050610464565b506008805460ff191660ff86169081179091556040519081527fad69f39a472e811a67d908edb2289cef7e7c483f98be25cd00456eeb3ffd0c2a9060200160405180910390a150505050565b5f8281526020819052604090206001015461056781610ef0565b6105718383610efd565b505050565b5f808080610585600486610f1e565b90969095509350505050565b6001600160a01b03811633146106015760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161044d565b61060b8282610f3b565b5050565b60605f61061d858585610f5c565b5f81815260026020526040902090915061063690610f93565b95945050505050565b7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c606061066981610ef0565b5f61067486866109ec565b90505f8160ff16116106c85760405162461bcd60e51b815260206004820152601e60248201527f52656365697665723a207468726573686f6c64206973206e6f74207365740000604482015260640161044d565b5f6106d4858886610f5c565b5f8181526002602052604090209091506106ee9033610f9f565b1561073b5760405162461bcd60e51b815260206004820152601a60248201527f52656365697665723a20616c7265616479207265636569766564000000000000604482015260640161044d565b5f8181526002602052604090206107529033610fc0565b50604080513381526020810186905260018183015290517f05a8cf3f8b7b63de36cba6657ba54e06272d840f8a36a13a9f9d46721bca06a19181900360600190a150505050505050565b5f8281526001602052604081206107b39083610fd4565b9392505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f6107ee858584610f5c565b5f8181526003602052604081208054929350909161080b90611f69565b80601f016020809104026020016040519081016040528092919081815260200182805461083790611f69565b80156108825780601f1061085957610100808354040283529160200191610882565b820191905f5260205f20905b81548152906001019060200180831161086557829003601f168201915b5050505050905080515f036108d95760405162461bcd60e51b815260206004820152601b60248201527f52656365697665723a2064617461206e6f742072656365697665640000000000604482015260640161044d565b5f828152600260205260409020610908906108f390610fdf565b6108fd87876109ec565b60ff16838587610fe8565b61094d5760405162461bcd60e51b8152602060048201526016602482015275149958d95a5d995c8e881b9bdd08195e1958dd5d195960521b604482015260640161044d565b505050505050565b60036020525f90815260409020805461096d90611f69565b80601f016020809104026020016040519081016040528092919081815260200182805461099990611f69565b80156109e45780601f106109bb576101008083540402835291602001916109e4565b820191905f5260205f20905b8154815290600101906020018083116109c757829003601f168201915b505050505081565b5f805f610a046109fc86866111e3565b600490611228565b9150915081610a555760405162461bcd60e51b815260206004820152601b60248201527f52656365697665723a205468726573686f6c64206e6f74207365740000000000604482015260640161044d565b949350505050565b5f8181526001602052604081206103cd90610fdf565b5f82815260208190526040902060010154610a8d81610ef0565b6105718383610f3b565b5f610aa26004611236565b905090565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ad181610ef0565b8351825160ff821614610b1e5760405162461bcd60e51b8152602060048201526015602482015274149958d95a5d995c8e881ddc9bdb99c818dbdd5b9d605a1b604482015260640161044d565b83518160ff1614610b695760405162461bcd60e51b8152602060048201526015602482015274149958d95a5d995c8e881ddc9bdb99c818dbdd5b9d605a1b604482015260640161044d565b5f5b8160ff168160ff161015610ce0576001848260ff1681518110610b9057610b90611fa1565b602002602001015160ff161015610be55760405162461bcd60e51b8152602060048201526019602482015278149958d95a5d995c8e881ddc9bdb99c81d1a1c995cda1bdb19603a1b604482015260640161044d565b600854845160ff918216918691908416908110610c0457610c04611fa1565b602002602001015160ff161115610c595760405162461bcd60e51b8152602060048201526019602482015278149958d95a5d995c8e881ddc9bdb99c81d1a1c995cda1bdb19603a1b604482015260640161044d565b610ccf610c9e878360ff1681518110610c7457610c74611fa1565b6020026020010151878460ff1681518110610c9157610c91611fa1565b60200260200101516111e3565b858360ff1681518110610cb357610cb3611fa1565b602002602001015160ff1660046112409092919063ffffffff16565b50610cd981611fb5565b9050610b6b565b507fb3a8c333726ed3eddc241dca233e7a10992b103dcbdddf41ca3b65cbfb604e35858585604051610d149392919061200f565b60405180910390a15050505050565b7f7a97506be97703960d71e3a118f1850a50b01da6957110e8293eacb08d8c6060610d4d81610ef0565b5f610d5886866109ec565b90505f8160ff1611610dac5760405162461bcd60e51b815260206004820152601e60248201527f52656365697665723a207468726573686f6c64206973206e6f74207365740000604482015260640161044d565b5f610dbf85805190602001208886610f5c565b5f818152600260205260409020909150610dd99033610f9f565b610df6575f818152600260205260409020610df49033610fc0565b505b5f610e0188886109ec565b60ff16905080600103610e3a575f828152600260205260408120610e2490610fdf565b9050610e33818389868a610fe8565b5050610e73565b5f8281526003602052604090208054610e5290611f69565b90505f03610e73575f828152600360205260409020610e7187826120ea565b505b60408051338152602081018790525f8183015290517f05a8cf3f8b7b63de36cba6657ba54e06272d840f8a36a13a9f9d46721bca06a19181900360600190a15050505050505050565b5f6001600160e01b03198216637965db0b60e01b14806103cd57506301ffc9a760e01b6001600160e01b03198316146103cd565b610efa813361124c565b50565b610f0782826112a5565b5f8281526001602052604090206105719082610fc0565b5f808080610f2c8686611328565b909450925050505b9250929050565b610f458282611351565b5f82815260016020526040902061057190826113b5565b6040805160208082019590955280820193909352606080840192909252805180840390920182526080909201909152805191012090565b60605f6107b3836113c9565b6001600160a01b0381165f90815260018301602052604081205415156107b3565b5f6107b3836001600160a01b038416611422565b5f6107b3838361146e565b5f6103cd825490565b5f8281526007602052604081205460ff16156110465760405162461bcd60e51b815260206004820152601a60248201527f52656365697665723a20616c7265616479206578656375746564000000000000604482015260640161044d565b8486106106365783515f0361105c57505f610636565b5f8381526007602090815260408220805460ff19166001179055855182918291829161108e918a018101908a016121e8565b92965090945092509050805f6110ad6001600160a01b03831686611494565b9050808060200190518101906110c39190612257565b6111085760405162461bcd60e51b8152602060048201526016602482015275149958d95a5d995c8e8818da1958dac819985a5b195960521b604482015260640161044d565b60408051808201909152601881527f52656365697665723a2072656365697665206661696c656400000000000000006020820152611152906001600160a01b0384169088906114d7565b505f898152600260205260409020611169906114e5565b5f89815260026020526040812090818161118382826119b9565b5050505f8a815260036020526040812061119e9250906119d4565b6040518881527fe2a752598b97815acff854b1d0b6d5c7f33b848bcbb541df9b760382872824679060200160405180910390a15060019b9a5050505050505050505050565b5f828260405160200161120a92919091825267ffffffffffffffff16602082015260400190565b60405160208183030381529060405280519060200120905092915050565b5f808080610f2c868661152a565b5f6103cd82611562565b5f610a5584848461156c565b61125682826107ba565b61060b5761126381611588565b61126e83602061159a565b60405160200161127f929190612276565b60408051601f198184030181529082905262461bcd60e51b825261044d91600401611c2f565b6112af82826107ba565b61060b575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112e43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f80806113358585610fd4565b5f81815260029690960160205260409095205494959350505050565b61135b82826107ba565b1561060b575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f6107b3836001600160a01b038416611730565b6060815f0180548060200260200160405190810160405280929190818152602001828054801561141657602002820191905f5260205f20905b815481526020019060010190808311611402575b50505050509050919050565b5f81815260018301602052604081205461146757508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556103cd565b505f6103cd565b5f825f01828154811061148357611483611fa1565b905f5260205f200154905092915050565b60606107b383835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250611813565b6060610a5584845f85611813565b5f6114ef82610fdf565b90505b801561060b576115176115106115096001846122ea565b8490610fd4565b83906113b5565b5080611522816122fd565b9150506114f2565b5f8181526002830160205260408120548190806115575761154b85856118ea565b92505f9150610f349050565b600192509050610f34565b5f6103cd82610fdf565b5f8281526002840160205260408120829055610a5584846118f5565b60606103cd6001600160a01b03831660145b60605f6115a8836002612312565b6115b3906002612329565b67ffffffffffffffff8111156115cb576115cb611c6b565b6040519080825280601f01601f1916602001820160405280156115f5576020820181803683370190505b509050600360fc1b815f8151811061160f5761160f611fa1565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061163d5761163d611fa1565b60200101906001600160f81b03191690815f1a9053505f61165f846002612312565b61166a906001612329565b90505b60018111156116e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061169e5761169e611fa1565b1a60f81b8282815181106116b4576116b4611fa1565b60200101906001600160f81b03191690815f1a90535060049490941c936116da816122fd565b905061166d565b5083156107b35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161044d565b5f818152600183016020526040812054801561180a575f6117526001836122ea565b85549091505f90611765906001906122ea565b90508181146117c4575f865f01828154811061178357611783611fa1565b905f5260205f200154905080875f0184815481106117a3576117a3611fa1565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806117d5576117d561233c565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506103cd565b5f9150506103cd565b6060824710156118745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161044d565b5f80866001600160a01b0316858760405161188f9190612350565b5f6040518083038185875af1925050503d805f81146118c9576040519150601f19603f3d011682016040523d82523d5f602084013e6118ce565b606091505b50915091506118df87838387611900565b979650505050505050565b5f6107b38383611978565b5f6107b38383611422565b6060831561196e5782515f03611967576001600160a01b0385163b6119675760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161044d565b5081610a55565b610a55838361198f565b5f81815260018301602052604081205415156107b3565b81511561199f5781518083602001fd5b8060405162461bcd60e51b815260040161044d9190611c2f565b5080545f8255905f5260205f2090810190610efa9190611a07565b5080546119e090611f69565b5f825580601f106119ef575050565b601f0160209004905f5260205f2090810190610efa91905b5b80821115611a1b575f8155600101611a08565b5090565b5f60208284031215611a2f575f80fd5b5035919050565b5f60208284031215611a46575f80fd5b81356001600160e01b0319811681146107b3575f80fd5b803560ff81168114611a6d575f80fd5b919050565b5f60208284031215611a82575f80fd5b6107b382611a5d565b5f8060408385031215611a9c575f80fd5b8235915060208301356001600160a01b0381168114611ab9575f80fd5b809150509250929050565b5f805f60608486031215611ad6575f80fd5b505081359360208301359350604090920135919050565b602080825282518282018190525f9190848201906040850190845b81811015611b2d5783516001600160a01b031683529284019291840191600101611b08565b50909695505050505050565b803567ffffffffffffffff81168114611a6d575f80fd5b5f805f8060808587031215611b63575f80fd5b84359350611b7360208601611b39565b93969395505050506040820135916060013590565b5f8060408385031215611b99575f80fd5b50508035926020909101359150565b5f805f8060808587031215611bbb575f80fd5b8435935060208501359250611bd260408601611b39565b9396929550929360600135925050565b5f5b83811015611bfc578181015183820152602001611be4565b50505f910152565b5f8151808452611c1b816020860160208601611be2565b601f01601f19169290920160200192915050565b602081525f6107b36020830184611c04565b5f8060408385031215611c52575f80fd5b82359150611c6260208401611b39565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611ca857611ca8611c6b565b604052919050565b5f67ffffffffffffffff821115611cc957611cc9611c6b565b5060051b60200190565b5f82601f830112611ce2575f80fd5b81356020611cf7611cf283611cb0565b611c7f565b82815260059290921b84018101918181019086841115611d15575f80fd5b8286015b84811015611d3757611d2a81611b39565b8352918301918301611d19565b509695505050505050565b5f82601f830112611d51575f80fd5b81356020611d61611cf283611cb0565b82815260059290921b84018101918181019086841115611d7f575f80fd5b8286015b84811015611d3757611d9481611a5d565b8352918301918301611d83565b5f805f60608486031215611db3575f80fd5b833567ffffffffffffffff80821115611dca575f80fd5b818601915086601f830112611ddd575f80fd5b81356020611ded611cf283611cb0565b82815260059290921b8401810191818101908a841115611e0b575f80fd5b948201945b83861015611e2957853582529482019490820190611e10565b97505087013592505080821115611e3e575f80fd5b611e4a87838801611cd3565b93506040860135915080821115611e5f575f80fd5b50611e6c86828701611d42565b9150509250925092565b5f67ffffffffffffffff821115611e8f57611e8f611c6b565b50601f01601f191660200190565b5f805f8060808587031215611eb0575f80fd5b84359350611ec060208601611b39565b9250604085013567ffffffffffffffff811115611edb575f80fd5b8501601f81018713611eeb575f80fd5b8035611ef9611cf282611e76565b818152886020838501011115611f0d575f80fd5b816020840160208301375f91810160200191909152949793965093946060013593505050565b634e487b7160e01b5f52601160045260245ffd5b5f63ffffffff808316818103611f5f57611f5f611f33565b6001019392505050565b600181811c90821680611f7d57607f821691505b602082108103611f9b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b5f60ff821660ff8103611fca57611fca611f33565b60010192915050565b5f8151808452602080850194508084015f5b8381101561200457815160ff1687529582019590820190600101611fe5565b509495945050505050565b606080825284519082018190525f906020906080840190828801845b828110156120475781518452928401929084019060010161202b565b505050838103828501528551808252868301918301905f5b8181101561208557835167ffffffffffffffff168352928401929184019160010161205f565b505084810360408601526120998187611fd3565b98975050505050505050565b601f821115610571575f81815260208120601f850160051c810160208610156120cb5750805b601f850160051c820191505b8181101561094d578281556001016120d7565b815167ffffffffffffffff81111561210457612104611c6b565b612118816121128454611f69565b846120a5565b602080601f83116001811461214b575f84156121345750858301515b5f19600386901b1c1916600185901b17855561094d565b5f85815260208120601f198616915b828110156121795788860151825594840194600190910190840161215a565b508582101561219657878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f82601f8301126121b5575f80fd5b81516121c3611cf282611e76565b8181528460208386010111156121d7575f80fd5b610a55826020830160208701611be2565b5f805f80608085870312156121fb575f80fd5b845167ffffffffffffffff80821115612212575f80fd5b61221e888389016121a6565b95506020870151915080821115612233575f80fd5b50612240878288016121a6565b604087015160609097015195989097509350505050565b5f60208284031215612267575f80fd5b815180151581146107b3575f80fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f83516122ad816017850160208801611be2565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516122de816028840160208801611be2565b01602801949350505050565b818103818111156103cd576103cd611f33565b5f8161230b5761230b611f33565b505f190190565b80820281158282048414176103cd576103cd611f33565b808201808211156103cd576103cd611f33565b634e487b7160e01b5f52603160045260245ffd5b5f8251612361818460208701611be2565b919091019291505056fea2646970667358221220fef76ef9ff9949e3b294087e29f922091de124db235cbaeaabf071e9b93cec0564736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.