ETH Price: $3,581.41 (+0.85%)
Gas: 25 Gwei

Contract

0xCf46c4c7f936dF6aE12091ADB9897E3F2363f16F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Txn Hash Block From To Value
160395282022-11-24 11:25:59489 days ago1669289159  Contract Creation0 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xAa47c268...4f5212c2A
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AllowedRecipientsRegistry

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2022-11-23
*/

// SPDX-License-Identifier: MIT & GPL-3.0
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>


pragma solidity ^0.8.4;

/// @author psirex
/// @notice Contains methods for convenient creation
/// of EVMScripts in EVMScript factories contracts
library EVMScriptCreator {
    // Id of default CallsScript Aragon's executor.
    bytes4 private constant SPEC_ID = hex"00000001";

    /// @notice Encodes one method call as EVMScript
    function createEVMScript(
        address _to,
        bytes4 _methodId,
        bytes memory _evmScriptCallData
    ) internal pure returns (bytes memory _commands) {
        return
            abi.encodePacked(
                SPEC_ID,
                _to,
                uint32(_evmScriptCallData.length) + 4,
                _methodId,
                _evmScriptCallData
            );
    }

    /// @notice Encodes multiple calls of the same method on one contract as EVMScript
    function createEVMScript(
        address _to,
        bytes4 _methodId,
        bytes[] memory _evmScriptCallData
    ) internal pure returns (bytes memory _evmScript) {
        for (uint256 i = 0; i < _evmScriptCallData.length; ++i) {
            _evmScript = bytes.concat(
                _evmScript,
                abi.encodePacked(
                    _to,
                    uint32(_evmScriptCallData[i].length) + 4,
                    _methodId,
                    _evmScriptCallData[i]
                )
            );
        }
        _evmScript = bytes.concat(SPEC_ID, _evmScript);
    }

    /// @notice Encodes multiple calls to different methods within the same contract as EVMScript
    function createEVMScript(
        address _to,
        bytes4[] memory _methodIds,
        bytes[] memory _evmScriptCallData
    ) internal pure returns (bytes memory _evmScript) {
        require(_methodIds.length == _evmScriptCallData.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < _methodIds.length; ++i) {
            _evmScript = bytes.concat(
                _evmScript,
                abi.encodePacked(
                    _to,
                    uint32(_evmScriptCallData[i].length) + 4,
                    _methodIds[i],
                    _evmScriptCallData[i]
                )
            );
        }
        _evmScript = bytes.concat(SPEC_ID, _evmScript);
    }

    /// @notice Encodes multiple calls to different contracts as EVMScript
    function createEVMScript(
        address[] memory _to,
        bytes4[] memory _methodIds,
        bytes[] memory _evmScriptCallData
    ) internal pure returns (bytes memory _evmScript) {
        require(_to.length == _methodIds.length, "LENGTH_MISMATCH");
        require(_to.length == _evmScriptCallData.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < _to.length; ++i) {
            _evmScript = bytes.concat(
                _evmScript,
                abi.encodePacked(
                    _to[i],
                    uint32(_evmScriptCallData[i].length) + 4,
                    _methodIds[i],
                    _evmScriptCallData[i]
                )
            );
        }
        _evmScript = bytes.concat(SPEC_ID, _evmScript);
    }
}
// SPDX-FileCopyrightText: 2022 Lido <[email protected]>




/// @author zuzueeka
/// @notice Interface of methods from BokkyPooBahsDateTimeContract to deal with dates
interface IBokkyPooBahsDateTimeContract {
    function timestampToDate(uint256 timestamp)
        external
        pure
        returns (
            uint256 year,
            uint256 month,
            uint256 day
        );

    function timestampFromDate(
        uint256 year,
        uint256 month,
        uint256 day
    ) external pure returns (uint256 timestamp);

    function addMonths(uint256 timestamp, uint256 _months)
        external
        pure
        returns (uint256 newTimestamp);
}




/**
 * @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;
}




/**
 * @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;
    }
}




/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}




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






/**
 * @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;
    }
}









/**
 * @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:
 *
 * ```
 * 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}:
 *
 * ```
 * 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.
 */
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, _msgSender());
        _;
    }

    /**
     * @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 override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @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 {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " 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 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.
     */
    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.
     */
    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 granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    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.
     *
     * [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}.
     * ====
     */
    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);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
// SPDX-FileCopyrightText: 2022 Lido <[email protected]>









/// @author zuzueeka
/// @notice Stores limits params and provides limit-enforcement logic
///
/// ▲ spendableBalance = limit-spentAmount
/// |
/// │             |................              |..               limit-spentAmount = limit-0 = limit
/// │.....        |                ...           |
/// │     ........|                   ......     |  ..............
///               |                         .....|
/// │─────────────────────────────────────────────────────────────> Time
/// |     ^       |                ^  ^     ^    |  ^              (^ - Motion enactment)
/// │             |currentPeriodEndTimestamp     |currentPeriodEndTimestamp
/// |             |spentAmount=0                 |spentAmount=0
///
/// currentPeriodEndTimestamp is calculated as a calendar date of the beginning of
/// a next month, bi-months, quarter, half year, or year period.
/// If, for example, periodDurationMonths = 3, then it is considered that the date changes once a quarter.
/// And currentPeriodEndTimestamp can take values 1 Apr, 1 Jul, 1 Oct, 1 Jan.
/// If periodDurationMonths = 1, then shift of currentPeriodEndTimestamp occurs once a month
/// and currentPeriodEndTimestamp can take values 1 Feb, 1 Mar, 1 Apr, etc
///
contract LimitsChecker is AccessControl {
    // -------------
    // EVENTS
    // -------------
    event LimitsParametersChanged(uint256 _limit, uint256 _periodDurationMonths);
    event SpendableAmountChanged(
        uint256 _alreadySpentAmount,
        uint256 _spendableBalance,
        uint256 indexed _periodStartTimestamp,
        uint256 _periodEndTimestamp
    );
    event CurrentPeriodAdvanced(uint256 indexed _periodStartTimestamp);
    event BokkyPooBahsDateTimeContractChanged(address indexed _newAddress);
    event SpentAmountChanged(uint256 _newSpentAmount);

    // -------------
    // ERRORS
    // -------------
    string private constant ERROR_INVALID_PERIOD_DURATION = "INVALID_PERIOD_DURATION";
    string private constant ERROR_SUM_EXCEEDS_SPENDABLE_BALANCE = "SUM_EXCEEDS_SPENDABLE_BALANCE";
    string private constant ERROR_TOO_LARGE_LIMIT = "TOO_LARGE_LIMIT";
    string private constant ERROR_SAME_DATE_TIME_CONTRACT_ADDRESS =
        "SAME_DATE_TIME_CONTRACT_ADDRESS";
    string private constant ERROR_SPENT_AMOUNT_EXCEEDS_LIMIT = "ERROR_SPENT_AMOUNT_EXCEEDS_LIMIT";

    // -------------
    // ROLES
    // -------------
    bytes32 public constant SET_PARAMETERS_ROLE = keccak256("SET_PARAMETERS_ROLE");
    bytes32 public constant UPDATE_SPENT_AMOUNT_ROLE = keccak256("UPDATE_SPENT_AMOUNT_ROLE");

    // -------------
    // CONSTANTS
    // -------------

    // ------------
    // STORAGE VARIABLES
    // ------------

    /// @notice Address of BokkyPooBahsDateTimeContract
    IBokkyPooBahsDateTimeContract public bokkyPooBahsDateTimeContract;

    /// @notice Length of period in months
    uint64 internal periodDurationMonths;

    /// @notice End of the current period
    uint128 internal currentPeriodEndTimestamp;

    /// @notice The maximum that can be spent in a period
    uint128 internal limit;

    /// @notice Amount already spent in the period
    uint128 internal spentAmount;

    // ------------
    // CONSTRUCTOR
    // ------------
    /// @param _setParametersRoleHolders List of addresses which will
    ///     be granted with role SET_PARAMETERS_ROLE
    /// @param _updateSpentAmountRoleHolders List of addresses which will
    ///     be granted with role UPDATE_SPENT_AMOUNT_ROLE
    /// @param _bokkyPooBahsDateTimeContract Address of bokkyPooBahs DateTime Contract
    constructor(
        address[] memory _setParametersRoleHolders,
        address[] memory _updateSpentAmountRoleHolders,
        IBokkyPooBahsDateTimeContract _bokkyPooBahsDateTimeContract
    ) {
        for (uint256 i = 0; i < _setParametersRoleHolders.length; i++) {
            _setupRole(SET_PARAMETERS_ROLE, _setParametersRoleHolders[i]);
        }
        for (uint256 i = 0; i < _updateSpentAmountRoleHolders.length; i++) {
            _setupRole(UPDATE_SPENT_AMOUNT_ROLE, _updateSpentAmountRoleHolders[i]);
        }
        bokkyPooBahsDateTimeContract = _bokkyPooBahsDateTimeContract;
    }

    // -------------
    // EXTERNAL METHODS
    // -------------

    /// @notice Checks if _payoutAmount is less or equal than the may be spent
    /// @param _payoutAmount Motion total amount
    /// @param _motionDuration Motion duration - minimal time required to pass before enacting of motion
    /// @return True if _payoutAmount is less or equal than may be spent
    /// @dev note that upfront check is used to compare _paymentSum with total limit in case
    /// when motion is started in one period and will be probably enacted in the next.
    function isUnderSpendableBalance(uint256 _payoutAmount, uint256 _motionDuration)
        external
        view
        returns (bool)
    {
        if (block.timestamp + _motionDuration >= currentPeriodEndTimestamp) {
            return _payoutAmount <= limit;
        } else {
            return _payoutAmount <= _spendableBalance(limit, spentAmount);
        }
    }

    /// @notice Checks if _payoutAmount may be spent and increases spentAmount by _payoutAmount.
    /// @notice Also updates the period boundaries if necessary.
    function updateSpentAmount(uint256 _payoutAmount) external onlyRole(UPDATE_SPENT_AMOUNT_ROLE) {
        uint256 spentAmountLocal = spentAmount;
        uint256 limitLocal = limit;
        uint256 currentPeriodEndTimestampLocal = currentPeriodEndTimestamp;

        /// When it is necessary to shift the currentPeriodEndTimestamp it takes on a new value.
        /// And also spent is set to zero. Thus begins a new period.
        if (block.timestamp >= currentPeriodEndTimestampLocal) {
            currentPeriodEndTimestampLocal = _getPeriodEndFromTimestamp(block.timestamp);
            spentAmountLocal = 0;
            emit CurrentPeriodAdvanced(
                _getPeriodStartFromTimestamp(currentPeriodEndTimestampLocal - 1)
            );
            currentPeriodEndTimestamp = uint128(currentPeriodEndTimestampLocal);
        }

        require(
            _payoutAmount <= _spendableBalance(limitLocal, spentAmountLocal),
            ERROR_SUM_EXCEEDS_SPENDABLE_BALANCE
        );
        spentAmountLocal += _payoutAmount;
        spentAmount = uint128(spentAmountLocal);

        (
            uint256 alreadySpentAmount,
            uint256 spendableBalanceInPeriod,
            uint256 periodStartTimestamp,
            uint256 periodEndTimestamp
        ) = _getCurrentPeriodState(limitLocal, spentAmountLocal, currentPeriodEndTimestampLocal);

        emit SpendableAmountChanged(
            alreadySpentAmount,
            spendableBalanceInPeriod,
            periodStartTimestamp,
            periodEndTimestamp
        );
    }

    /// @notice Returns balance that can be spent in the current period
    /// @notice If period advanced and no call to updateSpentAmount or setLimitParameters made,
    /// @notice then the method will return spendable balance corresponding to the previous period.
    /// @return Balance that can be spent in the current period
    function spendableBalance() external view returns (uint256) {
        return _spendableBalance(limit, spentAmount);
    }

    /// @notice Sets periodDurationMonths and limit
    /// @notice Calculates currentPeriodEndTimestamp as a calendar date of the beginning of next period.
    /// @param _limit Limit to set
    /// @param _periodDurationMonths Length of period in months. Must be 1, 2, 3, 6 or 12.
    function setLimitParameters(uint256 _limit, uint256 _periodDurationMonths)
        external
        onlyRole(SET_PARAMETERS_ROLE)
    {
        require(_limit <= type(uint128).max, ERROR_TOO_LARGE_LIMIT);

        _validatePeriodDurationMonths(_periodDurationMonths);
        periodDurationMonths = uint64(_periodDurationMonths);
        uint256 currentPeriodEndTimestampLocal = _getPeriodEndFromTimestamp(block.timestamp);
        emit CurrentPeriodAdvanced(
            _getPeriodStartFromTimestamp(currentPeriodEndTimestampLocal - 1)
        );
        currentPeriodEndTimestamp = uint128(currentPeriodEndTimestampLocal);
        limit = uint128(_limit);

        emit LimitsParametersChanged(_limit, _periodDurationMonths);
    }

    /// @notice Returns limit and periodDurationMonths
    /// @return limit - the maximum that can be spent in a period
    /// @return periodDurationMonths - length of period in months
    function getLimitParameters() external view returns (uint256, uint256) {
        return (limit, periodDurationMonths);
    }

    /// @notice Returns state of the current period: amount spent, balance available for spending,
    /// @notice start date of the current period and end date of the current period
    /// @notice If period advanced and the period was not shifted,
    /// @notice then the method will return spendable balance corresponding to the previous period.
    /// @return _alreadySpentAmount - amount already spent in the current period
    /// @return _spendableBalanceInPeriod - balance available for spending in the current period
    /// @return _periodStartTimestamp - start date of the current period
    /// @return _periodEndTimestamp - end date of the current period
    function getPeriodState()
        external
        view
        returns (
            uint256 _alreadySpentAmount,
            uint256 _spendableBalanceInPeriod,
            uint256 _periodStartTimestamp,
            uint256 _periodEndTimestamp
        )
    {
        return _getCurrentPeriodState(limit, spentAmount, currentPeriodEndTimestamp);
    }

    /// @notice Sets address of BokkyPooBahsDateTime contract
    /// @dev Need this to be able to replace the contract in case of a bug in it
    /// @param _bokkyPooBahsDateTimeContract New address of the BokkyPooBahsDateTime library
    function setBokkyPooBahsDateTimeContract(address _bokkyPooBahsDateTimeContract)
        external
        onlyRole(SET_PARAMETERS_ROLE)
    {
        require(
            _bokkyPooBahsDateTimeContract != address(bokkyPooBahsDateTimeContract),
            ERROR_SAME_DATE_TIME_CONTRACT_ADDRESS
        );

        bokkyPooBahsDateTimeContract = IBokkyPooBahsDateTimeContract(_bokkyPooBahsDateTimeContract);
        emit BokkyPooBahsDateTimeContractChanged(_bokkyPooBahsDateTimeContract);
    }

    /// @notice Allows setting the amount of spent tokens in the current period manually
    /// @param _newSpentAmount New value for the amount of spent tokens in the current period
    function unsafeSetSpentAmount(uint256 _newSpentAmount) external onlyRole(SET_PARAMETERS_ROLE) {
        require(_newSpentAmount <= limit, ERROR_SPENT_AMOUNT_EXCEEDS_LIMIT);

        if (spentAmount != _newSpentAmount) {
            spentAmount = uint128(_newSpentAmount);
            emit SpentAmountChanged(_newSpentAmount);
        }
    }

    // ------------------
    // PRIVATE METHODS
    // ------------------
    function _getCurrentPeriodState(
        uint256 _limit,
        uint256 _spentAmount,
        uint256 _currentPeriodEndTimestamp
    )
        internal
        view
        returns (
            uint256 _alreadySpentAmount,
            uint256 _spendableBalanceInPeriod,
            uint256 _periodStartTimestamp,
            uint256 _periodEndTimestamp
        )
    {
        return (
            _spentAmount,
            _spendableBalance(_limit, _spentAmount),
            _getPeriodStartFromTimestamp(_currentPeriodEndTimestamp - 1),
            _currentPeriodEndTimestamp
        );
    }

    function _spendableBalance(uint256 _limit, uint256 _spentAmount)
        internal
        pure
        returns (uint256)
    {
        return _spentAmount < _limit ? _limit - _spentAmount : 0;
    }

    function _validatePeriodDurationMonths(uint256 _periodDurationMonths) internal pure {
        require(
            _periodDurationMonths == 1 ||
                _periodDurationMonths == 2 ||
                _periodDurationMonths == 3 ||
                _periodDurationMonths == 6 ||
                _periodDurationMonths == 12,
            ERROR_INVALID_PERIOD_DURATION
        );
    }

    function _getPeriodStartFromTimestamp(uint256 _timestamp) internal view returns (uint256) {
        // Get year and number of month of the timestamp:
        (uint256 year, uint256 month, ) = bokkyPooBahsDateTimeContract.timestampToDate(_timestamp);
        // We assume that the year will remain the same,
        // because the beginning of the current calendar period will necessarily be in the same year.
        uint256 periodStartYear = year;
        // Get the number of the start date month:
        uint256 periodStartMonth = _getFirstMonthInPeriodFromMonth(month, periodDurationMonths);
        // The beginning of the period always matches the calendar date of the beginning of the month.
        uint256 periodStartDay = 1;
        return
            bokkyPooBahsDateTimeContract.timestampFromDate(
                periodStartYear,
                periodStartMonth,
                periodStartDay
            );
    }

    function _getFirstMonthInPeriodFromMonth(uint256 _month, uint256 _periodDurationMonths)
        internal
        pure
        returns (uint256 _firstMonthInPeriod)
    {
        require(_periodDurationMonths != 0, ERROR_INVALID_PERIOD_DURATION);

        // To get the number of the first month in the period:
        //   1. get the number of the period within the current year, starting from its beginning:
        uint256 periodNumber = (_month - 1) / _periodDurationMonths;
        //   2. and then the number of the first month in this period:
        _firstMonthInPeriod = periodNumber * _periodDurationMonths + 1;
        // The shift by - 1 and then by + 1 happens because the months in the calendar start from 1 and not from 0.
    }

    function _getPeriodEndFromTimestamp(uint256 _timestamp) internal view returns (uint256) {
        uint256 periodStart = _getPeriodStartFromTimestamp(_timestamp);
        return bokkyPooBahsDateTimeContract.addMonths(periodStart, periodDurationMonths);
    }
}
// SPDX-FileCopyrightText: 2022 Lido <[email protected]>






/// @author psirex, zuzueeka
/// @title Registry of allowed addresses for payouts
/// @notice Stores list of allowed addresses
contract AllowedRecipientsRegistry is LimitsChecker {
    // -------------
    // EVENTS
    // -------------
    event RecipientAdded(address indexed _recipient, string _title);
    event RecipientRemoved(address indexed _recipient);

    // -------------
    // ROLES
    // -------------
    bytes32 public constant ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE =
        keccak256("ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE");
    bytes32 public constant REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE =
        keccak256("REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE");

    // -------------
    // ERRORS
    // -------------
    string private constant ERROR_RECIPIENT_ALREADY_ADDED_TO_ALLOWED_LIST =
        "RECIPIENT_ALREADY_ADDED_TO_ALLOWED_LIST";
    string private constant ERROR_RECIPIENT_NOT_FOUND_IN_ALLOWED_LIST =
        "RECIPIENT_NOT_FOUND_IN_ALLOWED_LIST";

    // -------------
    // VARIABLES
    // -------------

    /// @dev List of allowed addresses for payouts
    address[] public allowedRecipients;

    // Position of the address in the `allowedRecipients` array,
    // plus 1 because index 0 means a value is not in the set.
    mapping(address => uint256) private allowedRecipientIndices;

    // -------------
    // CONSTRUCTOR
    // -------------

    /// @param _admin Address which will be granted with role DEFAULT_ADMIN_ROLE
    /// @param _addRecipientToAllowedListRoleHolders List of addresses which will be
    ///     granted with role ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE
    /// @param _removeRecipientFromAllowedListRoleHolders List of addresses which will
    ///     be granted with role REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE
    /// @param _setParametersRoleHolders List of addresses which will
    ///     be granted with role SET_PARAMETERS_ROLE
    /// @param _updateSpentAmountRoleHolders List of addresses which will
    ///     be granted with role UPDATE_SPENT_AMOUNT_ROLE
    /// @param _bokkyPooBahsDateTimeContract Address of bokkyPooBahs DateTime Contract
    constructor(
        address _admin,
        address[] memory _addRecipientToAllowedListRoleHolders,
        address[] memory _removeRecipientFromAllowedListRoleHolders,
        address[] memory _setParametersRoleHolders,
        address[] memory _updateSpentAmountRoleHolders,
        IBokkyPooBahsDateTimeContract _bokkyPooBahsDateTimeContract
    )
        LimitsChecker(
            _setParametersRoleHolders,
            _updateSpentAmountRoleHolders,
            _bokkyPooBahsDateTimeContract
        )
    {
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        for (uint256 i = 0; i < _addRecipientToAllowedListRoleHolders.length; i++) {
            _setupRole(
                ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE,
                _addRecipientToAllowedListRoleHolders[i]
            );
        }
        for (uint256 i = 0; i < _removeRecipientFromAllowedListRoleHolders.length; i++) {
            _setupRole(
                REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE,
                _removeRecipientFromAllowedListRoleHolders[i]
            );
        }
    }

    // -------------
    // EXTERNAL METHODS
    // -------------

    /// @notice Adds address to list of allowed addresses for payouts
    function addRecipient(address _recipient, string memory _title)
        external
        onlyRole(ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE)
    {
        require(
            allowedRecipientIndices[_recipient] == 0,
            ERROR_RECIPIENT_ALREADY_ADDED_TO_ALLOWED_LIST
        );

        allowedRecipients.push(_recipient);
        allowedRecipientIndices[_recipient] = allowedRecipients.length;
        emit RecipientAdded(_recipient, _title);
    }

    /// @notice Removes address from list of allowed addresses for payouts
    /// @dev To delete an allowed address from the allowedRecipients 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').
    function removeRecipient(address _recipient)
        external
        onlyRole(REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE)
    {
        uint256 index = _getAllowedRecipientIndex(_recipient);
        uint256 lastIndex = allowedRecipients.length - 1;

        if (index != lastIndex) {
            address lastAllowedRecipient = allowedRecipients[lastIndex];
            allowedRecipients[index] = lastAllowedRecipient;
            allowedRecipientIndices[lastAllowedRecipient] = index + 1;
        }

        allowedRecipients.pop();
        delete allowedRecipientIndices[_recipient];
        emit RecipientRemoved(_recipient);
    }

    /// @notice Returns if passed address is listed as allowed recipient in the registry
    function isRecipientAllowed(address _recipient) external view returns (bool) {
        return allowedRecipientIndices[_recipient] > 0;
    }

    /// @notice Returns current list of allowed recipients
    function getAllowedRecipients() external view returns (address[] memory) {
        return allowedRecipients;
    }

    // ------------------
    // PRIVATE METHODS
    // ------------------

    function _getAllowedRecipientIndex(address _recipient) private view returns (uint256 _index) {
        _index = allowedRecipientIndices[_recipient];
        require(_index > 0, ERROR_RECIPIENT_NOT_FOUND_IN_ALLOWED_LIST);
        _index -= 1;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address[]","name":"_addRecipientToAllowedListRoleHolders","type":"address[]"},{"internalType":"address[]","name":"_removeRecipientFromAllowedListRoleHolders","type":"address[]"},{"internalType":"address[]","name":"_setParametersRoleHolders","type":"address[]"},{"internalType":"address[]","name":"_updateSpentAmountRoleHolders","type":"address[]"},{"internalType":"contract IBokkyPooBahsDateTimeContract","name":"_bokkyPooBahsDateTimeContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newAddress","type":"address"}],"name":"BokkyPooBahsDateTimeContractChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_periodStartTimestamp","type":"uint256"}],"name":"CurrentPeriodAdvanced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_limit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_periodDurationMonths","type":"uint256"}],"name":"LimitsParametersChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"string","name":"_title","type":"string"}],"name":"RecipientAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"}],"name":"RecipientRemoved","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":"uint256","name":"_alreadySpentAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_spendableBalance","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_periodStartTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_periodEndTimestamp","type":"uint256"}],"name":"SpendableAmountChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newSpentAmount","type":"uint256"}],"name":"SpentAmountChanged","type":"event"},{"inputs":[],"name":"ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REMOVE_RECIPIENT_FROM_ALLOWED_LIST_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SET_PARAMETERS_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPDATE_SPENT_AMOUNT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"string","name":"_title","type":"string"}],"name":"addRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allowedRecipients","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bokkyPooBahsDateTimeContract","outputs":[{"internalType":"contract IBokkyPooBahsDateTimeContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllowedRecipients","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLimitParameters","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPeriodState","outputs":[{"internalType":"uint256","name":"_alreadySpentAmount","type":"uint256"},{"internalType":"uint256","name":"_spendableBalanceInPeriod","type":"uint256"},{"internalType":"uint256","name":"_periodStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"_periodEndTimestamp","type":"uint256"}],"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":"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":"address","name":"_recipient","type":"address"}],"name":"isRecipientAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_payoutAmount","type":"uint256"},{"internalType":"uint256","name":"_motionDuration","type":"uint256"}],"name":"isUnderSpendableBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"removeRecipient","outputs":[],"stateMutability":"nonpayable","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":"address","name":"_bokkyPooBahsDateTimeContract","type":"address"}],"name":"setBokkyPooBahsDateTimeContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"},{"internalType":"uint256","name":"_periodDurationMonths","type":"uint256"}],"name":"setLimitParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"spendableBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"_newSpentAmount","type":"uint256"}],"name":"unsafeSetSpentAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_payoutAmount","type":"uint256"}],"name":"updateSpentAmount","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101725760003560e01c80637ef7a462116100de578063b361cf5811610097578063d547741f11610071578063d547741f14610393578063e3ed1466146103a6578063e759b06c146103bb578063ee72782d146103f957600080fd5b8063b361cf5814610344578063c0f7e5481461036b578063cb6eca5b1461038057600080fd5b80637ef7a462146102995780638400c307146102c457806391d14854146102ef5780639213680614610302578063a217fddf14610329578063b124e88e1461033157600080fd5b806336568abe1161013057806336568abe146102135780633e0bde6714610226578063435bd804146102395780634ba578ab146102605780636667122914610273578063739b53841461028657600080fd5b8062d7343f1461017757806301ffc9a71461018c57806312a29198146101b4578063248a9ca3146101c75780632a9a872a146101f85780632f2ff15d14610200575b600080fd5b61018a610185366004611473565b610421565b005b61019f61019a366004611595565b6104f3565b60405190151581526020015b60405180910390f35b61018a6101c2366004611473565b61052a565b6101ea6101d5366004611550565b60009081526020819052604090206001015490565b6040519081526020016101ab565b6101ea61068e565b61018a61020e366004611569565b6106b9565b61018a610221366004611569565b6106e4565b61018a6102343660046115d8565b610762565b6101ea7fc5260260446719a726d11a6faece21d19daa48b4cbcca118345832d4cb71df9981565b61019f61026e3660046115d8565b610899565b61018a610281366004611550565b610900565b61018a61029436600461148e565b610aa2565b6001546102ac906001600160a01b031681565b6040516001600160a01b0390911681526020016101ab565b61019f6102d2366004611473565b6001600160a01b0316600090815260056020526040902054151590565b61019f6102fd366004611569565b610bc7565b6101ea7fec20c52871c824e5437859e75ac830e83aaaaeb7b0ffd850de830ddd3e38527681565b6101ea600081565b6102ac61033f366004611550565b610bf0565b6101ea7f491d7752c25cfca0f73715cde1130022a9b815373f91a996bbb1ba8943efc99b81565b610373610c1a565b6040516101ab919061169d565b61018a61038e366004611550565b610c7c565b61018a6103a1366004611569565b610d62565b6101ea60008051602061182d83398151915281565b600254600154600160801b9091046001600160801b031690600160a01b900467ffffffffffffffff16604080519283526020830191909152016101ab565b610401610d88565b6040805194855260208501939093529183015260608201526080016101ab565b60008051602061182d83398151915261043a8133610dc4565b60015460408051808201909152601f81527f53414d455f444154455f54494d455f434f4e54524143545f41444452455353006020820152906001600160a01b03848116911614156104a75760405162461bcd60e51b815260040161049e91906116ea565b60405180910390fd5b50600180546001600160a01b0319166001600160a01b0384169081179091556040517f785c49b69dcb54e73b13ec21a35430cf86373b1424270b7873e4ea84daef71e290600090a25050565b60006001600160e01b03198216637965db0b60e01b148061052457506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f491d7752c25cfca0f73715cde1130022a9b815373f91a996bbb1ba8943efc99b6105558133610dc4565b600061056083610e28565b60045490915060009061057590600190611776565b90508082146106115760006004828154811061059357610593611800565b600091825260209091200154600480546001600160a01b0390921692508291859081106105c2576105c2611800565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790556105f683600161171d565b6001600160a01b039091166000908152600560205260409020555b6004805480610622576106226117ea565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038616808352600590915260408083208390555190917f8176fc5412eb5076fee7f1a264915b808c24d495c2698c189030e5200e707d2591a250505050565b6002546003546000916106b4916001600160801b03600160801b90920482169116610e99565b905090565b6000828152602081905260409020600101546106d58133610dc4565b6106df8383610eba565b505050565b6001600160a01b03811633146107545760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161049e565b61075e8282610f3e565b5050565b60008051602061182d83398151915261077b8133610dc4565b60408051808201909152600f81526e1513d3d7d3105491d157d312535255608a1b60208201526001600160801b038411156107c95760405162461bcd60e51b815260040161049e91906116ea565b506107d382610fa3565b6001805467ffffffffffffffff60a01b1916600160a01b67ffffffffffffffff851602179055600061080442611021565b9050610819610814600183611776565b6110c0565b6040517f01e1441ccf0c1da6f26a624ad4c5c20c52ccc3c56ecad9f154ec6af11122ea5190600090a26001600160801b03848116600160801b029082161760025560408051858152602081018590527f673d7870f9aef68143dc0ba3aa39a6b503258aecfcb7493060c477921da3b842910160405180910390a150505050565b6002546000906001600160801b03166108b2834261171d565b106108d35750600254600160801b90046001600160801b0316821115610524565b6002546003546108f6916001600160801b03600160801b90910481169116610e99565b9092111592915050565b7fc5260260446719a726d11a6faece21d19daa48b4cbcca118345832d4cb71df9961092b8133610dc4565b6003546002546001600160801b0391821691600160801b8204811691164281116109b15761095842611021565b60009350905061096c610814600183611776565b6040517f01e1441ccf0c1da6f26a624ad4c5c20c52ccc3c56ecad9f154ec6af11122ea5190600090a2600280546001600160801b0319166001600160801b0383161790555b6109bb8284610e99565b8511156040518060400160405280601d81526020017f53554d5f455843454544535f5350454e4441424c455f42414c414e434500000081525090610a125760405162461bcd60e51b815260040161049e91906116ea565b50610a1d858461171d565b600380546001600160801b0319166001600160801b03831617905592506000808080610a4a868887611206565b60408051858152602081018590529081018290529397509195509350915082907fc7b603a3095aa2949aabc1b803b13eec3e3f35b9e735f6700576e5349d454b509060600160405180910390a2505050505050505050565b7fec20c52871c824e5437859e75ac830e83aaaaeb7b0ffd850de830ddd3e385276610acd8133610dc4565b60056000846001600160a01b03166001600160a01b03168152602001908152602001600020546000146040518060600160405280602781526020016118706027913990610b2d5760405162461bcd60e51b815260040161049e91906116ea565b50600480546001810182557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b03861690811790915590546000828152600560205260409081902091909155517f0dfdc032c38a6ca7df610430533dc59c9fe39b380b7f88db3f5f0e3ae8502ec190610bba9085906116ea565b60405180910390a2505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60048181548110610c0057600080fd5b6000918252602090912001546001600160a01b0316905081565b60606004805480602002602001604051908101604052809291908181526020018280548015610c7257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c54575b5050505050905090565b60008051602061182d833981519152610c958133610dc4565b6002546040805180820190915260208082527f4552524f525f5350454e545f414d4f554e545f455843454544535f4c494d49549082015290600160801b90046001600160801b0316831115610cfd5760405162461bcd60e51b815260040161049e91906116ea565b506003546001600160801b0316821461075e57600380546001600160801b0319166001600160801b0384161790556040518281527fde44563e65a22e271e721e644a8ce8005f4c7685e6e7ec3211de480311cf1f269060200160405180910390a15050565b600082815260208190526040902060010154610d7e8133610dc4565b6106df8383610f3e565b600254600354600091829182918291610db6916001600160801b03600160801b820481169281169116611206565b935093509350935090919293565b610dce8282610bc7565b61075e57610de6816001600160a01b03166014611234565b610df1836020611234565b604051602001610e02929190611628565b60408051601f198184030181529082905262461bcd60e51b825261049e916004016116ea565b600060056000836001600160a01b03166001600160a01b031681526020019081526020016000205490506000811160405180606001604052806023815260200161184d6023913990610e8d5760405162461bcd60e51b815260040161049e91906116ea565b50610524600182611776565b6000828210610ea9576000610eb3565b610eb38284611776565b9392505050565b610ec48282610bc7565b61075e576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610efa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610f488282610bc7565b1561075e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b8060011480610fb25750806002145b80610fbd5750806003145b80610fc85750806006145b80610fd3575080600c145b6040518060400160405280601781526020017624a72b20a624a22fa822a924a7a22fa22aa920aa24a7a760491b8152509061075e5760405162461bcd60e51b815260040161049e91906116ea565b60008061102d836110c0565b600154604051634355644d60e01b815260048101839052600160a01b820467ffffffffffffffff1660248201529192506001600160a01b031690634355644d9060440160206040518083038186803b15801561108857600080fd5b505afa15801561109c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb391906115bf565b60015460405163de5101af60e01b815260048101839052600091829182916001600160a01b03169063de5101af9060240160606040518083038186803b15801561110957600080fd5b505afa15801561111d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114191906115fa565b506001549193509150829060009061116b908490600160a01b900467ffffffffffffffff166113d0565b60018054604051630fa7bbd960e11b815260048101869052602481018490526044810183905292935090916001600160a01b0390911690631f4f77b29060640160206040518083038186803b1580156111c357600080fd5b505afa1580156111d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fb91906115bf565b979650505050505050565b600080600080856112178888610e99565b611225610814600189611776565b91999098509096509350505050565b60606000611243836002611757565b61124e90600261171d565b67ffffffffffffffff81111561126657611266611816565b6040519080825280601f01601f191660200182016040528015611290576020820181803683370190505b509050600360fc1b816000815181106112ab576112ab611800565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106112da576112da611800565b60200101906001600160f81b031916908160001a90535060006112fe846002611757565b61130990600161171d565b90505b6001811115611381576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061133d5761133d611800565b1a60f81b82828151811061135357611353611800565b60200101906001600160f81b031916908160001a90535060049490941c9361137a816117bd565b905061130c565b508315610eb35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161049e565b60408051808201909152601781527624a72b20a624a22fa822a924a7a22fa22aa920aa24a7a760491b60208201526000908261141f5760405162461bcd60e51b815260040161049e91906116ea565b5060008261142e600186611776565b6114389190611735565b90506114448382611757565b61144f90600161171d565b949350505050565b80356001600160a01b038116811461146e57600080fd5b919050565b60006020828403121561148557600080fd5b610eb382611457565b600080604083850312156114a157600080fd5b6114aa83611457565b9150602083013567ffffffffffffffff808211156114c757600080fd5b818501915085601f8301126114db57600080fd5b8135818111156114ed576114ed611816565b604051601f8201601f19908116603f0116810190838211818310171561151557611515611816565b8160405282815288602084870101111561152e57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561156257600080fd5b5035919050565b6000806040838503121561157c57600080fd5b8235915061158c60208401611457565b90509250929050565b6000602082840312156115a757600080fd5b81356001600160e01b031981168114610eb357600080fd5b6000602082840312156115d157600080fd5b5051919050565b600080604083850312156115eb57600080fd5b50508035926020909101359150565b60008060006060848603121561160f57600080fd5b8351925060208401519150604084015190509250925092565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161166081601785016020880161178d565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161169181602884016020880161178d565b01602801949350505050565b6020808252825182820181905260009190848201906040850190845b818110156116de5783516001600160a01b0316835292840192918401916001016116b9565b50909695505050505050565b602081526000825180602084015261170981604085016020870161178d565b601f01601f19169190910160400192915050565b60008219821115611730576117306117d4565b500190565b60008261175257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611771576117716117d4565b500290565b600082821015611788576117886117d4565b500390565b60005b838110156117a8578181015183820152602001611790565b838111156117b7576000848401525b50505050565b6000816117cc576117cc6117d4565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe260b83d52a26066d8e9db550fa70395df5f3f064b50ff9d8a94267d9f1fe1967524543495049454e545f4e4f545f464f554e445f494e5f414c4c4f5745445f4c495354524543495049454e545f414c52454144595f41444445445f544f5f414c4c4f5745445f4c495354a264697066735822122029617d7b6065e85791d92ac991122a1357a7f82ff96ced1632956984dcfedf3164736f6c63430008060033

Deployed Bytecode Sourcemap

33139:5484:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28595:502;;;;;;:::i;:::-;;:::i;:::-;;13660:204;;;;;;:::i;:::-;;:::i;:::-;;;4884:14:1;;4877:22;4859:41;;4847:2;4832:18;13660:204:0;;;;;;;;37210:647;;;;;;:::i;:::-;;:::i;15071:123::-;;;;;;:::i;:::-;15137:7;15164:12;;;;;;;;;;:22;;;;15071:123;;;;5057:25:1;;;5045:2;5030:18;15071:123:0;5012:76:1;25808:123:0;;;:::i;15456:147::-;;;;;;:::i;:::-;;:::i;16504:218::-;;;;;;:::i;:::-;;:::i;26226:749::-;;;;;;:::i;:::-;;:::i;21010:88::-;;21061:37;21010:88;;23327:378;;;;;;:::i;:::-;;:::i;23877:1587::-;;;;;;:::i;:::-;;:::i;36427:463::-;;;;;;:::i;:::-;;:::i;21298:65::-;;;;;-1:-1:-1;;;;;21298:65:0;;;;;;-1:-1:-1;;;;;4012:32:1;;;3994:51;;3982:2;3967:18;21298:65:0;3949:102:1;37955:142:0;;;;;;:::i;:::-;-1:-1:-1;;;;;38050:35:0;38026:4;38050:35;;;:23;:35;;;;;;:39;;;37955:142;13956:139;;;;;;:::i;:::-;;:::i;33444:117::-;;33514:47;33444:117;;13047:49;;13092:4;13047:49;;34131:34;;;;;;:::i;:::-;;:::i;33568:127::-;;33643:52;33568:127;;38165:116;;;:::i;:::-;;;;;;;:::i;29290:348::-;;;;;;:::i;:::-;;:::i;15848:149::-;;;;;;:::i;:::-;;:::i;20925:78::-;;-1:-1:-1;;;;;;;;;;;20925:78:0;;27173:126;27263:5;;27270:20;;-1:-1:-1;;;27263:5:0;;;-1:-1:-1;;;;;27263:5:0;;-1:-1:-1;;;27270:20:0;;;;27173:126;;;6859:25:1;;;6915:2;6900:18;;6893:34;;;;6832:18;27173:126:0;6814:119:1;27985:363:0;;;:::i;:::-;;;;7493:25:1;;;7549:2;7534:18;;7527:34;;;;7577:18;;;7570:34;7635:2;7620:18;;7613:34;7480:3;7465:19;27985:363:0;7447:206:1;28595:502:0;-1:-1:-1;;;;;;;;;;;13538:30:0;20971:32;7476:10;13538;:30::i;:::-;28811:28:::1;::::0;28855:37:::1;::::0;;;;::::1;::::0;;;::::1;::::0;;::::1;;::::0;::::1;::::0;;-1:-1:-1;;;;;28770:70:0;;::::1;28811:28:::0;::::1;28770:70;;28748:155;;;;-1:-1:-1::0;;;28748:155:0::1;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1::0;28916:28:0::1;:91:::0;;-1:-1:-1;;;;;;28916:91:0::1;-1:-1:-1::0;;;;;28916:91:0;::::1;::::0;;::::1;::::0;;;29023:66:::1;::::0;::::1;::::0;-1:-1:-1;;29023:66:0::1;28595:502:::0;;:::o;13660:204::-;13745:4;-1:-1:-1;;;;;;13769:47:0;;-1:-1:-1;;;13769:47:0;;:87;;-1:-1:-1;;;;;;;;;;11174:40:0;;;13820:36;13762:94;13660:204;-1:-1:-1;;13660:204:0:o;37210:647::-;33643:52;13538:30;33643:52;7476:10;13538;:30::i;:::-;37348:13:::1;37364:37;37390:10;37364:25;:37::i;:::-;37432:17;:24:::0;37348:53;;-1:-1:-1;37412:17:0::1;::::0;37432:28:::1;::::0;37459:1:::1;::::0;37432:28:::1;:::i;:::-;37412:48;;37486:9;37477:5;:18;37473:244;;37512:28;37543:17;37561:9;37543:28;;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;::::1;::::0;37586:17:::1;:24:::0;;-1:-1:-1;;;;;37543:28:0;;::::1;::::0;-1:-1:-1;37543:28:0;;37604:5;;37586:24;::::1;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;::::1;:47:::0;;-1:-1:-1;;;;;;37586:47:0::1;-1:-1:-1::0;;;;;37586:47:0;;;::::1;::::0;;;::::1;::::0;;37696:9:::1;:5:::0;-1:-1:-1;37696:9:0::1;:::i;:::-;-1:-1:-1::0;;;;;37648:45:0;;::::1;;::::0;;;:23:::1;:45;::::0;;;;:57;37473:244:::1;37729:17;:23;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;;;-1:-1:-1;;37729:23:0;;;;;-1:-1:-1;;;;;;37729:23:0::1;::::0;;;;;;;;-1:-1:-1;;;;;37770:35:0;::::1;::::0;;;:23:::1;:35:::0;;;;;;;37763:42;;;37821:28;37770:35;;37821:28:::1;::::0;::::1;37337:520;;37210:647:::0;;:::o;25808:123::-;25904:5;;25911:11;;25859:7;;25886:37;;-1:-1:-1;;;;;;;;25904:5:0;;;;;;25911:11;25886:17;:37::i;:::-;25879:44;;25808:123;:::o;15456:147::-;15137:7;15164:12;;;;;;;;;;:22;;;13538:30;13549:4;7476:10;13538;:30::i;:::-;15570:25:::1;15581:4;15587:7;15570:10;:25::i;:::-;15456:147:::0;;;:::o;16504:218::-;-1:-1:-1;;;;;16600:23:0;;7476:10;16600:23;16592:83;;;;-1:-1:-1;;;16592:83:0;;6289:2:1;16592:83:0;;;6271:21:1;6328:2;6308:18;;;6301:30;6367:34;6347:18;;;6340:62;-1:-1:-1;;;6418:18:1;;;6411:45;6473:19;;16592:83:0;6261:237:1;16592:83:0;16688:26;16700:4;16706:7;16688:11;:26::i;:::-;16504:218;;:::o;26226:749::-;-1:-1:-1;;;;;;;;;;;13538:30:0;20971:32;7476:10;13538;:30::i;:::-;26411:21:::1;::::0;;;;::::1;::::0;;;::::1;::::0;;-1:-1:-1;;;26411:21:0::1;::::0;::::1;::::0;-1:-1:-1;;;;;26382:27:0;::::1;;26374:59;;;;-1:-1:-1::0;;;26374:59:0::1;;;;;;;;:::i;:::-;;26446:52;26476:21;26446:29;:52::i;:::-;26509:20;:52:::0;;-1:-1:-1;;;;26509:52:0::1;-1:-1:-1::0;;;26509:52:0::1;::::0;::::1;;;::::0;;-1:-1:-1;26613:43:0::1;26640:15;26613:26;:43::i;:::-;26572:84:::0;-1:-1:-1;26708:64:0::1;26737:34;26770:1;26572:84:::0;26737:34:::1;:::i;:::-;26708:28;:64::i;:::-;26672:111;::::0;::::1;::::0;;;::::1;-1:-1:-1::0;;;;;26872:23:0;;::::1;-1:-1:-1::0;;;26872:23:0::1;26794:67:::0;;::::1;26872:23;26794:25;26872:23:::0;26913:54:::1;::::0;;6859:25:1;;;6915:2;6900:18;;6893:34;;;26913:54:0::1;::::0;6832:18:1;26913:54:0::1;;;;;;;26363:612;26226:749:::0;;;:::o;23327:378::-;23521:25;;23458:4;;-1:-1:-1;;;;;23521:25:0;23484:33;23502:15;23484;:33;:::i;:::-;:62;23480:218;;-1:-1:-1;23587:5:0;;-1:-1:-1;;;23587:5:0;;-1:-1:-1;;;;;23587:5:0;23570:22;;;23563:29;;23480:218;23667:5;;23674:11;;23649:37;;-1:-1:-1;;;;;;;;23667:5:0;;;;;;23674:11;23649:17;:37::i;:::-;23632:54;;;;;23327:378;-1:-1:-1;;23327:378:0:o;23877:1587::-;21061:37;13538:30;21061:37;7476:10;13538;:30::i;:::-;24009:11:::1;::::0;24052:5:::1;::::0;-1:-1:-1;;;;;24009:11:0;;::::1;::::0;-1:-1:-1;;;24052:5:0;::::1;::::0;::::1;::::0;24109:25:::1;24319:15;:49:::0;-1:-1:-1;24315:414:0::1;;24418:43;24445:15;24418:26;:43::i;:::-;24495:1;::::0;-1:-1:-1;24385:76:0;-1:-1:-1;24556:64:0::1;24585:34;24618:1;24385:76:::0;24585:34:::1;:::i;24556:64::-;24516:119;::::0;::::1;::::0;;;::::1;24650:25;:67:::0;;-1:-1:-1;;;;;;24650:67:0::1;-1:-1:-1::0;;;;;24650:67:0;::::1;;::::0;;24315:414:::1;24780:47;24798:10;24810:16;24780:17;:47::i;:::-;24763:13;:64;;24842:35;;;;;;;;;;;;;;;;::::0;24741:147:::1;;;;;-1:-1:-1::0;;;24741:147:0::1;;;;;;;;:::i;:::-;-1:-1:-1::0;24899:33:0::1;24919:13:::0;24899:33;::::1;:::i;:::-;24943:11;:39:::0;;-1:-1:-1;;;;;;24943:39:0::1;-1:-1:-1::0;;;;;24943:39:0;::::1;;::::0;;;-1:-1:-1;;;;;25181:84:0::1;25204:10:::0;24943:39;25234:30;25181:22:::1;:84::i;:::-;25283:173;::::0;;7140:25:1;;;7196:2;7181:18;;7174:34;;;7224:18;;;7217:34;;;24995:270:0;;-1:-1:-1;24995:270:0;;-1:-1:-1;24995:270:0;-1:-1:-1;24995:270:0;-1:-1:-1;24995:270:0;;25283:173:::1;::::0;7128:2:1;7113:18;25283:173:0::1;;;;;;;23971:1493;;;;;;;23877:1587:::0;;:::o;36427:463::-;33514:47;13538:30;33514:47;7476:10;13538;:30::i;:::-;36601:23:::1;:35;36625:10;-1:-1:-1::0;;;;;36601:35:0::1;-1:-1:-1::0;;;;;36601:35:0::1;;;;;;;;;;;;;36640:1;36601:40;36656:45;;;;;;;;;;;;;;;;;36579:133;;;;;-1:-1:-1::0;;;36579:133:0::1;;;;;;;;:::i;:::-;-1:-1:-1::0;36725:17:0::1;:34:::0;;::::1;::::0;::::1;::::0;;;::::1;::::0;;-1:-1:-1;;;;;;36725:34:0::1;-1:-1:-1::0;;;;;36725:34:0;::::1;::::0;;::::1;::::0;;;36808:24;;-1:-1:-1;36770:35:0;;;:23:::1;36725:34;36770:35:::0;;;;;;:62;;;;36848:34;::::1;::::0;::::1;::::0;36875:6;;36848:34:::1;:::i;:::-;;;;;;;;36427:463:::0;;;:::o;13956:139::-;14034:4;14058:12;;;;;;;;;;;-1:-1:-1;;;;;14058:29:0;;;;;;;;;;;;;;;13956:139::o;34131:34::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;34131:34:0;;-1:-1:-1;34131:34:0;:::o;38165:116::-;38220:16;38256:17;38249:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;38249:24:0;;;;;;;;;;;;;;;;;;;;;;;38165:116;:::o;29290:348::-;-1:-1:-1;;;;;;;;;;;13538:30:0;20971:32;7476:10;13538;:30::i;:::-;29422:5:::1;::::0;29429:32:::1;::::0;;;;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;::::1;::::0;;-1:-1:-1;;;29422:5:0;::::1;-1:-1:-1::0;;;;;29422:5:0::1;29403:24:::0;::::1;;29395:67;;;;-1:-1:-1::0;;;29395:67:0::1;;;;;;;;:::i;:::-;-1:-1:-1::0;29479:11:0::1;::::0;-1:-1:-1;;;;;29479:11:0::1;:30:::0;::::1;29475:156;;29526:11;:38:::0;;-1:-1:-1;;;;;;29526:38:0::1;-1:-1:-1::0;;;;;29526:38:0;::::1;;::::0;;29584:35:::1;::::0;5057:25:1;;;29584:35:0::1;::::0;5045:2:1;5030:18;29584:35:0::1;;;;;;;29290:348:::0;;:::o;15848:149::-;15137:7;15164:12;;;;;;;;;;:22;;;13538:30;13549:4;7476:10;13538;:30::i;:::-;15963:26:::1;15975:4;15981:7;15963:11;:26::i;27985:363::-:0;28294:5;;28301:11;;28075:27;;;;;;;;28271:69;;-1:-1:-1;;;;;;;;28294:5:0;;;;;28301:11;;;28314:25;28271:22;:69::i;:::-;28264:76;;;;;;;;27985:363;;;;:::o;14385:497::-;14466:22;14474:4;14480:7;14466;:22::i;:::-;14461:414;;14654:41;14682:7;-1:-1:-1;;;;;14654:41:0;14692:2;14654:19;:41::i;:::-;14768:38;14796:4;14803:2;14768:19;:38::i;:::-;14559:270;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;14559:270:0;;;;;;;;;;-1:-1:-1;;;14505:358:0;;;;;;;:::i;38369:251::-;38446:14;38482:23;:35;38506:10;-1:-1:-1;;;;;38482:35:0;-1:-1:-1;;;;;38482:35:0;;;;;;;;;;;;;38473:44;;38545:1;38536:6;:10;38548:41;;;;;;;;;;;;;;;;;38528:62;;;;;-1:-1:-1;;;38528:62:0;;;;;;;;:::i;:::-;-1:-1:-1;38601:11:0;38611:1;38601:11;;:::i;30348:204::-;30463:7;30510:6;30495:12;:21;:49;;30543:1;30495:49;;;30519:21;30528:12;30519:6;:21;:::i;:::-;30488:56;30348:204;-1:-1:-1;;;30348:204:0:o;17808:229::-;17883:22;17891:4;17897:7;17883;:22::i;:::-;17878:152;;17922:6;:12;;;;;;;;;;;-1:-1:-1;;;;;17922:29:0;;;;;;;;;:36;;-1:-1:-1;;17922:36:0;17954:4;17922:36;;;18005:12;7476:10;;7396:98;18005:12;-1:-1:-1;;;;;17978:40:0;17996:7;-1:-1:-1;;;;;17978:40:0;17990:4;17978:40;;;;;;;;;;17808:229;;:::o;18045:230::-;18120:22;18128:4;18134:7;18120;:22::i;:::-;18116:152;;;18191:5;18159:12;;;;;;;;;;;-1:-1:-1;;;;;18159:29:0;;;;;;;;;;:37;;-1:-1:-1;;18159:37:0;;;18216:40;7476:10;;18159:12;;18216:40;;18191:5;18216:40;18045:230;;:::o;30560:395::-;30677:21;30702:1;30677:26;:73;;;;30724:21;30749:1;30724:26;30677:73;:120;;;;30771:21;30796:1;30771:26;30677:120;:167;;;;30818:21;30843:1;30818:26;30677:167;:215;;;;30865:21;30890:2;30865:27;30677:215;30907:29;;;;;;;;;;;;;-1:-1:-1;;;30907:29:0;;;30655:292;;;;;-1:-1:-1;;;30655:292:0;;;;;;;;:::i;32679:260::-;32758:7;32778:19;32800:40;32829:10;32800:28;:40::i;:::-;32858:28;;:73;;-1:-1:-1;;;32858:73:0;;;;;7831:25:1;;;-1:-1:-1;;;32910:20:0;;;;7872:18:1;;;7865:59;32778:62:0;;-1:-1:-1;;;;;;32858:28:0;;:38;;7804:18:1;;32858:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;30963:945::-;31157:28;;:56;;-1:-1:-1;;;31157:56:0;;;;;5057:25:1;;;31044:7:0;;;;;;-1:-1:-1;;;;;31157:28:0;;:44;;5030:18:1;;31157:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;31544:20:0;;31123:90;;-1:-1:-1;31123:90:0;-1:-1:-1;31123:90:0;;31385:23;;31505:60;;31123:90;;-1:-1:-1;;;31544:20:0;;;;31505:31;:60::i;:::-;31705:1;31737:28;;:163;;-1:-1:-1;;;31737:163:0;;;;;7140:25:1;;;7181:18;;;7174:34;;;7224:18;;;7217:34;;;31478:87:0;;-1:-1:-1;31705:1:0;;-1:-1:-1;;;;;31737:28:0;;;;:46;;7113:18:1;;31737:163:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31717:183;30963:945;-1:-1:-1;;;;;;;30963:945:0:o;29724:616::-;29928:27;29970:33;30018:29;30062:27;30139:12;30166:39;30184:6;30192:12;30166:17;:39::i;:::-;30220:60;30249:30;30278:1;30249:26;:30;:::i;30220:60::-;30117:215;;;;-1:-1:-1;30117:215:0;;-1:-1:-1;29724:616:0;-1:-1:-1;;;;29724:616:0:o;9143:451::-;9218:13;9244:19;9276:10;9280:6;9276:1;:10;:::i;:::-;:14;;9289:1;9276:14;:::i;:::-;9266:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9266:25:0;;9244:47;;-1:-1:-1;;;9302:6:0;9309:1;9302:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;9302:15:0;;;;;;;;;-1:-1:-1;;;9328:6:0;9335:1;9328:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;9328:15:0;;;;;;;;-1:-1:-1;9359:9:0;9371:10;9375:6;9371:1;:10;:::i;:::-;:14;;9384:1;9371:14;:::i;:::-;9359:26;;9354:135;9391:1;9387;:5;9354:135;;;-1:-1:-1;;;9439:5:0;9447:3;9439:11;9426:25;;;;;;;:::i;:::-;;;;9414:6;9421:1;9414:9;;;;;;;;:::i;:::-;;;;:37;-1:-1:-1;;;;;9414:37:0;;;;;;;;-1:-1:-1;9476:1:0;9466:11;;;;;9394:3;;;:::i;:::-;;;9354:135;;;-1:-1:-1;9507:10:0;;9499:55;;;;-1:-1:-1;;;9499:55:0;;5928:2:1;9499:55:0;;;5910:21:1;;;5947:18;;;5940:30;6006:34;5986:18;;;5979:62;6058:18;;9499:55:0;5900:182:1;31916:755:0;32135:29;;;;;;;;;;;;-1:-1:-1;;;32135:29:0;;;;32054:27;;32107:26;32099:66;;;;-1:-1:-1;;;32099:66:0;;;;;;;;:::i;:::-;-1:-1:-1;32342:20:0;32380:21;32366:10;32375:1;32366:6;:10;:::i;:::-;32365:36;;;;:::i;:::-;32342:59;-1:-1:-1;32506:36:0;32521:21;32342:59;32506:36;:::i;:::-;:40;;32545:1;32506:40;:::i;:::-;32484:62;31916:755;-1:-1:-1;;;;31916:755:0:o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:2;;177:1;174;167:12;111:2;63:124;;;:::o;192:186::-;251:6;304:2;292:9;283:7;279:23;275:32;272:2;;;320:1;317;310:12;272:2;343:29;362:9;343:29;:::i;383:996::-;461:6;469;522:2;510:9;501:7;497:23;493:32;490:2;;;538:1;535;528:12;490:2;561:29;580:9;561:29;:::i;:::-;551:39;;641:2;630:9;626:18;613:32;664:18;705:2;697:6;694:14;691:2;;;721:1;718;711:12;691:2;759:6;748:9;744:22;734:32;;804:7;797:4;793:2;789:13;785:27;775:2;;826:1;823;816:12;775:2;862;849:16;884:2;880;877:10;874:2;;;890:18;;:::i;:::-;965:2;959:9;933:2;1019:13;;-1:-1:-1;;1015:22:1;;;1039:2;1011:31;1007:40;995:53;;;1063:18;;;1083:22;;;1060:46;1057:2;;;1109:18;;:::i;:::-;1149:10;1145:2;1138:22;1184:2;1176:6;1169:18;1224:7;1219:2;1214;1210;1206:11;1202:20;1199:33;1196:2;;;1245:1;1242;1235:12;1196:2;1301;1296;1292;1288:11;1283:2;1275:6;1271:15;1258:46;1346:1;1341:2;1336;1328:6;1324:15;1320:24;1313:35;1367:6;1357:16;;;;;;;480:899;;;;;:::o;1384:180::-;1443:6;1496:2;1484:9;1475:7;1471:23;1467:32;1464:2;;;1512:1;1509;1502:12;1464:2;-1:-1:-1;1535:23:1;;1454:110;-1:-1:-1;1454:110:1:o;1569:254::-;1637:6;1645;1698:2;1686:9;1677:7;1673:23;1669:32;1666:2;;;1714:1;1711;1704:12;1666:2;1750:9;1737:23;1727:33;;1779:38;1813:2;1802:9;1798:18;1779:38;:::i;:::-;1769:48;;1656:167;;;;;:::o;1828:286::-;1886:6;1939:2;1927:9;1918:7;1914:23;1910:32;1907:2;;;1955:1;1952;1945:12;1907:2;1981:23;;-1:-1:-1;;;;;;2033:32:1;;2023:43;;2013:2;;2080:1;2077;2070:12;2304:184;2374:6;2427:2;2415:9;2406:7;2402:23;2398:32;2395:2;;;2443:1;2440;2433:12;2395:2;-1:-1:-1;2466:16:1;;2385:103;-1:-1:-1;2385:103:1:o;2493:248::-;2561:6;2569;2622:2;2610:9;2601:7;2597:23;2593:32;2590:2;;;2638:1;2635;2628:12;2590:2;-1:-1:-1;;2661:23:1;;;2731:2;2716:18;;;2703:32;;-1:-1:-1;2580:161:1:o;2746:306::-;2834:6;2842;2850;2903:2;2891:9;2882:7;2878:23;2874:32;2871:2;;;2919:1;2916;2909:12;2871:2;2948:9;2942:16;2932:26;;2998:2;2987:9;2983:18;2977:25;2967:35;;3042:2;3031:9;3027:18;3021:25;3011:35;;2861:191;;;;;:::o;3057:786::-;3468:25;3463:3;3456:38;3438:3;3523:6;3517:13;3539:62;3594:6;3589:2;3584:3;3580:12;3573:4;3565:6;3561:17;3539:62;:::i;:::-;-1:-1:-1;;;3660:2:1;3620:16;;;3652:11;;;3645:40;3710:13;;3732:63;3710:13;3781:2;3773:11;;3766:4;3754:17;;3732:63;:::i;:::-;3815:17;3834:2;3811:26;;3446:397;-1:-1:-1;;;;3446:397:1:o;4056:658::-;4227:2;4279:21;;;4349:13;;4252:18;;;4371:22;;;4198:4;;4227:2;4450:15;;;;4424:2;4409:18;;;4198:4;4493:195;4507:6;4504:1;4501:13;4493:195;;;4572:13;;-1:-1:-1;;;;;4568:39:1;4556:52;;4663:15;;;;4628:12;;;;4604:1;4522:9;4493:195;;;-1:-1:-1;4705:3:1;;4207:507;-1:-1:-1;;;;;;4207:507:1:o;5338:383::-;5487:2;5476:9;5469:21;5450:4;5519:6;5513:13;5562:6;5557:2;5546:9;5542:18;5535:34;5578:66;5637:6;5632:2;5621:9;5617:18;5612:2;5604:6;5600:15;5578:66;:::i;:::-;5705:2;5684:15;-1:-1:-1;;5680:29:1;5665:45;;;;5712:2;5661:54;;5459:262;-1:-1:-1;;5459:262:1:o;7935:128::-;7975:3;8006:1;8002:6;7999:1;7996:13;7993:2;;;8012:18;;:::i;:::-;-1:-1:-1;8048:9:1;;7983:80::o;8068:217::-;8108:1;8134;8124:2;;8178:10;8173:3;8169:20;8166:1;8159:31;8213:4;8210:1;8203:15;8241:4;8238:1;8231:15;8124:2;-1:-1:-1;8270:9:1;;8114:171::o;8290:168::-;8330:7;8396:1;8392;8388:6;8384:14;8381:1;8378:21;8373:1;8366:9;8359:17;8355:45;8352:2;;;8403:18;;:::i;:::-;-1:-1:-1;8443:9:1;;8342:116::o;8463:125::-;8503:4;8531:1;8528;8525:8;8522:2;;;8536:18;;:::i;:::-;-1:-1:-1;8573:9:1;;8512:76::o;8593:258::-;8665:1;8675:113;8689:6;8686:1;8683:13;8675:113;;;8765:11;;;8759:18;8746:11;;;8739:39;8711:2;8704:10;8675:113;;;8806:6;8803:1;8800:13;8797:2;;;8841:1;8832:6;8827:3;8823:16;8816:27;8797:2;;8646:205;;;:::o;8856:136::-;8895:3;8923:5;8913:2;;8932:18;;:::i;:::-;-1:-1:-1;;;8968:18:1;;8903:89::o;8997:127::-;9058:10;9053:3;9049:20;9046:1;9039:31;9089:4;9086:1;9079:15;9113:4;9110:1;9103:15;9129:127;9190:10;9185:3;9181:20;9178:1;9171:31;9221:4;9218:1;9211:15;9245:4;9242:1;9235:15;9261:127;9322:10;9317:3;9313:20;9310:1;9303:31;9353:4;9350:1;9343:15;9377:4;9374:1;9367:15;9393:127;9454:10;9449:3;9445:20;9442:1;9435:31;9485:4;9482:1;9475:15;9509:4;9506:1;9499:15

Swarm Source

ipfs://29617d7b6065e85791d92ac991122a1357a7f82ff96ced1632956984dcfedf31

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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