ETH Price: $2,646.48 (+1.77%)
Gas: 1 Gwei

Contract

0xE639E9DC0E302f5dB025713009868c8adE4Ced26
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw204323252024-08-01 7:52:119 days ago1722498731IN
0xE639E9DC...adE4Ced26
0 ETH0.000895735.72071192
Stake202041142024-06-30 11:10:2341 days ago1719745823IN
0xE639E9DC...adE4Ced26
0 ETH0.000624332.7340327
Withdraw201540602024-06-23 11:21:5948 days ago1719141719IN
0xE639E9DC...adE4Ced26
0 ETH0.000419572.67557165
Stake199212772024-05-21 22:30:4781 days ago1716330647IN
0xE639E9DC...adE4Ced26
0 ETH0.001996488.76147216
Stake197869362024-05-03 3:34:23100 days ago1714707263IN
0xE639E9DC...adE4Ced26
0 ETH0.001681557.54186842
Stake195697562024-04-02 18:01:59130 days ago1712080919IN
0xE639E9DC...adE4Ced26
0 ETH0.011596449.7582182
Withdraw194878972024-03-22 4:50:35141 days ago1711083035IN
0xE639E9DC...adE4Ced26
0 ETH0.0035637822.76046394
Withdraw193673932024-03-05 7:12:35158 days ago1709622755IN
0xE639E9DC...adE4Ced26
0 ETH0.0095383368.38593883
Stake192154582024-02-13 0:16:11180 days ago1707783371IN
0xE639E9DC...adE4Ced26
0 ETH0.0123847853.13558872
Withdraw192121242024-02-12 13:04:23180 days ago1707743063IN
0xE639E9DC...adE4Ced26
0 ETH0.0037887323.7089119
Stake192112822024-02-12 10:14:23180 days ago1707732863IN
0xE639E9DC...adE4Ced26
0 ETH0.0048005621.04154606
Stake191700822024-02-06 15:28:23186 days ago1707233303IN
0xE639E9DC...adE4Ced26
0 ETH0.0113677248.82727613
Stake191639102024-02-05 18:42:11187 days ago1707158531IN
0xE639E9DC...adE4Ced26
0 ETH0.0039875517.46972317
Stake191630542024-02-05 15:47:35187 days ago1707148055IN
0xE639E9DC...adE4Ced26
0 ETH0.0073540132.20432346
Stake191371392024-02-02 0:24:59191 days ago1706833499IN
0xE639E9DC...adE4Ced26
0 ETH0.0045706519.62099678
Stake190991372024-01-27 16:33:47196 days ago1706373227IN
0xE639E9DC...adE4Ced26
0 ETH0.0029844615.01730871
Stake190991202024-01-27 16:30:23196 days ago1706373023IN
0xE639E9DC...adE4Ced26
0 ETH0.0037659916.17676048
Stake190937792024-01-26 22:33:59197 days ago1706308439IN
0xE639E9DC...adE4Ced26
0 ETH0.0027465112.28431352
Stake190741612024-01-24 4:36:35199 days ago1706070995IN
0xE639E9DC...adE4Ced26
0 ETH0.002111649.46113492
Stake190598012024-01-22 4:06:47202 days ago1705896407IN
0xE639E9DC...adE4Ced26
0 ETH0.0025051610.77811774
Stake190573582024-01-21 19:44:11202 days ago1705866251IN
0xE639E9DC...adE4Ced26
0 ETH0.0033303914.92094058
Stake190528892024-01-21 4:36:23202 days ago1705811783IN
0xE639E9DC...adE4Ced26
0 ETH0.002169489.5
Stake190207212024-01-16 16:43:23207 days ago1705423403IN
0xE639E9DC...adE4Ced26
0 ETH0.013944359.8943453
Stake190068972024-01-14 18:24:59209 days ago1705256699IN
0xE639E9DC...adE4Ced26
0 ETH0.0056607824.8132953
Stake190032542024-01-14 6:11:35209 days ago1705212695IN
0xE639E9DC...adE4Ced26
0 ETH0.0072576732.49682253
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Minting

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 10 : Minting.sol
//SPDX-License-Identifier: MIT
pragma solidity =0.8.18;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol';
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';

/**
 * @title Minting
 * @author gotbit
 * @notice Contract for staking tokens in order to earn rewards. Any user can make multiple stakes. Reward earn period is practically unlimited.
 */

contract Minting is Ownable, Pausable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.UintSet;

    // TYPES

    struct Stake {
        address owner;
        uint256 amount;
        uint256 rewardToUser;
        uint32 apy;
        uint32 unstakedAtBlockTimestamp;
        uint32 stakingPeriod;
        uint32 timestamp;
    }

    // STATE VARIABLES

    uint256 public constant ACCURACY = 1e18;
    uint256 public constant MIN_STAKING_PERIOD = 1 days; // 1 day
    uint256 public constant MAX_STAKING_PERIOD = YEAR * 5; // 5 year
    uint256 public constant RECEIVE_PERIOD = 14 days; // 14 days
    uint256 public constant ONE_HUNDRED = 100; // 100%
    uint256 public constant APY_4 = 4; // 4%
    uint256 public constant APY_7 = 7; // 7%
    uint256 public constant APY_15 = 15; // 15%
    uint256 public constant APY_34 = 34; // 34%
    uint256 public constant APY_53 = 53; // 53%
    uint256 public constant APY_67 = 67; // 67%
    uint256 public constant APY_75 = 75; // 75%
    uint256 public constant APY_84 = 84; // 84%
    uint256 public constant YEAR = 360 days; // 365 days = 1 year
    // uint256 ~ 10*77 => 10**77 ~ amount * 100 * 10**10 = amount * 10 ** 12 => amount < 10 ** (77 - 12)
    uint256 public constant MAX_STAKE_AMOUNT = 10 ** 54;

    IERC20 public immutable stakingToken;

    uint256 public totalSupply;

    uint256 public maxPotentialDebt;

    mapping(uint256 => Stake) public stakes;
    mapping(address => uint256[]) public userInactiveStakes;
    mapping(address => EnumerableSet.UintSet) private _idsByUser;
    mapping(address => uint256) public balanceOf;

    uint256 public globalId;

    // sum of all staking periods across all active stakes
    uint80 public sumOfActiveStakingPeriods;
    // number of currenlty active stakes
    uint80 public numOfActiveStakes;
    // sum of apy values over all active stakes
    uint80 public sumOfActiveAPY;

    event Staked(address indexed user, uint256 indexed id, uint256 amount);
    event Withdrawn(address user, uint256 indexed id, uint256 amount);

    constructor(IERC20 stakingToken_, address owner_) {
        require(address(stakingToken_) != address(0), 'Invalid address');
        require(owner_ != address(0), 'Invalid address');

        stakingToken = stakingToken_;
        _transferOwnership(owner_);
    }

    /// @dev Allows user to stake tokens
    /// @param amount of token to stake
    /// @param stakingPeriod period to hold staked tokens (in case of unstake too early or too late => penalties applied)
    function stake(uint256 amount, uint32 stakingPeriod) external whenNotPaused {
        require(amount > 0, 'Cannot stake 0');
        require(amount <= MAX_STAKE_AMOUNT, 'Stake amount exceeds limit');
        require(stakingPeriod >= MIN_STAKING_PERIOD, 'Staking period is too short');
        require(stakingPeriod <= MAX_STAKING_PERIOD, 'Staking period is too long');

        totalSupply += amount;
        sumOfActiveStakingPeriods += stakingPeriod;
        ++numOfActiveStakes;
        uint32 apy = uint32(getAPYforDuration(stakingPeriod));
        sumOfActiveAPY += apy;

        maxPotentialDebt +=
            _calculateRewardForDurationAndStakingPeriod(
                amount,
                stakingPeriod,
                stakingPeriod
            ) +
            amount;

        require(
            maxPotentialDebt <= contractBalance() + amount,
            'Max potential debt exceeds contract balance'
        );

        uint256 id = ++globalId;

        // address owner;
        // uint256 amount;
        // uint256 rewardToUser
        // uint32 apy;
        // uint32 unstakedAtBlockTimestamp;
        // uint32 stakingPeriod;
        // uint32 timestamp;
        stakes[id] = Stake(
            msg.sender,
            amount,
            0,
            apy,
            0,
            stakingPeriod,
            uint32(block.timestamp)
        );

        balanceOf[msg.sender] += amount;
        _idsByUser[msg.sender].add(id);

        emit Staked(msg.sender, id, amount);

        stakingToken.safeTransferFrom(msg.sender, address(this), amount);
    }

    /// @dev Allows to calculate principal and rewards penalties (nominated in percents, multiplied by ACCURACY = 1e18) for a specific stake
    /// @param id Stake id
    /// @return principalPenaltyPercentage - principal fee, rewardPenaltyPercentage - rewards fee (multiplied by ACCURACY)
    function calculatePenalties(
        uint256 id
    )
        public
        view
        returns (uint256 principalPenaltyPercentage, uint256 rewardPenaltyPercentage)
    {
        uint128 timestamp = stakes[id].timestamp;
        uint128 stakingPeriod = stakes[id].stakingPeriod;
        uint256 actualStakingTime = block.timestamp - timestamp;

        if (actualStakingTime < stakingPeriod) {
            // EMERGENCY UNSTAKE
            if (actualStakingTime < (2 * stakingPeriod) / 10) {
                // 0 - 20 % hold time
                principalPenaltyPercentage = 80 * ACCURACY;
                rewardPenaltyPercentage = 100 * ACCURACY;
            } else if (actualStakingTime < (4 * stakingPeriod) / 10) {
                // 20 - 40 % hold time
                principalPenaltyPercentage = 40 * ACCURACY;
                rewardPenaltyPercentage = 100 * ACCURACY;
            } else if (actualStakingTime < (5 * stakingPeriod) / 10) {
                // 40 - 50 % hold time
                rewardPenaltyPercentage = 100 * ACCURACY;
            } else if (actualStakingTime < (7 * stakingPeriod) / 10) {
                // 50 - 70 % hold time
                rewardPenaltyPercentage = 50 * ACCURACY;
            } else {
                // 70 - 100 % hold time
                rewardPenaltyPercentage = 20 * ACCURACY;
            }
        } else if (actualStakingTime > stakingPeriod + RECEIVE_PERIOD) {
            // LATE UNSTAKE
            // principal penalty = 0

            uint256 extraPeriod = actualStakingTime - stakingPeriod;
            rewardPenaltyPercentage = (extraPeriod * 100 * ACCURACY) / actualStakingTime;
        }
        // else SAFE UNSTAKE (principal fee = 0, rewards fee = 0)
    }

    /// @dev Allows user to withdraw staked tokens + claim earned rewards - penalties
    /// @param id Stake id
    function withdraw(uint256 id) external {
        Stake memory _stake = stakes[id];
        uint256 amount = _stake.amount;
        require(_stake.unstakedAtBlockTimestamp == 0, 'Already unstaked');
        require(_stake.owner == msg.sender, 'Can`t be called not by stake owner');

        totalSupply -= amount;
        balanceOf[msg.sender] -= amount;

        (
            uint256 principalPenaltyPercentage,
            uint256 rewardPenaltyPercentage
        ) = calculatePenalties(id);

        --numOfActiveStakes;
        sumOfActiveStakingPeriods -= _stake.stakingPeriod;
        sumOfActiveAPY -= _stake.apy;

        uint256 rewardAmountToContract;
        uint256 rewardAmountToUser;

        uint256 reward = earned(id);

        if (reward != 0) {
            // CLAIM ALL EARNED REWARDS
            rewardAmountToContract =
                (reward * rewardPenaltyPercentage) /
                (100 * ACCURACY);

            rewardAmountToUser = reward - rewardAmountToContract;

            stakes[id].rewardToUser = rewardAmountToUser;
        }

        // stake will no longer gain rewards => substract max possible stake amount + reward
        maxPotentialDebt -=
            _calculateRewardForDurationAndStakingPeriod(
                _stake.amount,
                _stake.stakingPeriod,
                _stake.stakingPeriod
            ) +
            _stake.amount;

        _idsByUser[msg.sender].remove(id);
        userInactiveStakes[msg.sender].push(id);

        stakes[id].unstakedAtBlockTimestamp = uint32(block.timestamp);

        // ALL TOKENS TRANSFERS -------------------------------------------------------

        // REWARDS + PRINCIPAL TRANSFERS

        uint256 amountToWallet = (amount * principalPenaltyPercentage) / (100 * ACCURACY);
        // amountToWallet + rewardAmountToWallet stay on comtract

        emit Withdrawn(msg.sender, id, amount - amountToWallet + rewardAmountToUser);

        // amount != amountToWallet due to the technical design
        stakingToken.safeTransfer(
            msg.sender,
            amount - amountToWallet + rewardAmountToUser
        );
    }

    /// @dev Allows to view current user earned rewards
    /// @param id to view rewards
    /// @return earned - Amount of rewards for the selected user stake
    function earned(uint256 id) public view returns (uint256) {
        Stake memory _stake = stakes[id];
        if (_stake.unstakedAtBlockTimestamp == 0) {
            // ACTIVE STAKE => calculate amount + increase reward per token
            // amountForDuration >= amount
            return
                _calculateRewardForDurationAndStakingPeriod(
                    _stake.amount,
                    getStakeRealDuration(id),
                    _stake.stakingPeriod
                );
        }

        // INACTIVE STAKE
        return 0;
    }

    /// @dev Returns the stake exact hold time
    /// @param id stake id
    /// @return duration - stake exact hold time
    function getStakeRealDuration(uint256 id) public view returns (uint256 duration) {
        Stake memory _stake = stakes[id];
        uint256 holdTime = block.timestamp - _stake.timestamp;
        duration = holdTime > _stake.stakingPeriod ? _stake.stakingPeriod : holdTime;
    }

    /// @dev Returns the approximate APY for a specific stake position including penalties (real APY = potential APY * (1 - rewardPenalty))
    /// @param id stake id
    /// @return APY value multiplied by 10**18
    function getAPY(uint256 id) external view returns (uint256) {
        (, uint256 rewardPenalty) = calculatePenalties(id);

        uint256 apy = getAPYforDuration(stakes[id].stakingPeriod);
        return (apy * (ONE_HUNDRED * ACCURACY - rewardPenalty)) / (ONE_HUNDRED); // apy * 10**18
    }

    /// @dev Calculates the max potential reward after unstake for a stake with a given amount and staking period (without substracting penalties)
    /// @param amount - stake amount
    /// @param duration - stake actual hold period
    /// @param stakingPeriod - stake period, set when making stake
    /// @return max potential unstaked reward
    function _calculateRewardForDurationAndStakingPeriod(
        uint256 amount,
        uint256 duration,
        uint256 stakingPeriod
    ) private pure returns (uint256) {
        uint256 apy = getAPYforDuration(stakingPeriod);

        return (amount * apy * duration) / (YEAR * ONE_HUNDRED);
    }

    /// @dev Returns the correct APY per annum value for the corresponding duration
    /// @param duration - stake hold period
    /// @return apy - APY value nominated in percents
    function getAPYforDuration(uint256 duration) public pure returns (uint256 apy) {
        if (duration <= 30 days) {
            apy = APY_4;
        } else if (duration > 30 days && duration <= 90 days) {
            apy = APY_7;
        } else if (duration > 90 days && duration <= 180 days) {
            apy = APY_15;
        } else if (duration > 180 days && duration <= 360 days) {
            apy = APY_34;
        } else if (duration > 360 days && duration <= 720 days) {
            apy = APY_53;
        } else if (duration > 720 days && duration <= 1080 days) {
            apy = APY_67;
        } else if (duration > 1080 days && duration <= 1440 days) {
            apy = APY_75;
        } else {
            // duration > 1440 days && duration < MAX_STAKE_PERIOD
            apy = APY_84;
        }
    }

    /// @dev Returns rewards which can be distributed to new users
    /// @return Max reward available at the moment
    function getRewardsAvailable() external view returns (uint256) {
        // maxPotentialDebt = sum of principal + sum of max potential reward
        return contractBalance() - maxPotentialDebt;
    }

    /// @dev Allows to view staking token contract balance
    /// @return balance of staking token contract balance
    function contractBalance() public view returns (uint256) {
        return stakingToken.balanceOf(address(this));
    }

    /// @dev Allows to view user stake ids
    /// @param user user account
    /// @return array of user ids
    function getUserStakeIds(address user) external view returns (uint256[] memory) {
        return _idsByUser[user].values();
    }

    /// @dev Allows to view user`s stake ids quantity
    /// @param user user account
    /// @return length of user ids array
    function getUserStakeIdsLength(address user) external view returns (uint256) {
        return _idsByUser[user].values().length;
    }

    /// @dev Allows to view if a user has a stake with specific id
    /// @param user user account
    /// @param id stake id
    /// @return bool flag (true if a user has owns the id)
    function hasStakeId(address user, uint256 id) external view returns (bool) {
        return _idsByUser[user].contains(id);
    }

    /// @dev Allows to get all user stakes
    /// @param user user account
    /// @return array of user stakes
    function getAllUserStakes(address user) external view returns (Stake[] memory) {
        uint256[] memory ids = _idsByUser[user].values();
        uint256 len = ids.length;
        Stake[] memory userStakes = new Stake[](len);
        for (uint256 i; i < len; ++i) {
            uint256 stakeId = ids[i];
            userStakes[i] = stakes[stakeId];
        }

        return userStakes;
    }

    /// @dev Allows to get a slice user stakes array
    /// @param user user account
    /// @param startIndex Starting index in user ids array
    /// @param length return array length
    /// @return Array-slice of user stakes
    function getUserStakesSlice(
        address user,
        uint256 startIndex,
        uint256 length
    ) external view returns (Stake[] memory) {
        uint256[] memory ids = _idsByUser[user].values();
        uint256 len = ids.length;
        require(startIndex + length <= len, 'Invalid startIndex + length');

        Stake[] memory userStakes = new Stake[](length);
        uint256 userIndex;
        for (uint256 i = startIndex; i < startIndex + length; ++i) {
            uint256 stakeId = ids[i];
            userStakes[userIndex] = stakes[stakeId];
            ++userIndex;
        }

        return userStakes;
    }

    /// @dev Sets paused state for the contract (can be called by the owner only)
    /// @param paused paused flag
    function setPaused(bool paused) external onlyOwner {
        if (paused) {
            _pause();
        } else {
            _unpause();
        }
    }

    /// @dev Allows to get a slice user stakes history array
    /// @param user user account
    /// @param startIndex Starting index in user ids array
    /// @param length return array length
    /// @return Array-slice of user stakes history
    function getUserInactiveStakesSlice(
        address user,
        uint256 startIndex,
        uint256 length
    ) external view returns (Stake[] memory) {
        uint256 len = userInactiveStakes[user].length;
        require(startIndex + length <= len, 'Invalid startIndex + length');
        Stake[] memory userStakes = new Stake[](length);
        uint256[] memory userInactiveStakes_ = userInactiveStakes[user];
        uint256 userIndex;
        for (uint256 i = startIndex; i < startIndex + length; ++i) {
            uint256 stakeId = userInactiveStakes_[i];
            userStakes[userIndex] = stakes[stakeId];
            ++userIndex;
        }
        return userStakes;
    }

    /// @dev Allows to view user`s closed stakes quantity
    /// @param user user account
    /// @return length of user closed stakes array
    function getUserInactiveStakesLength(address user) external view returns (uint256) {
        return userInactiveStakes[user].length;
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 10 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    bool private _paused;

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

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 4 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

File 5 of 10 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 10 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    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 7 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @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.encodeWithSelector(token.approve.selector, spender, value);

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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.isContract(address(token));
    }
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"stakingToken_","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"ACCURACY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_15","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_34","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_4","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_53","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_67","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_7","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_75","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APY_84","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_STAKE_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_STAKING_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_STAKING_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_HUNDRED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECEIVE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"YEAR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"calculatePenalties","outputs":[{"internalType":"uint256","name":"principalPenaltyPercentage","type":"uint256"},{"internalType":"uint256","name":"rewardPenaltyPercentage","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getAPY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"getAPYforDuration","outputs":[{"internalType":"uint256","name":"apy","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getAllUserStakes","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardToUser","type":"uint256"},{"internalType":"uint32","name":"apy","type":"uint32"},{"internalType":"uint32","name":"unstakedAtBlockTimestamp","type":"uint32"},{"internalType":"uint32","name":"stakingPeriod","type":"uint32"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct Minting.Stake[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStakeRealDuration","outputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserInactiveStakesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getUserInactiveStakesSlice","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardToUser","type":"uint256"},{"internalType":"uint32","name":"apy","type":"uint32"},{"internalType":"uint32","name":"unstakedAtBlockTimestamp","type":"uint32"},{"internalType":"uint32","name":"stakingPeriod","type":"uint32"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct Minting.Stake[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakeIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakeIdsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getUserStakesSlice","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardToUser","type":"uint256"},{"internalType":"uint32","name":"apy","type":"uint32"},{"internalType":"uint32","name":"unstakedAtBlockTimestamp","type":"uint32"},{"internalType":"uint32","name":"stakingPeriod","type":"uint32"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct Minting.Stake[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"hasStakeId","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPotentialDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numOfActiveStakes","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"stakingPeriod","type":"uint32"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardToUser","type":"uint256"},{"internalType":"uint32","name":"apy","type":"uint32"},{"internalType":"uint32","name":"unstakedAtBlockTimestamp","type":"uint32"},{"internalType":"uint32","name":"stakingPeriod","type":"uint32"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sumOfActiveAPY","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sumOfActiveStakingPeriods","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userInactiveStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b50604051620028b9380380620028b983398101604081905262000034916200016d565b6200003f3362000104565b6000805460ff60a01b191690556001600160a01b0382166200009a5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064015b60405180910390fd5b6001600160a01b038116620000e45760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640162000091565b6001600160a01b038216608052620000fc8162000104565b5050620001ac565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200016a57600080fd5b50565b600080604083850312156200018157600080fd5b82516200018e8162000154565b6020840151909250620001a18162000154565b809150509250929050565b6080516126dc620001dd6000396000818161044101528181610ab70152818161150b015261164101526126dc6000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80638232f9a11161015c578063bfaa8cca116100ce578063dd288ea211610087578063dd288ea214610614578063eb8af21a1461061c578063eeee849b14610645578063f1752ec514610658578063f2fde38b14610672578063fbcd9b051461068557600080fd5b8063bfaa8cca14610538578063c743dabb14610540578063ca6668231461054a578063cac33fdc14610553578063d5a44f861461055b578063dc7804be1461060b57600080fd5b806398d6bd001161012057806398d6bd00146104e057806399320130146104e8578063a182dd13146104f0578063a370968714610503578063ab1f932b14610516578063be15d8ef1461051e57600080fd5b80638232f9a1146104a157806383914540146104a95780638b7afe2e146104b45780638bd7ca57146104bc5780638da5cb5b146104cf57600080fd5b80635688515d1161020057806370a08231116101b957806370a0823114610401578063715018a6146104215780637180e5901461042957806372f702f31461043c57806378a96cc01461047b578063808bf6771461048e57600080fd5b80635688515d146103965780635709632b146103a05780635ae64bd8146103b35780635c975abb146103bb5780636a89beb7146103d95780636f882ca0146103f957600080fd5b8063313da78f11610252578063313da78f146102f55780633a5dd35f146103155780633e9ac989146103285780633ffee56d14610350578063468ce9e81461037b5780634d6ed8c41461038357600080fd5b806316c38b3c1461028f57806318160ddd146102a457806319775d14146102c05780632e1a7d4d146102c85780632f92f1f2146102db575b600080fd5b6102a261029d36600461227b565b610694565b005b6102ad60015481565b6040519081526020015b60405180910390f35b6102ad605481565b6102a26102d6366004612298565b6106b5565b6102ad6f29c30f1029939b146664242d97d9f64960361b81565b6103086103033660046122c8565b610ae9565b6040516102b791906122e3565b6102ad610323366004612327565b610b13565b61033b610336366004612298565b610b44565b604080519283526020830191909152016102b7565b600854610363906001600160501b031681565b6040516001600160501b0390911681526020016102b7565b6102ad603581565b6102ad610391366004612298565b610d0d565b6102ad6212750081565b6102ad6103ae3660046122c8565b610dbf565b6102ad610de7565b600054600160a01b900460ff165b60405190151581526020016102b7565b6103ec6103e7366004612351565b610e03565b6040516102b79190612384565b6102ad604381565b6102ad61040f3660046122c8565b60066020526000908152604090205481565b6102a2611032565b6103c9610437366004612327565b611046565b6104637f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102b7565b6102a2610489366004612412565b611068565b6102ad61049c366004612298565b611539565b6102ad600f81565b6102ad6301da9c0081565b6102ad611629565b6103ec6104ca3660046122c8565b6116b4565b6000546001600160a01b0316610463565b6102ad600481565b6102ad602281565b6103ec6104fe366004612351565b611813565b6102ad610511366004612298565b6119e5565b6102ad604b81565b60085461036390600160a01b90046001600160501b031681565b6102ad606481565b6102ad6201518081565b6102ad60075481565b6102ad611a99565b6105c1610569366004612298565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919063ffffffff80821691600160201b8104821691600160401b8204811691600160601b90041687565b604080516001600160a01b03909816885260208801969096529486019390935263ffffffff91821660608601528116608085015290811660a08401521660c082015260e0016102b7565b6102ad60025481565b6102ad600781565b6102ad61062a3660046122c8565b6001600160a01b031660009081526004602052604090205490565b6102ad610653366004612298565b611aab565b60085461036390600160501b90046001600160501b031681565b6102a26106803660046122c8565b611b19565b6102ad670de0b6b3a764000081565b61069c611b8f565b80156106ad576106aa611be9565b50565b6106aa611c49565b600081815260036020818152604092839020835160e08101855281546001600160a01b0316815260018201549281018390526002820154948101949094529091015463ffffffff8082166060850152600160201b8204811660808501819052600160401b8304821660a0860152600160601b9092041660c0840152156107755760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481d5b9cdd185ad95960821b60448201526064015b60405180910390fd5b81516001600160a01b031633146107d95760405162461bcd60e51b815260206004820152602260248201527f43616e60742062652063616c6c6564206e6f74206279207374616b65206f776e60448201526132b960f11b606482015260840161076c565b80600160008282546107eb9190612461565b9091555050336000908152600660205260408120805483929061080f908490612461565b90915550600090508061082185610b44565b915091506008600a81819054906101000a90046001600160501b031661084690612474565b91906101000a8154816001600160501b0302191690836001600160501b031602179055508360a0015163ffffffff16600860008282829054906101000a90046001600160501b03166108989190612497565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550836060015163ffffffff16600860148282829054906101000a90046001600160501b03166108ea9190612497565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550600080600061091c88610d0d565b9050801561096e57610937670de0b6b3a764000060646124b7565b61094185836124b7565b61094b91906124e4565b92506109578382612461565b600089815260036020526040902060020181905591505b602087015160a088015161098a90829063ffffffff1680611c85565b61099491906124f8565b600260008282546109a59190612461565b90915550503360009081526005602052604090206109c39089611cca565b503360009081526004602090815260408083208054600181018255908452828420018b90558a8352600391829052822001805467ffffffff000000001916600160201b4263ffffffff1602179055610a24670de0b6b3a764000060646124b7565b610a2e87896124b7565b610a3891906124e4565b9050887f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc63385610a68858c612461565b610a7291906124f8565b604080516001600160a01b03909316835260208301919091520160405180910390a2610ade3384610aa3848b612461565b610aad91906124f8565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190611cd6565b505050505050505050565b6001600160a01b0381166000908152600560205260409020606090610b0d90611d3e565b92915050565b60046020528160005260406000208181548110610b2f57600080fd5b90600052602060002001600091509150505481565b600081815260036020819052604082200154819063ffffffff600160601b8204811691600160401b90041682610b7a8342612461565b9050816001600160801b0316811015610ca457600a610b9a83600261250b565b610ba49190612536565b6001600160801b0316811015610be357610bc7670de0b6b3a764000060506124b7565b9450610bdc670de0b6b3a764000060646124b7565b9350610d05565b600a610bf083600461250b565b610bfa9190612536565b6001600160801b0316811015610c1d57610bc7670de0b6b3a764000060286124b7565b600a610c2a83600561250b565b610c349190612536565b6001600160801b0316811015610c5757610bdc670de0b6b3a764000060646124b7565b600a610c6483600761250b565b610c6e9190612536565b6001600160801b0316811015610c9157610bdc670de0b6b3a764000060326124b7565b610bdc670de0b6b3a764000060146124b7565b610cba621275006001600160801b0384166124f8565b811115610d05576000610cd66001600160801b03841683612461565b905081670de0b6b3a7640000610ced8360646124b7565b610cf791906124b7565b610d0191906124e4565b9450505b505050915091565b6000818152600360208181526040808420815160e08101835281546001600160a01b031681526001820154938101939093526002810154918301919091529091015463ffffffff8082166060840152600160201b8204811660808401819052600160401b8304821660a0850152600160601b9092041660c08301528203610db657610daf8160200151610d9f856119e5565b8360a0015163ffffffff16611c85565b9392505050565b50600092915050565b6001600160a01b0381166000908152600560205260408120610de090611d3e565b5192915050565b6000600254610df4611629565b610dfe9190612461565b905090565b6001600160a01b03831660009081526004602052604090205460609080610e2a84866124f8565b1115610e785760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207374617274496e646578202b206c656e6774680000000000604482015260640161076c565b60008367ffffffffffffffff811115610e9357610e9361255c565b604051908082528060200260200182016040528015610ecc57816020015b610eb9612231565b815260200190600190039081610eb15790505b506001600160a01b038716600090815260046020908152604080832080548251818502810185019093528083529495509293909291830182828015610f3057602002820191906000526020600020905b815481526020019060010190808311610f1c575b505050505090506000808790505b610f4887896124f8565b811015611025576000838281518110610f6357610f63612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c08301528651909250869085908110610ffc57610ffc612572565b60200260200101819052508261101190612588565b9250508061101e90612588565b9050610f3e565b5091979650505050505050565b61103a611b8f565b6110446000611d4b565b565b6001600160a01b0382166000908152600560205260408120610daf9083611d9b565b611070611db3565b600082116110b15760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015260640161076c565b6f29c30f1029939b146664242d97d9f64960361b8211156111145760405162461bcd60e51b815260206004820152601a60248201527f5374616b6520616d6f756e742065786365656473206c696d6974000000000000604482015260640161076c565b620151808163ffffffff16101561116d5760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e6720706572696f6420697320746f6f2073686f72740000000000604482015260640161076c565b61117c6301da9c0060056124b7565b8163ffffffff1611156111d15760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720706572696f6420697320746f6f206c6f6e67000000000000604482015260640161076c565b81600160008282546111e391906124f8565b90915550506008805463ffffffff8316919060009061120c9084906001600160501b03166125a1565b92506101000a8154816001600160501b0302191690836001600160501b031602179055506008600a81819054906101000a90046001600160501b0316611251906125c1565b91906101000a8154816001600160501b0302191690836001600160501b0316021790555060006112868263ffffffff16611539565b90508063ffffffff16600860148282829054906101000a90046001600160501b03166112b291906125a1565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550826112ee848463ffffffff168563ffffffff16611c85565b6112f891906124f8565b6002600082825461130991906124f8565b90915550839050611318611629565b61132291906124f8565b60025411156113875760405162461bcd60e51b815260206004820152602b60248201527f4d617820706f74656e7469616c2064656274206578636565647320636f6e747260448201526a6163742062616c616e636560a81b606482015260840161076c565b600060076000815461139890612588565b91829055506040805160e081018252338082526020808301898152600084860181815263ffffffff8a811660608801908152608088018481528d831660a08a0190815242841660c08b019081528c87526003808a528c88209b518c546001600160a01b0319166001600160a01b03909116178c55975160018c0155945160028b0155915198909501805495519151935198831667ffffffffffffffff1990961695909517600160201b91831691909102176fffffffffffffffff00000000000000001916600160401b9282169290920263ffffffff60601b191691909117600160601b969091169590950294909417905590825260069052908120805492935086929091906114a89084906124f8565b90915550503360009081526005602052604090206114c69082611e00565b50604051848152819033907f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee909060200160405180910390a36115336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333087611e0c565b50505050565b600062278d00821161154d57506004919050565b62278d008211801561156257506276a7008211155b1561156f57506007919050565b6276a70082118015611584575062ed4e008211155b156115915750600f919050565b62ed4e00821180156115a757506301da9c008211155b156115b457506022919050565b6301da9c00821180156115cb57506303b538008211155b156115d857506035919050565b6303b53800821180156115ef575063058fd4008211155b156115fc57506043919050565b63058fd40082118015611613575063076a70008211155b156116205750604b919050565b5060545b919050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611690573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906125e7565b6001600160a01b0381166000908152600560205260408120606091906116d990611d3e565b805190915060008167ffffffffffffffff8111156116f9576116f961255c565b60405190808252806020026020018201604052801561173257816020015b61171f612231565b8152602001906001900390816117175790505b50905060005b8281101561180a57600084828151811061175457611754612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c083015284519092508490849081106117ed576117ed612572565b6020026020010181905250508061180390612588565b9050611738565b50949350505050565b6001600160a01b03831660009081526005602052604081206060919061183890611d3e565b80519091508061184885876124f8565b11156118965760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207374617274496e646578202b206c656e6774680000000000604482015260640161076c565b60008467ffffffffffffffff8111156118b1576118b161255c565b6040519080825280602002602001820160405280156118ea57816020015b6118d7612231565b8152602001906001900390816118cf5790505b5090506000865b6118fb87896124f8565b8110156119d857600085828151811061191657611916612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c083015285519092508590859081106119af576119af612572565b6020026020010181905250826119c490612588565b925050806119d190612588565b90506118f1565b5090979650505050505050565b6000818152600360208181526040808420815160e08101835281546001600160a01b031681526001820154938101939093526002810154918301919091529091015463ffffffff8082166060840152600160201b820481166080840152600160401b8204811660a0840152600160601b9091041660c082018190528290611a6c9042612461565b90508160a0015163ffffffff168111611a855780611a91565b8160a0015163ffffffff165b949350505050565b611aa86301da9c0060056124b7565b81565b600080611ab783610b44565b6000858152600360208190526040822001549193509150611ae490600160401b900463ffffffff16611539565b9050606482611afb670de0b6b3a7640000836124b7565b611b059190612461565b611b0f90836124b7565b611a9191906124e4565b611b21611b8f565b6001600160a01b038116611b865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161076c565b6106aa81611d4b565b6000546001600160a01b031633146110445760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161076c565b611bf1611db3565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c2c3390565b6040516001600160a01b03909116815260200160405180910390a1565b611c51611e44565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611c2c565b600080611c9183611539565b9050611ca260646301da9c006124b7565b84611cad83886124b7565b611cb791906124b7565b611cc191906124e4565b95945050505050565b6000610daf8383611e94565b6040516001600160a01b038316602482015260448101829052611d3990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f8e565b505050565b60606000610daf83612063565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120541515610daf565b600054600160a01b900460ff16156110445760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161076c565b6000610daf83836120bf565b6040516001600160a01b03808516602483015283166044820152606481018290526115339085906323b872dd60e01b90608401611d02565b600054600160a01b900460ff166110445760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161076c565b60008181526001830160205260408120548015611f7d576000611eb8600183612461565b8554909150600090611ecc90600190612461565b9050818114611f31576000866000018281548110611eec57611eec612572565b9060005260206000200154905080876000018481548110611f0f57611f0f612572565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611f4257611f42612600565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610b0d565b6000915050610b0d565b5092915050565b6000611fe3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661210e9092919063ffffffff16565b90508051600014806120045750808060200190518101906120049190612616565b611d395760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161076c565b6060816000018054806020026020016040519081016040528092919081815260200182805480156120b357602002820191906000526020600020905b81548152602001906001019080831161209f575b50505050509050919050565b600081815260018301602052604081205461210657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b0d565b506000610b0d565b6060611a91848460008585600080866001600160a01b031685876040516121359190612657565b60006040518083038185875af1925050503d8060008114612172576040519150601f19603f3d011682016040523d82523d6000602084013e612177565b606091505b509150915061218887838387612193565b979650505050505050565b606083156122025782516000036121fb576001600160a01b0385163b6121fb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161076c565b5081611a91565b611a9183838151156122175781518083602001fd5b8060405162461bcd60e51b815260040161076c9190612673565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b80151581146106aa57600080fd5b60006020828403121561228d57600080fd5b8135610daf8161226d565b6000602082840312156122aa57600080fd5b5035919050565b80356001600160a01b038116811461162457600080fd5b6000602082840312156122da57600080fd5b610daf826122b1565b6020808252825182820181905260009190848201906040850190845b8181101561231b578351835292840192918401916001016122ff565b50909695505050505050565b6000806040838503121561233a57600080fd5b612343836122b1565b946020939093013593505050565b60008060006060848603121561236657600080fd5b61236f846122b1565b95602085013595506040909401359392505050565b602080825282518282018190526000919060409081850190868401855b8281101561102557815180516001600160a01b031685528681015187860152858101518686015260608082015163ffffffff9081169187019190915260808083015182169087015260a08083015182169087015260c091820151169085015260e090930192908501906001016123a1565b6000806040838503121561242557600080fd5b82359150602083013563ffffffff8116811461244057600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b0d57610b0d61244b565b60006001600160501b0382168061248d5761248d61244b565b6000190192915050565b6001600160501b03828116828216039080821115611f8757611f8761244b565b8082028115828204841417610b0d57610b0d61244b565b634e487b7160e01b600052601260045260246000fd5b6000826124f3576124f36124ce565b500490565b80820180821115610b0d57610b0d61244b565b6001600160801b0381811683821602808216919082811461252e5761252e61244b565b505092915050565b60006001600160801b0380841680612550576125506124ce565b92169190910492915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161259a5761259a61244b565b5060010190565b6001600160501b03818116838216019080821115611f8757611f8761244b565b60006001600160501b038083168181036125dd576125dd61244b565b6001019392505050565b6000602082840312156125f957600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561262857600080fd5b8151610daf8161226d565b60005b8381101561264e578181015183820152602001612636565b50506000910152565b60008251612669818460208701612633565b9190910192915050565b6020815260008251806020840152612692816040850160208701612633565b601f01601f1916919091016040019291505056fea2646970667358221220662c7acedc17bc42327e7bf818e85ee7046ba16eb580492f34a5fd8fd822fa9264736f6c63430008120033000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b5906300000000000000000000000036d27965c1db1c707801225c4b4729e32c5455ab

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80638232f9a11161015c578063bfaa8cca116100ce578063dd288ea211610087578063dd288ea214610614578063eb8af21a1461061c578063eeee849b14610645578063f1752ec514610658578063f2fde38b14610672578063fbcd9b051461068557600080fd5b8063bfaa8cca14610538578063c743dabb14610540578063ca6668231461054a578063cac33fdc14610553578063d5a44f861461055b578063dc7804be1461060b57600080fd5b806398d6bd001161012057806398d6bd00146104e057806399320130146104e8578063a182dd13146104f0578063a370968714610503578063ab1f932b14610516578063be15d8ef1461051e57600080fd5b80638232f9a1146104a157806383914540146104a95780638b7afe2e146104b45780638bd7ca57146104bc5780638da5cb5b146104cf57600080fd5b80635688515d1161020057806370a08231116101b957806370a0823114610401578063715018a6146104215780637180e5901461042957806372f702f31461043c57806378a96cc01461047b578063808bf6771461048e57600080fd5b80635688515d146103965780635709632b146103a05780635ae64bd8146103b35780635c975abb146103bb5780636a89beb7146103d95780636f882ca0146103f957600080fd5b8063313da78f11610252578063313da78f146102f55780633a5dd35f146103155780633e9ac989146103285780633ffee56d14610350578063468ce9e81461037b5780634d6ed8c41461038357600080fd5b806316c38b3c1461028f57806318160ddd146102a457806319775d14146102c05780632e1a7d4d146102c85780632f92f1f2146102db575b600080fd5b6102a261029d36600461227b565b610694565b005b6102ad60015481565b6040519081526020015b60405180910390f35b6102ad605481565b6102a26102d6366004612298565b6106b5565b6102ad6f29c30f1029939b146664242d97d9f64960361b81565b6103086103033660046122c8565b610ae9565b6040516102b791906122e3565b6102ad610323366004612327565b610b13565b61033b610336366004612298565b610b44565b604080519283526020830191909152016102b7565b600854610363906001600160501b031681565b6040516001600160501b0390911681526020016102b7565b6102ad603581565b6102ad610391366004612298565b610d0d565b6102ad6212750081565b6102ad6103ae3660046122c8565b610dbf565b6102ad610de7565b600054600160a01b900460ff165b60405190151581526020016102b7565b6103ec6103e7366004612351565b610e03565b6040516102b79190612384565b6102ad604381565b6102ad61040f3660046122c8565b60066020526000908152604090205481565b6102a2611032565b6103c9610437366004612327565b611046565b6104637f000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b5906381565b6040516001600160a01b0390911681526020016102b7565b6102a2610489366004612412565b611068565b6102ad61049c366004612298565b611539565b6102ad600f81565b6102ad6301da9c0081565b6102ad611629565b6103ec6104ca3660046122c8565b6116b4565b6000546001600160a01b0316610463565b6102ad600481565b6102ad602281565b6103ec6104fe366004612351565b611813565b6102ad610511366004612298565b6119e5565b6102ad604b81565b60085461036390600160a01b90046001600160501b031681565b6102ad606481565b6102ad6201518081565b6102ad60075481565b6102ad611a99565b6105c1610569366004612298565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919063ffffffff80821691600160201b8104821691600160401b8204811691600160601b90041687565b604080516001600160a01b03909816885260208801969096529486019390935263ffffffff91821660608601528116608085015290811660a08401521660c082015260e0016102b7565b6102ad60025481565b6102ad600781565b6102ad61062a3660046122c8565b6001600160a01b031660009081526004602052604090205490565b6102ad610653366004612298565b611aab565b60085461036390600160501b90046001600160501b031681565b6102a26106803660046122c8565b611b19565b6102ad670de0b6b3a764000081565b61069c611b8f565b80156106ad576106aa611be9565b50565b6106aa611c49565b600081815260036020818152604092839020835160e08101855281546001600160a01b0316815260018201549281018390526002820154948101949094529091015463ffffffff8082166060850152600160201b8204811660808501819052600160401b8304821660a0860152600160601b9092041660c0840152156107755760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481d5b9cdd185ad95960821b60448201526064015b60405180910390fd5b81516001600160a01b031633146107d95760405162461bcd60e51b815260206004820152602260248201527f43616e60742062652063616c6c6564206e6f74206279207374616b65206f776e60448201526132b960f11b606482015260840161076c565b80600160008282546107eb9190612461565b9091555050336000908152600660205260408120805483929061080f908490612461565b90915550600090508061082185610b44565b915091506008600a81819054906101000a90046001600160501b031661084690612474565b91906101000a8154816001600160501b0302191690836001600160501b031602179055508360a0015163ffffffff16600860008282829054906101000a90046001600160501b03166108989190612497565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550836060015163ffffffff16600860148282829054906101000a90046001600160501b03166108ea9190612497565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550600080600061091c88610d0d565b9050801561096e57610937670de0b6b3a764000060646124b7565b61094185836124b7565b61094b91906124e4565b92506109578382612461565b600089815260036020526040902060020181905591505b602087015160a088015161098a90829063ffffffff1680611c85565b61099491906124f8565b600260008282546109a59190612461565b90915550503360009081526005602052604090206109c39089611cca565b503360009081526004602090815260408083208054600181018255908452828420018b90558a8352600391829052822001805467ffffffff000000001916600160201b4263ffffffff1602179055610a24670de0b6b3a764000060646124b7565b610a2e87896124b7565b610a3891906124e4565b9050887f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc63385610a68858c612461565b610a7291906124f8565b604080516001600160a01b03909316835260208301919091520160405180910390a2610ade3384610aa3848b612461565b610aad91906124f8565b6001600160a01b037f000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b59063169190611cd6565b505050505050505050565b6001600160a01b0381166000908152600560205260409020606090610b0d90611d3e565b92915050565b60046020528160005260406000208181548110610b2f57600080fd5b90600052602060002001600091509150505481565b600081815260036020819052604082200154819063ffffffff600160601b8204811691600160401b90041682610b7a8342612461565b9050816001600160801b0316811015610ca457600a610b9a83600261250b565b610ba49190612536565b6001600160801b0316811015610be357610bc7670de0b6b3a764000060506124b7565b9450610bdc670de0b6b3a764000060646124b7565b9350610d05565b600a610bf083600461250b565b610bfa9190612536565b6001600160801b0316811015610c1d57610bc7670de0b6b3a764000060286124b7565b600a610c2a83600561250b565b610c349190612536565b6001600160801b0316811015610c5757610bdc670de0b6b3a764000060646124b7565b600a610c6483600761250b565b610c6e9190612536565b6001600160801b0316811015610c9157610bdc670de0b6b3a764000060326124b7565b610bdc670de0b6b3a764000060146124b7565b610cba621275006001600160801b0384166124f8565b811115610d05576000610cd66001600160801b03841683612461565b905081670de0b6b3a7640000610ced8360646124b7565b610cf791906124b7565b610d0191906124e4565b9450505b505050915091565b6000818152600360208181526040808420815160e08101835281546001600160a01b031681526001820154938101939093526002810154918301919091529091015463ffffffff8082166060840152600160201b8204811660808401819052600160401b8304821660a0850152600160601b9092041660c08301528203610db657610daf8160200151610d9f856119e5565b8360a0015163ffffffff16611c85565b9392505050565b50600092915050565b6001600160a01b0381166000908152600560205260408120610de090611d3e565b5192915050565b6000600254610df4611629565b610dfe9190612461565b905090565b6001600160a01b03831660009081526004602052604090205460609080610e2a84866124f8565b1115610e785760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207374617274496e646578202b206c656e6774680000000000604482015260640161076c565b60008367ffffffffffffffff811115610e9357610e9361255c565b604051908082528060200260200182016040528015610ecc57816020015b610eb9612231565b815260200190600190039081610eb15790505b506001600160a01b038716600090815260046020908152604080832080548251818502810185019093528083529495509293909291830182828015610f3057602002820191906000526020600020905b815481526020019060010190808311610f1c575b505050505090506000808790505b610f4887896124f8565b811015611025576000838281518110610f6357610f63612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c08301528651909250869085908110610ffc57610ffc612572565b60200260200101819052508261101190612588565b9250508061101e90612588565b9050610f3e565b5091979650505050505050565b61103a611b8f565b6110446000611d4b565b565b6001600160a01b0382166000908152600560205260408120610daf9083611d9b565b611070611db3565b600082116110b15760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015260640161076c565b6f29c30f1029939b146664242d97d9f64960361b8211156111145760405162461bcd60e51b815260206004820152601a60248201527f5374616b6520616d6f756e742065786365656473206c696d6974000000000000604482015260640161076c565b620151808163ffffffff16101561116d5760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e6720706572696f6420697320746f6f2073686f72740000000000604482015260640161076c565b61117c6301da9c0060056124b7565b8163ffffffff1611156111d15760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720706572696f6420697320746f6f206c6f6e67000000000000604482015260640161076c565b81600160008282546111e391906124f8565b90915550506008805463ffffffff8316919060009061120c9084906001600160501b03166125a1565b92506101000a8154816001600160501b0302191690836001600160501b031602179055506008600a81819054906101000a90046001600160501b0316611251906125c1565b91906101000a8154816001600160501b0302191690836001600160501b0316021790555060006112868263ffffffff16611539565b90508063ffffffff16600860148282829054906101000a90046001600160501b03166112b291906125a1565b92506101000a8154816001600160501b0302191690836001600160501b03160217905550826112ee848463ffffffff168563ffffffff16611c85565b6112f891906124f8565b6002600082825461130991906124f8565b90915550839050611318611629565b61132291906124f8565b60025411156113875760405162461bcd60e51b815260206004820152602b60248201527f4d617820706f74656e7469616c2064656274206578636565647320636f6e747260448201526a6163742062616c616e636560a81b606482015260840161076c565b600060076000815461139890612588565b91829055506040805160e081018252338082526020808301898152600084860181815263ffffffff8a811660608801908152608088018481528d831660a08a0190815242841660c08b019081528c87526003808a528c88209b518c546001600160a01b0319166001600160a01b03909116178c55975160018c0155945160028b0155915198909501805495519151935198831667ffffffffffffffff1990961695909517600160201b91831691909102176fffffffffffffffff00000000000000001916600160401b9282169290920263ffffffff60601b191691909117600160601b969091169590950294909417905590825260069052908120805492935086929091906114a89084906124f8565b90915550503360009081526005602052604090206114c69082611e00565b50604051848152819033907f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee909060200160405180910390a36115336001600160a01b037f000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b5906316333087611e0c565b50505050565b600062278d00821161154d57506004919050565b62278d008211801561156257506276a7008211155b1561156f57506007919050565b6276a70082118015611584575062ed4e008211155b156115915750600f919050565b62ed4e00821180156115a757506301da9c008211155b156115b457506022919050565b6301da9c00821180156115cb57506303b538008211155b156115d857506035919050565b6303b53800821180156115ef575063058fd4008211155b156115fc57506043919050565b63058fd40082118015611613575063076a70008211155b156116205750604b919050565b5060545b919050565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b590636001600160a01b0316906370a0823190602401602060405180830381865afa158015611690573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906125e7565b6001600160a01b0381166000908152600560205260408120606091906116d990611d3e565b805190915060008167ffffffffffffffff8111156116f9576116f961255c565b60405190808252806020026020018201604052801561173257816020015b61171f612231565b8152602001906001900390816117175790505b50905060005b8281101561180a57600084828151811061175457611754612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c083015284519092508490849081106117ed576117ed612572565b6020026020010181905250508061180390612588565b9050611738565b50949350505050565b6001600160a01b03831660009081526005602052604081206060919061183890611d3e565b80519091508061184885876124f8565b11156118965760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207374617274496e646578202b206c656e6774680000000000604482015260640161076c565b60008467ffffffffffffffff8111156118b1576118b161255c565b6040519080825280602002602001820160405280156118ea57816020015b6118d7612231565b8152602001906001900390816118cf5790505b5090506000865b6118fb87896124f8565b8110156119d857600085828151811061191657611916612572565b60209081029190910181015160008181526003808452604091829020825160e08101845281546001600160a01b03168152600182015495810195909552600281015492850192909252015463ffffffff8082166060850152600160201b820481166080850152600160401b8204811660a0850152600160601b9091041660c083015285519092508590859081106119af576119af612572565b6020026020010181905250826119c490612588565b925050806119d190612588565b90506118f1565b5090979650505050505050565b6000818152600360208181526040808420815160e08101835281546001600160a01b031681526001820154938101939093526002810154918301919091529091015463ffffffff8082166060840152600160201b820481166080840152600160401b8204811660a0840152600160601b9091041660c082018190528290611a6c9042612461565b90508160a0015163ffffffff168111611a855780611a91565b8160a0015163ffffffff165b949350505050565b611aa86301da9c0060056124b7565b81565b600080611ab783610b44565b6000858152600360208190526040822001549193509150611ae490600160401b900463ffffffff16611539565b9050606482611afb670de0b6b3a7640000836124b7565b611b059190612461565b611b0f90836124b7565b611a9191906124e4565b611b21611b8f565b6001600160a01b038116611b865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161076c565b6106aa81611d4b565b6000546001600160a01b031633146110445760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161076c565b611bf1611db3565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c2c3390565b6040516001600160a01b03909116815260200160405180910390a1565b611c51611e44565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611c2c565b600080611c9183611539565b9050611ca260646301da9c006124b7565b84611cad83886124b7565b611cb791906124b7565b611cc191906124e4565b95945050505050565b6000610daf8383611e94565b6040516001600160a01b038316602482015260448101829052611d3990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f8e565b505050565b60606000610daf83612063565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120541515610daf565b600054600160a01b900460ff16156110445760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161076c565b6000610daf83836120bf565b6040516001600160a01b03808516602483015283166044820152606481018290526115339085906323b872dd60e01b90608401611d02565b600054600160a01b900460ff166110445760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161076c565b60008181526001830160205260408120548015611f7d576000611eb8600183612461565b8554909150600090611ecc90600190612461565b9050818114611f31576000866000018281548110611eec57611eec612572565b9060005260206000200154905080876000018481548110611f0f57611f0f612572565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611f4257611f42612600565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610b0d565b6000915050610b0d565b5092915050565b6000611fe3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661210e9092919063ffffffff16565b90508051600014806120045750808060200190518101906120049190612616565b611d395760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161076c565b6060816000018054806020026020016040519081016040528092919081815260200182805480156120b357602002820191906000526020600020905b81548152602001906001019080831161209f575b50505050509050919050565b600081815260018301602052604081205461210657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b0d565b506000610b0d565b6060611a91848460008585600080866001600160a01b031685876040516121359190612657565b60006040518083038185875af1925050503d8060008114612172576040519150601f19603f3d011682016040523d82523d6000602084013e612177565b606091505b509150915061218887838387612193565b979650505050505050565b606083156122025782516000036121fb576001600160a01b0385163b6121fb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161076c565b5081611a91565b611a9183838151156122175781518083602001fd5b8060405162461bcd60e51b815260040161076c9190612673565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b80151581146106aa57600080fd5b60006020828403121561228d57600080fd5b8135610daf8161226d565b6000602082840312156122aa57600080fd5b5035919050565b80356001600160a01b038116811461162457600080fd5b6000602082840312156122da57600080fd5b610daf826122b1565b6020808252825182820181905260009190848201906040850190845b8181101561231b578351835292840192918401916001016122ff565b50909695505050505050565b6000806040838503121561233a57600080fd5b612343836122b1565b946020939093013593505050565b60008060006060848603121561236657600080fd5b61236f846122b1565b95602085013595506040909401359392505050565b602080825282518282018190526000919060409081850190868401855b8281101561102557815180516001600160a01b031685528681015187860152858101518686015260608082015163ffffffff9081169187019190915260808083015182169087015260a08083015182169087015260c091820151169085015260e090930192908501906001016123a1565b6000806040838503121561242557600080fd5b82359150602083013563ffffffff8116811461244057600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b0d57610b0d61244b565b60006001600160501b0382168061248d5761248d61244b565b6000190192915050565b6001600160501b03828116828216039080821115611f8757611f8761244b565b8082028115828204841417610b0d57610b0d61244b565b634e487b7160e01b600052601260045260246000fd5b6000826124f3576124f36124ce565b500490565b80820180821115610b0d57610b0d61244b565b6001600160801b0381811683821602808216919082811461252e5761252e61244b565b505092915050565b60006001600160801b0380841680612550576125506124ce565b92169190910492915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161259a5761259a61244b565b5060010190565b6001600160501b03818116838216019080821115611f8757611f8761244b565b60006001600160501b038083168181036125dd576125dd61244b565b6001019392505050565b6000602082840312156125f957600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561262857600080fd5b8151610daf8161226d565b60005b8381101561264e578181015183820152602001612636565b50506000910152565b60008251612669818460208701612633565b9190910192915050565b6020815260008251806020840152612692816040850160208701612633565b601f01601f1916919091016040019291505056fea2646970667358221220662c7acedc17bc42327e7bf818e85ee7046ba16eb580492f34a5fd8fd822fa9264736f6c63430008120033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b5906300000000000000000000000036d27965c1db1c707801225c4b4729e32c5455ab

-----Decoded View---------------
Arg [0] : stakingToken_ (address): 0xb55EE890426341FE45EE6dc788D2D93d25B59063
Arg [1] : owner_ (address): 0x36d27965C1db1C707801225c4b4729E32c5455Ab

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b55ee890426341fe45ee6dc788d2d93d25b59063
Arg [1] : 00000000000000000000000036d27965c1db1c707801225c4b4729e32c5455ab


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
[ Download: CSV Export  ]

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