ETH Price: $2,035.77 (-0.92%)
Gas: 31 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Sponsored

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
160351262022-11-23 20:39:35371 days 8 hrs ago1669235975  Contract Creation0 ETH
Loading...
Loading

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

Contract Name:
TopUpAllowedRecipients

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 A helper contract contains logic to validate that only a trusted caller has access to certain methods.
/// @dev Trusted caller set once on deployment and can't be changed.
contract TrustedCaller {
    string private constant ERROR_TRUSTED_CALLER_IS_ZERO_ADDRESS = "TRUSTED_CALLER_IS_ZERO_ADDRESS";
    string private constant ERROR_CALLER_IS_FORBIDDEN = "CALLER_IS_FORBIDDEN";

    address public immutable trustedCaller;

    constructor(address _trustedCaller) {
        require(_trustedCaller != address(0), ERROR_TRUSTED_CALLER_IS_ZERO_ADDRESS);
        trustedCaller = _trustedCaller;
    }

    modifier onlyTrustedCaller(address _caller) {
        require(_caller == trustedCaller, ERROR_CALLER_IS_FORBIDDEN);
        _;
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>




/// @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;
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>




/// @author psirex
/// @notice Interface of method from Aragon's Finance contract to create a new payment
interface IFinance {
    function newImmediatePayment(
        address _token,
        address _receiver,
        uint256 _amount,
        string memory _reference
    ) external;
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>




/// @author psirex
/// @notice Interface which every EVMScript factory used in EasyTrack contract has to implement
interface IEVMScriptFactory {
    function createEVMScript(address _creator, bytes memory _evmScriptCallData)
        external
        returns (bytes memory);
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>






/// @author psirex
/// @notice Provides methods to update motion duration, objections threshold, and limit of active motions of Easy Track
contract MotionSettings is AccessControl {
    // -------------
    // EVENTS
    // -------------
    event MotionDurationChanged(uint256 _motionDuration);
    event MotionsCountLimitChanged(uint256 _newMotionsCountLimit);
    event ObjectionsThresholdChanged(uint256 _newThreshold);

    // -------------
    // ERRORS
    // -------------

    string private constant ERROR_VALUE_TOO_SMALL = "VALUE_TOO_SMALL";
    string private constant ERROR_VALUE_TOO_LARGE = "VALUE_TOO_LARGE";

    // ------------
    // CONSTANTS
    // ------------
    /// @notice Upper bound for motionsCountLimit variable.
    uint256 public constant MAX_MOTIONS_LIMIT = 24;

    /// @notice Upper bound for objectionsThreshold variable.
    /// @dev Stored in basis points (1% = 100)
    uint256 public constant MAX_OBJECTIONS_THRESHOLD = 500;

    /// @notice Lower bound for motionDuration variable
    uint256 public constant MIN_MOTION_DURATION = 48 hours;

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

    /// @notice Percent from total supply of governance tokens required to reject motion.
    /// @dev Value stored in basis points: 1% == 100.
    uint256 public objectionsThreshold;

    /// @notice Max count of active motions
    uint256 public motionsCountLimit;

    /// @notice Minimal time required to pass before enacting of motion
    uint256 public motionDuration;

    // ------------
    // CONSTRUCTOR
    // ------------
    constructor(
        address _admin,
        uint256 _motionDuration,
        uint256 _motionsCountLimit,
        uint256 _objectionsThreshold
    ) {
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        _setMotionDuration(_motionDuration);
        _setMotionsCountLimit(_motionsCountLimit);
        _setObjectionsThreshold(_objectionsThreshold);
    }

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

    /// @notice Sets the minimal time required to pass before enacting of motion
    function setMotionDuration(uint256 _motionDuration) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setMotionDuration(_motionDuration);
    }

    /// @notice Sets percent from total supply of governance tokens required to reject motion
    function setObjectionsThreshold(uint256 _objectionsThreshold)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _setObjectionsThreshold(_objectionsThreshold);
    }

    /// @notice Sets max count of active motions.
    function setMotionsCountLimit(uint256 _motionsCountLimit)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _setMotionsCountLimit(_motionsCountLimit);
    }

    function _setMotionDuration(uint256 _motionDuration) internal {
        require(_motionDuration >= MIN_MOTION_DURATION, ERROR_VALUE_TOO_SMALL);
        motionDuration = _motionDuration;
        emit MotionDurationChanged(_motionDuration);
    }

    function _setObjectionsThreshold(uint256 _objectionsThreshold) internal {
        require(_objectionsThreshold <= MAX_OBJECTIONS_THRESHOLD, ERROR_VALUE_TOO_LARGE);
        objectionsThreshold = _objectionsThreshold;
        emit ObjectionsThresholdChanged(_objectionsThreshold);
    }

    function _setMotionsCountLimit(uint256 _motionsCountLimit) internal {
        require(_motionsCountLimit <= MAX_MOTIONS_LIMIT, ERROR_VALUE_TOO_LARGE);
        motionsCountLimit = _motionsCountLimit;
        emit MotionsCountLimitChanged(_motionsCountLimit);
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>




/// @author psirex
/// @notice Contains methods to extract primitive types from bytes
library BytesUtils {
    function bytes24At(bytes memory data, uint256 location) internal pure returns (bytes24 result) {
        uint256 word = uint256At(data, location);
        assembly {
            result := word
        }
    }

    function addressAt(bytes memory data, uint256 location) internal pure returns (address result) {
        uint256 word = uint256At(data, location);
        assembly {
            result := shr(
                96,
                and(word, 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000)
            )
        }
    }

    function uint32At(bytes memory _data, uint256 _location) internal pure returns (uint32 result) {
        uint256 word = uint256At(_data, _location);

        assembly {
            result := shr(
                224,
                and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000)
            )
        }
    }

    function uint256At(bytes memory data, uint256 location) internal pure returns (uint256 result) {
        assembly {
            result := mload(add(data, add(0x20, location)))
        }
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>






/// @author psirex
/// @notice Provides methods to convinient work with permissions bytes
/// @dev Permissions - is a list of tuples (address, bytes4) encoded into a bytes representation.
/// Each tuple (address, bytes4) describes a method allowed to be called by EVMScript
library EVMScriptPermissions {
    using BytesUtils for bytes;

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

    /// Bytes size of SPEC_ID in EVMScript
    uint256 private constant SPEC_ID_SIZE = 4;

    /// Size of the address type in bytes
    uint256 private constant ADDRESS_SIZE = 20;

    /// Bytes size of calldata length in EVMScript
    uint256 private constant CALLDATA_LENGTH_SIZE = 4;

    /// Bytes size of method selector
    uint256 private constant METHOD_SELECTOR_SIZE = 4;

    /// Bytes size of one item in permissions
    uint256 private constant PERMISSION_SIZE = ADDRESS_SIZE + METHOD_SELECTOR_SIZE;

    // ------------------
    // INTERNAL METHODS
    // ------------------

    /// @notice Validates that passed EVMScript calls only methods allowed in permissions.
    /// @dev Returns false if provided permissions are invalid (has a wrong length or empty)
    function canExecuteEVMScript(bytes memory _permissions, bytes memory _evmScript)
        internal
        pure
        returns (bool)
    {
        uint256 location = SPEC_ID_SIZE; // first 4 bytes reserved for SPEC_ID
        if (!isValidPermissions(_permissions) || _evmScript.length <= location) {
            return false;
        }

        while (location < _evmScript.length) {
            (bytes24 methodToCall, uint32 callDataLength) = _getNextMethodId(_evmScript, location);
            if (!_hasPermission(_permissions, methodToCall)) {
                return false;
            }
            location += ADDRESS_SIZE + CALLDATA_LENGTH_SIZE + callDataLength;
        }
        return true;
    }

    /// @notice Validates that bytes with permissions not empty and has correct length
    function isValidPermissions(bytes memory _permissions) internal pure returns (bool) {
        return _permissions.length > 0 && _permissions.length % PERMISSION_SIZE == 0;
    }

    // Retrieves bytes24 which describes tuple (address, bytes4)
    // from EVMScript starting from _location position
    function _getNextMethodId(bytes memory _evmScript, uint256 _location)
        private
        pure
        returns (bytes24, uint32)
    {
        address recipient = _evmScript.addressAt(_location);
        uint32 callDataLength = _evmScript.uint32At(_location + ADDRESS_SIZE);
        uint32 functionSelector =
            _evmScript.uint32At(_location + ADDRESS_SIZE + CALLDATA_LENGTH_SIZE);
        return (bytes24(uint192(functionSelector)) | bytes20(recipient), callDataLength);
    }

    // Validates that passed _methodToCall contained in permissions
    function _hasPermission(bytes memory _permissions, bytes24 _methodToCall)
        private
        pure
        returns (bool)
    {
        uint256 location = 0;
        while (location < _permissions.length) {
            bytes24 permission = _permissions.bytes24At(location);
            if (permission == _methodToCall) {
                return true;
            }
            location += PERMISSION_SIZE;
        }
        return false;
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>









/// @author psirex
/// @notice Provides methods to add/remove EVMScript factories
/// and contains an internal method for the convenient creation of EVMScripts
contract EVMScriptFactoriesRegistry is AccessControl {
    using EVMScriptPermissions for bytes;

    // -------------
    // EVENTS
    // -------------

    event EVMScriptFactoryAdded(address indexed _evmScriptFactory, bytes _permissions);
    event EVMScriptFactoryRemoved(address indexed _evmScriptFactory);

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

    /// @notice List of allowed EVMScript factories
    address[] public evmScriptFactories;

    // Position of the EVMScript factory in the `evmScriptFactories` array,
    // plus 1 because index 0 means a value is not in the set.
    mapping(address => uint256) internal evmScriptFactoryIndices;

    /// @notice Permissions of current list of allowed EVMScript factories.
    mapping(address => bytes) public evmScriptFactoryPermissions;

    // ------------
    // CONSTRUCTOR
    // ------------
    constructor(address _admin) {
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
    }

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

    /// @notice Adds new EVMScript Factory to the list of allowed EVMScript factories with given permissions.
    /// Be careful about factories and their permissions added via this method. Only reviewed and tested
    /// factories must be added via this method.
    function addEVMScriptFactory(address _evmScriptFactory, bytes memory _permissions)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(_permissions.isValidPermissions(), "INVALID_PERMISSIONS");
        require(!_isEVMScriptFactory(_evmScriptFactory), "EVM_SCRIPT_FACTORY_ALREADY_ADDED");
        evmScriptFactories.push(_evmScriptFactory);
        evmScriptFactoryIndices[_evmScriptFactory] = evmScriptFactories.length;
        evmScriptFactoryPermissions[_evmScriptFactory] = _permissions;
        emit EVMScriptFactoryAdded(_evmScriptFactory, _permissions);
    }

    /// @notice Removes EVMScript factory from the list of allowed EVMScript factories
    /// @dev To delete a EVMScript factory from the rewardPrograms 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 removeEVMScriptFactory(address _evmScriptFactory)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        uint256 index = _getEVMScriptFactoryIndex(_evmScriptFactory);
        uint256 lastIndex = evmScriptFactories.length - 1;

        if (index != lastIndex) {
            address lastEVMScriptFactory = evmScriptFactories[lastIndex];
            evmScriptFactories[index] = lastEVMScriptFactory;
            evmScriptFactoryIndices[lastEVMScriptFactory] = index + 1;
        }

        evmScriptFactories.pop();
        delete evmScriptFactoryIndices[_evmScriptFactory];
        delete evmScriptFactoryPermissions[_evmScriptFactory];
        emit EVMScriptFactoryRemoved(_evmScriptFactory);
    }

    /// @notice Returns current list of EVMScript factories
    function getEVMScriptFactories() external view returns (address[] memory) {
        return evmScriptFactories;
    }

    /// @notice Returns if passed address are listed as EVMScript factory in the registry
    function isEVMScriptFactory(address _maybeEVMScriptFactory) external view returns (bool) {
        return _isEVMScriptFactory(_maybeEVMScriptFactory);
    }

    // ------------------
    // INTERNAL METHODS
    // ------------------

    /// @notice Creates EVMScript using given EVMScript factory
    /// @dev Checks permissions of resulting EVMScript and reverts with error
    /// if script tries to call methods not listed in permissions
    function _createEVMScript(
        address _evmScriptFactory,
        address _creator,
        bytes memory _evmScriptCallData
    ) internal returns (bytes memory _evmScript) {
        require(_isEVMScriptFactory(_evmScriptFactory), "EVM_SCRIPT_FACTORY_NOT_FOUND");
        _evmScript = IEVMScriptFactory(_evmScriptFactory).createEVMScript(
            _creator,
            _evmScriptCallData
        );
        bytes memory permissions = evmScriptFactoryPermissions[_evmScriptFactory];
        require(permissions.canExecuteEVMScript(_evmScript), "HAS_NO_PERMISSIONS");
    }

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

    function _getEVMScriptFactoryIndex(address _evmScriptFactory)
        private
        view
        returns (uint256 _index)
    {
        _index = evmScriptFactoryIndices[_evmScriptFactory];
        require(_index > 0, "EVM_SCRIPT_FACTORY_NOT_FOUND");
        _index -= 1;
    }

    function _isEVMScriptFactory(address _maybeEVMScriptFactory) private view returns (bool) {
        return evmScriptFactoryIndices[_maybeEVMScriptFactory] > 0;
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>




/// @notice Interface of EVMScript executor used by EasyTrack
interface IEVMScriptExecutor {
    function executeEVMScript(bytes memory _evmScript) external returns (bytes memory);
}






/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>











interface IMiniMeToken {
    function balanceOfAt(address _owner, uint256 _blockNumber) external pure returns (uint256);

    function totalSupplyAt(uint256 _blockNumber) external view returns (uint256);
}

/// @author psirex
/// @notice Contains main logic of Easy Track
contract EasyTrack is Pausable, AccessControl, MotionSettings, EVMScriptFactoriesRegistry {
    struct Motion {
        uint256 id;
        address evmScriptFactory;
        address creator;
        uint256 duration;
        uint256 startDate;
        uint256 snapshotBlock;
        uint256 objectionsThreshold;
        uint256 objectionsAmount;
        bytes32 evmScriptHash;
    }

    // -------------
    // EVENTS
    // -------------
    event MotionCreated(
        uint256 indexed _motionId,
        address _creator,
        address indexed _evmScriptFactory,
        bytes _evmScriptCallData,
        bytes _evmScript
    );
    event MotionObjected(
        uint256 indexed _motionId,
        address indexed _objector,
        uint256 _weight,
        uint256 _newObjectionsAmount,
        uint256 _newObjectionsAmountPct
    );
    event MotionRejected(uint256 indexed _motionId);
    event MotionCanceled(uint256 indexed _motionId);
    event MotionEnacted(uint256 indexed _motionId);
    event EVMScriptExecutorChanged(address indexed _evmScriptExecutor);

    // -------------
    // ERRORS
    // -------------
    string private constant ERROR_ALREADY_OBJECTED = "ALREADY_OBJECTED";
    string private constant ERROR_NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE";
    string private constant ERROR_NOT_CREATOR = "NOT_CREATOR";
    string private constant ERROR_MOTION_NOT_PASSED = "MOTION_NOT_PASSED";
    string private constant ERROR_UNEXPECTED_EVM_SCRIPT = "UNEXPECTED_EVM_SCRIPT";
    string private constant ERROR_MOTION_NOT_FOUND = "MOTION_NOT_FOUND";
    string private constant ERROR_MOTIONS_LIMIT_REACHED = "MOTIONS_LIMIT_REACHED";

    // -------------
    // ROLES
    // -------------
    bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");
    bytes32 public constant UNPAUSE_ROLE = keccak256("UNPAUSE_ROLE");
    bytes32 public constant CANCEL_ROLE = keccak256("CANCEL_ROLE");

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

    // Stores 100% in basis points
    uint256 internal constant HUNDRED_PERCENT = 10000;

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

    /// @notice List of active motions
    Motion[] public motions;

    // Id of the lastly created motion
    uint256 internal lastMotionId;

    /// @notice Address of governanceToken which implements IMiniMeToken interface
    IMiniMeToken public governanceToken;

    /// @notice Address of current EVMScriptExecutor
    IEVMScriptExecutor public evmScriptExecutor;

    // Position of the motion in the `motions` array, plus 1
    // because index 0 means a value is not in the set.
    mapping(uint256 => uint256) internal motionIndicesByMotionId;

    /// @notice Stores if motion with given id has been objected from given address.
    mapping(uint256 => mapping(address => bool)) public objections;

    // ------------
    // CONSTRUCTOR
    // ------------
    constructor(
        address _governanceToken,
        address _admin,
        uint256 _motionDuration,
        uint256 _motionsCountLimit,
        uint256 _objectionsThreshold
    )
        EVMScriptFactoriesRegistry(_admin)
        MotionSettings(_admin, _motionDuration, _motionsCountLimit, _objectionsThreshold)
    {
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        _setupRole(PAUSE_ROLE, _admin);
        _setupRole(UNPAUSE_ROLE, _admin);
        _setupRole(CANCEL_ROLE, _admin);

        governanceToken = IMiniMeToken(_governanceToken);
    }

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

    /// @notice Creates new motion
    /// @param _evmScriptFactory Address of EVMScript factory registered in Easy Track
    /// @param _evmScriptCallData Encoded call data of EVMScript factory
    /// @return _newMotionId Id of created motion
    function createMotion(address _evmScriptFactory, bytes memory _evmScriptCallData)
        external
        whenNotPaused
        returns (uint256 _newMotionId)
    {
        require(motions.length < motionsCountLimit, ERROR_MOTIONS_LIMIT_REACHED);

        Motion storage newMotion = motions.push();
        _newMotionId = ++lastMotionId;

        newMotion.id = _newMotionId;
        newMotion.creator = msg.sender;
        newMotion.startDate = block.timestamp;
        newMotion.snapshotBlock = block.number;
        newMotion.duration = motionDuration;
        newMotion.objectionsThreshold = objectionsThreshold;
        newMotion.evmScriptFactory = _evmScriptFactory;
        motionIndicesByMotionId[_newMotionId] = motions.length;

        bytes memory evmScript =
            _createEVMScript(_evmScriptFactory, msg.sender, _evmScriptCallData);
        newMotion.evmScriptHash = keccak256(evmScript);

        emit MotionCreated(
            _newMotionId,
            msg.sender,
            _evmScriptFactory,
            _evmScriptCallData,
            evmScript
        );
    }

    /// @notice Enacts motion with given id
    /// @param _motionId Id of motion to enact
    /// @param _evmScriptCallData Encoded call data of EVMScript factory. Same as passed on the creation
    /// of motion with the given motion id. Transaction reverts if EVMScript factory call data differs
    function enactMotion(uint256 _motionId, bytes memory _evmScriptCallData)
        external
        whenNotPaused
    {
        Motion storage motion = _getMotion(_motionId);
        require(motion.startDate + motion.duration <= block.timestamp, ERROR_MOTION_NOT_PASSED);

        address creator = motion.creator;
        bytes32 evmScriptHash = motion.evmScriptHash;
        address evmScriptFactory = motion.evmScriptFactory;

        _deleteMotion(_motionId);
        emit MotionEnacted(_motionId);

        bytes memory evmScript = _createEVMScript(evmScriptFactory, creator, _evmScriptCallData);
        require(evmScriptHash == keccak256(evmScript), ERROR_UNEXPECTED_EVM_SCRIPT);

        evmScriptExecutor.executeEVMScript(evmScript);
    }

    /// @notice Submits an objection from `governanceToken` holder.
    /// @param _motionId Id of motion to object
    function objectToMotion(uint256 _motionId) external {
        Motion storage motion = _getMotion(_motionId);
        require(!objections[_motionId][msg.sender], ERROR_ALREADY_OBJECTED);
        objections[_motionId][msg.sender] = true;

        uint256 snapshotBlock = motion.snapshotBlock;
        uint256 objectorBalance = governanceToken.balanceOfAt(msg.sender, snapshotBlock);
        require(objectorBalance > 0, ERROR_NOT_ENOUGH_BALANCE);

        uint256 totalSupply = governanceToken.totalSupplyAt(snapshotBlock);
        uint256 newObjectionsAmount = motion.objectionsAmount + objectorBalance;
        uint256 newObjectionsAmountPct = (HUNDRED_PERCENT * newObjectionsAmount) / totalSupply;

        emit MotionObjected(
            _motionId,
            msg.sender,
            objectorBalance,
            newObjectionsAmount,
            newObjectionsAmountPct
        );

        if (newObjectionsAmountPct < motion.objectionsThreshold) {
            motion.objectionsAmount = newObjectionsAmount;
        } else {
            _deleteMotion(_motionId);
            emit MotionRejected(_motionId);
        }
    }

    /// @notice Cancels motion with given id
    /// @param _motionId Id of motion to cancel
    /// @dev Method reverts if it is called with not existed _motionId
    function cancelMotion(uint256 _motionId) external {
        Motion storage motion = _getMotion(_motionId);
        require(motion.creator == msg.sender, ERROR_NOT_CREATOR);
        _deleteMotion(_motionId);
        emit MotionCanceled(_motionId);
    }

    /// @notice Cancels all motions with given ids
    /// @param _motionIds Ids of motions to cancel
    function cancelMotions(uint256[] memory _motionIds) external onlyRole(CANCEL_ROLE) {
        for (uint256 i = 0; i < _motionIds.length; ++i) {
            if (motionIndicesByMotionId[_motionIds[i]] > 0) {
                _deleteMotion(_motionIds[i]);
                emit MotionCanceled(_motionIds[i]);
            }
        }
    }

    /// @notice Cancels all active motions
    function cancelAllMotions() external onlyRole(CANCEL_ROLE) {
        uint256 motionsCount = motions.length;
        while (motionsCount > 0) {
            motionsCount -= 1;
            uint256 motionId = motions[motionsCount].id;
            _deleteMotion(motionId);
            emit MotionCanceled(motionId);
        }
    }

    /// @notice Sets new EVMScriptExecutor
    /// @param _evmScriptExecutor Address of new EVMScriptExecutor
    function setEVMScriptExecutor(address _evmScriptExecutor)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        evmScriptExecutor = IEVMScriptExecutor(_evmScriptExecutor);
        emit EVMScriptExecutorChanged(_evmScriptExecutor);
    }

    /// @notice Pauses Easy Track if it isn't paused.
    /// Paused Easy Track can't create and enact motions
    function pause() external whenNotPaused onlyRole(PAUSE_ROLE) {
        _pause();
    }

    /// @notice Unpauses Easy Track if it is paused
    function unpause() external whenPaused onlyRole(UNPAUSE_ROLE) {
        _unpause();
    }

    /// @notice Returns if an _objector can submit an objection to motion with id equals to _motionId or not
    /// @param _motionId Id of motion to check opportunity to object
    /// @param _objector Address of objector
    function canObjectToMotion(uint256 _motionId, address _objector) external view returns (bool) {
        Motion storage motion = _getMotion(_motionId);
        uint256 balance = governanceToken.balanceOfAt(_objector, motion.snapshotBlock);
        return balance > 0 && !objections[_motionId][_objector];
    }

    /// @notice Returns list of active motions
    function getMotions() external view returns (Motion[] memory) {
        return motions;
    }

    /// @notice Returns motion with the given id
    /// @param _motionId Id of motion to retrieve
    function getMotion(uint256 _motionId) external view returns (Motion memory) {
        return _getMotion(_motionId);
    }

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

    // Removes motion from list of active moitons
    // To delete a motion from the moitons 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 _deleteMotion(uint256 _motionId) private {
        uint256 index = motionIndicesByMotionId[_motionId] - 1;
        uint256 lastIndex = motions.length - 1;

        if (index != lastIndex) {
            Motion storage lastMotion = motions[lastIndex];
            motions[index] = lastMotion;
            motionIndicesByMotionId[lastMotion.id] = index + 1;
        }

        motions.pop();
        delete motionIndicesByMotionId[_motionId];
    }

    // Returns motion with given id if it exists
    function _getMotion(uint256 _motionId) private view returns (Motion storage) {
        uint256 _motionIndex = motionIndicesByMotionId[_motionId];
        require(_motionIndex > 0, ERROR_MOTION_NOT_FOUND);
        return motions[_motionIndex - 1];
    }
}
// SPDX-FileCopyrightText: 2022 Lido <[email protected]>











/// @notice Creates EVMScript to top up allowed recipients addresses within the current spendable balance
contract TopUpAllowedRecipients is TrustedCaller, IEVMScriptFactory {
    // -------------
    // ERRORS
    // -------------
    string private constant ERROR_LENGTH_MISMATCH = "LENGTH_MISMATCH";
    string private constant ERROR_EMPTY_DATA = "EMPTY_DATA";
    string private constant ERROR_ZERO_AMOUNT = "ZERO_AMOUNT";
    string private constant ERROR_RECIPIENT_NOT_ALLOWED = "RECIPIENT_NOT_ALLOWED";
    string private constant ERROR_SUM_EXCEEDS_SPENDABLE_BALANCE = "SUM_EXCEEDS_SPENDABLE_BALANCE";

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

    /// @notice Address of EasyTrack contract
    EasyTrack public immutable easyTrack;

    /// @notice Address of Aragon's Finance contract
    IFinance public immutable finance;

    /// @notice Address of payout token
    address public token;

    /// @notice Address of AllowedRecipientsRegistry contract
    AllowedRecipientsRegistry public allowedRecipientsRegistry;

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

    /// @param _trustedCaller Address that has access to certain methods.
    ///     Set once on deployment and can't be changed.
    /// @param _allowedRecipientsRegistry Address of AllowedRecipientsRegistry contract
    /// @param _finance Address of Aragon's Finance contract
    /// @param _token Address of payout token
    /// @param _easyTrack Address of EasyTrack contract
    constructor(
        address _trustedCaller,
        address _allowedRecipientsRegistry,
        address _finance,
        address _token,
        address _easyTrack
    ) TrustedCaller(_trustedCaller) {
        finance = IFinance(_finance);
        token = _token;
        allowedRecipientsRegistry = AllowedRecipientsRegistry(_allowedRecipientsRegistry);
        easyTrack = EasyTrack(_easyTrack);
    }

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

    /// @notice Creates EVMScript to top up allowed recipients addresses
    /// @param _creator Address who creates EVMScript
    /// @param _evmScriptCallData Encoded tuple: (address[] recipients, uint256[] amounts) where
    /// recipients - addresses of recipients to top up
    /// amounts - corresponding amounts of token to transfer
    /// @dev note that the arrays below has one extra element to store limit enforcement calls
    function createEVMScript(address _creator, bytes memory _evmScriptCallData)
        external
        view
        override
        onlyTrustedCaller(_creator)
        returns (bytes memory)
    {
        (address[] memory recipients, uint256[] memory amounts) = _decodeEVMScriptCallData(
            _evmScriptCallData
        );
        uint256 totalAmount = _validateEVMScriptCallData(recipients, amounts);

        address[] memory to = new address[](recipients.length + 1);
        bytes4[] memory methodIds = new bytes4[](recipients.length + 1);
        bytes[] memory evmScriptsCalldata = new bytes[](recipients.length + 1);

        to[0] = address(allowedRecipientsRegistry);
        methodIds[0] = allowedRecipientsRegistry.updateSpentAmount.selector;
        evmScriptsCalldata[0] = abi.encode(totalAmount);

        for (uint256 i = 0; i < recipients.length; ++i) {
            to[i + 1] = address(finance);
            methodIds[i + 1] = finance.newImmediatePayment.selector;
            evmScriptsCalldata[i + 1] = abi.encode(
                token,
                recipients[i],
                amounts[i],
                "Easy Track: top up recipient"
            );
        }

        return EVMScriptCreator.createEVMScript(to, methodIds, evmScriptsCalldata);
    }

    /// @notice Decodes call data used by createEVMScript method
    /// @param _evmScriptCallData Encoded tuple: (address[] recipients, uint256[] amounts) where
    /// recipients - addresses of recipients to top up
    /// amounts - corresponding amounts of token to transfer
    /// @return recipients Addresses of recipients to top up
    /// @return amounts Amounts of token to transfer
    function decodeEVMScriptCallData(bytes memory _evmScriptCallData)
        external
        pure
        returns (address[] memory recipients, uint256[] memory amounts)
    {
        return _decodeEVMScriptCallData(_evmScriptCallData);
    }

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

    function _validateEVMScriptCallData(address[] memory _recipients, uint256[] memory _amounts)
        private
        view
        returns (uint256 totalAmount)
    {
        require(_amounts.length == _recipients.length, ERROR_LENGTH_MISMATCH);
        require(_recipients.length > 0, ERROR_EMPTY_DATA);

        for (uint256 i = 0; i < _recipients.length; ++i) {
            require(_amounts[i] > 0, ERROR_ZERO_AMOUNT);
            require(
                allowedRecipientsRegistry.isRecipientAllowed(_recipients[i]),
                ERROR_RECIPIENT_NOT_ALLOWED
            );
            totalAmount += _amounts[i];
        }

        _validateSpendableBalance(totalAmount);
    }

    function _decodeEVMScriptCallData(bytes memory _evmScriptCallData)
        private
        pure
        returns (address[] memory recipients, uint256[] memory amounts)
    {
        return abi.decode(_evmScriptCallData, (address[], uint256[]));
    }

    function _validateSpendableBalance(uint256 _amount) private view {
        require(
            allowedRecipientsRegistry.isUnderSpendableBalance(_amount, easyTrack.motionDuration()),
            ERROR_SUM_EXCEEDS_SPENDABLE_BALANCE
        );
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_trustedCaller","type":"address"},{"internalType":"address","name":"_allowedRecipientsRegistry","type":"address"},{"internalType":"address","name":"_finance","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_easyTrack","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"allowedRecipientsRegistry","outputs":[{"internalType":"contract AllowedRecipientsRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"bytes","name":"_evmScriptCallData","type":"bytes"}],"name":"createEVMScript","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_evmScriptCallData","type":"bytes"}],"name":"decodeEVMScriptCallData","outputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"easyTrack","outputs":[{"internalType":"contract EasyTrack","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finance","outputs":[{"internalType":"contract IFinance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063ecf7c6901161005b578063ecf7c69014610114578063fc0c546a14610135578063fdcceb1414610148578063fea21c9c1461015b57600080fd5b8063268f076014610082578063313b7b19146100c6578063c368df7e146100ed575b600080fd5b6100a97f00000000000000000000000012a43b049a7d330cb8aeab5113032d18ae9a903081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a97f000000000000000000000000b9e5cbb9ca5b0d659238807e84d0176930753d8681565b6100a97f000000000000000000000000f0211b7660680b49de1a7e9f25c65660f0a13fea81565b610127610122366004610d1c565b61017b565b6040516100bd929190610e56565b6000546100a9906001600160a01b031681565b6001546100a9906001600160a01b031681565b61016e610169366004610be1565b610190565b6040516100bd9190610ecd565b60608061018783610598565b91509150915091565b6060827f00000000000000000000000012a43b049a7d330cb8aeab5113032d18ae9a90306001600160a01b0316816001600160a01b0316146040518060400160405280601381526020017221a0a62622a92fa4a9afa327a92124a22222a760691b8152509061021b5760405162461bcd60e51b81526004016102129190610ecd565b60405180910390fd5b5060008061022885610598565b91509150600061023883836105af565b905060008351600161024a9190610f35565b67ffffffffffffffff81111561026257610262610fe3565b60405190808252806020026020018201604052801561028b578160200160208202803683370190505b50905060008451600161029e9190610f35565b67ffffffffffffffff8111156102b6576102b6610fe3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b5090506000855160016102f29190610f35565b67ffffffffffffffff81111561030a5761030a610fe3565b60405190808252806020026020018201604052801561033d57816020015b60608152602001906001900390816103285790505b5060015484519192506001600160a01b031690849060009061036157610361610fcd565b60200260200101906001600160a01b031690816001600160a01b031681525050636667122960e01b8260008151811061039c5761039c610fcd565b6001600160e01b0319929092166020928302919091018201526040805191820186905201604051602081830303815290604052816000815181106103e2576103e2610fcd565b602002602001018190525060005b865181101561057e577f000000000000000000000000b9e5cbb9ca5b0d659238807e84d0176930753d8684610426836001610f35565b8151811061043657610436610fcd565b6001600160a01b0390921660209283029190910190910152637b1b242360e11b83610462836001610f35565b8151811061047257610472610fcd565b6001600160e01b03199092166020928302919091019091015260005487516001600160a01b03909116908890839081106104ae576104ae610fcd565b60200260200101518783815181106104c8576104c8610fcd565b6020026020010151604051602001610536939291906001600160a01b0393841681529190921660208201526040810191909152608060608201819052601c908201527f4561737920547261636b3a20746f7020757020726563697069656e740000000060a082015260c00190565b60408051601f1981840301815291905282610552836001610f35565b8151811061056257610562610fcd565b60200260200101819052508061057790610f9c565b90506103f0565b5061058a8383836107f0565b9a9950505050505050505050565b606080828060200190518101906101879190610c31565b600082518251146040518060400160405280600f81526020016e0988a9c8ea890be9a92a69a82a8869608b1b815250906105fc5760405162461bcd60e51b81526004016102129190610ecd565b5060008351116040518060400160405280600a815260200169454d5054595f4441544160b01b815250906106435760405162461bcd60e51b81526004016102129190610ecd565b5060005b83518110156107e057600083828151811061066457610664610fcd565b6020026020010151116040518060400160405280600b81526020016a16915493d7d05353d5539560aa1b815250906106af5760405162461bcd60e51b81526004016102129190610ecd565b5060015484516001600160a01b0390911690638400c307908690849081106106d9576106d9610fcd565b60200260200101516040518263ffffffff1660e01b815260040161070c91906001600160a01b0391909116815260200190565b60206040518083038186803b15801561072457600080fd5b505afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c9190610cf3565b60405180604001604052806015815260200174149150d2541251539517d393d517d0531313d5d151605a1b815250906107a85760405162461bcd60e51b81526004016102129190610ecd565b508281815181106107bb576107bb610fcd565b6020026020010151826107ce9190610f35565b91506107d981610f9c565b9050610647565b506107ea8161097d565b92915050565b606082518451146108355760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b6044820152606401610212565b81518451146108785760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b6044820152606401610212565b60005b845181101561094d578185828151811061089757610897610fcd565b60200260200101518483815181106108b1576108b1610fcd565b60200260200101515160046108c69190610f4d565b8684815181106108d8576108d8610fcd565b60200260200101518685815181106108f2576108f2610fcd565b602002602001015160405160200161090d9493929190610d9e565b60408051601f198184030181529082905261092b9291602001610e27565b60405160208183030381529060405291508061094690610f9c565b905061087b565b50600160e01b81604051602001610965929190610df6565b60405160208183030381529060405290509392505050565b600160009054906101000a90046001600160a01b03166001600160a01b0316634ba578ab827f000000000000000000000000f0211b7660680b49de1a7e9f25c65660f0a13fea6001600160a01b03166364993a736040518163ffffffff1660e01b815260040160206040518083038186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a339190610d59565b6040516001600160e01b031960e085901b1681526004810192909252602482015260440160206040518083038186803b158015610a6f57600080fd5b505afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa79190610cf3565b6040518060400160405280601d81526020017f53554d5f455843454544535f5350454e4441424c455f42414c414e434500000081525090610afb5760405162461bcd60e51b81526004016102129190610ecd565b5050565b600082601f830112610b1057600080fd5b81516020610b25610b2083610f11565b610ee0565b80838252828201915082860187848660051b8901011115610b4557600080fd5b60005b85811015610b6457815184529284019290840190600101610b48565b5090979650505050505050565b600082601f830112610b8257600080fd5b813567ffffffffffffffff811115610b9c57610b9c610fe3565b610baf601f8201601f1916602001610ee0565b818152846020838601011115610bc457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215610bf457600080fd5b8235610bff81610ff9565b9150602083013567ffffffffffffffff811115610c1b57600080fd5b610c2785828601610b71565b9150509250929050565b60008060408385031215610c4457600080fd5b825167ffffffffffffffff80821115610c5c57600080fd5b818501915085601f830112610c7057600080fd5b81516020610c80610b2083610f11565b8083825282820191508286018a848660051b8901011115610ca057600080fd5b600096505b84871015610ccc578051610cb881610ff9565b835260019690960195918301918301610ca5565b5091880151919650909350505080821115610ce657600080fd5b50610c2785828601610aff565b600060208284031215610d0557600080fd5b81518015158114610d1557600080fd5b9392505050565b600060208284031215610d2e57600080fd5b813567ffffffffffffffff811115610d4557600080fd5b610d5184828501610b71565b949350505050565b600060208284031215610d6b57600080fd5b5051919050565b60008151808452610d8a816020860160208601610f6c565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff19606086901b1681526001600160e01b031960e085901b81166014830152831660188201528151600090610de681601c850160208701610f6c565b91909101601c0195945050505050565b6001600160e01b0319831681528151600090610e19816004850160208701610f6c565b919091016004019392505050565b60008351610e39818460208801610f6c565b835190830190610e4d818360208801610f6c565b01949350505050565b604080825283519082018190526000906020906060840190828701845b82811015610e985781516001600160a01b031684529284019290840190600101610e73565b5050508381038285015284518082528583019183019060005b81811015610b6457835183529284019291840191600101610eb1565b602081526000610d156020830184610d72565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f0957610f09610fe3565b604052919050565b600067ffffffffffffffff821115610f2b57610f2b610fe3565b5060051b60200190565b60008219821115610f4857610f48610fb7565b500190565b600063ffffffff808316818516808303821115610e4d57610e4d610fb7565b60005b83811015610f87578181015183820152602001610f6f565b83811115610f96576000848401525b50505050565b6000600019821415610fb057610fb0610fb7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461100e57600080fd5b5056fea2646970667358221220f47c56541c16567bf6c5e5004f61d395aaa36361297227d7eda892f28d64c7a764736f6c63430008060033

Deployed Bytecode Sourcemap

68197:5645:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;547:38;;;;;;;;-1:-1:-1;;;;;5571:32:1;;;5553:51;;5541:2;5526:18;547:38:0;;;;;;;;68925:33;;;;;68826:36;;;;;72279:246;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;69008:20::-;;;;;-1:-1:-1;;;;;69008:20:0;;;69100:58;;;;;-1:-1:-1;;;;;69100:58:0;;;70557:1316;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;72279:246::-;72395:27;72424:24;72473:44;72498:18;72473:24;:44::i;:::-;72466:51;;;;72279:246;;;:::o;70557:1316::-;70738:12;70710:8;847:13;-1:-1:-1;;;;;836:24:0;:7;-1:-1:-1;;;;;836:24:0;;862:25;;;;;;;;;;;;;-1:-1:-1;;;862:25:0;;;828:60;;;;;-1:-1:-1;;;828:60:0;;;;;;;;:::i;:::-;;;;;;;;;;70769:27:::1;70798:24:::0;70826:68:::1;70865:18;70826:24;:68::i;:::-;70768:126;;;;70905:19;70927:47;70954:10;70966:7;70927:26;:47::i;:::-;70905:69;;70987:19;71023:10;:17;71043:1;71023:21;;;;:::i;:::-;71009:36;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;-1:-1:-1;71009:36:0::1;;70987:58;;71056:25;71097:10;:17;71117:1;71097:21;;;;:::i;:::-;71084:35;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;-1:-1:-1;71084:35:0::1;;71056:63;;71130:33;71178:10;:17;71198:1;71178:21;;;;:::i;:::-;71166:34;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;71229:25:0::1;::::0;71213:5;;71130:70;;-1:-1:-1;;;;;;71229:25:0::1;::::0;71213:2;;71229:25:::1;::::0;71213:5:::1;;;;:::i;:::-;;;;;;:42;-1:-1:-1::0;;;;;71213:42:0::1;;;-1:-1:-1::0;;;;;71213:42:0::1;;;::::0;::::1;71281:52;;;71266:9;71276:1;71266:12;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;;71266:67:0;;;::::1;:12;::::0;;::::1;::::0;;;;;;:67;71368:23:::1;::::0;;;;::::1;9057:25:1::0;;;9030:18;71368:23:0::1;;;;;;;;;;;;71344:18;71363:1;71344:21;;;;;;;;:::i;:::-;;;;;;:47;;;;71409:9;71404:375;71428:10;:17;71424:1;:21;71404:375;;;71487:7;71467:2:::0;71470:5:::1;:1:::0;71474::::1;71470:5;:::i;:::-;71467:9;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;71467:28:0;;::::1;:9;::::0;;::::1;::::0;;;;;;;:28;-1:-1:-1;;;71510:9:0;71520:5:::1;:1:::0;71524::::1;71520:5;:::i;:::-;71510:16;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;;71510:55:0;;::::1;:16;::::0;;::::1;::::0;;;;;;;:55;71637:5:::1;::::0;71661:13;;-1:-1:-1;;;;;71637:5:0;;::::1;::::0;71661:10;;71672:1;;71661:13;::::1;;;;;:::i;:::-;;;;;;;71693:7;71701:1;71693:10;;;;;;;;:::i;:::-;;;;;;;71608:159;;;;;;;;;-1:-1:-1::0;;;;;5939:15:1;;;5921:34;;5991:15;;;;5986:2;5971:18;;5964:43;6038:2;6023:18;;6016:34;;;;6086:3;6081:2;6066:18;;6059:31;;;6127:2;6106:19;;;6099:31;6167:30;5901:3;6146:19;;6139:59;6230:3;6215:19;;5873:367;71608:159:0::1;;::::0;;-1:-1:-1;;71608:159:0;;::::1;::::0;;;;;;71580:18;71599:5:::1;:1:::0;71603::::1;71599:5;:::i;:::-;71580:25;;;;;;;;:::i;:::-;;;;;;:187;;;;71447:3;;;;:::i;:::-;;;71404:375;;;;71798:67;71831:2;71835:9;71846:18;71798:32;:67::i;:::-;71791:74:::0;70557:1316;-1:-1:-1;;;;;;;;;;70557:1316:0:o;73322:256::-;73438:27;73467:24;73527:18;73516:54;;;;;;;;;;;;:::i;72613:701::-;72755:19;72819:11;:18;72800:8;:15;:37;72839:21;;;;;;;;;;;;;-1:-1:-1;;;72839:21:0;;;72792:69;;;;;-1:-1:-1;;;72792:69:0;;;;;;;;:::i;:::-;;72901:1;72880:11;:18;:22;72904:16;;;;;;;;;;;;;-1:-1:-1;;;72904:16:0;;;72872:49;;;;;-1:-1:-1;;;72872:49:0;;;;;;;;:::i;:::-;;72939:9;72934:322;72958:11;:18;72954:1;:22;72934:322;;;73020:1;73006:8;73015:1;73006:11;;;;;;;;:::i;:::-;;;;;;;:15;73023:17;;;;;;;;;;;;;-1:-1:-1;;;73023:17:0;;;72998:43;;;;;-1:-1:-1;;;72998:43:0;;;;;;;;:::i;:::-;-1:-1:-1;73082:25:0;;73127:14;;-1:-1:-1;;;;;73082:25:0;;;;:44;;73127:11;;73139:1;;73127:14;;;;;;:::i;:::-;;;;;;;73082:60;;;;;;;;;;;;;;-1:-1:-1;;;;;5571:32:1;;;;5553:51;;5541:2;5526:18;;5508:102;73082:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;73161:27;;;;;;;;;;;;;-1:-1:-1;;;73161:27:0;;;73056:147;;;;;-1:-1:-1;;;73056:147:0;;;;;;;;:::i;:::-;;73233:8;73242:1;73233:11;;;;;;;;:::i;:::-;;;;;;;73218:26;;;;;:::i;:::-;;-1:-1:-1;72978:3:0;;;:::i;:::-;;;72934:322;;;;73268:38;73294:11;73268:25;:38::i;:::-;72613:701;;;;:::o;3322:780::-;3489:23;3547:10;:17;3533:3;:10;:31;3525:59;;;;-1:-1:-1;;;3525:59:0;;8769:2:1;3525:59:0;;;8751:21:1;8808:2;8788:18;;;8781:30;-1:-1:-1;;;8827:18:1;;;8820:45;8882:18;;3525:59:0;8741:165:1;3525:59:0;3617:18;:25;3603:3;:10;:39;3595:67;;;;-1:-1:-1;;;3595:67:0;;8769:2:1;3595:67:0;;;8751:21:1;8808:2;8788:18;;;8781:30;-1:-1:-1;;;8827:18:1;;;8820:45;8882:18;;3595:67:0;8741:165:1;3595:67:0;3680:9;3675:363;3699:3;:10;3695:1;:14;3675:363;;;3775:10;3843:3;3847:1;3843:6;;;;;;;;:::i;:::-;;;;;;;3879:18;3898:1;3879:21;;;;;;;;:::i;:::-;;;;;;;:28;3911:1;3872:40;;;;:::i;:::-;3935:10;3946:1;3935:13;;;;;;;;:::i;:::-;;;;;;;3971:18;3990:1;3971:21;;;;;;;;:::i;:::-;;;;;;;3804:207;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;3804:207:0;;;;;;;;;;3744:282;;;3804:207;3744:282;;:::i;:::-;;;;;;;;;;;;;3731:295;;3711:3;;;;:::i;:::-;;;3675:363;;;;-1:-1:-1;;;4083:10:0;4061:33;;;;;;;;;:::i;:::-;;;;;;;;;;;;;4048:46;;3322:780;;;;;:::o;73586:253::-;73684:25;;;;;;;;;-1:-1:-1;;;;;73684:25:0;-1:-1:-1;;;;;73684:49:0;;73734:7;73743:9;-1:-1:-1;;;;;73743:24:0;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;73684:86;;-1:-1:-1;;;;;;73684:86:0;;;;;;;;;;9267:25:1;;;;9308:18;;;9301:34;9240:18;;73684:86:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;73785:35;;;;;;;;;;;;;;;;;73662:169;;;;;-1:-1:-1;;;73662:169:0;;;;;;;;:::i;:::-;;73586:253;:::o;14:670:1:-;79:5;132:3;125:4;117:6;113:17;109:27;99:2;;150:1;147;140:12;99:2;179:6;173:13;205:4;229:60;245:43;285:2;245:43;:::i;:::-;229:60;:::i;:::-;311:3;335:2;330:3;323:15;363:2;358:3;354:12;347:19;;398:2;390:6;386:15;450:3;445:2;439;436:1;432:10;424:6;420:23;416:32;413:41;410:2;;;467:1;464;457:12;410:2;489:1;499:156;513:2;510:1;507:9;499:156;;;570:10;;558:23;;601:12;;;;633;;;;531:1;524:9;499:156;;;-1:-1:-1;673:5:1;;89:595;-1:-1:-1;;;;;;;89:595:1:o;689:530::-;731:5;784:3;777:4;769:6;765:17;761:27;751:2;;802:1;799;792:12;751:2;838:6;825:20;864:18;860:2;857:26;854:2;;;886:18;;:::i;:::-;930:55;973:2;954:13;;-1:-1:-1;;950:27:1;979:4;946:38;930:55;:::i;:::-;1010:2;1001:7;994:19;1056:3;1049:4;1044:2;1036:6;1032:15;1028:26;1025:35;1022:2;;;1073:1;1070;1063:12;1022:2;1138;1131:4;1123:6;1119:17;1112:4;1103:7;1099:18;1086:55;1186:1;1161:16;;;1179:4;1157:27;1150:38;;;;1165:7;741:478;-1:-1:-1;;;741:478:1:o;1224:455::-;1301:6;1309;1362:2;1350:9;1341:7;1337:23;1333:32;1330:2;;;1378:1;1375;1368:12;1330:2;1417:9;1404:23;1436:31;1461:5;1436:31;:::i;:::-;1486:5;-1:-1:-1;1542:2:1;1527:18;;1514:32;1569:18;1558:30;;1555:2;;;1601:1;1598;1591:12;1555:2;1624:49;1665:7;1656:6;1645:9;1641:22;1624:49;:::i;:::-;1614:59;;;1320:359;;;;;:::o;1684:1220::-;1813:6;1821;1874:2;1862:9;1853:7;1849:23;1845:32;1842:2;;;1890:1;1887;1880:12;1842:2;1923:9;1917:16;1952:18;1993:2;1985:6;1982:14;1979:2;;;2009:1;2006;1999:12;1979:2;2047:6;2036:9;2032:22;2022:32;;2092:7;2085:4;2081:2;2077:13;2073:27;2063:2;;2114:1;2111;2104:12;2063:2;2143;2137:9;2165:4;2189:60;2205:43;2245:2;2205:43;:::i;2189:60::-;2271:3;2295:2;2290:3;2283:15;2323:2;2318:3;2314:12;2307:19;;2354:2;2350;2346:11;2402:7;2397:2;2391;2388:1;2384:10;2380:2;2376:19;2372:28;2369:41;2366:2;;;2423:1;2420;2413:12;2366:2;2445:1;2436:10;;2455:231;2469:2;2466:1;2463:9;2455:231;;;2533:3;2527:10;2550:31;2575:5;2550:31;:::i;:::-;2594:18;;2487:1;2480:9;;;;;2632:12;;;;2664;;2455:231;;;-1:-1:-1;2741:18:1;;;2735:25;2705:5;;-1:-1:-1;2735:25:1;;-1:-1:-1;;;2772:16:1;;;2769:2;;;2801:1;2798;2791:12;2769:2;;2824:74;2890:7;2879:8;2868:9;2864:24;2824:74;:::i;2909:277::-;2976:6;3029:2;3017:9;3008:7;3004:23;3000:32;2997:2;;;3045:1;3042;3035:12;2997:2;3077:9;3071:16;3130:5;3123:13;3116:21;3109:5;3106:32;3096:2;;3152:1;3149;3142:12;3096:2;3175:5;2987:199;-1:-1:-1;;;2987:199:1:o;3191:320::-;3259:6;3312:2;3300:9;3291:7;3287:23;3283:32;3280:2;;;3328:1;3325;3318:12;3280:2;3368:9;3355:23;3401:18;3393:6;3390:30;3387:2;;;3433:1;3430;3423:12;3387:2;3456:49;3497:7;3488:6;3477:9;3473:22;3456:49;:::i;:::-;3446:59;3270:241;-1:-1:-1;;;;3270:241:1:o;3516:184::-;3586:6;3639:2;3627:9;3618:7;3614:23;3610:32;3607:2;;;3655:1;3652;3645:12;3607:2;-1:-1:-1;3678:16:1;;3597:103;-1:-1:-1;3597:103:1:o;3705:257::-;3746:3;3784:5;3778:12;3811:6;3806:3;3799:19;3827:63;3883:6;3876:4;3871:3;3867:14;3860:4;3853:5;3849:16;3827:63;:::i;:::-;3944:2;3923:15;-1:-1:-1;;3919:29:1;3910:39;;;;3951:4;3906:50;;3754:208;-1:-1:-1;;3754:208:1:o;3967:588::-;-1:-1:-1;;4214:2:1;4210:15;;;4206:53;4194:66;;-1:-1:-1;;;;;;4283:3:1;4333:16;;;4329:25;;4324:2;4315:12;;4308:47;4385:15;;4380:2;4371:12;;4364:37;4424:13;;-1:-1:-1;;4446:62:1;4424:13;4496:2;4487:12;;4480:4;4468:17;;4446:62;:::i;:::-;4528:16;;;;4546:2;4524:25;;4184:371;-1:-1:-1;;;;;4184:371:1:o;4560:::-;-1:-1:-1;;;;;;4745:33:1;;4733:46;;4802:13;;4715:3;;4824:61;4802:13;4874:1;4865:11;;4858:4;4846:17;;4824:61;:::i;:::-;4905:16;;;;4923:1;4901:24;;4723:208;-1:-1:-1;;;4723:208:1:o;4936:466::-;5111:3;5149:6;5143:13;5165:53;5211:6;5206:3;5199:4;5191:6;5187:17;5165:53;:::i;:::-;5281:13;;5240:16;;;;5303:57;5281:13;5240:16;5337:4;5325:17;;5303:57;:::i;:::-;5376:20;;5119:283;-1:-1:-1;;;;5119:283:1:o;6245:1178::-;6513:2;6525:21;;;6595:13;;6498:18;;;6617:22;;;6465:4;;6692;;6670:2;6655:18;;;6719:15;;;6465:4;6762:195;6776:6;6773:1;6770:13;6762:195;;;6841:13;;-1:-1:-1;;;;;6837:39:1;6825:52;;6897:12;;;;6932:15;;;;6873:1;6791:9;6762:195;;;-1:-1:-1;;;6993:19:1;;;6973:18;;;6966:47;7063:13;;7085:21;;;7161:15;;;;7124:12;;;7196:1;7206:189;7222:8;7217:3;7214:17;7206:189;;;7291:15;;7277:30;;7368:17;;;;7329:14;;;;7250:1;7241:11;7206:189;;7428:217;7575:2;7564:9;7557:21;7538:4;7595:44;7635:2;7624:9;7620:18;7612:6;7595:44;:::i;9346:275::-;9417:2;9411:9;9482:2;9463:13;;-1:-1:-1;;9459:27:1;9447:40;;9517:18;9502:34;;9538:22;;;9499:62;9496:2;;;9564:18;;:::i;:::-;9600:2;9593:22;9391:230;;-1:-1:-1;9391:230:1:o;9626:183::-;9686:4;9719:18;9711:6;9708:30;9705:2;;;9741:18;;:::i;:::-;-1:-1:-1;9786:1:1;9782:14;9798:4;9778:25;;9695:114::o;9814:128::-;9854:3;9885:1;9881:6;9878:1;9875:13;9872:2;;;9891:18;;:::i;:::-;-1:-1:-1;9927:9:1;;9862:80::o;9947:228::-;9986:3;10014:10;10051:2;10048:1;10044:10;10081:2;10078:1;10074:10;10112:3;10108:2;10104:12;10099:3;10096:21;10093:2;;;10120:18;;:::i;10180:258::-;10252:1;10262:113;10276:6;10273:1;10270:13;10262:113;;;10352:11;;;10346:18;10333:11;;;10326:39;10298:2;10291:10;10262:113;;;10393:6;10390:1;10387:13;10384:2;;;10428:1;10419:6;10414:3;10410:16;10403:27;10384:2;;10233:205;;;:::o;10443:135::-;10482:3;-1:-1:-1;;10503:17:1;;10500:2;;;10523:18;;:::i;:::-;-1:-1:-1;10570:1:1;10559:13;;10490:88::o;10583:127::-;10644:10;10639:3;10635:20;10632:1;10625:31;10675:4;10672:1;10665:15;10699:4;10696:1;10689:15;10715:127;10776:10;10771:3;10767:20;10764:1;10757:31;10807:4;10804:1;10797:15;10831:4;10828:1;10821:15;10847:127;10908:10;10903:3;10899:20;10896:1;10889:31;10939:4;10936:1;10929:15;10963:4;10960:1;10953:15;10979:131;-1:-1:-1;;;;;11054:31:1;;11044:42;;11034:2;;11100:1;11097;11090:12;11034:2;11024:86;:::o

Swarm Source

ipfs://f47c56541c16567bf6c5e5004f61d395aaa36361297227d7eda892f28d64c7a7

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.