ETH Price: $3,303.35 (-0.20%)

Contract

0x00b6e95a520112c288d1899C3D46b5F282e4bb89
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VotingPowerV1

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 8 : VotingPowerV1.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// @title Voting Power for the Meta Pool mpDAO token.

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IVotingPower} from "./interfaces/IVotingPower.sol";
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

struct UnlockingPosition {
    uint256 releaseDate;
    uint256 amount;
}

struct LockedPosition {
    uint256 lockedDays;
    uint256 amount;
}

struct User {
    address user;
    uint256 mpDaoBalance;
    uint256 votingPower;
    LockedPosition[] lps;
    UnlockingPosition[] ulps;
}

library UnlockingLib {
    /// @notice Method to return the amount of seconds to release the amount in the `unlocking` position.
    /// If amount `0` is returned, then the amount is ready to be withdraw.
    function getSecs2Release(UnlockingPosition memory self) internal view returns (uint256 _secs) {
        if (isUnlocking(self)) _secs = self.releaseDate - block.timestamp;
    }

    function isUnlocking(UnlockingPosition memory self) internal view returns (bool) {
        return block.timestamp < self.releaseDate;
    }
}

contract VotingPowerV1 is Initializable, IVotingPower {
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.UintSet;
    using SafeERC20 for IERC20;
    using UnlockingLib for UnlockingPosition;

    uint256 public totalVotingPower;
    uint256 public totalMpDAO;

    // Inclusive range [30, 300]
    uint256 private constant MIN_LOCKING_DAYS = 30;
    uint256 private constant MAX_LOCKING_DAYS = 300;
    uint256 private constant MAX_LOCKED_POSITIONS = 10;

    EnumerableSet.AddressSet private users;
    // lockedPositionDays: we use UintSet to keep it unique, there can be only one 30 day-unbond locking position
    mapping(address => EnumerableSet.UintSet) private lockedPositionDays;
    // lockedPositionMpDAO: address => days => amount
    mapping(address => mapping(uint256 => uint256)) private lockedPositionMpDAO;
    mapping(address => uint256) private votingPower;
    // UnlockingPosition: address => postion, it is an array because you can have more than one with the same release date and/or amount
    mapping(address => UnlockingPosition[]) private unlockingPositions;

    // mpDAO address is set one-time only at initialize [immutable].
    IERC20 public mpDAO;

    modifier checkDays(uint256 _days) {
        if (_days < MIN_LOCKING_DAYS || _days > MAX_LOCKING_DAYS) {
            revert OutOfValidLockingPeriod(_days);
        }
        _;
    }

    function initialize(IERC20 _mpDAO) public initializer {
        mpDAO = _mpDAO;
    }

    // ******************
    // * View functions *
    // ******************

    /// @dev Get a list of all the account locked positions.
    function getLockedPositions(address _account) public view returns (LockedPosition[] memory _results) {
        uint256[] memory lockedDays = lockedPositionDays[_account].values();
        uint256 len = lockedDays.length;
        _results = new LockedPosition[](len);
        if (len == 0) return _results;
        for (uint i; i < len; ++i) {
            _results[i] = LockedPosition(
                lockedDays[i], // Locked days
                lockedPositionMpDAO[_account][lockedDays[i]] // mpDAO token amount
            );
        }
    }

    function getUnlockingPositions(address _account) external view returns (UnlockingPosition[] memory) {
        return unlockingPositions[_account];
    }

    /// @dev Method for the Meta Pool bot 🤖
    function getUsers(
        uint256 _from,
        uint256 _limit
    ) external view returns (User[] memory) {
        uint256 len = users.length();
        if (len == 0) return new User[](0);
        if (_from >= len) revert IndexOutOfBounds();
        uint256 upperLimit = _min(len, _from + _limit);
        // Adjust the size of _results to match the slice being returned
        User[] memory _results = new User[](upperLimit - _from);
        address user;
        for (uint i = _from; i < upperLimit; ++i) {
            user = users.at(i);
            // Adjust the index for _results
            _results[i - _from] = User(
                user,
                getLockedAmount(user),
                votingPower[user],
                getLockedPositions(user),
                unlockingPositions[user]
            );
        }
        return _results;
    }

    function getUser(address _account) external view returns (User memory) {
        return User(
            _account,
            getLockedAmount(_account),
            votingPower[_account],
            getLockedPositions(_account),
            unlockingPositions[_account]
        );
    }

    function getVotingPower(address _account) external view returns (uint256) {
        return votingPower[_account];
    }

    /// @dev The maximum value of `len`, and iterations, is given by MAX_LOCKED_POSITIONS.
    function getLockedAmount(address _account) public view returns (uint256 _amount) {
        uint len = lockedPositionDays[_account].length();
        for (uint i; i < len; ++i) {
            _amount += lockedPositionMpDAO[_account][lockedPositionDays[_account].at(i)];
        }
    }

    function getLockedAmountAt(address _account, uint256 _days) external view returns (uint256) {
        return lockedPositionMpDAO[_account][_days];
    }

    function getUnlockAmount(address _account) external view returns (uint256 _unlocking, uint256 _unlocked) {
        uint len = unlockingPositions[_account].length;
        UnlockingPosition memory _position;
        for (uint i; i < len; ++i) {
            _position = unlockingPositions[_account][i];
            if (_position.releaseDate > block.timestamp) {
                _unlocking += _position.amount;
            } else {
                _unlocked += _position.amount;
            }
        }
    }

    function previewVotingPower(uint256 _days, uint256 _amount) external pure returns (uint256) {
        return _calculateVotingPower(_days, _amount);
    }

    // ******************
    // * mpDAO deposits *
    // ******************

    /// @notice Call this function to create, or fund, a Locked Position and get Voting Power.
    function createLockedPosition(uint256 _days, uint256 _amount) external returns (uint256) {
        if (_amount == 0) revert InvalidZeroAmount();
        mpDAO.safeTransferFrom(msg.sender, address(this), _amount);
        totalMpDAO += _amount;
        users.add(msg.sender);

        emit Deposit(msg.sender, _days, _amount);
        return _createLockedPosition(msg.sender, _days, _amount);
    }

    // *******************
    // * Start Unlocking *
    // *******************

    function unlockPosition(uint256 _days) public {
        bool success = lockedPositionDays[msg.sender].remove(_days);
        if (!success) revert LockedPositionDaysNotFound(_days);

        uint256 amount = lockedPositionMpDAO[msg.sender][_days];
        lockedPositionMpDAO[msg.sender][_days] = 0;
        totalMpDAO -= amount;

        _decreaseVotingPower(msg.sender, _days, amount);
        _createUnlockingPosition(msg.sender, block.timestamp + _day2sec(_days), amount);
        emit Unlock(msg.sender, _days, amount);
    }

    function unlockPartialPosition(uint256 _days, uint256 _amount) external {
        bool success = lockedPositionDays[msg.sender].contains(_days);
        if (!success) revert LockedPositionDaysNotFound(_days);
        if (_amount == 0) revert InvalidZeroAmount();
        uint256 _availableAmount = lockedPositionMpDAO[msg.sender][_days];

        if (_availableAmount == _amount) { return unlockPosition(_days); }
        if (_amount > _availableAmount) revert NotEnoughAvailableAmount(_availableAmount, _amount);
        lockedPositionMpDAO[msg.sender][_days] -= _amount;

        uint256 _vp = _calculateVotingPower(_days, _amount);
        totalVotingPower -= _vp;
        votingPower[msg.sender] -= _vp;
        totalMpDAO -= _amount;

        _createUnlockingPosition(msg.sender, block.timestamp + _day2sec(_days), _amount);
        emit Unlock(msg.sender, _days, _amount);
    }

    // **********
    // * Extend *
    // **********

    function extendLockingPositionDays(uint256 _fromDays, uint256 _toDays) external {
        if (_toDays < _fromDays) revert InvalidExtension(_fromDays, _toDays);
        bool success = lockedPositionDays[msg.sender].remove(_fromDays);
        if (!success) revert LockedPositionDaysNotFound(_fromDays);

        uint256 amount = lockedPositionMpDAO[msg.sender][_fromDays];
        lockedPositionMpDAO[msg.sender][_fromDays] = 0;

        _decreaseVotingPower(msg.sender, _fromDays, amount);
        _createLockedPosition(msg.sender, _toDays, amount);
        emit ExtendPositionDays(msg.sender, _fromDays, _toDays);
    }

    // **********
    // * Relock *
    // **********

    function relockPosition(uint256 _index, uint256 _days) public {
        UnlockingPosition memory _removedPosition = _removeNthPosition(msg.sender, _index);
        if (_day2sec(_days) < _removedPosition.getSecs2Release()) revert InvalidLockedDays(_days);
        totalMpDAO += _removedPosition.amount;
        users.add(msg.sender);

        _createLockedPosition(msg.sender, _days, _removedPosition.amount);
        emit Relock(msg.sender, _days, _removedPosition.amount);
    }

    function relockPartialPosition(uint256 _index, uint256 _days, uint256 _amount) external {
        UnlockingPosition memory _removedPosition = _removeNthPosition(msg.sender, _index);
        if (_day2sec(_days) < _removedPosition.getSecs2Release()) revert InvalidLockedDays(_days);
        if (_removedPosition.amount == _amount) return relockPosition(_index, _days);
        if (_removedPosition.amount < _amount) revert InvalidLockedAmount();
        totalMpDAO += _amount;
        users.add(msg.sender);

        _createLockedPosition(msg.sender, _days, _amount);
        _createUnlockingPosition(
            msg.sender,
            _removedPosition.releaseDate,
            _removedPosition.amount - _amount
        );
        emit Relock(msg.sender, _days, _amount);
    }

    // ************
    // * Withdraw *
    // ************

    function withdraw(uint256 _index) external {
        uint256 len = unlockingPositions[msg.sender].length;
        if (len <= _index) revert IndexOutOfBounds();

        UnlockingPosition memory position = unlockingPositions[msg.sender][_index];
        if (position.isUnlocking()) revert ImmatureUnlockingPosition();
        _removeNthPosition(msg.sender, _index);
        len -= 1;

        _withdraw(msg.sender, position.amount, len);
    }

    function withdrawAll() external returns (uint256 _toSend) {
        uint256 len = unlockingPositions[msg.sender].length;
        if (len == 0) revert EmptyUnlockingPositions();

        UnlockingPosition memory position;
        // Iterate over the indices in reverse order using a while loop
        uint i = len;
        while (i > 0) {
            i--; // Decrement i first to convert length to 0-based index
            position = unlockingPositions[msg.sender][i];
            if (!position.isUnlocking()) {
                _toSend += position.amount;
                _removeNthPosition(msg.sender, i);
                len -= 1;
            }
            // No need to decrement i here as it's already done at the beginning of the loop
        }

        if (_toSend == 0) revert InvalidZeroAmount();
        _withdraw(msg.sender, _toSend, len);
    }

    // ***********
    // * Private *
    // ***********

    /// @param _positionLen The amount of remaining locking positions for the user.
    function _withdraw(address _receiver, uint256 _amount, uint256 _positionLen) private {
        // if this was the last locking position the user had
        // and the user has no voting power (no locks)
        // then remove the user
        if (_positionLen == 0 && votingPower[_receiver] == 0) {
            users.remove(_receiver);
        }

        mpDAO.safeTransfer(_receiver, _amount);
        emit Withdraw(_receiver, _amount);
    }

    /// @dev First add() the days to the lockedPosition set, and then check the lenght.
    function _createLockedPosition(
        address _receiver,
        uint256 _days,
        uint256 _amount
    ) private checkDays(_days) returns (uint256 _vp) {
        lockedPositionDays[_receiver].add(_days);
        if (lockedPositionDays[_receiver].length() > MAX_LOCKED_POSITIONS) revert ExceededLockedPositions();
        lockedPositionMpDAO[_receiver][_days] += _amount;
        _vp = _calculateVotingPower(_days, _amount);
        votingPower[_receiver] += _vp;
        totalVotingPower += _vp;
    }

    function _decreaseVotingPower(address _receiver, uint256 _days, uint256 _amount) private {
        uint256 _vp = _calculateVotingPower(_days, _amount);
        totalVotingPower -= _vp;
        votingPower[_receiver] -= _vp;
    }

    function _removeNthPosition(address _receiver, uint256 _index) private returns (UnlockingPosition memory _pos) {
        uint256 len = unlockingPositions[_receiver].length;
        if (_index >= len) revert IndexOutOfBounds();

        _pos = unlockingPositions[_receiver][_index];
        // If the array has only one element or we are removing the last element, just pop
        if (len == 1 || _index == len - 1) {
            unlockingPositions[_receiver].pop();
        } else {
            // Replace the nth element with the last element
            unlockingPositions[_receiver][_index] = unlockingPositions[_receiver][len - 1];
            // Remove the last element
            unlockingPositions[_receiver].pop();
        }
    }

    function _createUnlockingPosition(address _receiver, uint256 _releaseDate, uint256 _amount) private {
        unlockingPositions[_receiver].push(UnlockingPosition(_releaseDate, _amount));
    }

    /// @notice Voting power is given by f(x) = Amount * unbondDays / 60
    /// multiplier is 0.5x for 30d, 1x for 60d, 3x for 120d... and 5x for 300d
    function _calculateVotingPower(uint256 _unbondDays, uint256 _amount) private pure returns (uint256) {
        return _amount * _unbondDays / 60;
    }

    /// Convert days into seconds.
    function _day2sec(uint256 _days) private pure returns (uint256) {
        return _days * 1 days;
    }

    /// @dev get the min value of two integers.
    function _min(uint256 _a, uint256 _b) private pure returns (uint256) {
        if (_a > _b) { return _b; } else { return _a; }
    }
}

File 2 of 8 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

File 3 of 8 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 4 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 5 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 6 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

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

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

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

File 7 of 8 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

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

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

File 8 of 8 : IVotingPower.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IVotingPower {

    error EmptyUnlockingPositions();
    error ExceededLockedPositions();
    error ImmatureUnlockingPosition();
    error IndexOutOfBounds();
    error InvalidExtension(uint256 _fromDays, uint256 _toDays);
    error InvalidLockedAmount();
    error InvalidLockedDays(uint256 _days);
    error InvalidZeroAmount();
    error LockedPositionDaysNotFound(uint256 _days);
    error NotEnoughAvailableAmount(uint256 _available, uint256 _requested);
    error OutOfValidLockingPeriod(uint256 _days);

    event Deposit(address indexed _account, uint256 _days, uint256 _amount);
    event ExtendPositionDays(address indexed _account, uint256 _fromDays, uint256 _toDays);
    event Relock(address indexed _account, uint256 _days, uint256 _amount);
    event Unlock(address indexed _account, uint256 _days, uint256 _amount);
    event Withdraw(address indexed _account, uint256 _amount);

    function createLockedPosition(uint256 _days, uint256 _amount) external returns (uint256);
    function extendLockingPositionDays(uint256 _fromDays, uint256 _toDays) external;
    function relockPosition(uint256 _index, uint256 _days) external;
    function unlockPartialPosition(uint256 _days, uint256 _amount) external;
    function unlockPosition(uint256 _days) external;
    function withdraw(uint256 _index) external;
    function withdrawAll() external returns (uint256 _toSend);
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"EmptyUnlockingPositions","type":"error"},{"inputs":[],"name":"ExceededLockedPositions","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"ImmatureUnlockingPosition","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[{"internalType":"uint256","name":"_fromDays","type":"uint256"},{"internalType":"uint256","name":"_toDays","type":"uint256"}],"name":"InvalidExtension","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLockedAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"InvalidLockedDays","type":"error"},{"inputs":[],"name":"InvalidZeroAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"LockedPositionDaysNotFound","type":"error"},{"inputs":[{"internalType":"uint256","name":"_available","type":"uint256"},{"internalType":"uint256","name":"_requested","type":"uint256"}],"name":"NotEnoughAvailableAmount","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"OutOfValidLockingPeriod","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_days","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_fromDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toDays","type":"uint256"}],"name":"ExtendPositionDays","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_days","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Relock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_days","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Unlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createLockedPosition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromDays","type":"uint256"},{"internalType":"uint256","name":"_toDays","type":"uint256"}],"name":"extendLockingPositionDays","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getLockedAmount","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"getLockedAmountAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getLockedPositions","outputs":[{"components":[{"internalType":"uint256","name":"lockedDays","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct LockedPosition[]","name":"_results","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getUnlockAmount","outputs":[{"internalType":"uint256","name":"_unlocking","type":"uint256"},{"internalType":"uint256","name":"_unlocked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getUnlockingPositions","outputs":[{"components":[{"internalType":"uint256","name":"releaseDate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct UnlockingPosition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getUser","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"mpDaoBalance","type":"uint256"},{"internalType":"uint256","name":"votingPower","type":"uint256"},{"components":[{"internalType":"uint256","name":"lockedDays","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct LockedPosition[]","name":"lps","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"releaseDate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct UnlockingPosition[]","name":"ulps","type":"tuple[]"}],"internalType":"struct User","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getUsers","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"mpDaoBalance","type":"uint256"},{"internalType":"uint256","name":"votingPower","type":"uint256"},{"components":[{"internalType":"uint256","name":"lockedDays","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct LockedPosition[]","name":"lps","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"releaseDate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct UnlockingPosition[]","name":"ulps","type":"tuple[]"}],"internalType":"struct User[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_mpDAO","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mpDAO","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"previewVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_days","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"relockPartialPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"relockPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalMpDAO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unlockPartialPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"unlockPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[{"internalType":"uint256","name":"_toSend","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061381e806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80636b0e7371116100b8578063bb4d44361161007c578063bb4d443614610375578063c195d779146103a5578063c4d66de8146103c1578063c586b27d146103dd578063cf56974a1461040d578063dea075e81461043d57610137565b80636b0e7371146102a95780636f77926b146102d9578063853828b614610309578063929ec53714610327578063a55ff3fc1461035757610137565b80633033bed8116100ff5780633033bed8146101f05780633958dfab1461022157806345982a661461023f578063671b37931461026f578063687cb3531461028d57610137565b806302fa7d0a1461013c57806324f9d39a1461016c57806325b599b81461019c5780632a50ac4d146101b85780632e1a7d4d146101d4575b600080fd5b61015660048036038101906101519190612cb7565b610459565b6040516101639190612d06565b60405180910390f35b61018660048036038101906101819190612d21565b6104b4565b6040516101939190612d06565b60405180910390f35b6101b660048036038101906101b19190612d21565b6104c8565b005b6101d260048036038101906101cd9190612d61565b6106be565b005b6101ee60048036038101906101e99190612db4565b610829565b005b61020a60048036038101906102059190612de1565b610999565b604051610218929190612e0e565b60405180910390f35b610229610abf565b6040516102369190612e96565b60405180910390f35b61025960048036038101906102549190612d21565b610ae5565b60405161026691906131ca565b60405180910390f35b610277610dab565b6040516102849190612d06565b60405180910390f35b6102a760048036038101906102a29190612db4565b610db1565b005b6102c360048036038101906102be9190612de1565b610f8a565b6040516102d0919061325b565b60405180910390f35b6102f360048036038101906102ee9190612de1565b611118565b60405161030091906132fa565b60405180910390f35b61031161125b565b60405161031e9190612d06565b60405180910390f35b610341600480360381019061033c9190612de1565b61140c565b60405161034e9190612d06565b60405180910390f35b61035f611523565b60405161036c9190612d06565b60405180910390f35b61038f600480360381019061038a9190612de1565b611529565b60405161039c9190612d06565b60405180910390f35b6103bf60048036038101906103ba9190612d21565b611572565b005b6103db60048036038101906103d6919061335a565b611670565b005b6103f760048036038101906103f29190612de1565b611837565b60405161040491906133f6565b60405180910390f35b61042760048036038101906104229190612d21565b6118e9565b6040516104349190612d06565b60405180910390f35b61045760048036038101906104529190612d21565b611a04565b005b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b60006104c08383611cfa565b905092915050565b8181101561050f5781816040517fa39d5628000000000000000000000000000000000000000000000000000000008152600401610506929190612e0e565b60405180910390fd5b600061056283600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d1c90919063ffffffff16565b9050806105a657826040517fc71ff29100000000000000000000000000000000000000000000000000000000815260040161059d9190612d06565b60405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000205490506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000208190555061065c338583611d36565b610667338483611db8565b503373ffffffffffffffffffffffffffffffffffffffff167f7f1bcac4c8e459439c54b457224e6fd22a847afe9c1ef086d7c8af353ffec08185856040516106b0929190612e0e565b60405180910390a250505050565b60006106ca3385611fc9565b90506106d5816122ce565b6106de846122f6565b101561072157826040517fed699ef50000000000000000000000000000000000000000000000000000000081526004016107189190612d06565b60405180910390fd5b8181602001510361073c576107368484611572565b50610824565b818160200151101561077a576040517fda96344a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600082825461078c9190613447565b925050819055506107a733600261230e90919063ffffffff16565b506107b3338484611db8565b506107d23382600001518484602001516107cd919061347b565b61233e565b3373ffffffffffffffffffffffffffffffffffffffff167f732bb053e7a01aa5bdddd99623a4babbb36177debb85cff06592a420c4270a7d848460405161081a929190612e0e565b60405180910390a2505b505050565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090508181116108a9576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106108fc576108fb6134af565b5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050610934816123d6565b1561096b576040517f33d6c18e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109753384611fc9565b50600182610983919061347b565b9150610994338260200151846123e6565b505050565b6000806000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090506109eb612ba5565b60005b82811015610ab757600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110610a4757610a466134af565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505091504282600001511115610a9957816020015185610a929190613447565b9450610aac565b816020015184610aa99190613447565b93505b8060010190506109ee565b505050915091565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606000610af360026124f0565b905060008103610b5a57600067ffffffffffffffff811115610b1857610b176134de565b5b604051908082528060200260200182016040528015610b5157816020015b610b3e612bbf565b815260200190600190039081610b365790505b50915050610da5565b808410610b93576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610baa828587610ba59190613447565b612505565b905060008582610bba919061347b565b67ffffffffffffffff811115610bd357610bd26134de565b5b604051908082528060200260200182016040528015610c0c57816020015b610bf9612bbf565b815260200190600190039081610bf15790505b5090506000808790505b83811015610d9c57610c3281600261252190919063ffffffff16565b91506040518060a001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001610c648461140c565b8152602001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001610cb784610f8a565b8152602001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610d6157838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610d1b565b50505050815250838983610d75919061347b565b81518110610d8657610d856134af565b5b6020026020010181905250806001019050610c16565b50819450505050505b92915050565b60005481565b6000610e0482600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d1c90919063ffffffff16565b905080610e4857816040517fc71ff291000000000000000000000000000000000000000000000000000000008152600401610e3f9190612d06565b60405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205490506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020819055508060016000828254610f05919061347b565b92505081905550610f17338483611d36565b610f3533610f24856122f6565b42610f2f9190613447565b8361233e565b3373ffffffffffffffffffffffffffffffffffffffff167ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c20048483604051610f7d929190612e0e565b60405180910390a2505050565b60606000610fd5600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061253b565b90506000815190508067ffffffffffffffff811115610ff757610ff66134de565b5b60405190808252806020026020018201604052801561103057816020015b61101d612c04565b8152602001906001900390816110155790505b50925060008103611042575050611113565b60005b8181101561110f57604051806040016040528084838151811061106b5761106a6134af565b5b60200260200101518152602001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008685815181106110cc576110cb6134af565b5b60200260200101518152602001908152602001600020548152508482815181106110f9576110f86134af565b5b6020026020010181905250806001019050611045565b5050505b919050565b611120612bbf565b6040518060a001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020016111508461140c565b8152602001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020016111a384610f8a565b8152602001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561124d57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611207565b505050508152509050919050565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050600081036112dd576040517f19cc381700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112e5612ba5565b60008290505b60008111156113c15780806112ff9061350d565b915050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110611353576113526134af565b5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050915061138b826123d6565b6113bc5781602001518461139f9190613447565b93506113ab3382611fc9565b506001836113b9919061347b565b92505b6112eb565b600084036113fb576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114063385856123e6565b50505090565b600080611456600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061255c565b905060005b8181101561151c57600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006114f583600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061257190919063ffffffff16565b8152602001908152602001600020548361150f9190613447565b925080600101905061145b565b5050919050565b60015481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061157e3384611fc9565b9050611589816122ce565b611592836122f6565b10156115d557816040517fed699ef50000000000000000000000000000000000000000000000000000000081526004016115cc9190612d06565b60405180910390fd5b8060200151600160008282546115eb9190613447565b9250508190555061160633600261230e90919063ffffffff16565b5061161633838360200151611db8565b503373ffffffffffffffffffffffffffffffffffffffff167f732bb053e7a01aa5bdddd99623a4babbb36177debb85cff06592a420c4270a7d838360200151604051611663929190612e0e565b60405180910390a2505050565b600061167a61258b565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff161480156116c85750825b9050600060018367ffffffffffffffff161480156116fd575060003073ffffffffffffffffffffffffffffffffffffffff163b145b90508115801561170b575080155b15611742576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156117925760018560000160086101000a81548160ff0219169083151502179055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550831561182f5760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516118269190613585565b60405180910390a15b505050505050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156118de57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611898565b505050509050919050565b6000808203611924576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611973333084600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b3909392919063ffffffff16565b81600160008282546119859190613447565b925050819055506119a033600261230e90919063ffffffff16565b503373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1584846040516119e9929190612e0e565b60405180910390a26119fc338484611db8565b905092915050565b6000611a5783600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061263590919063ffffffff16565b905080611a9b57826040517fc71ff291000000000000000000000000000000000000000000000000000000008152600401611a929190612d06565b60405180910390fd5b60008203611ad5576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020549050828103611b4157611b3a84610db1565b5050611cf6565b80831115611b885780836040517f6361acfc000000000000000000000000000000000000000000000000000000008152600401611b7f929190612e0e565b60405180910390fd5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000828254611be8919061347b565b925050819055506000611bfb8585611cfa565b905080600080828254611c0e919061347b565b9250508190555080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611c64919061347b565b925050819055508360016000828254611c7d919061347b565b92505081905550611ca233611c91876122f6565b42611c9c9190613447565b8661233e565b3373ffffffffffffffffffffffffffffffffffffffff167ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c20048686604051611cea929190612e0e565b60405180910390a25050505b5050565b6000603c8383611d0a91906135a0565b611d149190613611565b905092915050565b6000611d2e836000018360001b61264f565b905092915050565b6000611d428383611cfa565b905080600080828254611d55919061347b565b9250508190555080600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611dab919061347b565b9250508190555050505050565b600082601e811080611dcb575061012c81115b15611e0d57806040517fc3a13fb6000000000000000000000000000000000000000000000000000000008152600401611e049190612d06565b60405180910390fd5b611e5e84600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061276390919063ffffffff16565b50600a611ea8600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061255c565b1115611ee0576040517f1f3fc77b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000828254611f409190613447565b92505081905550611f518484611cfa565b915081600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fa29190613447565b9250508190555081600080828254611fba9190613447565b92505081905550509392505050565b611fd1612ba5565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050808310612051576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106120a2576120a16134af565b5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050915060018114806120eb57506001816120e8919061347b565b83145b1561216d57600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061213f5761213e613642565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090556122c7565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001826121b9919061347b565b815481106121ca576121c96134af565b5b9060005260206000209060020201600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110612229576122286134af565b5b90600052602060002090600202016000820154816000015560018201548160010155905050600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061229d5761229c613642565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090555b5092915050565b60006122d9826123d6565b156122f1574282600001516122ee919061347b565b90505b919050565b6000620151808261230791906135a0565b9050919050565b6000612336836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61277d565b905092915050565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040528084815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000155602082015181600101555050505050565b6000816000015142109050919050565b60008114801561243557506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156124505761244e8360026127ed90919063ffffffff16565b505b61249d8383600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661281d9092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516124e39190612d06565b60405180910390a2505050565b60006124fe8260000161289c565b9050919050565b6000818311156125175781905061251b565b8290505b92915050565b600061253083600001836128ad565b60001c905092915050565b6060600061254b836000016128d8565b905060608190508092505050919050565b600061256a8260000161289c565b9050919050565b600061258083600001836128ad565b60001c905092915050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b61262f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016125e893929190613680565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612934565b50505050565b6000612647836000018360001b6129cb565b905092915050565b60008083600101600084815260200190815260200160002054905060008114612757576000600182612681919061347b565b9050600060018660000180549050612699919061347b565b90508082146127085760008660000182815481106126ba576126b96134af565b5b90600052602060002001549050808760000184815481106126de576126dd6134af565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061271c5761271b613642565b5b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061275d565b60009150505b92915050565b6000612775836000018360001b61277d565b905092915050565b600061278983836129cb565b6127e25782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506127e7565b600090505b92915050565b6000612815836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61264f565b905092915050565b612897838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016128509291906136b7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612934565b505050565b600081600001805490509050919050565b60008260000182815481106128c5576128c46134af565b5b9060005260206000200154905092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561292857602002820191906000526020600020905b815481526020019060010190808311612914575b50505050509050919050565b600061295f828473ffffffffffffffffffffffffffffffffffffffff166129ee90919063ffffffff16565b905060008151141580156129845750808060200190518101906129829190613718565b155b156129c657826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016129bd9190613745565b60405180910390fd5b505050565b600080836001016000848152602001908152602001600020541415905092915050565b60606129fc83836000612a04565b905092915050565b606081471015612a4b57306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401612a429190613745565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051612a7491906137d1565b60006040518083038185875af1925050503d8060008114612ab1576040519150601f19603f3d011682016040523d82523d6000602084013e612ab6565b606091505b5091509150612ac6868383612ad1565b925050509392505050565b606082612ae657612ae182612b60565b612b58565b60008251148015612b0e575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612b5057836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612b479190613745565b60405180910390fd5b819050612b59565b5b9392505050565b600081511115612b735780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806040016040528060008152602001600081525090565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160608152602001606081525090565b604051806040016040528060008152602001600081525090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c4e82612c23565b9050919050565b612c5e81612c43565b8114612c6957600080fd5b50565b600081359050612c7b81612c55565b92915050565b6000819050919050565b612c9481612c81565b8114612c9f57600080fd5b50565b600081359050612cb181612c8b565b92915050565b60008060408385031215612cce57612ccd612c1e565b5b6000612cdc85828601612c6c565b9250506020612ced85828601612ca2565b9150509250929050565b612d0081612c81565b82525050565b6000602082019050612d1b6000830184612cf7565b92915050565b60008060408385031215612d3857612d37612c1e565b5b6000612d4685828601612ca2565b9250506020612d5785828601612ca2565b9150509250929050565b600080600060608486031215612d7a57612d79612c1e565b5b6000612d8886828701612ca2565b9350506020612d9986828701612ca2565b9250506040612daa86828701612ca2565b9150509250925092565b600060208284031215612dca57612dc9612c1e565b5b6000612dd884828501612ca2565b91505092915050565b600060208284031215612df757612df6612c1e565b5b6000612e0584828501612c6c565b91505092915050565b6000604082019050612e236000830185612cf7565b612e306020830184612cf7565b9392505050565b6000819050919050565b6000612e5c612e57612e5284612c23565b612e37565b612c23565b9050919050565b6000612e6e82612e41565b9050919050565b6000612e8082612e63565b9050919050565b612e9081612e75565b82525050565b6000602082019050612eab6000830184612e87565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612ee681612c43565b82525050565b612ef581612c81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b604082016000820151612f3d6000850182612eec565b506020820151612f506020850182612eec565b50505050565b6000612f628383612f27565b60408301905092915050565b6000602082019050919050565b6000612f8682612efb565b612f908185612f06565b9350612f9b83612f17565b8060005b83811015612fcc578151612fb38882612f56565b9750612fbe83612f6e565b925050600181019050612f9f565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60408201600082015161301b6000850182612eec565b50602082015161302e6020850182612eec565b50505050565b60006130408383613005565b60408301905092915050565b6000602082019050919050565b600061306482612fd9565b61306e8185612fe4565b935061307983612ff5565b8060005b838110156130aa5781516130918882613034565b975061309c8361304c565b92505060018101905061307d565b5085935050505092915050565b600060a0830160008301516130cf6000860182612edd565b5060208301516130e26020860182612eec565b5060408301516130f56040860182612eec565b506060830151848203606086015261310d8282612f7b565b915050608083015184820360808601526131278282613059565b9150508091505092915050565b600061314083836130b7565b905092915050565b6000602082019050919050565b600061316082612eb1565b61316a8185612ebc565b93508360208202850161317c85612ecd565b8060005b858110156131b857848403895281516131998582613134565b94506131a483613148565b925060208a01995050600181019050613180565b50829750879550505050505092915050565b600060208201905081810360008301526131e48184613155565b905092915050565b600082825260208201905092915050565b600061320882612efb565b61321281856131ec565b935061321d83612f17565b8060005b8381101561324e5781516132358882612f56565b975061324083612f6e565b925050600181019050613221565b5085935050505092915050565b6000602082019050818103600083015261327581846131fd565b905092915050565b600060a0830160008301516132956000860182612edd565b5060208301516132a86020860182612eec565b5060408301516132bb6040860182612eec565b50606083015184820360608601526132d38282612f7b565b915050608083015184820360808601526132ed8282613059565b9150508091505092915050565b60006020820190508181036000830152613314818461327d565b905092915050565b600061332782612c43565b9050919050565b6133378161331c565b811461334257600080fd5b50565b6000813590506133548161332e565b92915050565b6000602082840312156133705761336f612c1e565b5b600061337e84828501613345565b91505092915050565b600082825260208201905092915050565b60006133a382612fd9565b6133ad8185613387565b93506133b883612ff5565b8060005b838110156133e95781516133d08882613034565b97506133db8361304c565b9250506001810190506133bc565b5085935050505092915050565b600060208201905081810360008301526134108184613398565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061345282612c81565b915061345d83612c81565b925082820190508082111561347557613474613418565b5b92915050565b600061348682612c81565b915061349183612c81565b92508282039050818111156134a9576134a8613418565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061351882612c81565b91506000820361352b5761352a613418565b5b600182039050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600061356f61356a61356584613536565b612e37565b613540565b9050919050565b61357f81613554565b82525050565b600060208201905061359a6000830184613576565b92915050565b60006135ab82612c81565b91506135b683612c81565b92508282026135c481612c81565b915082820484148315176135db576135da613418565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061361c82612c81565b915061362783612c81565b925082613637576136366135e2565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b61367a81612c43565b82525050565b60006060820190506136956000830186613671565b6136a26020830185613671565b6136af6040830184612cf7565b949350505050565b60006040820190506136cc6000830185613671565b6136d96020830184612cf7565b9392505050565b60008115159050919050565b6136f5816136e0565b811461370057600080fd5b50565b600081519050613712816136ec565b92915050565b60006020828403121561372e5761372d612c1e565b5b600061373c84828501613703565b91505092915050565b600060208201905061375a6000830184613671565b92915050565b600081519050919050565b600081905092915050565b60005b83811015613794578082015181840152602081019050613779565b60008484015250505050565b60006137ab82613760565b6137b5818561376b565b93506137c5818560208601613776565b80840191505092915050565b60006137dd82846137a0565b91508190509291505056fea2646970667358221220ed92963182bf502ce8d2f54d9648ade1c5dd5e9847b61df5d0340cd80c1b4c6364736f6c63430008180033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80636b0e7371116100b8578063bb4d44361161007c578063bb4d443614610375578063c195d779146103a5578063c4d66de8146103c1578063c586b27d146103dd578063cf56974a1461040d578063dea075e81461043d57610137565b80636b0e7371146102a95780636f77926b146102d9578063853828b614610309578063929ec53714610327578063a55ff3fc1461035757610137565b80633033bed8116100ff5780633033bed8146101f05780633958dfab1461022157806345982a661461023f578063671b37931461026f578063687cb3531461028d57610137565b806302fa7d0a1461013c57806324f9d39a1461016c57806325b599b81461019c5780632a50ac4d146101b85780632e1a7d4d146101d4575b600080fd5b61015660048036038101906101519190612cb7565b610459565b6040516101639190612d06565b60405180910390f35b61018660048036038101906101819190612d21565b6104b4565b6040516101939190612d06565b60405180910390f35b6101b660048036038101906101b19190612d21565b6104c8565b005b6101d260048036038101906101cd9190612d61565b6106be565b005b6101ee60048036038101906101e99190612db4565b610829565b005b61020a60048036038101906102059190612de1565b610999565b604051610218929190612e0e565b60405180910390f35b610229610abf565b6040516102369190612e96565b60405180910390f35b61025960048036038101906102549190612d21565b610ae5565b60405161026691906131ca565b60405180910390f35b610277610dab565b6040516102849190612d06565b60405180910390f35b6102a760048036038101906102a29190612db4565b610db1565b005b6102c360048036038101906102be9190612de1565b610f8a565b6040516102d0919061325b565b60405180910390f35b6102f360048036038101906102ee9190612de1565b611118565b60405161030091906132fa565b60405180910390f35b61031161125b565b60405161031e9190612d06565b60405180910390f35b610341600480360381019061033c9190612de1565b61140c565b60405161034e9190612d06565b60405180910390f35b61035f611523565b60405161036c9190612d06565b60405180910390f35b61038f600480360381019061038a9190612de1565b611529565b60405161039c9190612d06565b60405180910390f35b6103bf60048036038101906103ba9190612d21565b611572565b005b6103db60048036038101906103d6919061335a565b611670565b005b6103f760048036038101906103f29190612de1565b611837565b60405161040491906133f6565b60405180910390f35b61042760048036038101906104229190612d21565b6118e9565b6040516104349190612d06565b60405180910390f35b61045760048036038101906104529190612d21565b611a04565b005b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b60006104c08383611cfa565b905092915050565b8181101561050f5781816040517fa39d5628000000000000000000000000000000000000000000000000000000008152600401610506929190612e0e565b60405180910390fd5b600061056283600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d1c90919063ffffffff16565b9050806105a657826040517fc71ff29100000000000000000000000000000000000000000000000000000000815260040161059d9190612d06565b60405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000205490506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000208190555061065c338583611d36565b610667338483611db8565b503373ffffffffffffffffffffffffffffffffffffffff167f7f1bcac4c8e459439c54b457224e6fd22a847afe9c1ef086d7c8af353ffec08185856040516106b0929190612e0e565b60405180910390a250505050565b60006106ca3385611fc9565b90506106d5816122ce565b6106de846122f6565b101561072157826040517fed699ef50000000000000000000000000000000000000000000000000000000081526004016107189190612d06565b60405180910390fd5b8181602001510361073c576107368484611572565b50610824565b818160200151101561077a576040517fda96344a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600082825461078c9190613447565b925050819055506107a733600261230e90919063ffffffff16565b506107b3338484611db8565b506107d23382600001518484602001516107cd919061347b565b61233e565b3373ffffffffffffffffffffffffffffffffffffffff167f732bb053e7a01aa5bdddd99623a4babbb36177debb85cff06592a420c4270a7d848460405161081a929190612e0e565b60405180910390a2505b505050565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090508181116108a9576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106108fc576108fb6134af565b5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050610934816123d6565b1561096b576040517f33d6c18e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109753384611fc9565b50600182610983919061347b565b9150610994338260200151846123e6565b505050565b6000806000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090506109eb612ba5565b60005b82811015610ab757600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110610a4757610a466134af565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505091504282600001511115610a9957816020015185610a929190613447565b9450610aac565b816020015184610aa99190613447565b93505b8060010190506109ee565b505050915091565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606000610af360026124f0565b905060008103610b5a57600067ffffffffffffffff811115610b1857610b176134de565b5b604051908082528060200260200182016040528015610b5157816020015b610b3e612bbf565b815260200190600190039081610b365790505b50915050610da5565b808410610b93576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610baa828587610ba59190613447565b612505565b905060008582610bba919061347b565b67ffffffffffffffff811115610bd357610bd26134de565b5b604051908082528060200260200182016040528015610c0c57816020015b610bf9612bbf565b815260200190600190039081610bf15790505b5090506000808790505b83811015610d9c57610c3281600261252190919063ffffffff16565b91506040518060a001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001610c648461140c565b8152602001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001610cb784610f8a565b8152602001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610d6157838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610d1b565b50505050815250838983610d75919061347b565b81518110610d8657610d856134af565b5b6020026020010181905250806001019050610c16565b50819450505050505b92915050565b60005481565b6000610e0482600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d1c90919063ffffffff16565b905080610e4857816040517fc71ff291000000000000000000000000000000000000000000000000000000008152600401610e3f9190612d06565b60405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205490506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020819055508060016000828254610f05919061347b565b92505081905550610f17338483611d36565b610f3533610f24856122f6565b42610f2f9190613447565b8361233e565b3373ffffffffffffffffffffffffffffffffffffffff167ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c20048483604051610f7d929190612e0e565b60405180910390a2505050565b60606000610fd5600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061253b565b90506000815190508067ffffffffffffffff811115610ff757610ff66134de565b5b60405190808252806020026020018201604052801561103057816020015b61101d612c04565b8152602001906001900390816110155790505b50925060008103611042575050611113565b60005b8181101561110f57604051806040016040528084838151811061106b5761106a6134af565b5b60200260200101518152602001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008685815181106110cc576110cb6134af565b5b60200260200101518152602001908152602001600020548152508482815181106110f9576110f86134af565b5b6020026020010181905250806001019050611045565b5050505b919050565b611120612bbf565b6040518060a001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020016111508461140c565b8152602001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020016111a384610f8a565b8152602001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561124d57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611207565b505050508152509050919050565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050600081036112dd576040517f19cc381700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112e5612ba5565b60008290505b60008111156113c15780806112ff9061350d565b915050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110611353576113526134af565b5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050915061138b826123d6565b6113bc5781602001518461139f9190613447565b93506113ab3382611fc9565b506001836113b9919061347b565b92505b6112eb565b600084036113fb576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114063385856123e6565b50505090565b600080611456600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061255c565b905060005b8181101561151c57600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006114f583600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061257190919063ffffffff16565b8152602001908152602001600020548361150f9190613447565b925080600101905061145b565b5050919050565b60015481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061157e3384611fc9565b9050611589816122ce565b611592836122f6565b10156115d557816040517fed699ef50000000000000000000000000000000000000000000000000000000081526004016115cc9190612d06565b60405180910390fd5b8060200151600160008282546115eb9190613447565b9250508190555061160633600261230e90919063ffffffff16565b5061161633838360200151611db8565b503373ffffffffffffffffffffffffffffffffffffffff167f732bb053e7a01aa5bdddd99623a4babbb36177debb85cff06592a420c4270a7d838360200151604051611663929190612e0e565b60405180910390a2505050565b600061167a61258b565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff161480156116c85750825b9050600060018367ffffffffffffffff161480156116fd575060003073ffffffffffffffffffffffffffffffffffffffff163b145b90508115801561170b575080155b15611742576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156117925760018560000160086101000a81548160ff0219169083151502179055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550831561182f5760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516118269190613585565b60405180910390a15b505050505050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156118de57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611898565b505050509050919050565b6000808203611924576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611973333084600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b3909392919063ffffffff16565b81600160008282546119859190613447565b925050819055506119a033600261230e90919063ffffffff16565b503373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1584846040516119e9929190612e0e565b60405180910390a26119fc338484611db8565b905092915050565b6000611a5783600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061263590919063ffffffff16565b905080611a9b57826040517fc71ff291000000000000000000000000000000000000000000000000000000008152600401611a929190612d06565b60405180910390fd5b60008203611ad5576040517fdd484e7000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020549050828103611b4157611b3a84610db1565b5050611cf6565b80831115611b885780836040517f6361acfc000000000000000000000000000000000000000000000000000000008152600401611b7f929190612e0e565b60405180910390fd5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000828254611be8919061347b565b925050819055506000611bfb8585611cfa565b905080600080828254611c0e919061347b565b9250508190555080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611c64919061347b565b925050819055508360016000828254611c7d919061347b565b92505081905550611ca233611c91876122f6565b42611c9c9190613447565b8661233e565b3373ffffffffffffffffffffffffffffffffffffffff167ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c20048686604051611cea929190612e0e565b60405180910390a25050505b5050565b6000603c8383611d0a91906135a0565b611d149190613611565b905092915050565b6000611d2e836000018360001b61264f565b905092915050565b6000611d428383611cfa565b905080600080828254611d55919061347b565b9250508190555080600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611dab919061347b565b9250508190555050505050565b600082601e811080611dcb575061012c81115b15611e0d57806040517fc3a13fb6000000000000000000000000000000000000000000000000000000008152600401611e049190612d06565b60405180910390fd5b611e5e84600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061276390919063ffffffff16565b50600a611ea8600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061255c565b1115611ee0576040517f1f3fc77b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000828254611f409190613447565b92505081905550611f518484611cfa565b915081600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fa29190613447565b9250508190555081600080828254611fba9190613447565b92505081905550509392505050565b611fd1612ba5565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050808310612051576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106120a2576120a16134af565b5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050915060018114806120eb57506001816120e8919061347b565b83145b1561216d57600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061213f5761213e613642565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090556122c7565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001826121b9919061347b565b815481106121ca576121c96134af565b5b9060005260206000209060020201600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110612229576122286134af565b5b90600052602060002090600202016000820154816000015560018201548160010155905050600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061229d5761229c613642565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090555b5092915050565b60006122d9826123d6565b156122f1574282600001516122ee919061347b565b90505b919050565b6000620151808261230791906135a0565b9050919050565b6000612336836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61277d565b905092915050565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040528084815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000155602082015181600101555050505050565b6000816000015142109050919050565b60008114801561243557506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156124505761244e8360026127ed90919063ffffffff16565b505b61249d8383600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661281d9092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516124e39190612d06565b60405180910390a2505050565b60006124fe8260000161289c565b9050919050565b6000818311156125175781905061251b565b8290505b92915050565b600061253083600001836128ad565b60001c905092915050565b6060600061254b836000016128d8565b905060608190508092505050919050565b600061256a8260000161289c565b9050919050565b600061258083600001836128ad565b60001c905092915050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b61262f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016125e893929190613680565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612934565b50505050565b6000612647836000018360001b6129cb565b905092915050565b60008083600101600084815260200190815260200160002054905060008114612757576000600182612681919061347b565b9050600060018660000180549050612699919061347b565b90508082146127085760008660000182815481106126ba576126b96134af565b5b90600052602060002001549050808760000184815481106126de576126dd6134af565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061271c5761271b613642565b5b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061275d565b60009150505b92915050565b6000612775836000018360001b61277d565b905092915050565b600061278983836129cb565b6127e25782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506127e7565b600090505b92915050565b6000612815836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61264f565b905092915050565b612897838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016128509291906136b7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612934565b505050565b600081600001805490509050919050565b60008260000182815481106128c5576128c46134af565b5b9060005260206000200154905092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561292857602002820191906000526020600020905b815481526020019060010190808311612914575b50505050509050919050565b600061295f828473ffffffffffffffffffffffffffffffffffffffff166129ee90919063ffffffff16565b905060008151141580156129845750808060200190518101906129829190613718565b155b156129c657826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016129bd9190613745565b60405180910390fd5b505050565b600080836001016000848152602001908152602001600020541415905092915050565b60606129fc83836000612a04565b905092915050565b606081471015612a4b57306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401612a429190613745565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051612a7491906137d1565b60006040518083038185875af1925050503d8060008114612ab1576040519150601f19603f3d011682016040523d82523d6000602084013e612ab6565b606091505b5091509150612ac6868383612ad1565b925050509392505050565b606082612ae657612ae182612b60565b612b58565b60008251148015612b0e575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612b5057836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612b479190613745565b60405180910390fd5b819050612b59565b5b9392505050565b600081511115612b735780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806040016040528060008152602001600081525090565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160608152602001606081525090565b604051806040016040528060008152602001600081525090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c4e82612c23565b9050919050565b612c5e81612c43565b8114612c6957600080fd5b50565b600081359050612c7b81612c55565b92915050565b6000819050919050565b612c9481612c81565b8114612c9f57600080fd5b50565b600081359050612cb181612c8b565b92915050565b60008060408385031215612cce57612ccd612c1e565b5b6000612cdc85828601612c6c565b9250506020612ced85828601612ca2565b9150509250929050565b612d0081612c81565b82525050565b6000602082019050612d1b6000830184612cf7565b92915050565b60008060408385031215612d3857612d37612c1e565b5b6000612d4685828601612ca2565b9250506020612d5785828601612ca2565b9150509250929050565b600080600060608486031215612d7a57612d79612c1e565b5b6000612d8886828701612ca2565b9350506020612d9986828701612ca2565b9250506040612daa86828701612ca2565b9150509250925092565b600060208284031215612dca57612dc9612c1e565b5b6000612dd884828501612ca2565b91505092915050565b600060208284031215612df757612df6612c1e565b5b6000612e0584828501612c6c565b91505092915050565b6000604082019050612e236000830185612cf7565b612e306020830184612cf7565b9392505050565b6000819050919050565b6000612e5c612e57612e5284612c23565b612e37565b612c23565b9050919050565b6000612e6e82612e41565b9050919050565b6000612e8082612e63565b9050919050565b612e9081612e75565b82525050565b6000602082019050612eab6000830184612e87565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612ee681612c43565b82525050565b612ef581612c81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b604082016000820151612f3d6000850182612eec565b506020820151612f506020850182612eec565b50505050565b6000612f628383612f27565b60408301905092915050565b6000602082019050919050565b6000612f8682612efb565b612f908185612f06565b9350612f9b83612f17565b8060005b83811015612fcc578151612fb38882612f56565b9750612fbe83612f6e565b925050600181019050612f9f565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60408201600082015161301b6000850182612eec565b50602082015161302e6020850182612eec565b50505050565b60006130408383613005565b60408301905092915050565b6000602082019050919050565b600061306482612fd9565b61306e8185612fe4565b935061307983612ff5565b8060005b838110156130aa5781516130918882613034565b975061309c8361304c565b92505060018101905061307d565b5085935050505092915050565b600060a0830160008301516130cf6000860182612edd565b5060208301516130e26020860182612eec565b5060408301516130f56040860182612eec565b506060830151848203606086015261310d8282612f7b565b915050608083015184820360808601526131278282613059565b9150508091505092915050565b600061314083836130b7565b905092915050565b6000602082019050919050565b600061316082612eb1565b61316a8185612ebc565b93508360208202850161317c85612ecd565b8060005b858110156131b857848403895281516131998582613134565b94506131a483613148565b925060208a01995050600181019050613180565b50829750879550505050505092915050565b600060208201905081810360008301526131e48184613155565b905092915050565b600082825260208201905092915050565b600061320882612efb565b61321281856131ec565b935061321d83612f17565b8060005b8381101561324e5781516132358882612f56565b975061324083612f6e565b925050600181019050613221565b5085935050505092915050565b6000602082019050818103600083015261327581846131fd565b905092915050565b600060a0830160008301516132956000860182612edd565b5060208301516132a86020860182612eec565b5060408301516132bb6040860182612eec565b50606083015184820360608601526132d38282612f7b565b915050608083015184820360808601526132ed8282613059565b9150508091505092915050565b60006020820190508181036000830152613314818461327d565b905092915050565b600061332782612c43565b9050919050565b6133378161331c565b811461334257600080fd5b50565b6000813590506133548161332e565b92915050565b6000602082840312156133705761336f612c1e565b5b600061337e84828501613345565b91505092915050565b600082825260208201905092915050565b60006133a382612fd9565b6133ad8185613387565b93506133b883612ff5565b8060005b838110156133e95781516133d08882613034565b97506133db8361304c565b9250506001810190506133bc565b5085935050505092915050565b600060208201905081810360008301526134108184613398565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061345282612c81565b915061345d83612c81565b925082820190508082111561347557613474613418565b5b92915050565b600061348682612c81565b915061349183612c81565b92508282039050818111156134a9576134a8613418565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061351882612c81565b91506000820361352b5761352a613418565b5b600182039050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600061356f61356a61356584613536565b612e37565b613540565b9050919050565b61357f81613554565b82525050565b600060208201905061359a6000830184613576565b92915050565b60006135ab82612c81565b91506135b683612c81565b92508282026135c481612c81565b915082820484148315176135db576135da613418565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061361c82612c81565b915061362783612c81565b925082613637576136366135e2565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b61367a81612c43565b82525050565b60006060820190506136956000830186613671565b6136a26020830185613671565b6136af6040830184612cf7565b949350505050565b60006040820190506136cc6000830185613671565b6136d96020830184612cf7565b9392505050565b60008115159050919050565b6136f5816136e0565b811461370057600080fd5b50565b600081519050613712816136ec565b92915050565b60006020828403121561372e5761372d612c1e565b5b600061373c84828501613703565b91505092915050565b600060208201905061375a6000830184613671565b92915050565b600081519050919050565b600081905092915050565b60005b83811015613794578082015181840152602081019050613779565b60008484015250505050565b60006137ab82613760565b6137b5818561376b565b93506137c5818560208601613776565b80840191505092915050565b60006137dd82846137a0565b91508190509291505056fea2646970667358221220ed92963182bf502ce8d2f54d9648ade1c5dd5e9847b61df5d0340cd80c1b4c6364736f6c63430008180033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.