POL Price: $0.620487 (-3.38%)
 

Overview

Max Total Supply

4,279,672.64101381984168947 sGAMER

Holders

859

Total Transfers

-

Market

Price

$0.00 @ 0.000000 POL

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
StakingPool

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
constantinople EvmVersion
File 1 of 11 : StakingPool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "solowei/contracts/AttoDecimal.sol";
import "solowei/contracts/TwoStageOwnable.sol";

contract StakingPool is ERC20, ReentrancyGuard, TwoStageOwnable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using AttoDecimal for AttoDecimal.Instance;

    struct Strategy {
        uint256 endsAt;
        uint256 perSecondReward;
        uint256 startsAt;
    }

    struct Unstake {
        uint256 amount;
        uint256 applicableAt;
    }

    uint256 public constant MIN_STAKE_BALANCE = 10**18;

    uint256 public claimingFeePercent;
    uint256 public lastUpdatedAt;

    uint256 private _feePool;
    uint256 private _lockedRewards;
    uint256 private _totalStaked;
    uint256 private _totalUnstaked;
    uint256 private _unstakingTime;
    IERC20 private _stakingToken;

    AttoDecimal.Instance private _defaultPrice;
    AttoDecimal.Instance private _price;
    Strategy private _currentStrategy;
    Strategy private _nextStrategy;

    mapping(address => Unstake) private _unstakes;

    function getTimestamp() internal view virtual returns (uint256) {
        return block.timestamp;
    }

    function feePool() public view returns (uint256) {
        return _feePool;
    }

    function lockedRewards() public view returns (uint256) {
        return _lockedRewards;
    }

    function totalStaked() public view returns (uint256) {
        return _totalStaked;
    }

    function totalUnstaked() public view returns (uint256) {
        return _totalUnstaked;
    }

    function stakingToken() public view returns (IERC20) {
        return _stakingToken;
    }

    function unstakingTime() public view returns (uint256) {
        return _unstakingTime;
    }

    function currentStrategy() public view returns (Strategy memory) {
        return _currentStrategy;
    }

    function nextStrategy() public view returns (Strategy memory) {
        return _nextStrategy;
    }

    function getUnstake(address account) public view returns (Unstake memory result) {
        result = _unstakes[account];
    }

    function defaultPrice()
        external
        view
        returns (
            uint256 mantissa,
            uint256 base,
            uint256 exponentiation
        )
    {
        return _defaultPrice.toTuple();
    }

    function getCurrentStrategyUnlockedRewards() public view returns (uint256 unlocked) {
        unlocked = _getStrategyUnlockedRewards(_currentStrategy);
    }

    function getUnlockedRewards() public view returns (uint256 unlocked, bool currentStrategyEnded) {
        unlocked = _getStrategyUnlockedRewards(_currentStrategy);
        if (getTimestamp() >= _currentStrategy.endsAt) {
            currentStrategyEnded = true;
            if (_nextStrategy.endsAt != 0) unlocked = unlocked.add(_getStrategyUnlockedRewards(_nextStrategy));
        }
    }

    /// @notice Calculates price of synthetic token for current block
    function price()
        public
        view
        returns (
            uint256 mantissa,
            uint256 base,
            uint256 exponentiation
        )
    {
        (uint256 unlocked, ) = getUnlockedRewards();
        uint256 totalStaked_ = _totalStaked;
        uint256 totalSupply_ = totalSupply();
        AttoDecimal.Instance memory result = _defaultPrice;
        if (totalSupply_ > 0) result = AttoDecimal.div(totalStaked_.add(unlocked), totalSupply_);
        return result.toTuple();
    }

    /// @notice Returns last updated price of synthetic token
    function priceStored()
        public
        view
        returns (
            uint256 mantissa,
            uint256 base,
            uint256 exponentiation
        )
    {
        return _price.toTuple();
    }

    /// @notice Calculates expected result of swapping synthetic tokens for staking tokens
    /// @param account Account that wants to swap
    /// @param amount Minimum amount of staking tokens that should be received at swapping process
    /// @return unstakedAmount Amount of staking tokens that should be received at swapping process
    /// @return burnedAmount Amount of synthetic tokens that should be burned at swapping process
    function calculateUnstake(address account, uint256 amount)
        public
        view
        returns (uint256 unstakedAmount, uint256 burnedAmount)
    {
        (uint256 mantissa_, , ) = price();
        return _calculateUnstake(account, amount, AttoDecimal.Instance(mantissa_));
    }

    event Claimed(
        address indexed account,
        uint256 requestedAmount,
        uint256 claimedAmount,
        uint256 feeAmount,
        uint256 burnedAmount
    );

    event ClaimingFeePercentUpdated(uint256 feePercent);
    event CurrentStrategyUpdated(uint256 perSecondReward, uint256 startsAt, uint256 endsAt);
    event FeeClaimed(address indexed receiver, uint256 amount);
    event NextStrategyUpdated(uint256 perSecondReward, uint256 startsAt, uint256 endsAt);
    event UnstakingTimeUpdated(uint256 unstakingTime);
    event NextStrategyRemoved();
    event PoolDecreased(uint256 amount);
    event PoolIncreased(address indexed payer, uint256 amount);
    event PriceUpdated(uint256 mantissa, uint256 base, uint256 exponentiation);
    event RewardsUnlocked(uint256 amount);
    event Staked(address indexed account, address indexed payer, uint256 stakedAmount, uint256 mintedAmount);
    event Unstaked(address indexed account, uint256 requestedAmount, uint256 unstakedAmount, uint256 burnedAmount);
    event UnstakingCanceled(address indexed account, uint256 amount);
    event Withdrawed(address indexed account, uint256 amount);

    constructor(
        string memory syntheticTokenName,
        string memory syntheticTokenSymbol,
        IERC20 stakingToken_,
        address owner_,
        uint256 claimingFeePercent_,
        uint256 perSecondReward_,
        uint256 startsAt_,
        uint256 duration_,
        uint256 unstakingTime_,
        uint256 defaultPriceMantissa
    ) public TwoStageOwnable(owner_) ERC20(syntheticTokenName, syntheticTokenSymbol) {
        _defaultPrice = AttoDecimal.Instance(defaultPriceMantissa);
        _stakingToken = stakingToken_;
        _setClaimingFeePercent(claimingFeePercent_);
        _validateStrategyParameters(perSecondReward_, startsAt_, duration_);
        _setUnstakingTime(unstakingTime_);
        _setCurrentStrategy(perSecondReward_, startsAt_, startsAt_.add(duration_));
        lastUpdatedAt = getTimestamp();
        _price = _defaultPrice;
    }

    /// @notice Cancels unstaking by staking locked for withdrawals tokens
    /// @param amount Amount of locked for withdrawals tokens
    function cancelUnstaking(uint256 amount) external onlyPositiveAmount(amount) returns (bool success) {
        _update();
        address caller = msg.sender;
        Unstake storage unstake_ = _unstakes[caller];
        uint256 unstakingAmount = unstake_.amount;
        require(unstakingAmount >= amount, "Not enough unstaked balance");
        uint256 stakedAmount = _price.mul(balanceOf(caller)).floor();
        require(stakedAmount.add(amount) >= MIN_STAKE_BALANCE, "Stake balance lt min stake");
        uint256 synthAmount = AttoDecimal.div(amount, _price).floor();
        _mint(caller, synthAmount);
        _totalStaked = _totalStaked.add(amount);
        _totalUnstaked = _totalUnstaked.sub(amount);
        unstake_.amount = unstakingAmount.sub(amount);
        emit Staked(caller, address(0), amount, synthAmount);
        emit UnstakingCanceled(caller, amount);
        return true;
    }

    /// @notice Swaps synthetic tokens for staking tokens and immediately sends them to the caller but takes some fee
    /// @param amount Staking tokens amount to swap for. Fee will be taked from this amount
    /// @return claimedAmount Amount of staking tokens that was been sended to caller
    /// @return burnedAmount Amount of synthetic tokens that was burned while swapping
    function claim(uint256 amount)
        external
        onlyPositiveAmount(amount)
        returns (uint256 claimedAmount, uint256 burnedAmount)
    {
        _update();
        address caller = msg.sender;
        (claimedAmount, burnedAmount) = _calculateUnstake(caller, amount, _price);
        uint256 fee = claimedAmount.mul(claimingFeePercent).div(100);
        _burn(caller, burnedAmount);
        _totalStaked = _totalStaked.sub(claimedAmount);
        claimedAmount = claimedAmount.sub(fee);
        _feePool = _feePool.add(fee);
        emit Claimed(caller, amount, claimedAmount, fee, burnedAmount);
        _stakingToken.safeTransfer(caller, claimedAmount);
    }

    /// @notice Withdraws all staking tokens, that have been accumulated in imidiatly claiming process.
    ///     Allowed to be called only by the owner
    /// @return amount Amount of accumulated and withdrawed tokens
    function claimFees() external onlyOwner returns (uint256 amount) {
        require(_feePool > 0, "No fees");
        amount = _feePool;
        _feePool = 0;
        emit FeeClaimed(owner(), amount);
        _stakingToken.safeTransfer(owner(), amount);
    }

    /// @notice Creates new strategy. Allowed to be called only by the owner
    /// @param perSecondReward_ Reward that should be added to common staking tokens pool every second
    /// @param startsAt_ Timestamp from which strategy should starts
    /// @param duration_ Seconds count for which new strategy should be applied
    function createNewStrategy(
        uint256 perSecondReward_,
        uint256 startsAt_,
        uint256 duration_
    ) public onlyOwner returns (bool success) {
        _update();
        _validateStrategyParameters(perSecondReward_, startsAt_, duration_);
        uint256 endsAt = startsAt_.add(duration_);
        Strategy memory strategy = Strategy({perSecondReward: perSecondReward_, startsAt: startsAt_, endsAt: endsAt});
        if (_currentStrategy.startsAt > getTimestamp()) {
            delete _nextStrategy;
            emit NextStrategyRemoved();
            _currentStrategy = strategy;
            emit CurrentStrategyUpdated(perSecondReward_, startsAt_, endsAt);
        } else {
            emit NextStrategyUpdated(perSecondReward_, startsAt_, endsAt);
            _nextStrategy = strategy;
            if (_currentStrategy.endsAt > startsAt_) {
                _currentStrategy.endsAt = startsAt_;
                emit CurrentStrategyUpdated(_currentStrategy.perSecondReward, _currentStrategy.startsAt, startsAt_);
            }
        }
        return true;
    }

    function decreasePool(uint256 amount) external onlyPositiveAmount(amount) onlyOwner returns (bool success) {
        _update();
        _lockedRewards = _lockedRewards.sub(amount, "Not enough locked rewards");
        emit PoolDecreased(amount);
        _stakingToken.safeTransfer(owner(), amount);
        return true;
    }

    /// @notice Increases pool of rewards
    /// @param amount Amount of staking tokens (in wei) that should be added to rewards pool
    function increasePool(uint256 amount) external onlyPositiveAmount(amount) returns (bool success) {
        _update();
        address payer = msg.sender;
        _lockedRewards = _lockedRewards.add(amount);
        emit PoolIncreased(payer, amount);
        _stakingToken.safeTransferFrom(payer, address(this), amount);
        return true;
    }

    /// @notice Change claiming fee percent. Can be called only by the owner
    /// @param feePercent New claiming fee percent
    function setClaimingFeePercent(uint256 feePercent) external onlyOwner returns (bool success) {
        _setClaimingFeePercent(feePercent);
        return true;
    }

    /// @notice Converts staking tokens to synthetic tokens
    /// @param amount Amount of staking tokens to be swapped
    /// @return mintedAmount Amount of synthetic tokens that was received at swapping process
    function stake(uint256 amount) external onlyPositiveAmount(amount) returns (uint256 mintedAmount) {
        address staker = msg.sender;
        return _stake(staker, staker, amount);
    }

    /// @notice Converts staking tokens to synthetic tokens and sends them to specific account
    /// @param account Receiver of synthetic tokens
    /// @param amount Amount of staking tokens to be swapped
    /// @return mintedAmount Amount of synthetic tokens that was received by specified account at swapping process
    function stakeForUser(address account, uint256 amount)
        external
        onlyPositiveAmount(amount)
        returns (uint256 mintedAmount)
    {
        return _stake(account, msg.sender, amount);
    }

    /// @notice Swapes synthetic tokens for staking tokens and locks them for some period
    /// @param amount Minimum amount of staking tokens that should be locked after swapping process
    /// @return unstakedAmount Amount of staking tokens that was locked
    /// @return burnedAmount Amount of synthetic tokens that was burned
    function unstake(uint256 amount)
        external
        onlyPositiveAmount(amount)
        returns (uint256 unstakedAmount, uint256 burnedAmount)
    {
        _update();
        address caller = msg.sender;
        (unstakedAmount, burnedAmount) = _calculateUnstake(caller, amount, _price);
        _burn(caller, burnedAmount);
        _totalStaked = _totalStaked.sub(unstakedAmount);
        _totalUnstaked = _totalUnstaked.add(unstakedAmount);
        Unstake storage unstake_ = _unstakes[caller];
        unstake_.amount = unstake_.amount.add(unstakedAmount);
        unstake_.applicableAt = getTimestamp().add(_unstakingTime);
        emit Unstaked(caller, amount, unstakedAmount, burnedAmount);
    }

    /// @notice Updates price of synthetic token
    /// @dev Automatically has been called on every contract action, that uses or can affect price
    function update() external returns (bool success) {
        _update();
        return true;
    }

    /// @notice Withdraws unstaked staking tokens
    function withdraw() external returns (bool success) {
        address caller = msg.sender;
        Unstake storage unstake_ = _unstakes[caller];
        uint256 amount = unstake_.amount;
        require(amount > 0, "Not unstaked");
        require(unstake_.applicableAt <= getTimestamp(), "Not released at");
        delete _unstakes[caller];
        _totalUnstaked = _totalUnstaked.sub(amount);
        emit Withdrawed(caller, amount);
        _stakingToken.safeTransfer(caller, amount);
        return true;
    }

    /// @notice Change unstaking time. Can be called only by the owner
    /// @param unstakingTime_ New unstaking process duration in seconds
    function setUnstakingTime(uint256 unstakingTime_) external onlyOwner returns (bool success) {
        _setUnstakingTime(unstakingTime_);
        return true;
    }

    function _getStrategyUnlockedRewards(Strategy memory strategy_) internal view returns (uint256 unlocked) {
        uint256 timestamp = getTimestamp();
        if (timestamp < strategy_.startsAt || timestamp == lastUpdatedAt) {
            return unlocked;
        }
        uint256 lastRewardedSecond = Math.max(lastUpdatedAt, strategy_.startsAt);
        uint256 lastRewardableTimestamp = Math.min(timestamp, strategy_.endsAt);
        if (lastRewardedSecond < lastRewardableTimestamp) {
            uint256 timeDiff = lastRewardableTimestamp.sub(lastRewardedSecond);
            unlocked = unlocked.add(timeDiff.mul(strategy_.perSecondReward));
        }
    }

    function _calculateUnstake(
        address account,
        uint256 amount,
        AttoDecimal.Instance memory price_
    ) internal view returns (uint256 unstakedAmount, uint256 burnedAmount) {
        unstakedAmount = amount;
        burnedAmount = AttoDecimal.div(amount, price_).ceil();
        uint256 balance = balanceOf(account);
        require(burnedAmount > 0, "Too small unstaking amount");
        require(balance >= burnedAmount, "Not enough synthetic tokens");
        uint256 remainingSyntheticBalance = balance.sub(burnedAmount);
        uint256 remainingStake = _price.mul(remainingSyntheticBalance).floor();
        if (remainingStake < 10**18) {
            burnedAmount = balance;
            unstakedAmount = unstakedAmount.add(remainingStake);
        }
    }

    function _unlockRewardsAndStake() internal {
        (uint256 unlocked, bool currentStrategyEnded) = getUnlockedRewards();
        if (currentStrategyEnded) {
            _currentStrategy = _nextStrategy;
            emit NextStrategyRemoved();
            if (_currentStrategy.endsAt != 0) {
                emit CurrentStrategyUpdated(
                    _currentStrategy.perSecondReward,
                    _currentStrategy.startsAt,
                    _currentStrategy.endsAt
                );
            }
            delete _nextStrategy;
        }
        unlocked = Math.min(unlocked, _lockedRewards);
        if (unlocked > 0) {
            emit RewardsUnlocked(unlocked);
            _lockedRewards = _lockedRewards.sub(unlocked);
            _totalStaked = _totalStaked.add(unlocked);
        }
        lastUpdatedAt = getTimestamp();
    }

    function _update() internal {
        if (getTimestamp() <= lastUpdatedAt) return;
        _unlockRewardsAndStake();
        _updatePrice();
    }

    function _updatePrice() internal {
        uint256 totalStaked_ = _totalStaked;
        uint256 totalSupply_ = totalSupply();
        if (totalSupply_ == 0) _price = _defaultPrice;
        else _price = AttoDecimal.div(totalStaked_, totalSupply_);
        emit PriceUpdated(_price.mantissa, AttoDecimal.BASE, AttoDecimal.EXPONENTIATION);
    }

    function _validateStrategyParameters(
        uint256 perSecondReward,
        uint256 startsAt,
        uint256 duration
    ) internal view {
        require(duration > 0, "Duration is zero");
        require(startsAt >= getTimestamp(), "Starting timestamp lt current");
        require(perSecondReward <= 188 * 10**18, "Per second reward overflow");
    }

    function _setClaimingFeePercent(uint256 feePercent) internal {
        require(feePercent >= 0 && feePercent <= 100, "Invalid fee percent");
        claimingFeePercent = feePercent;
        emit ClaimingFeePercentUpdated(feePercent);
    }

    function _setUnstakingTime(uint256 unstakingTime_) internal {
        _unstakingTime = unstakingTime_;
        emit UnstakingTimeUpdated(unstakingTime_);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal override {
        _update();
        string memory errorText = "Minimal stake balance should be more or equal to 1 token";
        if (from != address(0)) {
            uint256 fromNewBalance = _price.mul(balanceOf(from).sub(amount)).floor();
            require(fromNewBalance >= MIN_STAKE_BALANCE || fromNewBalance == 0, errorText);
        }
        if (to != address(0)) {
            require(_price.mul(balanceOf(to).add(amount)).floor() >= MIN_STAKE_BALANCE, errorText);
        }
    }

    function _setCurrentStrategy(
        uint256 perSecondReward_,
        uint256 startsAt_,
        uint256 endsAt_
    ) private {
        _currentStrategy = Strategy({perSecondReward: perSecondReward_, startsAt: startsAt_, endsAt: endsAt_});
        emit CurrentStrategyUpdated(perSecondReward_, startsAt_, endsAt_);
    }

    function _stake(
        address staker,
        address payer,
        uint256 amount
    ) private returns (uint256 mintedAmount) {
        _update();
        mintedAmount = AttoDecimal.div(amount, _price).floor();
        require(mintedAmount > 0, "Too small staking amount");
        _mint(staker, mintedAmount);
        _totalStaked = _totalStaked.add(amount);
        emit Staked(staker, payer, amount, mintedAmount);
        _stakingToken.safeTransferFrom(payer, address(this), amount);
    }

    modifier onlyPositiveAmount(uint256 amount) {
        require(amount > 0, "Amount is not positive");
        _;
    }
}

File 2 of 11 : TwoStageOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

abstract contract TwoStageOwnable {
    address private _nominatedOwner;
    address private _owner;

    function nominatedOwner() public view returns (address) {
        return _nominatedOwner;
    }

    function owner() public view returns (address) {
        return _owner;
    }

    event OwnerChanged(address indexed newOwner);
    event OwnerNominated(address indexed nominatedOwner);

    constructor(address owner_) internal {
        require(owner_ != address(0), "Owner is zero");
        _setOwner(owner_);
    }

    function acceptOwnership() external returns (bool success) {
        require(msg.sender == _nominatedOwner, "Not nominated to ownership");
        _setOwner(_nominatedOwner);
        return true;
    }

    function nominateNewOwner(address owner_) external onlyOwner returns (bool success) {
        _nominateNewOwner(owner_);
        return true;
    }

    modifier onlyOwner {
        require(msg.sender == _owner, "Not owner");
        _;
    }

    function _nominateNewOwner(address owner_) internal {
        if (_nominatedOwner == owner_) return;
        require(_owner != owner_, "Already owner");
        _nominatedOwner = owner_;
        emit OwnerNominated(owner_);
    }

    function _setOwner(address newOwner) internal {
        if (_owner == newOwner) return;
        _owner = newOwner;
        _nominatedOwner = address(0);
        emit OwnerChanged(newOwner);
    }
}

File 3 of 11 : AttoDecimal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";

library AttoDecimal {
    using SafeMath for uint256;

    struct Instance {
        uint256 mantissa;
    }

    uint256 internal constant BASE = 10;
    uint256 internal constant EXPONENTIATION = 18;
    uint256 internal constant ONE_MANTISSA = BASE**EXPONENTIATION;
    uint256 internal constant ONE_TENTH_MANTISSA = ONE_MANTISSA / 10;
    uint256 internal constant HALF_MANTISSA = ONE_MANTISSA / 2;
    uint256 internal constant SQUARED_ONE_MANTISSA = ONE_MANTISSA * ONE_MANTISSA;
    uint256 internal constant MAX_INTEGER = uint256(-1) / ONE_MANTISSA;

    function maximum() internal pure returns (Instance memory) {
        return Instance({mantissa: uint256(-1)});
    }

    function zero() internal pure returns (Instance memory) {
        return Instance({mantissa: 0});
    }

    function one() internal pure returns (Instance memory) {
        return Instance({mantissa: ONE_MANTISSA});
    }

    function convert(uint256 integer) internal pure returns (Instance memory) {
        return Instance({mantissa: integer.mul(ONE_MANTISSA)});
    }

    function compare(Instance memory a, Instance memory b) internal pure returns (int8) {
        if (a.mantissa < b.mantissa) return -1;
        return int8(a.mantissa > b.mantissa ? 1 : 0);
    }

    function compare(Instance memory a, uint256 b) internal pure returns (int8) {
        return compare(a, convert(b));
    }

    function add(Instance memory a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.add(b.mantissa)});
    }

    function add(Instance memory a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.add(b.mul(ONE_MANTISSA))});
    }

    function sub(Instance memory a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.sub(b.mantissa)});
    }

    function sub(Instance memory a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.sub(b.mul(ONE_MANTISSA))});
    }

    function sub(uint256 a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mul(ONE_MANTISSA).sub(b.mantissa)});
    }

    function mul(Instance memory a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mul(b.mantissa) / ONE_MANTISSA});
    }

    function mul(Instance memory a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mul(b)});
    }

    function div(Instance memory a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mul(ONE_MANTISSA).div(b.mantissa)});
    }

    function div(Instance memory a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mul(ONE_MANTISSA).div(b)});
    }

    function div(uint256 a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mul(SQUARED_ONE_MANTISSA).div(b.mantissa)});
    }

    function div(uint256 a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mul(ONE_MANTISSA).div(b)});
    }

    function idiv(Instance memory a, Instance memory b) internal pure returns (uint256) {
        return a.mantissa.div(b.mantissa);
    }

    function idiv(Instance memory a, uint256 b) internal pure returns (uint256) {
        return a.mantissa.div(b.mul(ONE_MANTISSA));
    }

    function idiv(uint256 a, Instance memory b) internal pure returns (uint256) {
        return a.mul(ONE_MANTISSA).div(b.mantissa);
    }

    function mod(Instance memory a, Instance memory b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mod(b.mantissa)});
    }

    function mod(Instance memory a, uint256 b) internal pure returns (Instance memory) {
        return Instance({mantissa: a.mantissa.mod(b.mul(ONE_MANTISSA))});
    }

    function mod(uint256 a, Instance memory b) internal pure returns (Instance memory) {
        if (a > MAX_INTEGER) return Instance({mantissa: a.mod(b.mantissa).mul(ONE_MANTISSA) % b.mantissa});
        return Instance({mantissa: a.mul(ONE_MANTISSA).mod(b.mantissa)});
    }

    function floor(Instance memory a) internal pure returns (uint256) {
        return a.mantissa / ONE_MANTISSA;
    }

    function ceil(Instance memory a) internal pure returns (uint256) {
        return (a.mantissa / ONE_MANTISSA) + (a.mantissa % ONE_MANTISSA > 0 ? 1 : 0);
    }

    function round(Instance memory a) internal pure returns (uint256) {
        return (a.mantissa / ONE_MANTISSA) + ((a.mantissa / ONE_TENTH_MANTISSA) % 10 >= 5 ? 1 : 0);
    }

    function eq(Instance memory a, Instance memory b) internal pure returns (bool) {
        return a.mantissa == b.mantissa;
    }

    function eq(Instance memory a, uint256 b) internal pure returns (bool) {
        if (b > MAX_INTEGER) return false;
        return a.mantissa == b * ONE_MANTISSA;
    }

    function gt(Instance memory a, Instance memory b) internal pure returns (bool) {
        return a.mantissa > b.mantissa;
    }

    function gt(Instance memory a, uint256 b) internal pure returns (bool) {
        if (b > MAX_INTEGER) return false;
        return a.mantissa > b * ONE_MANTISSA;
    }

    function gte(Instance memory a, Instance memory b) internal pure returns (bool) {
        return a.mantissa >= b.mantissa;
    }

    function gte(Instance memory a, uint256 b) internal pure returns (bool) {
        if (b > MAX_INTEGER) return false;
        return a.mantissa >= b * ONE_MANTISSA;
    }

    function lt(Instance memory a, Instance memory b) internal pure returns (bool) {
        return a.mantissa < b.mantissa;
    }

    function lt(Instance memory a, uint256 b) internal pure returns (bool) {
        if (b > MAX_INTEGER) return true;
        return a.mantissa < b * ONE_MANTISSA;
    }

    function lte(Instance memory a, Instance memory b) internal pure returns (bool) {
        return a.mantissa <= b.mantissa;
    }

    function lte(Instance memory a, uint256 b) internal pure returns (bool) {
        if (b > MAX_INTEGER) return true;
        return a.mantissa <= b * ONE_MANTISSA;
    }

    function isInteger(Instance memory a) internal pure returns (bool) {
        return a.mantissa % ONE_MANTISSA == 0;
    }

    function isPositive(Instance memory a) internal pure returns (bool) {
        return a.mantissa > 0;
    }

    function isZero(Instance memory a) internal pure returns (bool) {
        return a.mantissa == 0;
    }

    function sum(Instance[] memory array) internal pure returns (Instance memory result) {
        uint256 length = array.length;
        for (uint256 index = 0; index < length; index++) result = add(result, array[index]);
    }

    function toTuple(Instance memory a)
        internal
        pure
        returns (
            uint256 mantissa,
            uint256 base,
            uint256 exponentiation
        )
    {
        return (a.mantissa, BASE, EXPONENTIATION);
    }
}

File 4 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 11 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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://diligence.consensys.net/posts/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.5.11/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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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 functionCall(target, data, "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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 6 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    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'
        // solhint-disable-next-line max-line-length
        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));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @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");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

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

File 8 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 9 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 10 of 11 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 11 of 11 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"syntheticTokenName","type":"string"},{"internalType":"string","name":"syntheticTokenSymbol","type":"string"},{"internalType":"contract IERC20","name":"stakingToken_","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"claimingFeePercent_","type":"uint256"},{"internalType":"uint256","name":"perSecondReward_","type":"uint256"},{"internalType":"uint256","name":"startsAt_","type":"uint256"},{"internalType":"uint256","name":"duration_","type":"uint256"},{"internalType":"uint256","name":"unstakingTime_","type":"uint256"},{"internalType":"uint256","name":"defaultPriceMantissa","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnedAmount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feePercent","type":"uint256"}],"name":"ClaimingFeePercentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"perSecondReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startsAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endsAt","type":"uint256"}],"name":"CurrentStrategyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeClaimed","type":"event"},{"anonymous":false,"inputs":[],"name":"NextStrategyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"perSecondReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startsAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endsAt","type":"uint256"}],"name":"NextStrategyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nominatedOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PoolDecreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PoolIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"base","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exponentiation","type":"uint256"}],"name":"PriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintedAmount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unstakedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnedAmount","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnstakingCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"unstakingTime","type":"uint256"}],"name":"UnstakingTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawed","type":"event"},{"inputs":[],"name":"MIN_STAKE_BALANCE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateUnstake","outputs":[{"internalType":"uint256","name":"unstakedAmount","type":"uint256"},{"internalType":"uint256","name":"burnedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"cancelUnstaking","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[{"internalType":"uint256","name":"claimedAmount","type":"uint256"},{"internalType":"uint256","name":"burnedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFees","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimingFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"perSecondReward_","type":"uint256"},{"internalType":"uint256","name":"startsAt_","type":"uint256"},{"internalType":"uint256","name":"duration_","type":"uint256"}],"name":"createNewStrategy","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentStrategy","outputs":[{"components":[{"internalType":"uint256","name":"endsAt","type":"uint256"},{"internalType":"uint256","name":"perSecondReward","type":"uint256"},{"internalType":"uint256","name":"startsAt","type":"uint256"}],"internalType":"struct StakingPool.Strategy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreasePool","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultPrice","outputs":[{"internalType":"uint256","name":"mantissa","type":"uint256"},{"internalType":"uint256","name":"base","type":"uint256"},{"internalType":"uint256","name":"exponentiation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentStrategyUnlockedRewards","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnlockedRewards","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"},{"internalType":"bool","name":"currentStrategyEnded","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getUnstake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"applicableAt","type":"uint256"}],"internalType":"struct StakingPool.Unstake","name":"result","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increasePool","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastUpdatedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextStrategy","outputs":[{"components":[{"internalType":"uint256","name":"endsAt","type":"uint256"},{"internalType":"uint256","name":"perSecondReward","type":"uint256"},{"internalType":"uint256","name":"startsAt","type":"uint256"}],"internalType":"struct StakingPool.Strategy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"nominateNewOwner","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"mantissa","type":"uint256"},{"internalType":"uint256","name":"base","type":"uint256"},{"internalType":"uint256","name":"exponentiation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceStored","outputs":[{"internalType":"uint256","name":"mantissa","type":"uint256"},{"internalType":"uint256","name":"base","type":"uint256"},{"internalType":"uint256","name":"exponentiation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"feePercent","type":"uint256"}],"name":"setClaimingFeePercent","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"unstakingTime_","type":"uint256"}],"name":"setUnstakingTime","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"uint256","name":"mintedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakeForUser","outputs":[{"internalType":"uint256","name":"mintedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUnstaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[{"internalType":"uint256","name":"unstakedAmount","type":"uint256"},{"internalType":"uint256","name":"burnedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"update","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620034913803806200349183398101604081905262000034916200056c565b868a8a81600390805190602001906200004f9291906200041c565b508051620000659060049060208401906200041c565b50506005805460ff191660121790555060016006556001600160a01b038116620000c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd906200066d565b60405180910390fd5b620000d1816200016d565b5060408051602081019091528190526011819055601080546001600160a01b0319166001600160a01b038a161790556200010b86620001df565b620001188585856200025f565b62000123826200032d565b6200014985856200014386886200036460201b620014ec1790919060201c565b620003af565b6200015362000418565b600a55505060115460125550620007b59650505050505050565b6008546001600160a01b03828116911614156200018a57620001dc565b600880546001600160a01b0383166001600160a01b031991821681179092556007805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a25b50565b60648111156200021d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd9062000749565b60098190556040517fcd36e83aa831664c67a318291b1d97d2741c9ea9d5a49f66e29e28541b3c06e9906200025490839062000780565b60405180910390a150565b600081116200029c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd9062000636565b620002a662000418565b821015620002e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd9062000712565b680a31062beeed70000083111562000328576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd90620006db565b505050565b600f8190556040517f7f7d5eb76787d9279c88eb7f18c26b33761ae038bbd802551a7c6aa2f9f8dd12906200025490839062000780565b600082820183811015620003a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000bd90620006a4565b90505b92915050565b60408051606081018252828152602081018590528101839052601382905560148490556015839055517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c9492906200040b9085908590859062000789565b60405180910390a1505050565b4290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200045f57805160ff19168380011785556200048f565b828001600101855582156200048f579182015b828111156200048f57825182559160200191906001019062000472565b506200049d929150620004a1565b5090565b5b808211156200049d5760008155600101620004a2565b8051620003a9816200079f565b600082601f830112620004d6578081fd5b81516001600160401b0380821115620004ed578283fd5b6040516020601f8401601f19168201810183811183821017156200050f578586fd5b806040525081945083825286818588010111156200052c57600080fd5b600092505b8383101562000550578583018101518284018201529182019162000531565b83831115620005625760008185840101525b5050505092915050565b6000806000806000806000806000806101408b8d0312156200058c578586fd5b8a516001600160401b0380821115620005a3578788fd5b620005b18e838f01620004c5565b9b5060208d0151915080821115620005c7578788fd5b50620005d68d828e01620004c5565b995050620005e88c60408d01620004b8565b9750620005f98c60608d01620004b8565b965060808b0151955060a08b0151945060c08b0151935060e08b015192506101008b015191506101208b015190509295989b9194979a5092959850565b60208082526010908201527f4475726174696f6e206973207a65726f00000000000000000000000000000000604082015260600190565b6020808252600d908201527f4f776e6572206973207a65726f00000000000000000000000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601a908201527f506572207365636f6e6420726577617264206f766572666c6f77000000000000604082015260600190565b6020808252601d908201527f5374617274696e672074696d657374616d70206c742063757272656e74000000604082015260600190565b60208082526013908201527f496e76616c6964206665652070657263656e7400000000000000000000000000604082015260600190565b90815260200190565b9283526020830191909152604082015260600190565b6001600160a01b0381168114620001dc57600080fd5b612ccc80620007c56000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c806372f702f31161015c578063a694fc3a116100ce578063dd62ed3e11610087578063dd62ed3e14610524578063e175ae1314610537578063e2fd6ff91461053f578063e69e04b314610547578063e928ce721461054f578063fd79c6a2146105575761028a565b8063a694fc3a146104d3578063a9059cbb146104e6578063ae2e933b146104f9578063af1c7f2014610501578063d294f09314610509578063d708120e146105115761028a565b80638da5cb5b116101205780638da5cb5b14610480578063947ae12a1461048857806395d89b41146104a8578063a035b1fe146104b0578063a2e62045146104b8578063a457c2d7146104c05761028a565b806372f702f31461044257806379ba50971461044a5780637ee3beb914610452578063817b1cd214610465578063833e8bb61461046d5761028a565b806332a6bf43116102005780635235934d116101b95780635235934d146103e257806353a47bb7146103ea57806354aea127146103ff578063551fdc46146104075780636a1ceb2d1461041a57806370a082311461042f5761028a565b806332a6bf4314610382578063379607f51461039957806339509351146103ac578063396f55d0146103bf5780633ccfd60b146103c757806346267a93146103cf5761028a565b80631627540c116102525780631627540c1461030b57806318160ddd1461031e5780632059ba6f1461032657806323b872dd146103395780632e17de781461034c578063313ce5671461036d5761028a565b806301a563831461028f57806306fdde03146102ad578063095ea7b3146102c25780630be4bc0d146102e257806314cb97d7146102f8575b600080fd5b61029761056a565b6040516102a49190612b22565b60405180910390f35b6102b5610570565b6040516102a4919061253f565b6102d56102d036600461243a565b610607565b6040516102a49190612534565b6102ea610625565b6040516102a4929190612b2b565b6102d5610306366004612484565b6106af565b6102d56103193660046123ab565b6106f7565b61029761072d565b6102d5610334366004612484565b610733565b6102d56103473660046123fa565b610769565b61035f61035a366004612484565b6107f1565b6040516102a4929190612b3b565b6103756108fa565b6040516102a49190612b7a565b61038a610903565b6040516102a493929190612b49565b61035f6103a7366004612484565b61092e565b6102d56103ba36600461243a565b610a3d565b610297610a8b565b6102d5610a97565b61035f6103dd36600461243a565b610b86565b610297610bbc565b6103f2610bc2565b6040516102a491906124e3565b610297610bd1565b6102d5610415366004612484565b610bd7565b610422610cc7565b6040516102a49190612aea565b61029761043d3660046123ab565b610cf4565b6103f2610d0f565b6102d5610d1e565b6102d5610460366004612484565b610d66565b610297610f12565b6102d561047b366004612484565b610f18565b6103f2610fb0565b61049b6104963660046123ab565b610fbf565b6040516102a49190612b0b565b6102b5610ffa565b61038a61105b565b6102d56110c9565b6102d56104ce36600461243a565b6110d3565b6102976104e1366004612484565b61113b565b6102d56104f436600461243a565b611172565b610297611186565b61029761118c565b610297611192565b6102d561051f36600461249c565b611251565b6102976105323660046123c6565b61140e565b610422611439565b610297611466565b61038a611498565b6102976114b8565b61029761056536600461243a565b6114be565b60095481565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fc5780601f106105d1576101008083540402835291602001916105fc565b820191906000526020600020905b8154815290600101906020018083116105df57829003601f168201915b505050505090505b90565b600061061b610614611511565b8484611515565b5060015b92915050565b6040805160608101825260135481526014546020820152601554918101919091526000908190610654906115c9565b60135490925061066261165d565b106106ab5750601654600190156106ab576040805160608101825260165481526017546020820152601854918101919091526106a8906106a1906115c9565b83906114ec565b91505b9091565b6008546000906001600160a01b031633146106e55760405162461bcd60e51b81526004016106dc906128f9565b60405180910390fd5b6106ee82611661565b5060015b919050565b6008546000906001600160a01b031633146107245760405162461bcd60e51b81526004016106dc906128f9565b6106ee826116c2565b60025490565b6008546000906001600160a01b031633146107605760405162461bcd60e51b81526004016106dc906128f9565b6106ee82611756565b600061077684848461178b565b6107e684610782611511565b6107e185604051806060016040528060288152602001612c12602891396001600160a01b038a166000908152600160205260408120906107c0611511565b6001600160a01b0316815260208101919091526040016000205491906118a0565b611515565b5060015b9392505050565b60008082600081116108155760405162461bcd60e51b81526004016106dc906126d6565b61081d6118cc565b60408051602081019091526012548152339061083c90829087906118f3565b909450925061084b81846119b6565b600d546108589085611a98565b600d55600e5461086890856114ec565b600e556001600160a01b0381166000908152601960205260409020805461088f90866114ec565b8155600f546108a6906108a061165d565b906114ec565b60018201556040516001600160a01b038316907f204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00906108ea90899089908990612b49565b60405180910390a2505050915091565b60055460ff1690565b604080516020810190915260125481526000908190819061092390611ada565b925092509250909192565b60008082600081116109525760405162461bcd60e51b81526004016106dc906126d6565b61095a6118cc565b60408051602081019091526012548152339061097990829087906118f3565b600954919550935060009061099c90606490610996908890611ae4565b90611b1e565b90506109a882856119b6565b600d546109b59086611a98565b600d556109c28582611a98565b600b549095506109d290826114ec565b600b556040516001600160a01b038316907f7708755c9b641bf197be5047b04002d2e88fa658c173a351067747eb5dfc568a90610a16908990899086908a90612b5f565b60405180910390a2601054610a35906001600160a01b03168387611b60565b505050915091565b600061061b610a4a611511565b846107e18560016000610a5b611511565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906114ec565b670de0b6b3a764000081565b336000818152601960205260408120805491929180610ac85760405162461bcd60e51b81526004016106dc9061268f565b610ad061165d565b82600101541115610af35760405162461bcd60e51b81526004016106dc9061277e565b6001600160a01b038316600090815260196020526040812081815560010155600e54610b1f9082611a98565b600e556040516001600160a01b038416907f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe90610b5d908490612b22565b60405180910390a2601054610b7c906001600160a01b03168483611b60565b6001935050505090565b6000806000610b9361105b565b50509050610bb085856040518060200160405280858152506118f3565b92509250509250929050565b600e5490565b6007546001600160a01b031690565b600a5481565b60008160008111610bfa5760405162461bcd60e51b81526004016106dc906126d6565b6008546001600160a01b03163314610c245760405162461bcd60e51b81526004016106dc906128f9565b610c2c6118cc565b60408051808201909152601981527f4e6f7420656e6f756768206c6f636b65642072657761726473000000000000006020820152600c54610c6e9185906118a0565b600c556040517fcb871ad2b15bb3b1869f4566fd37fc75eb21cc32e880568fc6a73aae7939c5d290610ca1908590612b22565b60405180910390a161061b610cb4610fb0565b6010546001600160a01b03169085611b60565b610ccf612346565b5060408051606081018252601354815260145460208201526015549181019190915290565b6001600160a01b031660009081526020819052604090205490565b6010546001600160a01b031690565b6007546000906001600160a01b03163314610d4b5760405162461bcd60e51b81526004016106dc90612805565b600754610d60906001600160a01b0316611bbb565b50600190565b60008160008111610d895760405162461bcd60e51b81526004016106dc906126d6565b610d916118cc565b336000818152601960205260409020805485811015610dc25760405162461bcd60e51b81526004016106dc90612997565b6000610dee610de9610dd386610cf4565b6040805160208101909152601254815290611c2a565b611c54565b9050670de0b6b3a7640000610e0382896114ec565b1015610e215760405162461bcd60e51b81526004016106dc906128c2565b60408051602081019091526012548152600090610e4390610de9908a90611c63565b9050610e4f8582611c97565b600d54610e5c90896114ec565b600d55600e54610e6c9089611a98565b600e55610e798389611a98565b84556040516000906001600160a01b038716907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc90610ebb908c908690612b3b565b60405180910390a3846001600160a01b03167f6a6d5d5933544e2f8792a55eb024869c9b2fa719fd6b231725a991198658f94e89604051610efc9190612b22565b60405180910390a2506001979650505050505050565b600d5490565b60008160008111610f3b5760405162461bcd60e51b81526004016106dc906126d6565b610f436118cc565b600c543390610f5290856114ec565b600c556040516001600160a01b038216907f457b865678556d8d0f459b359ad2daa4638a33e4616c48e9c501f28ef8b673c490610f90908790612b22565b60405180910390a26010546107e6906001600160a01b0316823087611d4b565b6008546001600160a01b031690565b610fc7612367565b506001600160a01b0316600090815260196020908152604091829020825180840190935280548352600101549082015290565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fc5780601f106105d1576101008083540402835291602001916105fc565b600080600080611069610625565b50600d54909150600061107a61072d565b9050611084612381565b506040805160208101909152601154815281156110b1576110ae6110a884866114ec565b83611d72565b90505b6110ba81611ada565b96509650965050505050909192565b6000610d606118cc565b600061061b6110e0611511565b846107e185604051806060016040528060258152602001612c72602591396001600061110a611511565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906118a0565b6000816000811161115e5760405162461bcd60e51b81526004016106dc906126d6565b3361116a818086611d9c565b949350505050565b600061061b61117f611511565b848461178b565b600b5490565b600f5490565b6008546000906001600160a01b031633146111bf5760405162461bcd60e51b81526004016106dc906128f9565b6000600b54116111e15760405162461bcd60e51b81526004016106dc906126b5565b50600b805460009091556111f3610fb0565b6001600160a01b03167f20ca5094f3a20c321cbe4123d0f01b276b81df0fa24cd4d83d9253956035d8638260405161122b9190612b22565b60405180910390a261060461123e610fb0565b6010546001600160a01b03169083611b60565b6008546000906001600160a01b0316331461127e5760405162461bcd60e51b81526004016106dc906128f9565b6112866118cc565b611291848484611e69565b600061129d84846114ec565b90506112a7612346565b60405180606001604052808381526020018781526020018681525090506112cc61165d565b60155411156113625760006016819055601781905560188190556040517fe58d04c6069251e310ede9daae36efbc408e81b8bebd9915bf5a7e6e7ca95d989190a180516013556020810151601455604080820151601555517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c94929061135590889088908690612b49565b60405180910390a1611402565b7f1355800f5bff457ad5c5a51017502bef53351bc3e3575eaf67c1f768b2101b7586868460405161139593929190612b49565b60405180910390a18051601655602081015160175560408101516018556013548510156114025760138590556014546015546040517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c9492926113f99290918990612b49565b60405180910390a15b50600195945050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611441612346565b5060408051606081018252601654815260175460208201526018549181019190915290565b604080516060810182526013548152601454602082015260155491810191909152600090611493906115c9565b905090565b604080516020810190915260115481526000908190819061092390611ada565b600c5490565b600081600081116114e15760405162461bcd60e51b81526004016106dc906126d6565b61116a843385611d9c565b6000828201838110156107ea5760405162461bcd60e51b81526004016106dc90612621565b3390565b6001600160a01b03831661153b5760405162461bcd60e51b81526004016106dc9061291c565b6001600160a01b0382166115615760405162461bcd60e51b81526004016106dc906125df565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906115bc908590612b22565b60405180910390a3505050565b6000806115d461165d565b905082604001518110806115e95750600a5481145b156115f457506106f2565b6000611606600a548560400151611ed9565b90506000611618838660000151611ef0565b90508082101561165557600061162e8284611a98565b905061165161164a876020015183611ae490919063ffffffff16565b86906114ec565b9450505b505050919050565b4290565b60648111156116825760405162461bcd60e51b81526004016106dc906129ce565b60098190556040517fcd36e83aa831664c67a318291b1d97d2741c9ea9d5a49f66e29e28541b3c06e9906116b7908390612b22565b60405180910390a150565b6007546001600160a01b03828116911614156116dd57611753565b6008546001600160a01b038281169116141561170b5760405162461bcd60e51b81526004016106dc906127de565b600780546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a25b50565b600f8190556040517f7f7d5eb76787d9279c88eb7f18c26b33761ae038bbd802551a7c6aa2f9f8dd12906116b7908390612b22565b6001600160a01b0383166117b15760405162461bcd60e51b81526004016106dc9061287d565b6001600160a01b0382166117d75760405162461bcd60e51b81526004016106dc90612572565b6117e2838383611eff565b61181f81604051806060016040528060268152602001612bec602691396001600160a01b03861660009081526020819052604090205491906118a0565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461184e90826114ec565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115bc908590612b22565b600081848411156118c45760405162461bcd60e51b81526004016106dc919061253f565b505050900390565b600a546118d761165d565b116118e1576118f1565b6118e9611fda565b6118f1612101565b565b8160006119086119038385611c63565b612172565b9050600061191586610cf4565b9050600082116119375760405162461bcd60e51b81526004016106dc90612a7c565b818110156119575760405162461bcd60e51b81526004016106dc90612a45565b60006119638284611a98565b6040805160208101909152601254815290915060009061198790610de99084611c2a565b9050670de0b6b3a76400008110156119ab5791925082916119a885826114ec565b94505b505050935093915050565b6001600160a01b0382166119dc5760405162461bcd60e51b81526004016106dc9061283c565b6119e882600083611eff565b611a2581604051806060016040528060228152602001612bca602291396001600160a01b03851660009081526020819052604090205491906118a0565b6001600160a01b038316600090815260208190526040902055600254611a4b9082611a98565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a8c908590612b22565b60405180910390a35050565b60006107ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118a0565b5190600a90601290565b600082611af35750600061061f565b82820282848281611b0057fe5b04146107ea5760405162461bcd60e51b81526004016106dc9061273d565b60006107ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ac565b611bb68363a9059cbb60e01b8484604051602401611b7f92919061251b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526121e3565b505050565b6008546001600160a01b0382811691161415611bd657611753565b600880546001600160a01b0383166001600160a01b031991821681179092556007805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a250565b611c32612381565b604080516020810190915283518190611c4b9085611ae4565b90529392505050565b51670de0b6b3a7640000900490565b611c6b612381565b604080516020810190915282518190611c4b90610996876ec097ce7bc90715b34b9f1000000000611ae4565b6001600160a01b038216611cbd5760405162461bcd60e51b81526004016106dc90612ab3565b611cc960008383611eff565b600254611cd690826114ec565b6002556001600160a01b038216600090815260208190526040902054611cfc90826114ec565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a8c908590612b22565b611d6c846323b872dd60e01b858585604051602401611b7f939291906124f7565b50505050565b611d7a612381565b604080516020810190915280611c4b8461099687670de0b6b3a7640000611ae4565b6000611da66118cc565b60408051602081019091526012548152611dc590610de9908490611c63565b905060008111611de75760405162461bcd60e51b81526004016106dc906127a7565b611df18482611c97565b600d54611dfe90836114ec565b600d81905550826001600160a01b0316846001600160a01b03167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc8484604051611e49929190612b3b565b60405180910390a36010546107ea906001600160a01b0316843085611d4b565b60008111611e895760405162461bcd60e51b81526004016106dc906125b5565b611e9161165d565b821015611eb05760405162461bcd60e51b81526004016106dc90612706565b680a31062beeed700000831115611bb65760405162461bcd60e51b81526004016106dc90612658565b600081831015611ee957816107ea565b5090919050565b6000818310611ee957816107ea565b611f076118cc565b6060604051806060016040528060388152602001612c3a6038913990506001600160a01b03841615611f87576000611f4e610de9610dd385611f4889610cf4565b90611a98565b9050670de0b6b3a764000081101580611f65575080155b8290611f845760405162461bcd60e51b81526004016106dc919061253f565b50505b6001600160a01b03831615611d6c57670de0b6b3a7640000611fb2610de9610dd3856108a088610cf4565b10158190611fd35760405162461bcd60e51b81526004016106dc919061253f565b5050505050565b600080611fe5610625565b915091508015612086576016546013556017546014556018546015556040517fe58d04c6069251e310ede9daae36efbc408e81b8bebd9915bf5a7e6e7ca95d9890600090a160135415612076576014546015546013546040517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c94929361206d9390929091612b49565b60405180910390a15b6000601681905560178190556018555b61209282600c54611ef0565b915081156120f2577f01feb0f24c52736758ca404486734e6287175eb5c93aa090f0ab371665231d72826040516120c99190612b22565b60405180910390a1600c546120de9083611a98565b600c55600d546120ee90836114ec565b600d555b6120fa61165d565b600a555050565b600d54600061210e61072d565b9050806121205760115460125561212f565b61212a8282611d72565b516012555b601280546040517f15819dd2fd9f6418b142e798d08a18d0bf06ea368f4480b7b0d3f75bd966bc48926121669291600a9190612b49565b60405180910390a15050565b8051600090670de0b6b3a7640000900661218d576000612190565b60015b60ff166012600a0a8360000151816121a457fe5b040192915050565b600081836121cd5760405162461bcd60e51b81526004016106dc919061253f565b5060008385816121d957fe5b0495945050505050565b6060612238826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122729092919063ffffffff16565b805190915015611bb657808060200190518101906122569190612464565b611bb65760405162461bcd60e51b81526004016106dc906129fb565b606061116a8484600085606061228785612340565b6122a35760405162461bcd60e51b81526004016106dc90612960565b60006060866001600160a01b031685876040516122c091906124c7565b60006040518083038185875af1925050503d80600081146122fd576040519150601f19603f3d011682016040523d82523d6000602084013e612302565b606091505b5091509150811561231657915061116a9050565b8051156123265780518082602001fd5b8360405162461bcd60e51b81526004016106dc919061253f565b3b151590565b60405180606001604052806000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6040518060200160405280600081525090565b80356001600160a01b038116811461061f57600080fd5b6000602082840312156123bc578081fd5b6107ea8383612394565b600080604083850312156123d8578081fd5b6123e28484612394565b91506123f18460208501612394565b90509250929050565b60008060006060848603121561240e578081fd5b833561241981612bb4565b9250602084013561242981612bb4565b929592945050506040919091013590565b6000806040838503121561244c578182fd5b6124568484612394565b946020939093013593505050565b600060208284031215612475578081fd5b815180151581146107ea578182fd5b600060208284031215612495578081fd5b5035919050565b6000806000606084860312156124b0578283fd5b505081359360208301359350604090920135919050565b600082516124d9818460208701612b88565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252825180602084015261255e816040850160208701612b88565b601f01601f19169190910160400192915050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526010908201526f4475726174696f6e206973207a65726f60801b604082015260600190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601a908201527f506572207365636f6e6420726577617264206f766572666c6f77000000000000604082015260600190565b6020808252600c908201526b139bdd081d5b9cdd185ad95960a21b604082015260600190565b6020808252600790820152664e6f206665657360c81b604082015260600190565b602080825260169082015275416d6f756e74206973206e6f7420706f73697469766560501b604082015260600190565b6020808252601d908201527f5374617274696e672074696d657374616d70206c742063757272656e74000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600f908201526e139bdd081c995b19585cd95908185d608a1b604082015260600190565b60208082526018908201527f546f6f20736d616c6c207374616b696e6720616d6f756e740000000000000000604082015260600190565b6020808252600d908201526c20b63932b0b23c9037bbb732b960991b604082015260600190565b6020808252601a908201527f4e6f74206e6f6d696e6174656420746f206f776e657273686970000000000000604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252601a908201527f5374616b652062616c616e6365206c74206d696e207374616b65000000000000604082015260600190565b6020808252600990820152682737ba1037bbb732b960b91b604082015260600190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601b908201527f4e6f7420656e6f75676820756e7374616b65642062616c616e63650000000000604082015260600190565b602080825260139082015272125b9d985b1a5908199959481c195c98d95b9d606a1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601b908201527f4e6f7420656e6f7567682073796e74686574696320746f6b656e730000000000604082015260600190565b6020808252601a908201527f546f6f20736d616c6c20756e7374616b696e6720616d6f756e74000000000000604082015260600190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b81518152602080830151908201526040918201519181019190915260600190565b815181526020918201519181019190915260400190565b90815260200190565b9182521515602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60ff91909116815260200190565b60005b83811015612ba3578181015183820152602001612b8b565b83811115611d6c5750506000910152565b6001600160a01b038116811461175357600080fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654d696e696d616c207374616b652062616c616e63652073686f756c64206265206d6f7265206f7220657175616c20746f203120746f6b656e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220beb58b0d49480ee62b38c7fe142c52081223ff0a73da7cf28a82671bca3e196e64736f6c634300060c0033000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000003f6b3595ecf70735d3f48d69b09c4e4506db3f47000000000000000000000000d4eee3d50588d7dee8dcc42635e50093e0aa8cc00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000617be240000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000a8c000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000125374616b65642047616d6553746174696f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000067347414d45520000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c806372f702f31161015c578063a694fc3a116100ce578063dd62ed3e11610087578063dd62ed3e14610524578063e175ae1314610537578063e2fd6ff91461053f578063e69e04b314610547578063e928ce721461054f578063fd79c6a2146105575761028a565b8063a694fc3a146104d3578063a9059cbb146104e6578063ae2e933b146104f9578063af1c7f2014610501578063d294f09314610509578063d708120e146105115761028a565b80638da5cb5b116101205780638da5cb5b14610480578063947ae12a1461048857806395d89b41146104a8578063a035b1fe146104b0578063a2e62045146104b8578063a457c2d7146104c05761028a565b806372f702f31461044257806379ba50971461044a5780637ee3beb914610452578063817b1cd214610465578063833e8bb61461046d5761028a565b806332a6bf43116102005780635235934d116101b95780635235934d146103e257806353a47bb7146103ea57806354aea127146103ff578063551fdc46146104075780636a1ceb2d1461041a57806370a082311461042f5761028a565b806332a6bf4314610382578063379607f51461039957806339509351146103ac578063396f55d0146103bf5780633ccfd60b146103c757806346267a93146103cf5761028a565b80631627540c116102525780631627540c1461030b57806318160ddd1461031e5780632059ba6f1461032657806323b872dd146103395780632e17de781461034c578063313ce5671461036d5761028a565b806301a563831461028f57806306fdde03146102ad578063095ea7b3146102c25780630be4bc0d146102e257806314cb97d7146102f8575b600080fd5b61029761056a565b6040516102a49190612b22565b60405180910390f35b6102b5610570565b6040516102a4919061253f565b6102d56102d036600461243a565b610607565b6040516102a49190612534565b6102ea610625565b6040516102a4929190612b2b565b6102d5610306366004612484565b6106af565b6102d56103193660046123ab565b6106f7565b61029761072d565b6102d5610334366004612484565b610733565b6102d56103473660046123fa565b610769565b61035f61035a366004612484565b6107f1565b6040516102a4929190612b3b565b6103756108fa565b6040516102a49190612b7a565b61038a610903565b6040516102a493929190612b49565b61035f6103a7366004612484565b61092e565b6102d56103ba36600461243a565b610a3d565b610297610a8b565b6102d5610a97565b61035f6103dd36600461243a565b610b86565b610297610bbc565b6103f2610bc2565b6040516102a491906124e3565b610297610bd1565b6102d5610415366004612484565b610bd7565b610422610cc7565b6040516102a49190612aea565b61029761043d3660046123ab565b610cf4565b6103f2610d0f565b6102d5610d1e565b6102d5610460366004612484565b610d66565b610297610f12565b6102d561047b366004612484565b610f18565b6103f2610fb0565b61049b6104963660046123ab565b610fbf565b6040516102a49190612b0b565b6102b5610ffa565b61038a61105b565b6102d56110c9565b6102d56104ce36600461243a565b6110d3565b6102976104e1366004612484565b61113b565b6102d56104f436600461243a565b611172565b610297611186565b61029761118c565b610297611192565b6102d561051f36600461249c565b611251565b6102976105323660046123c6565b61140e565b610422611439565b610297611466565b61038a611498565b6102976114b8565b61029761056536600461243a565b6114be565b60095481565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fc5780601f106105d1576101008083540402835291602001916105fc565b820191906000526020600020905b8154815290600101906020018083116105df57829003601f168201915b505050505090505b90565b600061061b610614611511565b8484611515565b5060015b92915050565b6040805160608101825260135481526014546020820152601554918101919091526000908190610654906115c9565b60135490925061066261165d565b106106ab5750601654600190156106ab576040805160608101825260165481526017546020820152601854918101919091526106a8906106a1906115c9565b83906114ec565b91505b9091565b6008546000906001600160a01b031633146106e55760405162461bcd60e51b81526004016106dc906128f9565b60405180910390fd5b6106ee82611661565b5060015b919050565b6008546000906001600160a01b031633146107245760405162461bcd60e51b81526004016106dc906128f9565b6106ee826116c2565b60025490565b6008546000906001600160a01b031633146107605760405162461bcd60e51b81526004016106dc906128f9565b6106ee82611756565b600061077684848461178b565b6107e684610782611511565b6107e185604051806060016040528060288152602001612c12602891396001600160a01b038a166000908152600160205260408120906107c0611511565b6001600160a01b0316815260208101919091526040016000205491906118a0565b611515565b5060015b9392505050565b60008082600081116108155760405162461bcd60e51b81526004016106dc906126d6565b61081d6118cc565b60408051602081019091526012548152339061083c90829087906118f3565b909450925061084b81846119b6565b600d546108589085611a98565b600d55600e5461086890856114ec565b600e556001600160a01b0381166000908152601960205260409020805461088f90866114ec565b8155600f546108a6906108a061165d565b906114ec565b60018201556040516001600160a01b038316907f204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00906108ea90899089908990612b49565b60405180910390a2505050915091565b60055460ff1690565b604080516020810190915260125481526000908190819061092390611ada565b925092509250909192565b60008082600081116109525760405162461bcd60e51b81526004016106dc906126d6565b61095a6118cc565b60408051602081019091526012548152339061097990829087906118f3565b600954919550935060009061099c90606490610996908890611ae4565b90611b1e565b90506109a882856119b6565b600d546109b59086611a98565b600d556109c28582611a98565b600b549095506109d290826114ec565b600b556040516001600160a01b038316907f7708755c9b641bf197be5047b04002d2e88fa658c173a351067747eb5dfc568a90610a16908990899086908a90612b5f565b60405180910390a2601054610a35906001600160a01b03168387611b60565b505050915091565b600061061b610a4a611511565b846107e18560016000610a5b611511565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906114ec565b670de0b6b3a764000081565b336000818152601960205260408120805491929180610ac85760405162461bcd60e51b81526004016106dc9061268f565b610ad061165d565b82600101541115610af35760405162461bcd60e51b81526004016106dc9061277e565b6001600160a01b038316600090815260196020526040812081815560010155600e54610b1f9082611a98565b600e556040516001600160a01b038416907f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe90610b5d908490612b22565b60405180910390a2601054610b7c906001600160a01b03168483611b60565b6001935050505090565b6000806000610b9361105b565b50509050610bb085856040518060200160405280858152506118f3565b92509250509250929050565b600e5490565b6007546001600160a01b031690565b600a5481565b60008160008111610bfa5760405162461bcd60e51b81526004016106dc906126d6565b6008546001600160a01b03163314610c245760405162461bcd60e51b81526004016106dc906128f9565b610c2c6118cc565b60408051808201909152601981527f4e6f7420656e6f756768206c6f636b65642072657761726473000000000000006020820152600c54610c6e9185906118a0565b600c556040517fcb871ad2b15bb3b1869f4566fd37fc75eb21cc32e880568fc6a73aae7939c5d290610ca1908590612b22565b60405180910390a161061b610cb4610fb0565b6010546001600160a01b03169085611b60565b610ccf612346565b5060408051606081018252601354815260145460208201526015549181019190915290565b6001600160a01b031660009081526020819052604090205490565b6010546001600160a01b031690565b6007546000906001600160a01b03163314610d4b5760405162461bcd60e51b81526004016106dc90612805565b600754610d60906001600160a01b0316611bbb565b50600190565b60008160008111610d895760405162461bcd60e51b81526004016106dc906126d6565b610d916118cc565b336000818152601960205260409020805485811015610dc25760405162461bcd60e51b81526004016106dc90612997565b6000610dee610de9610dd386610cf4565b6040805160208101909152601254815290611c2a565b611c54565b9050670de0b6b3a7640000610e0382896114ec565b1015610e215760405162461bcd60e51b81526004016106dc906128c2565b60408051602081019091526012548152600090610e4390610de9908a90611c63565b9050610e4f8582611c97565b600d54610e5c90896114ec565b600d55600e54610e6c9089611a98565b600e55610e798389611a98565b84556040516000906001600160a01b038716907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc90610ebb908c908690612b3b565b60405180910390a3846001600160a01b03167f6a6d5d5933544e2f8792a55eb024869c9b2fa719fd6b231725a991198658f94e89604051610efc9190612b22565b60405180910390a2506001979650505050505050565b600d5490565b60008160008111610f3b5760405162461bcd60e51b81526004016106dc906126d6565b610f436118cc565b600c543390610f5290856114ec565b600c556040516001600160a01b038216907f457b865678556d8d0f459b359ad2daa4638a33e4616c48e9c501f28ef8b673c490610f90908790612b22565b60405180910390a26010546107e6906001600160a01b0316823087611d4b565b6008546001600160a01b031690565b610fc7612367565b506001600160a01b0316600090815260196020908152604091829020825180840190935280548352600101549082015290565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fc5780601f106105d1576101008083540402835291602001916105fc565b600080600080611069610625565b50600d54909150600061107a61072d565b9050611084612381565b506040805160208101909152601154815281156110b1576110ae6110a884866114ec565b83611d72565b90505b6110ba81611ada565b96509650965050505050909192565b6000610d606118cc565b600061061b6110e0611511565b846107e185604051806060016040528060258152602001612c72602591396001600061110a611511565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906118a0565b6000816000811161115e5760405162461bcd60e51b81526004016106dc906126d6565b3361116a818086611d9c565b949350505050565b600061061b61117f611511565b848461178b565b600b5490565b600f5490565b6008546000906001600160a01b031633146111bf5760405162461bcd60e51b81526004016106dc906128f9565b6000600b54116111e15760405162461bcd60e51b81526004016106dc906126b5565b50600b805460009091556111f3610fb0565b6001600160a01b03167f20ca5094f3a20c321cbe4123d0f01b276b81df0fa24cd4d83d9253956035d8638260405161122b9190612b22565b60405180910390a261060461123e610fb0565b6010546001600160a01b03169083611b60565b6008546000906001600160a01b0316331461127e5760405162461bcd60e51b81526004016106dc906128f9565b6112866118cc565b611291848484611e69565b600061129d84846114ec565b90506112a7612346565b60405180606001604052808381526020018781526020018681525090506112cc61165d565b60155411156113625760006016819055601781905560188190556040517fe58d04c6069251e310ede9daae36efbc408e81b8bebd9915bf5a7e6e7ca95d989190a180516013556020810151601455604080820151601555517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c94929061135590889088908690612b49565b60405180910390a1611402565b7f1355800f5bff457ad5c5a51017502bef53351bc3e3575eaf67c1f768b2101b7586868460405161139593929190612b49565b60405180910390a18051601655602081015160175560408101516018556013548510156114025760138590556014546015546040517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c9492926113f99290918990612b49565b60405180910390a15b50600195945050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611441612346565b5060408051606081018252601654815260175460208201526018549181019190915290565b604080516060810182526013548152601454602082015260155491810191909152600090611493906115c9565b905090565b604080516020810190915260115481526000908190819061092390611ada565b600c5490565b600081600081116114e15760405162461bcd60e51b81526004016106dc906126d6565b61116a843385611d9c565b6000828201838110156107ea5760405162461bcd60e51b81526004016106dc90612621565b3390565b6001600160a01b03831661153b5760405162461bcd60e51b81526004016106dc9061291c565b6001600160a01b0382166115615760405162461bcd60e51b81526004016106dc906125df565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906115bc908590612b22565b60405180910390a3505050565b6000806115d461165d565b905082604001518110806115e95750600a5481145b156115f457506106f2565b6000611606600a548560400151611ed9565b90506000611618838660000151611ef0565b90508082101561165557600061162e8284611a98565b905061165161164a876020015183611ae490919063ffffffff16565b86906114ec565b9450505b505050919050565b4290565b60648111156116825760405162461bcd60e51b81526004016106dc906129ce565b60098190556040517fcd36e83aa831664c67a318291b1d97d2741c9ea9d5a49f66e29e28541b3c06e9906116b7908390612b22565b60405180910390a150565b6007546001600160a01b03828116911614156116dd57611753565b6008546001600160a01b038281169116141561170b5760405162461bcd60e51b81526004016106dc906127de565b600780546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a25b50565b600f8190556040517f7f7d5eb76787d9279c88eb7f18c26b33761ae038bbd802551a7c6aa2f9f8dd12906116b7908390612b22565b6001600160a01b0383166117b15760405162461bcd60e51b81526004016106dc9061287d565b6001600160a01b0382166117d75760405162461bcd60e51b81526004016106dc90612572565b6117e2838383611eff565b61181f81604051806060016040528060268152602001612bec602691396001600160a01b03861660009081526020819052604090205491906118a0565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461184e90826114ec565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115bc908590612b22565b600081848411156118c45760405162461bcd60e51b81526004016106dc919061253f565b505050900390565b600a546118d761165d565b116118e1576118f1565b6118e9611fda565b6118f1612101565b565b8160006119086119038385611c63565b612172565b9050600061191586610cf4565b9050600082116119375760405162461bcd60e51b81526004016106dc90612a7c565b818110156119575760405162461bcd60e51b81526004016106dc90612a45565b60006119638284611a98565b6040805160208101909152601254815290915060009061198790610de99084611c2a565b9050670de0b6b3a76400008110156119ab5791925082916119a885826114ec565b94505b505050935093915050565b6001600160a01b0382166119dc5760405162461bcd60e51b81526004016106dc9061283c565b6119e882600083611eff565b611a2581604051806060016040528060228152602001612bca602291396001600160a01b03851660009081526020819052604090205491906118a0565b6001600160a01b038316600090815260208190526040902055600254611a4b9082611a98565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a8c908590612b22565b60405180910390a35050565b60006107ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118a0565b5190600a90601290565b600082611af35750600061061f565b82820282848281611b0057fe5b04146107ea5760405162461bcd60e51b81526004016106dc9061273d565b60006107ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ac565b611bb68363a9059cbb60e01b8484604051602401611b7f92919061251b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526121e3565b505050565b6008546001600160a01b0382811691161415611bd657611753565b600880546001600160a01b0383166001600160a01b031991821681179092556007805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a250565b611c32612381565b604080516020810190915283518190611c4b9085611ae4565b90529392505050565b51670de0b6b3a7640000900490565b611c6b612381565b604080516020810190915282518190611c4b90610996876ec097ce7bc90715b34b9f1000000000611ae4565b6001600160a01b038216611cbd5760405162461bcd60e51b81526004016106dc90612ab3565b611cc960008383611eff565b600254611cd690826114ec565b6002556001600160a01b038216600090815260208190526040902054611cfc90826114ec565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a8c908590612b22565b611d6c846323b872dd60e01b858585604051602401611b7f939291906124f7565b50505050565b611d7a612381565b604080516020810190915280611c4b8461099687670de0b6b3a7640000611ae4565b6000611da66118cc565b60408051602081019091526012548152611dc590610de9908490611c63565b905060008111611de75760405162461bcd60e51b81526004016106dc906127a7565b611df18482611c97565b600d54611dfe90836114ec565b600d81905550826001600160a01b0316846001600160a01b03167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc8484604051611e49929190612b3b565b60405180910390a36010546107ea906001600160a01b0316843085611d4b565b60008111611e895760405162461bcd60e51b81526004016106dc906125b5565b611e9161165d565b821015611eb05760405162461bcd60e51b81526004016106dc90612706565b680a31062beeed700000831115611bb65760405162461bcd60e51b81526004016106dc90612658565b600081831015611ee957816107ea565b5090919050565b6000818310611ee957816107ea565b611f076118cc565b6060604051806060016040528060388152602001612c3a6038913990506001600160a01b03841615611f87576000611f4e610de9610dd385611f4889610cf4565b90611a98565b9050670de0b6b3a764000081101580611f65575080155b8290611f845760405162461bcd60e51b81526004016106dc919061253f565b50505b6001600160a01b03831615611d6c57670de0b6b3a7640000611fb2610de9610dd3856108a088610cf4565b10158190611fd35760405162461bcd60e51b81526004016106dc919061253f565b5050505050565b600080611fe5610625565b915091508015612086576016546013556017546014556018546015556040517fe58d04c6069251e310ede9daae36efbc408e81b8bebd9915bf5a7e6e7ca95d9890600090a160135415612076576014546015546013546040517f2fa40e2e6101b8bae833c4716c3c36b1e15938b1aaa699ec9896bb2d836c94929361206d9390929091612b49565b60405180910390a15b6000601681905560178190556018555b61209282600c54611ef0565b915081156120f2577f01feb0f24c52736758ca404486734e6287175eb5c93aa090f0ab371665231d72826040516120c99190612b22565b60405180910390a1600c546120de9083611a98565b600c55600d546120ee90836114ec565b600d555b6120fa61165d565b600a555050565b600d54600061210e61072d565b9050806121205760115460125561212f565b61212a8282611d72565b516012555b601280546040517f15819dd2fd9f6418b142e798d08a18d0bf06ea368f4480b7b0d3f75bd966bc48926121669291600a9190612b49565b60405180910390a15050565b8051600090670de0b6b3a7640000900661218d576000612190565b60015b60ff166012600a0a8360000151816121a457fe5b040192915050565b600081836121cd5760405162461bcd60e51b81526004016106dc919061253f565b5060008385816121d957fe5b0495945050505050565b6060612238826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122729092919063ffffffff16565b805190915015611bb657808060200190518101906122569190612464565b611bb65760405162461bcd60e51b81526004016106dc906129fb565b606061116a8484600085606061228785612340565b6122a35760405162461bcd60e51b81526004016106dc90612960565b60006060866001600160a01b031685876040516122c091906124c7565b60006040518083038185875af1925050503d80600081146122fd576040519150601f19603f3d011682016040523d82523d6000602084013e612302565b606091505b5091509150811561231657915061116a9050565b8051156123265780518082602001fd5b8360405162461bcd60e51b81526004016106dc919061253f565b3b151590565b60405180606001604052806000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6040518060200160405280600081525090565b80356001600160a01b038116811461061f57600080fd5b6000602082840312156123bc578081fd5b6107ea8383612394565b600080604083850312156123d8578081fd5b6123e28484612394565b91506123f18460208501612394565b90509250929050565b60008060006060848603121561240e578081fd5b833561241981612bb4565b9250602084013561242981612bb4565b929592945050506040919091013590565b6000806040838503121561244c578182fd5b6124568484612394565b946020939093013593505050565b600060208284031215612475578081fd5b815180151581146107ea578182fd5b600060208284031215612495578081fd5b5035919050565b6000806000606084860312156124b0578283fd5b505081359360208301359350604090920135919050565b600082516124d9818460208701612b88565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252825180602084015261255e816040850160208701612b88565b601f01601f19169190910160400192915050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526010908201526f4475726174696f6e206973207a65726f60801b604082015260600190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601a908201527f506572207365636f6e6420726577617264206f766572666c6f77000000000000604082015260600190565b6020808252600c908201526b139bdd081d5b9cdd185ad95960a21b604082015260600190565b6020808252600790820152664e6f206665657360c81b604082015260600190565b602080825260169082015275416d6f756e74206973206e6f7420706f73697469766560501b604082015260600190565b6020808252601d908201527f5374617274696e672074696d657374616d70206c742063757272656e74000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600f908201526e139bdd081c995b19585cd95908185d608a1b604082015260600190565b60208082526018908201527f546f6f20736d616c6c207374616b696e6720616d6f756e740000000000000000604082015260600190565b6020808252600d908201526c20b63932b0b23c9037bbb732b960991b604082015260600190565b6020808252601a908201527f4e6f74206e6f6d696e6174656420746f206f776e657273686970000000000000604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252601a908201527f5374616b652062616c616e6365206c74206d696e207374616b65000000000000604082015260600190565b6020808252600990820152682737ba1037bbb732b960b91b604082015260600190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601b908201527f4e6f7420656e6f75676820756e7374616b65642062616c616e63650000000000604082015260600190565b602080825260139082015272125b9d985b1a5908199959481c195c98d95b9d606a1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601b908201527f4e6f7420656e6f7567682073796e74686574696320746f6b656e730000000000604082015260600190565b6020808252601a908201527f546f6f20736d616c6c20756e7374616b696e6720616d6f756e74000000000000604082015260600190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b81518152602080830151908201526040918201519181019190915260600190565b815181526020918201519181019190915260400190565b90815260200190565b9182521515602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60ff91909116815260200190565b60005b83811015612ba3578181015183820152602001612b8b565b83811115611d6c5750506000910152565b6001600160a01b038116811461175357600080fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654d696e696d616c207374616b652062616c616e63652073686f756c64206265206d6f7265206f7220657175616c20746f203120746f6b656e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220beb58b0d49480ee62b38c7fe142c52081223ff0a73da7cf28a82671bca3e196e64736f6c634300060c0033

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

000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000003f6b3595ecf70735d3f48d69b09c4e4506db3f47000000000000000000000000d4eee3d50588d7dee8dcc42635e50093e0aa8cc00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000617be240000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000a8c000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000125374616b65642047616d6553746174696f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000067347414d45520000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : syntheticTokenName (string): Staked GameStation
Arg [1] : syntheticTokenSymbol (string): sGAMER
Arg [2] : stakingToken_ (address): 0x3f6b3595ecF70735D3f48D69b09C4E4506DB3F47
Arg [3] : owner_ (address): 0xd4eeE3D50588D7dee8Dcc42635E50093E0AA8Cc0
Arg [4] : claimingFeePercent_ (uint256): 2
Arg [5] : perSecondReward_ (uint256): 0
Arg [6] : startsAt_ (uint256): 1635508800
Arg [7] : duration_ (uint256): 1
Arg [8] : unstakingTime_ (uint256): 691200
Arg [9] : defaultPriceMantissa (uint256): 1000000000000000000

-----Encoded View---------------
14 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [2] : 0000000000000000000000003f6b3595ecf70735d3f48d69b09c4e4506db3f47
Arg [3] : 000000000000000000000000d4eee3d50588d7dee8dcc42635e50093e0aa8cc0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 00000000000000000000000000000000000000000000000000000000617be240
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [8] : 00000000000000000000000000000000000000000000000000000000000a8c00
Arg [9] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [11] : 5374616b65642047616d6553746174696f6e0000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [13] : 7347414d45520000000000000000000000000000000000000000000000000000


Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.