MATIC Price: $0.99 (-1.47%)
Gas: 131 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim536485722024-02-18 1:08:3940 days ago1708218519IN
0x36caee4b...98E8b2678
0 MATIC0.0044597430
Deposit519512282024-01-05 2:20:3684 days ago1704421236IN
0x36caee4b...98E8b2678
0 MATIC0.0053293230
Deposit515259512023-12-25 4:56:2195 days ago1703480181IN
0x36caee4b...98E8b2678
0 MATIC0.0063875730
Deposit515258892023-12-25 4:53:4895 days ago1703480028IN
0x36caee4b...98E8b2678
0 MATIC0.0076467330
Claim515256342023-12-25 4:44:0995 days ago1703479449IN
0x36caee4b...98E8b2678
0 MATIC0.0043997430
Deposit506774962023-12-03 3:56:30117 days ago1701575790IN
0x36caee4b...98E8b2678
0 MATIC0.0054429630
Deposit502792002023-11-23 4:48:15127 days ago1700714895IN
0x36caee4b...98E8b2678
0 MATIC0.0056990430
Claim487672602023-10-16 1:19:00165 days ago1697419140IN
0x36caee4b...98E8b2678
0 MATIC0.0057103938.41297665
Claim487672432023-10-16 1:18:24165 days ago1697419104IN
0x36caee4b...98E8b2678
0 MATIC0.0056351837.90703413
Claim487672432023-10-16 1:18:24165 days ago1697419104IN
0x36caee4b...98E8b2678
0 MATIC0.0056351837.90703413
Claim487671852023-10-16 1:16:22165 days ago1697418982IN
0x36caee4b...98E8b2678
0 MATIC0.006327338.17197262
Deposit483486272023-10-05 7:47:22175 days ago1696492042IN
0x36caee4b...98E8b2678
0 MATIC0.0074999430
Claim478391692023-09-22 6:28:52188 days ago1695364132IN
0x36caee4b...98E8b2678
0 MATIC0.0089343460.1
Claim478391692023-09-22 6:28:52188 days ago1695364132IN
0x36caee4b...98E8b2678
0 MATIC0.0089343460.1
Claim478391692023-09-22 6:28:52188 days ago1695364132IN
0x36caee4b...98E8b2678
0 MATIC0.0089343460.1
Claim478391692023-09-22 6:28:52188 days ago1695364132IN
0x36caee4b...98E8b2678
0 MATIC0.0099620560.1
Claim475927192023-09-16 1:11:52195 days ago1694826712IN
0x36caee4b...98E8b2678
0 MATIC0.0104060670
Claim475927192023-09-16 1:11:52195 days ago1694826712IN
0x36caee4b...98E8b2678
0 MATIC0.0104060670
Claim475926962023-09-16 1:11:04195 days ago1694826664IN
0x36caee4b...98E8b2678
0 MATIC0.0104060670
Claim475926482023-09-16 1:09:22195 days ago1694826562IN
0x36caee4b...98E8b2678
0 MATIC0.0116030670
Claim461622562023-08-11 4:19:11231 days ago1691727551IN
0x36caee4b...98E8b2678
0 MATIC0.0089209660.01
Claim461622562023-08-11 4:19:11231 days ago1691727551IN
0x36caee4b...98E8b2678
0 MATIC0.0089209660.01
Claim461622562023-08-11 4:19:11231 days ago1691727551IN
0x36caee4b...98E8b2678
0 MATIC0.0089209660.01
Claim461622122023-08-11 4:17:37231 days ago1691727457IN
0x36caee4b...98E8b2678
0 MATIC0.0099471360.01
Claim410776492023-04-03 1:38:28361 days ago1680485908IN
0x36caee4b...98E8b2678
0 MATIC0.0089194860
View all transactions

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MasterChef

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : MasterChef.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";


import "./DGoldToken.sol";
import "./DragonLocker.sol";


interface IShares {
    function sendTo(address to, uint256 amount) external;
}

contract MasterChef is ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;
    

    // Info of each user.
    struct UserInfo {
        uint256 amount;         // How many LP tokens the user has provided.
        uint256 rewardKept;
        uint256 rewardDebt;     // Reward debt. See explanation below.
        uint256 rewardSharesKept;
        uint256 rewardSharesDebt;     // Reward debt. See explanation below.
        uint256 lastClaimedBlock;  // last powered Block
    }

    // Info of each pool.
    struct PoolInfo {
        uint256 amount;
        IERC20 lpToken;           // Address of LP token contract.
        uint256 allocPoint;       // How many allocation points assigned to this pool. SHs to distribute per block.
        uint256 lastRewardBlock;  // Last block number that Shs distribution occurs.
        uint256 accShPerPower;   // Accumulated Shs per share, times 1e12. See below.
        uint16 depositFeeBP;      // Deposit fee in basis points

        uint256 lastSharesRewardBlock;  // Last block number that Shs distribution occurs.
        uint256 accSharesPerPower;   // Accumulated Shs per share, times 1e12. See below.
    }

    DGoldToken public sh;
    IShares public shares;
    // Dev address.
    address public devaddr;
    // SH tokens created per block.
    uint256 public shPerBlock = 1e18;

    // Deposit Fee address
    address public feeAddress;
    address public sharesAddress;
    DragonLocker public immutable locker;
    
    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping (uint256 => mapping (address => UserInfo)) public userInfo;
    // Block number in which the user made token withdrawal from pool 0
    mapping (address => uint) public lastTokenWithdrawBlock;

    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when Sh mining starts.
    uint256 public startBlock;

    // Referrers
    mapping (address => address) public referrer;
    mapping (address => mapping (uint8 => uint)) public referrals;
    mapping (address => uint) public referrerReward;
    uint16[] public referrerRewardRate = [ 600, 300, 100 ];

    mapping(IERC20 => bool) public poolExistence;
    modifier nonDuplicated(IERC20 _lpToken) {
        require(poolExistence[_lpToken] == false, "nonDuplicated:duplicated");
        _;
    }


    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event Claim(address indexed user, uint256 indexed pid, uint256 amount);
    event Lock(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    
    event AddPool(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP, bool _withUpdate);
    event SetPool(uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, bool _withUpdate);
    
    event SetDev(address dev);
    event SetFee(address fee);
    event UpdateEmissionRate(uint256 _shPerBlock);
    
    event Reinvest(address indexed user, uint256 _pid);
    event ClaimShares(address indexed user, uint256 _pid);

    constructor (
        DGoldToken _sh,
        IShares _shares,
        DragonLocker _locker,
        address _devaddr,
        address _feeAddress,
        address _sharesAddress,
        uint256 _startBlock,
        uint256 _shAllocPoint
    ) {
        require(_devaddr != address(0), "address can't be 0");
        require(_feeAddress != address(0), "address can't be 0");

        locker = _locker;
        sh = _sh;
        shares = _shares;
        devaddr = _devaddr;
        feeAddress = _feeAddress;
        sharesAddress = _sharesAddress;
        startBlock = _startBlock;

        totalAllocPoint = _shAllocPoint;
        poolInfo.push(PoolInfo({
            amount: 0,
            lpToken: _sh,
            allocPoint: _shAllocPoint,
            lastRewardBlock: startBlock,
            accShPerPower: 0,
            depositFeeBP: 0,
            lastSharesRewardBlock: startBlock,
            accSharesPerPower: 0
        }));
    }

    function poolLength() external view returns (uint) {
        return poolInfo.length;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
    function add(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) nonDuplicated(_lpToken) external onlyOwner {
        require(_depositFeeBP <= 500, "add: invalid deposit fee basis points");
        if (_withUpdate) {
            _massUpdatePools();
        }
        
        poolExistence[_lpToken] = true;
        
        _lpToken.balanceOf(address(this));
        
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint += _allocPoint;
        poolInfo.push(PoolInfo({
            amount:0,
            lpToken: _lpToken,
            allocPoint: _allocPoint,
            lastRewardBlock: lastRewardBlock,
            accShPerPower: 0,
            depositFeeBP: _depositFeeBP,
            lastSharesRewardBlock: lastRewardBlock,
            accSharesPerPower: 0
        }));
        
        emit AddPool(_allocPoint, _lpToken, _depositFeeBP, _withUpdate);
    }

    // Update the given pool's SH allocation point and deposit fee. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, bool _withUpdate) external onlyOwner {
        require(_depositFeeBP <= 500, "set: invalid deposit fee basis points");
        if (_withUpdate) {
            _massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].depositFeeBP = _depositFeeBP;
        
        emit SetPool(_pid, _allocPoint, _depositFeeBP, _withUpdate);
    }

    // Update dev address by the previous dev.
    function dev(address _devaddr) external {
        require(msg.sender == devaddr, "dev: wut?");
        require(_devaddr != address(0), "!nonzero");
        
        devaddr = _devaddr;
        
        emit SetDev(_devaddr);
    }

    function setFeeAddress(address _feeAddress) external {
        require(msg.sender == feeAddress, "setFeeAddress: FORBIDDEN");
        require(_feeAddress != address(0), "!nonzero");
        
        feeAddress = _feeAddress;
        
        emit SetFee(_feeAddress);
    }

    //Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
    function updateEmissionRate(uint256 _shPerBlock) external onlyOwner {
        require(_shPerBlock <= 100 * 1e18,"Too high");
        
        _massUpdatePools();
        shPerBlock = _shPerBlock;
        
        emit UpdateEmissionRate(_shPerBlock);
    }

    // View function to see pending SHs on frontend.
    function pendingSh(uint256 _pid, address _user) external view returns (uint) {
        UserInfo storage user = userInfo[_pid][_user];
        return (user.rewardKept + _pendingSh(_pid, _user)) * (100 + aprMultiplier(_pid, _user)) / 100;
    }

    // View function to see pending SHs on frontend.
    function pendingShares(uint256 _pid, address _user) external view returns (uint) {
        UserInfo storage user = userInfo[_pid][_user];
        return user.rewardSharesKept + _pendingShares(_pid, _user);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function _massUpdatePools() internal {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            _updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function _updatePool(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }

        if (pool.amount == 0 || pool.allocPoint == 0) {
            pool.lastRewardBlock = block.number;
            pool.lastSharesRewardBlock = block.number;
            return;
        }

        uint256 blockAmount = block.number - pool.lastRewardBlock;
        uint256 shReward = blockAmount * shPerBlock * pool.allocPoint / totalAllocPoint;
        sh.mint(devaddr, shReward / 10);
        sh.mint(address(this), shReward);
        pool.accShPerPower += shReward * 1e12 / pool.amount;
        pool.lastRewardBlock = block.number;

        uint256 sharesMultiplier = (block.number - pool.lastSharesRewardBlock) / 74000;
        if (sharesMultiplier > 0) {
            uint256 sharesReward = 1e18 * sharesMultiplier / 3;
            pool.accSharesPerPower += sharesReward * 1e12 / pool.amount;
            pool.lastSharesRewardBlock = block.number;
        }
    }

    // Deposit LP tokens to MasterChef for SH allocation.
    function deposit(uint256 _pid, uint256 _amount, address _ref) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        _updatePool(_pid);
        _keepPendingShAndShares(_pid, msg.sender);
        
        if(_amount > 0) {
            uint256 balance = pool.lpToken.balanceOf(address(this));
            
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
            

            uint256 amount = pool.lpToken.balanceOf(address(this)) - balance;
            
            if(pool.depositFeeBP > 0){
                uint256 depositFee = amount * pool.depositFeeBP / 10000;
                uint256 feeAddressAmount = depositFee * 3/5;
                pool.lpToken.safeTransfer(feeAddress, feeAddressAmount);
                pool.lpToken.safeTransfer(sharesAddress, depositFee - feeAddressAmount);
                amount -= depositFee;
            }
            
            user.amount += amount;
            pool.amount += amount;
        }

        user.rewardDebt = user.amount * pool.accShPerPower / 1e12;
        user.rewardSharesDebt = user.amount * pool.accSharesPerPower / 1e12;

        if (user.lastClaimedBlock == 0) {
            user.lastClaimedBlock = block.number;
        }

        if (_ref != address(0) && _ref != msg.sender && referrer[msg.sender] == address(0)) {
            referrer[msg.sender] = _ref;

            // direct ref
            referrals[_ref][0] += 1;
            referrals[_ref][1] += referrals[msg.sender][0];
            referrals[_ref][2] += referrals[msg.sender][1];

            // direct refs from direct ref
            address ref1 = referrer[_ref];
            if (ref1 != address(0)) {
                referrals[ref1][1] += 1;
                referrals[ref1][2] += referrals[msg.sender][0];

                // their refs
                address ref2 = referrer[ref1];
                if (ref2 != address(0)) {
                    referrals[ref2][2] += 1;
                }
            }
        }

        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");

        _updatePool(_pid);
        _keepPendingShAndShares(_pid, msg.sender);

        if (_amount > 0) {
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
            user.amount -= _amount;
            pool.amount -= _amount;
        }

        user.rewardDebt = user.amount * pool.accShPerPower / 1e12;
        user.rewardSharesDebt = user.amount * pool.accSharesPerPower / 1e12;

        if (_pid == 0) {
            lastTokenWithdrawBlock[msg.sender] = block.number;
        }

        emit Withdraw(msg.sender, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERSHCY ONLY.
    function emergencyWithdraw(uint256 _pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        pool.amount -= user.amount;
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        user.rewardKept = 0;
        user.rewardSharesDebt = 0;
        user.rewardSharesKept = 0;

        if (_pid == 0) {
            lastTokenWithdrawBlock[msg.sender] = block.number;
        }

        pool.lpToken.safeTransfer(address(msg.sender), amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }

    function _rewardReferrers(uint256 baseAmount) internal {
        address ref = msg.sender;
        for (uint8 i = 0; i < referrerRewardRate.length; i++) {
            ref = referrer[ref];
            if (ref == address(0)) {
                break;
            }

            uint256 reward = baseAmount * referrerRewardRate[i] / 10000;
            sh.mint(ref, reward);
            referrerReward[ref] += reward;
        }
    }
    
    function aprMultiplier(uint256 _pid, address sender) public view returns (uint) {
        UserInfo storage user = userInfo[_pid][sender];
        uint256 multiplier = (block.number - Math.max(lastTokenWithdrawBlock[sender], user.lastClaimedBlock)) * 10 / 28800; //10% per 24 hours
        if (multiplier > 50) {
            multiplier = 50;
        }
        
        return multiplier;
    }

    function claim(uint256 _pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        _updatePool(_pid);

        uint256 pending = user.rewardKept + _pendingSh(_pid, msg.sender);

        require(pending > 0, "Nothing to claim");

        uint256 multiplier = aprMultiplier(_pid, msg.sender);

        _rewardReferrers(pending);
        
        if (address(locker) != address(0)) {
            uint256 startReleaseBlock = locker.getStartReleaseBlock();
            if (block.number < startReleaseBlock) {
                uint256 _lockerAmount = pending / 2;
                pending = pending - _lockerAmount;
                
                uint256 bonus = _lockerAmount * multiplier / 100;
                sh.mint(address(this), bonus);
                
                IERC20(sh).safeIncreaseAllowance(address(locker), _lockerAmount + bonus);
                locker.lock(msg.sender, _lockerAmount + bonus); 
                
                emit Lock(msg.sender, _pid, _lockerAmount + bonus);
            }
        }

        _safeShTransfer(msg.sender, pending);
        
        if (multiplier > 0) {
            sh.mint(msg.sender, pending * multiplier / 100);
        }

        emit Claim(msg.sender, _pid, pending + pending * multiplier / 100);
        
        
        user.rewardKept = 0;
        user.rewardDebt = user.amount * pool.accShPerPower / 1e12;
        user.lastClaimedBlock = block.number;
    }

    function reinvest(uint256 _pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        _updatePool(_pid);

        uint256 pending = user.rewardKept + _pendingSh(_pid, msg.sender);
        require(pending > 0, "Nothing to claim");
        
        _rewardReferrers(pending);
        
        uint256 multiplier = aprMultiplier(_pid, msg.sender);
        
        if (address(locker) != address(0)) {
            uint256 startReleaseBlock = locker.getStartReleaseBlock();
            if (block.number < startReleaseBlock) {
                uint256 _lockerAmount = pending / 2;
                pending = pending - _lockerAmount;
                
                uint256 bonus = _lockerAmount * multiplier / 100;
                sh.mint(address(this), bonus);
                IERC20(sh).safeIncreaseAllowance(address(locker), _lockerAmount + bonus);
                locker.lock(msg.sender, _lockerAmount + bonus); 
                
                emit Lock(msg.sender, _pid, _lockerAmount + bonus);
            }
        }

        if (multiplier > 0) {
            sh.mint(address(this), pending * multiplier / 100);
        }

        user.rewardKept = 0;
        user.rewardDebt = user.amount * pool.accShPerPower / 1e12;

        // adding to pool 0
        uint256 _amount = pending + pending * multiplier / 100;

        PoolInfo storage reinvestPool = poolInfo[0];
        UserInfo storage reinvestUser = userInfo[0][msg.sender];

        _updatePool(0);
        _keepPendingShAndShares(0, msg.sender);

        reinvestPool.amount += _amount;
        reinvestUser.amount += _amount;
        reinvestUser.rewardDebt = reinvestUser.amount * reinvestPool.accShPerPower / 1e12;
        reinvestUser.rewardSharesDebt = reinvestUser.amount * reinvestPool.accSharesPerPower / 1e12;
        
        emit Reinvest(msg.sender, _pid);
    }


    function claimShares(uint256 _pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        _updatePool(_pid);

        uint256 pending = user.rewardSharesKept + _pendingShares(_pid, msg.sender);

        require(pending > 0, "Nothing to claim");

        shares.sendTo(msg.sender, pending);

        user.rewardSharesKept = 0;
        user.rewardSharesDebt = user.amount * pool.accSharesPerPower / 1e12;
        
        emit ClaimShares(msg.sender, _pid);
    }

    function _keepPendingShAndShares(uint256 _pid, address _user) internal {
        UserInfo storage user = userInfo[_pid][_user];
        user.rewardKept += _pendingSh(_pid, _user);
        user.rewardSharesKept += _pendingShares(_pid, _user);
    }

    // DO NOT includes kept reward
    function _pendingSh(uint256 _pid, address _user) internal view returns (uint) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accShPerPower = pool.accShPerPower;

        if (block.number > pool.lastRewardBlock && pool.amount != 0 && totalAllocPoint > 0) {
            uint256 blockAmount = block.number - pool.lastRewardBlock;
            uint256 shReward = blockAmount * shPerBlock * pool.allocPoint / totalAllocPoint;
            accShPerPower += shReward * 1e12 / pool.amount;
        }

        return user.amount * accShPerPower / 1e12 - user.rewardDebt;
    }

    // DO NOT includes kept reward
    function _pendingShares(uint256 _pid, address _user) internal view returns (uint) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accSharesPerPower = pool.accSharesPerPower;

        if (_pid > 2) {
            return 0;
        }

        if (block.number > pool.lastSharesRewardBlock && pool.amount != 0 && totalAllocPoint > 0) {
            uint256 blockAmount = (block.number - pool.lastSharesRewardBlock) / 74000;
            uint256 sharesReward = blockAmount * 1e18 / 3;
            accSharesPerPower += sharesReward * 1e12 / pool.amount;
        }

        return user.amount * accSharesPerPower / 1e12 - user.rewardSharesDebt;
    }

    // Safe sh transfer function, just in case if rounding error causes pool to not have enough SHs.
    function _safeShTransfer(address _to, uint256 _amount) internal {
        uint256 shBal = sh.balanceOf(address(this));
        if (_amount > shBal) {
            sh.transfer(_to, shBal);
        } else {
            sh.transfer(_to, _amount);
        }
    }
}

File 2 of 13 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

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

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

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

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

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

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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


    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

File 3 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

File 4 of 13 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "../../utils/Context.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 {
    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual 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 this function is
     * overloaded;
     *
     * 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 virtual returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual 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);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        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] + 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) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        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);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += 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 += amount;
        _balances[account] += 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);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        _balances[account] = accountBalance - amount;
        _totalSupply -= 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 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 5 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

    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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _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 13 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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 8 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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].
 */
abstract 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 () {
        _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 9 of 13 : DGoldToken.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
pragma experimental ABIEncoderV2;

import "./OwnableToken.sol";


contract DGoldToken is OwnableToken {
  constructor() OwnableToken("Dragon Gold Token", "DGold") {}
}

File 10 of 13 : DragonLocker.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract DragonLocker {
    // using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IERC20 public immutable DGold;

    uint256 public constant startReleaseBlock = 20000000;
    uint256 public constant endReleaseBlock = 20500000;

    uint256 private _totalLock;
    mapping(address => uint256) private _locks;
    mapping(address => uint256) private _released;

    event Lock(address indexed to, uint256 value);

    constructor(IERC20 d) public {
        DGold = d;
    }

    function totalLock() external view returns (uint256) {
        return _totalLock;
    }
    
    function getStartReleaseBlock() external view returns (uint256) {
        return startReleaseBlock;
    }    

    function lockOf(address _account) external view returns (uint256) {
        return _locks[_account];
    }

    function released(address _account) external view returns (uint256) {
        return _released[_account];
    }

    function lock(address _account, uint256 _amount) external {
        require(block.number < startReleaseBlock, "no more lock");
        require(_account != address(0), "no lock to address(0)");
        require(_amount > 0, "zero lock");

        DGold.safeTransferFrom(msg.sender, address(this), _amount);

        _locks[_account] = _locks[_account] + _amount;
        _totalLock = _totalLock + _amount;

        emit Lock(_account, _amount);
    }

    function canUnlockAmount(address _account) public view returns (uint256) {
        if (block.number < startReleaseBlock) {
            return 0;
        } else if (block.number >= endReleaseBlock) {
            return _locks[_account] - _released[_account];
        } else {
            uint256 _releasedBlock = block.number - startReleaseBlock;
            uint256 _totalVestingBlock = endReleaseBlock - startReleaseBlock;
            return _locks[_account] * _releasedBlock / _totalVestingBlock - _released[_account];
        }
    }

    function unlock() external {
        require(block.number > startReleaseBlock, "still locked");
        require(_locks[msg.sender] > _released[msg.sender], "no locked");

        uint256 _amount = canUnlockAmount(msg.sender);

        DGold.safeTransfer(msg.sender, _amount);
        _released[msg.sender] = _released[msg.sender] + _amount;
        _totalLock = _totalLock - _amount;
    }

}

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

pragma solidity ^0.8.0;

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

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

File 12 of 13 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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 on 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        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 13 of 13 : OwnableToken.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract OwnableToken is ERC20, Ownable  {

  constructor(string memory name, string memory symbol) ERC20(name, symbol) { }

  function mint(address account, uint amount) public onlyOwner {
    _mint(account, amount);
  }

  function burn(address account, uint amount) public onlyOwner {
    _burn(account, amount);
  }

}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract DGoldToken","name":"_sh","type":"address"},{"internalType":"contract IShares","name":"_shares","type":"address"},{"internalType":"contract DragonLocker","name":"_locker","type":"address"},{"internalType":"address","name":"_devaddr","type":"address"},{"internalType":"address","name":"_feeAddress","type":"address"},{"internalType":"address","name":"_sharesAddress","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_shAllocPoint","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"indexed":false,"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"indexed":false,"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"indexed":false,"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"AddPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"ClaimShares","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Lock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"Reinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"dev","type":"address"}],"name":"SetDev","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fee","type":"address"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"indexed":false,"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"SetPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_shPerBlock","type":"uint256"}],"name":"UpdateEmissionRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"sender","type":"address"}],"name":"aprMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_ref","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devaddr","type":"address"}],"name":"dev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devaddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastTokenWithdrawBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"contract DragonLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingSh","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"poolExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accShPerPower","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"lastSharesRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accSharesPerPower","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint8","name":"","type":"uint8"}],"name":"referrals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrerReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"referrerRewardRate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"reinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sh","outputs":[{"internalType":"contract DGoldToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shares","outputs":[{"internalType":"contract IShares","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sharesAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shPerBlock","type":"uint256"}],"name":"updateEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardKept","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"rewardSharesKept","type":"uint256"},{"internalType":"uint256","name":"rewardSharesDebt","type":"uint256"},{"internalType":"uint256","name":"lastClaimedBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

670de0b6b3a76400006005556000600b5561010060405261025860a090815261012c60c052606460e0526200003990601090600362000350565b503480156200004757600080fd5b5060405162003b5538038062003b558339810160408190526200006a9162000417565b600160009081556200007b6200034c565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160a01b038516620000fb5760405162461bcd60e51b8152600401620000f290620004bc565b60405180910390fd5b6001600160a01b038416620001245760405162461bcd60e51b8152600401620000f290620004bc565b606095861b6001600160601b0319166080908152600280546001600160a01b03199081166001600160a01b039b8c169081179092556003805482169a8c169a909a17909955600480548a16978b1697909717909655600680548916958a169590951790945560078054881693891693909317909255600c819055600b829055604080516101008101825260008082526020820196875291810193845295860182815293860181815260a0870182815260c0880193845260e08801838152600880546001810182559481905298517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3949099029384019890985595517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee48301805490991699169890981790965590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee586015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee685015593517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee7840155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee88301805461ffff191661ffff90921691909117905591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee982015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636eea9091015562000501565b3390565b82805482825590600052602060002090600f01601090048101928215620003ee5791602002820160005b83821115620003bc57835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026200037a565b8015620003ec5782816101000a81549061ffff0219169055600201602081600101049283019260010302620003bc565b505b50620003fc92915062000400565b5090565b5b80821115620003fc576000815560010162000401565b600080600080600080600080610100898b03121562000434578384fd5b88516200044181620004e8565b60208a01519098506200045481620004e8565b60408a01519097506200046781620004e8565b60608a01519096506200047a81620004e8565b60808a01519095506200048d81620004e8565b60a08a0151909450620004a081620004e8565b60c08a015160e0909a0151989b979a5095989497939692505050565b6020808252601290820152710616464726573732063616e277420626520360741b604082015260600190565b6001600160a01b0381168114620004fe57600080fd5b50565b60805160601c6135fd6200055860003960008181610778015281816107a9015281816108df0152818161092701528181610fb901528181610fea015281816111200152818161115501526120d301526135fd6000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c80635312ea8e1161012557806393f1a40b116100ad578063d49e77cd1161007c578063d49e77cd14610452578063d7b96d4e1461045a578063d963842214610462578063f2fde38b14610475578063f33670aa1461048857610211565b806393f1a40b146103e7578063b65e93371461040c578063c68e45b71461041f578063cbd258b51461043257610211565b80638705fcd4116100f45780638705fcd4146103935780638d88a90e146103a65780638da5cb5b146103b95780638dbdbe6d146103c1578063922af83b146103d457610211565b80635312ea8e14610352578063715018a61461036557806383b4918b1461036d57806384e82a331461038057610211565b80632c0ef004116101a8578063379607f511610177578063379607f514610309578063412753581461031c578063441a3e701461032457806346d748ec1461033757806348cd4cb11461034a57610211565b80632c0ef004146102c65780632cf003c2146102ce578063318e82a3146102e157806333b2c1b11461030157610211565b80631526fe27116101e45780631526fe271461027157806317caf6f1146102985780631a00817d146102a05780632525d4fc146102b357610211565b806303314efa14610216578063081e3eda146102345780630ba84cd2146102495780631249d5381461025e575b600080fd5b61021e610490565b60405161022b9190613014565b60405180910390f35b61023c61049f565b60405161022b91906133fa565b61025c610257366004612ecf565b6104a5565b005b61023c61026c366004612e76565b61055e565b61028461027f366004612ecf565b61057b565b60405161022b98979695949392919061342d565b61023c6105e0565b61023c6102ae366004612e5a565b6105e6565b61023c6102c1366004612eff565b6105f8565b61021e61063d565b61021e6102dc366004612e5a565b61064c565b6102f46102ef366004612ecf565b610667565b60405161022b91906133eb565b61023c61069f565b61025c610317366004612ecf565b6106a5565b61021e610b0f565b61025c610332366004612f73565b610b1e565b61023c610345366004612eff565b610cc9565b61023c610d3d565b61025c610360366004612ecf565b610d43565b61025c610e5d565b61025c61037b366004612ecf565b610ee6565b61025c61038e366004612f23565b61142a565b61025c6103a1366004612e5a565b611796565b61025c6103b4366004612e5a565b611831565b61021e6118cc565b61025c6103cf366004612f94565b6118db565b61023c6103e2366004612e5a565b611e65565b6103fa6103f5366004612eff565b611e77565b60405161022b96959493929190613491565b61023c61041a366004612eff565b611eb7565b61025c61042d366004612ecf565b611f1d565b610445610440366004612e5a565b6120ad565b60405161022b919061307f565b61021e6120c2565b61021e6120d1565b61025c610470366004612fcc565b6120f5565b61025c610483366004612e5a565b612280565b61021e612341565b6003546001600160a01b031681565b60085490565b6104ad612350565b6001600160a01b03166104be6118cc565b6001600160a01b0316146104ed5760405162461bcd60e51b81526004016104e490613242565b60405180910390fd5b68056bc75e2d631000008111156105165760405162461bcd60e51b81526004016104e490613348565b61051e612354565b60058190556040517f232bc60e54c3a684fb69d1cde365a10c51105f4f8ba47a6cd0c5435192010a9c906105539083906133fa565b60405180910390a150565b600e60209081526000928352604080842090915290825290205481565b6008818154811061058b57600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701549597506001600160a01b039094169592949193909261ffff9091169188565b600b5481565b600a6020526000908152604090205481565b60008281526009602090815260408083206001600160a01b03851684529091528120610624848461237f565b816003015461063391906134b9565b9150505b92915050565b6002546001600160a01b031681565b600d602052600090815260409020546001600160a01b031681565b6010818154811061067757600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b60055481565b600260005414156106c85760405162461bcd60e51b81526004016104e4906133b4565b6002600090815560088054839081106106f157634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150610722836124bc565b600061072e843361270d565b826001015461073d91906134b9565b90506000811161075f5760405162461bcd60e51b81526004016104e490613102565b600061076b8533610cc9565b905061077682612816565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316156109f05760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663463dd61c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561080057600080fd5b505afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190612ee7565b9050804310156109ee57600061084f6002856134d1565b905061085b8185613510565b93506000606461086b85846134f1565b61087591906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906108a89030908590600401613066565b600060405180830381600087803b1580156108c257600080fd5b505af11580156108d6573d6000803e3d6000fd5b5050505061091d7f0000000000000000000000000000000000000000000000000000000000000000828461090a91906134b9565b6002546001600160a01b03169190612958565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663282d3fdf3361095784866134b9565b6040518363ffffffff1660e01b8152600401610974929190613066565b600060405180830381600087803b15801561098e57600080fd5b505af11580156109a2573d6000803e3d6000fd5b508a92503391507f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b90506109d684866134b9565b6040516109e391906133fa565b60405180910390a350505b505b6109fa3383612a41565b8015610a78576002546001600160a01b03166340c10f19336064610a1e85876134f1565b610a2891906134d1565b6040518363ffffffff1660e01b8152600401610a45929190613066565b600060405180830381600087803b158015610a5f57600080fd5b505af1158015610a73573d6000803e3d6000fd5b505050505b84337f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf76064610aa785876134f1565b610ab191906134d1565b610abb90866134b9565b604051610ac891906133fa565b60405180910390a3600060018401556004840154835464e8d4a5100091610aee916134f1565b610af891906134d1565b600284015550504360059091015550506001600055565b6006546001600160a01b031681565b60026000541415610b415760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805484908110610b6a57634e487b7160e01b600052603260045260246000fd5b600091825260208083208684526009825260408085203386529092529220805460089092029092019250831115610bb35760405162461bcd60e51b81526004016104e4906132e5565b610bbc846124bc565b610bc68433612bda565b8215610c18576001820154610be5906001600160a01b03163385612c46565b82816000016000828254610bf99190613510565b9091555050815483908390600090610c12908490613510565b90915550505b6004820154815464e8d4a5100091610c2f916134f1565b610c3991906134d1565b60028201556007820154815464e8d4a5100091610c55916134f1565b610c5f91906134d1565b600482015583610c7c57336000908152600a602052604090204390555b83336001600160a01b03167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56885604051610cb691906133fa565b60405180910390a3505060016000555050565b60008281526009602090815260408083206001600160a01b03851684528252808320600a9092528220546005820154839161708091610d089190612c65565b610d129043613510565b610d1d90600a6134f1565b610d2791906134d1565b9050603281111561063357506032949350505050565b600c5481565b60026000541415610d665760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110610d8f57634e487b7160e01b600052603260045260246000fd5b6000918252602080832085845260098252604080852033865290925290832080546008909302909101805490945090928491610dcc908490613510565b909155505080546000808355600283018190556001830181905560048301819055600383015583610e0a57336000908152600a602052604090204390555b6001830154610e23906001600160a01b03163383612c46565b83336001600160a01b03167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059583604051610cb691906133fa565b610e65612350565b6001600160a01b0316610e766118cc565b6001600160a01b031614610e9c5760405162461bcd60e51b81526004016104e490613242565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60026000541415610f095760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110610f3257634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150610f63836124bc565b6000610f6f843361270d565b8260010154610f7e91906134b9565b905060008111610fa05760405162461bcd60e51b81526004016104e490613102565b610fa981612816565b6000610fb58533610cc9565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161561121e5760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663463dd61c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561104157600080fd5b505afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612ee7565b90508043101561121c5760006110906002856134d1565b905061109c8185613510565b9350600060646110ac85846134f1565b6110b691906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906110e99030908590600401613066565b600060405180830381600087803b15801561110357600080fd5b505af1158015611117573d6000803e3d6000fd5b5050505061114b7f0000000000000000000000000000000000000000000000000000000000000000828461090a91906134b9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663282d3fdf3361118584866134b9565b6040518363ffffffff1660e01b81526004016111a2929190613066565b600060405180830381600087803b1580156111bc57600080fd5b505af11580156111d0573d6000803e3d6000fd5b508a92503391507f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b905061120484866134b9565b60405161121191906133fa565b60405180910390a350505b505b801561129c576002546001600160a01b03166340c10f1930606461124285876134f1565b61124c91906134d1565b6040518363ffffffff1660e01b8152600401611269929190613066565b600060405180830381600087803b15801561128357600080fd5b505af1158015611297573d6000803e3d6000fd5b505050505b600060018401556004840154835464e8d4a51000916112ba916134f1565b6112c491906134d1565b6002840155600060646112d783856134f1565b6112e191906134d1565b6112eb90846134b9565b90506000600860008154811061131157634e487b7160e01b600052603260045260246000fd5b600091825260208083203384527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b90915260408320600890920201925090611358906124bc565b611363600033612bda565b8282600001600082825461137791906134b9565b90915550508054839082906000906113909084906134b9565b90915550506004820154815464e8d4a51000916113ac916134f1565b6113b691906134d1565b60028201556007820154815464e8d4a51000916113d2916134f1565b6113dc91906134d1565b600482015560405133907fbd654390d0d973e8c8376ed6053be8658870df892687852cc5c914d700291b8790611413908b906133fa565b60405180910390a250506001600055505050505050565b6001600160a01b038316600090815260116020526040902054839060ff16156114655760405162461bcd60e51b81526004016104e490613277565b61146d612350565b6001600160a01b031661147e6118cc565b6001600160a01b0316146114a45760405162461bcd60e51b81526004016104e490613242565b6101f48361ffff1611156114ca5760405162461bcd60e51b81526004016104e4906130bd565b81156114d8576114d8612354565b6001600160a01b03841660008181526011602052604090819020805460ff19166001179055516370a0823160e01b81526370a082319061151c903090600401613014565b60206040518083038186803b15801561153457600080fd5b505afa158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c9190612ee7565b506000600c54431161158057600c54611582565b435b905085600b600082825461159691906134b9565b9091555050604080516101008101825260008082526001600160a01b03888116602084019081528385018b8152606085018781526080860185815261ffff8c811660a0890190815260c089018b815260e08a01898152600880546001810182559a8190529a517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee39a909b02998a019a909a5595517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4890180546001600160a01b031916919098161790965592517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee587015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee6860155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee785015591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee88401805461ffff19169190931617909155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee982015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636eea90910155517f1ea76ba8644ae1d8334006497b07c36bc57ea4066aca9be63ad69be790fa2ee290611786908890889088908890613403565b60405180910390a1505050505050565b6006546001600160a01b031633146117c05760405162461bcd60e51b81526004016104e490613311565b6001600160a01b0381166117e65760405162461bcd60e51b81526004016104e4906131db565b600680546001600160a01b0319166001600160a01b0383161790556040517ff27839648b9860ca5a1e1348e270b5dd324ccc37b450eefc4200ed3abe673fb690610553908390613014565b6004546001600160a01b0316331461185b5760405162461bcd60e51b81526004016104e4906131b8565b6001600160a01b0381166118815760405162461bcd60e51b81526004016104e4906131db565b600480546001600160a01b0319166001600160a01b0383161790556040517f8daa6bb00de042a7d51816fcee4a3d5c1e91a2128fd64fa1a9a38afa0d26beb590610553908390613014565b6001546001600160a01b031690565b600260005414156118fe5760405162461bcd60e51b81526004016104e4906133b4565b60026000908155600880548590811061192757634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600982526040808520338652909252922060089091029091019150611958856124bc565b6119628533612bda565b8315611b7e5760018201546040516370a0823160e01b81526000916001600160a01b0316906370a082319061199b903090600401613014565b60206040518083038186803b1580156119b357600080fd5b505afa1580156119c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119eb9190612ee7565b6001840154909150611a08906001600160a01b0316333088612c7e565b60018301546040516370a0823160e01b815260009183916001600160a01b03909116906370a0823190611a3f903090600401613014565b60206040518083038186803b158015611a5757600080fd5b505afa158015611a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8f9190612ee7565b611a999190613510565b600585015490915061ffff1615611b4957600584015460009061271090611ac49061ffff16846134f1565b611ace91906134d1565b905060006005611adf8360036134f1565b611ae991906134d1565b6006546001880154919250611b0b916001600160a01b03908116911683612c46565b600754611b3a906001600160a01b0316611b258385613510565b60018901546001600160a01b03169190612c46565b611b448284613510565b925050505b80836000016000828254611b5d91906134b9565b9091555050835481908590600090611b769084906134b9565b909155505050505b6004820154815464e8d4a5100091611b95916134f1565b611b9f91906134d1565b60028201556007820154815464e8d4a5100091611bbb916134f1565b611bc591906134d1565b60048201556005810154611bda574360058201555b6001600160a01b03831615801590611bfb57506001600160a01b0383163314155b8015611c1d5750336000908152600d60205260409020546001600160a01b0316155b15611e1757336000908152600d6020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558352600e82528083208380529091528120805460019290611c729084906134b9565b9091555050336000908152600e602081815260408084208480528252808420546001600160a01b0388168552928252808420600185529091528220805491929091611cbe9084906134b9565b9091555050336000908152600e60208181526040808420600185528252808420546001600160a01b0388168552928252808420600285529091528220805491929091611d0b9084906134b9565b90915550506001600160a01b038084166000908152600d6020526040902054168015611e15576001600160a01b0381166000908152600e60209081526040808320600180855292528220805491929091611d669084906134b9565b9091555050336000908152600e602081815260408084208480528252808420546001600160a01b0386168552928252808420600285529091528220805491929091611db29084906134b9565b90915550506001600160a01b038082166000908152600d6020526040902054168015611e13576001600160a01b0381166000908152600e60209081526040808320600284529091528120805460019290611e0d9084906134b9565b90915550505b505b505b84336001600160a01b03167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1586604051611e5191906133fa565b60405180910390a350506001600055505050565b600f6020526000908152604090205481565b6009602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b60008281526009602090815260408083206001600160a01b038516845290915281206064611ee58585610cc9565b611ef09060646134b9565b611efa868661270d565b8360010154611f0991906134b9565b611f1391906134f1565b61063391906134d1565b60026000541415611f405760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110611f6957634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150611f9a836124bc565b6000611fa6843361237f565b8260030154611fb591906134b9565b905060008111611fd75760405162461bcd60e51b81526004016104e490613102565b600354604051634f0d005560e11b81526001600160a01b0390911690639e1a00aa906120099033908590600401613066565b600060405180830381600087803b15801561202357600080fd5b505af1158015612037573d6000803e3d6000fd5b50506000600385015550506007830154825464e8d4a5100091612059916134f1565b61206391906134d1565b600483015560405133907fce3ea4745ffbcdb1833febb705a9558eb9362e915a0ff60625532831df6b375c9061209a9087906133fa565b60405180910390a2505060016000555050565b60116020526000908152604090205460ff1681565b6004546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6120fd612350565b6001600160a01b031661210e6118cc565b6001600160a01b0316146121345760405162461bcd60e51b81526004016104e490613242565b6101f48261ffff16111561215a5760405162461bcd60e51b81526004016104e4906131fd565b801561216857612168612354565b826008858154811061218a57634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160020154600b546121a99190613510565b6121b391906134b9565b600b8190555082600885815481106121db57634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160020181905550816008858154811061221257634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160050160006101000a81548161ffff021916908361ffff1602179055507f51a590a04784062e03e6e262f0a712722a099fcee9e31c52d100dfdcd71a2e34848484846040516122729493929190613470565b60405180910390a150505050565b612288612350565b6001600160a01b03166122996118cc565b6001600160a01b0316146122bf5760405162461bcd60e51b81526004016104e490613242565b6001600160a01b0381166122e55760405162461bcd60e51b81526004016104e49061312c565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031681565b3390565b60085460005b8181101561237b5761236b816124bc565b61237481613553565b905061235a565b5050565b600080600884815481106123a357634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526009825260408085206001600160a01b03891686529092529220600760089092029092019081015490925060028611156123f05760009350505050610637565b8260060154431180156124035750825415155b801561241157506000600b54115b156124855760006201211084600601544361242c9190613510565b61243691906134d1565b90506000600361244e83670de0b6b3a76400006134f1565b61245891906134d1565b855490915061246c8264e8d4a510006134f1565b61247691906134d1565b61248090846134b9565b925050505b6004820154825464e8d4a510009061249e9084906134f1565b6124a891906134d1565b6124b29190613510565b9695505050505050565b6000600882815481106124df57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060080201905080600301544311612500575061270a565b8054158061251057506002810154155b1561252857436003820181905560069091015561270a565b600081600301544361253a9190613510565b90506000600b5483600201546005548461255491906134f1565b61255e91906134f1565b61256891906134d1565b6002546004549192506001600160a01b03908116916340c10f19911661258f600a856134d1565b6040518363ffffffff1660e01b81526004016125ac929190613066565b600060405180830381600087803b1580156125c657600080fd5b505af11580156125da573d6000803e3d6000fd5b50506002546040516340c10f1960e01b81526001600160a01b0390911692506340c10f1991506126109030908590600401613066565b600060405180830381600087803b15801561262a57600080fd5b505af115801561263e573d6000803e3d6000fd5b50508454915061265590508264e8d4a510006134f1565b61265f91906134d1565b83600401600082825461267291906134b9565b909155505043600384018190556006840154600091620121109161269591613510565b61269f91906134d1565b9050801561270557600060036126bd83670de0b6b3a76400006134f1565b6126c791906134d1565b85549091506126db8264e8d4a510006134f1565b6126e591906134d1565b8560070160008282546126f891906134b9565b9091555050436006860155505b505050505b50565b6000806008848154811061273157634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526009825260408085206001600160a01b0389168652909252922060046008909202909201908101546003820154919350904311801561277d5750825415155b801561278b57506000600b54115b156127fd5760008360030154436127a29190613510565b90506000600b548560020154600554846127bc91906134f1565b6127c691906134f1565b6127d091906134d1565b85549091506127e48264e8d4a510006134f1565b6127ee91906134d1565b6127f890846134b9565b925050505b6002820154825464e8d4a510009061249e9084906134f1565b3360005b60105460ff82161015612953576001600160a01b039182166000908152600d6020526040902054909116908161284f57612953565b600061271060108360ff168154811061287857634e487b7160e01b600052603260045260246000fd5b600091825260209091206010820401546128a291600f166002026101000a900461ffff16866134f1565b6128ac91906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906128df9086908590600401613066565b600060405180830381600087803b1580156128f957600080fd5b505af115801561290d573d6000803e3d6000fd5b505050506001600160a01b0383166000908152600f6020526040812080548392906129399084906134b9565b9091555082915061294b90508161356e565b91505061281a565b505050565b600081846001600160a01b031663dd62ed3e30866040518363ffffffff1660e01b8152600401612989929190613028565b60206040518083038186803b1580156129a157600080fd5b505afa1580156129b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d99190612ee7565b6129e391906134b9565b9050612a3b8463095ea7b360e01b8584604051602401612a04929190613066565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612c9f565b50505050565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612a72903090600401613014565b60206040518083038186803b158015612a8a57600080fd5b505afa158015612a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac29190612ee7565b905080821115612b565760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90612afe9086908590600401613066565b602060405180830381600087803b158015612b1857600080fd5b505af1158015612b2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b509190612eb3565b50612953565b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90612b889086908690600401613066565b602060405180830381600087803b158015612ba257600080fd5b505af1158015612bb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3b9190612eb3565b60008281526009602090815260408083206001600160a01b03851684529091529020612c06838361270d565b816001016000828254612c1991906134b9565b90915550612c299050838361237f565b816003016000828254612c3c91906134b9565b9091555050505050565b6129538363a9059cbb60e01b8484604051602401612a04929190613066565b600081831015612c755781612c77565b825b9392505050565b612a3b846323b872dd60e01b858585604051602401612a0493929190613042565b6000612cf4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d2e9092919063ffffffff16565b8051909150156129535780806020019051810190612d129190612eb3565b6129535760405162461bcd60e51b81526004016104e49061336a565b6060612d3d8484600085612d45565b949350505050565b606082471015612d675760405162461bcd60e51b81526004016104e490613172565b612d7085612e05565b612d8c5760405162461bcd60e51b81526004016104e4906132ae565b600080866001600160a01b03168587604051612da89190612ff8565b60006040518083038185875af1925050503d8060008114612de5576040519150601f19603f3d011682016040523d82523d6000602084013e612dea565b606091505b5091509150612dfa828286612e0f565b979650505050505050565b803b15155b919050565b60608315612e1e575081612c77565b825115612e2e5782518084602001fd5b8160405162461bcd60e51b81526004016104e4919061308a565b803561ffff81168114612e0a57600080fd5b600060208284031215612e6b578081fd5b8135612c77816135a4565b60008060408385031215612e88578081fd5b8235612e93816135a4565b9150602083013560ff81168114612ea8578182fd5b809150509250929050565b600060208284031215612ec4578081fd5b8151612c77816135b9565b600060208284031215612ee0578081fd5b5035919050565b600060208284031215612ef8578081fd5b5051919050565b60008060408385031215612f11578182fd5b823591506020830135612ea8816135a4565b60008060008060808587031215612f38578182fd5b843593506020850135612f4a816135a4565b9250612f5860408601612e48565b91506060850135612f68816135b9565b939692955090935050565b60008060408385031215612f85578182fd5b50508035926020909101359150565b600080600060608486031215612fa8578283fd5b83359250602084013591506040840135612fc1816135a4565b809150509250925092565b60008060008060808587031215612fe1578384fd5b8435935060208501359250612f5860408601612e48565b6000825161300a818460208701613527565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60006020825282518060208401526130a9816040850160208701613527565b601f01601f19169190910160400192915050565b60208082526025908201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706040820152646f696e747360d81b606082015260800190565b60208082526010908201526f4e6f7468696e6720746f20636c61696d60801b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252600990820152686465763a207775743f60b81b604082015260600190565b602080825260089082015267216e6f6e7a65726f60c01b604082015260600190565b60208082526025908201527f7365743a20696e76616c6964206465706f7369742066656520626173697320706040820152646f696e747360d81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526018908201527f6e6f6e4475706c6963617465643a6475706c6963617465640000000000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b60208082526018908201527f736574466565416464726573733a20464f5242494444454e0000000000000000604082015260600190565b6020808252600890820152670a8dede40d0d2ced60c31b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b61ffff91909116815260200190565b90815260200190565b9384526001600160a01b0392909216602084015261ffff1660408301521515606082015260800190565b9788526001600160a01b0396909616602088015260408701949094526060860192909252608085015261ffff1660a084015260c083015260e08201526101000190565b938452602084019290925261ffff1660408301521515606082015260800190565b958652602086019490945260408501929092526060840152608083015260a082015260c00190565b600082198211156134cc576134cc61358e565b500190565b6000826134ec57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561350b5761350b61358e565b500290565b6000828210156135225761352261358e565b500390565b60005b8381101561354257818101518382015260200161352a565b83811115612a3b5750506000910152565b60006000198214156135675761356761358e565b5060010190565b600060ff821660ff8114156135855761358561358e565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461270a57600080fd5b801515811461270a57600080fdfea26469706673582212202a35212f2c03bfb44fc5d76d43476c8363441d7800acb7a84d31c536ddd27c7364736f6c634300080000330000000000000000000000000b502860b730bfaf5fa5566ec9996c53810dfe08000000000000000000000000df7d2df53b1c30543f2dda24fbd21a2935bbf02f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d10000000000000000000000004b6c21e96d6dcc20c23d1812b68ef2bdac24a67e00000000000000000000000077011f364e4f9a68f822fd9e71e0fd36e89cd96500000000000000000000000043e318ff665c63ab93f6610c2b3dcf0d0ec669a0000000000000000000000000000000000000000000000000000000000128c89000000000000000000000000000000000000000000000000000000000000009c4

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102115760003560e01c80635312ea8e1161012557806393f1a40b116100ad578063d49e77cd1161007c578063d49e77cd14610452578063d7b96d4e1461045a578063d963842214610462578063f2fde38b14610475578063f33670aa1461048857610211565b806393f1a40b146103e7578063b65e93371461040c578063c68e45b71461041f578063cbd258b51461043257610211565b80638705fcd4116100f45780638705fcd4146103935780638d88a90e146103a65780638da5cb5b146103b95780638dbdbe6d146103c1578063922af83b146103d457610211565b80635312ea8e14610352578063715018a61461036557806383b4918b1461036d57806384e82a331461038057610211565b80632c0ef004116101a8578063379607f511610177578063379607f514610309578063412753581461031c578063441a3e701461032457806346d748ec1461033757806348cd4cb11461034a57610211565b80632c0ef004146102c65780632cf003c2146102ce578063318e82a3146102e157806333b2c1b11461030157610211565b80631526fe27116101e45780631526fe271461027157806317caf6f1146102985780631a00817d146102a05780632525d4fc146102b357610211565b806303314efa14610216578063081e3eda146102345780630ba84cd2146102495780631249d5381461025e575b600080fd5b61021e610490565b60405161022b9190613014565b60405180910390f35b61023c61049f565b60405161022b91906133fa565b61025c610257366004612ecf565b6104a5565b005b61023c61026c366004612e76565b61055e565b61028461027f366004612ecf565b61057b565b60405161022b98979695949392919061342d565b61023c6105e0565b61023c6102ae366004612e5a565b6105e6565b61023c6102c1366004612eff565b6105f8565b61021e61063d565b61021e6102dc366004612e5a565b61064c565b6102f46102ef366004612ecf565b610667565b60405161022b91906133eb565b61023c61069f565b61025c610317366004612ecf565b6106a5565b61021e610b0f565b61025c610332366004612f73565b610b1e565b61023c610345366004612eff565b610cc9565b61023c610d3d565b61025c610360366004612ecf565b610d43565b61025c610e5d565b61025c61037b366004612ecf565b610ee6565b61025c61038e366004612f23565b61142a565b61025c6103a1366004612e5a565b611796565b61025c6103b4366004612e5a565b611831565b61021e6118cc565b61025c6103cf366004612f94565b6118db565b61023c6103e2366004612e5a565b611e65565b6103fa6103f5366004612eff565b611e77565b60405161022b96959493929190613491565b61023c61041a366004612eff565b611eb7565b61025c61042d366004612ecf565b611f1d565b610445610440366004612e5a565b6120ad565b60405161022b919061307f565b61021e6120c2565b61021e6120d1565b61025c610470366004612fcc565b6120f5565b61025c610483366004612e5a565b612280565b61021e612341565b6003546001600160a01b031681565b60085490565b6104ad612350565b6001600160a01b03166104be6118cc565b6001600160a01b0316146104ed5760405162461bcd60e51b81526004016104e490613242565b60405180910390fd5b68056bc75e2d631000008111156105165760405162461bcd60e51b81526004016104e490613348565b61051e612354565b60058190556040517f232bc60e54c3a684fb69d1cde365a10c51105f4f8ba47a6cd0c5435192010a9c906105539083906133fa565b60405180910390a150565b600e60209081526000928352604080842090915290825290205481565b6008818154811061058b57600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701549597506001600160a01b039094169592949193909261ffff9091169188565b600b5481565b600a6020526000908152604090205481565b60008281526009602090815260408083206001600160a01b03851684529091528120610624848461237f565b816003015461063391906134b9565b9150505b92915050565b6002546001600160a01b031681565b600d602052600090815260409020546001600160a01b031681565b6010818154811061067757600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b60055481565b600260005414156106c85760405162461bcd60e51b81526004016104e4906133b4565b6002600090815560088054839081106106f157634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150610722836124bc565b600061072e843361270d565b826001015461073d91906134b9565b90506000811161075f5760405162461bcd60e51b81526004016104e490613102565b600061076b8533610cc9565b905061077682612816565b7f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d16001600160a01b0316156109f05760007f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d16001600160a01b031663463dd61c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561080057600080fd5b505afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190612ee7565b9050804310156109ee57600061084f6002856134d1565b905061085b8185613510565b93506000606461086b85846134f1565b61087591906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906108a89030908590600401613066565b600060405180830381600087803b1580156108c257600080fd5b505af11580156108d6573d6000803e3d6000fd5b5050505061091d7f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d1828461090a91906134b9565b6002546001600160a01b03169190612958565b6001600160a01b037f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d11663282d3fdf3361095784866134b9565b6040518363ffffffff1660e01b8152600401610974929190613066565b600060405180830381600087803b15801561098e57600080fd5b505af11580156109a2573d6000803e3d6000fd5b508a92503391507f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b90506109d684866134b9565b6040516109e391906133fa565b60405180910390a350505b505b6109fa3383612a41565b8015610a78576002546001600160a01b03166340c10f19336064610a1e85876134f1565b610a2891906134d1565b6040518363ffffffff1660e01b8152600401610a45929190613066565b600060405180830381600087803b158015610a5f57600080fd5b505af1158015610a73573d6000803e3d6000fd5b505050505b84337f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf76064610aa785876134f1565b610ab191906134d1565b610abb90866134b9565b604051610ac891906133fa565b60405180910390a3600060018401556004840154835464e8d4a5100091610aee916134f1565b610af891906134d1565b600284015550504360059091015550506001600055565b6006546001600160a01b031681565b60026000541415610b415760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805484908110610b6a57634e487b7160e01b600052603260045260246000fd5b600091825260208083208684526009825260408085203386529092529220805460089092029092019250831115610bb35760405162461bcd60e51b81526004016104e4906132e5565b610bbc846124bc565b610bc68433612bda565b8215610c18576001820154610be5906001600160a01b03163385612c46565b82816000016000828254610bf99190613510565b9091555050815483908390600090610c12908490613510565b90915550505b6004820154815464e8d4a5100091610c2f916134f1565b610c3991906134d1565b60028201556007820154815464e8d4a5100091610c55916134f1565b610c5f91906134d1565b600482015583610c7c57336000908152600a602052604090204390555b83336001600160a01b03167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56885604051610cb691906133fa565b60405180910390a3505060016000555050565b60008281526009602090815260408083206001600160a01b03851684528252808320600a9092528220546005820154839161708091610d089190612c65565b610d129043613510565b610d1d90600a6134f1565b610d2791906134d1565b9050603281111561063357506032949350505050565b600c5481565b60026000541415610d665760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110610d8f57634e487b7160e01b600052603260045260246000fd5b6000918252602080832085845260098252604080852033865290925290832080546008909302909101805490945090928491610dcc908490613510565b909155505080546000808355600283018190556001830181905560048301819055600383015583610e0a57336000908152600a602052604090204390555b6001830154610e23906001600160a01b03163383612c46565b83336001600160a01b03167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059583604051610cb691906133fa565b610e65612350565b6001600160a01b0316610e766118cc565b6001600160a01b031614610e9c5760405162461bcd60e51b81526004016104e490613242565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60026000541415610f095760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110610f3257634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150610f63836124bc565b6000610f6f843361270d565b8260010154610f7e91906134b9565b905060008111610fa05760405162461bcd60e51b81526004016104e490613102565b610fa981612816565b6000610fb58533610cc9565b90507f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d16001600160a01b03161561121e5760007f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d16001600160a01b031663463dd61c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561104157600080fd5b505afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612ee7565b90508043101561121c5760006110906002856134d1565b905061109c8185613510565b9350600060646110ac85846134f1565b6110b691906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906110e99030908590600401613066565b600060405180830381600087803b15801561110357600080fd5b505af1158015611117573d6000803e3d6000fd5b5050505061114b7f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d1828461090a91906134b9565b6001600160a01b037f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d11663282d3fdf3361118584866134b9565b6040518363ffffffff1660e01b81526004016111a2929190613066565b600060405180830381600087803b1580156111bc57600080fd5b505af11580156111d0573d6000803e3d6000fd5b508a92503391507f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b905061120484866134b9565b60405161121191906133fa565b60405180910390a350505b505b801561129c576002546001600160a01b03166340c10f1930606461124285876134f1565b61124c91906134d1565b6040518363ffffffff1660e01b8152600401611269929190613066565b600060405180830381600087803b15801561128357600080fd5b505af1158015611297573d6000803e3d6000fd5b505050505b600060018401556004840154835464e8d4a51000916112ba916134f1565b6112c491906134d1565b6002840155600060646112d783856134f1565b6112e191906134d1565b6112eb90846134b9565b90506000600860008154811061131157634e487b7160e01b600052603260045260246000fd5b600091825260208083203384527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b90915260408320600890920201925090611358906124bc565b611363600033612bda565b8282600001600082825461137791906134b9565b90915550508054839082906000906113909084906134b9565b90915550506004820154815464e8d4a51000916113ac916134f1565b6113b691906134d1565b60028201556007820154815464e8d4a51000916113d2916134f1565b6113dc91906134d1565b600482015560405133907fbd654390d0d973e8c8376ed6053be8658870df892687852cc5c914d700291b8790611413908b906133fa565b60405180910390a250506001600055505050505050565b6001600160a01b038316600090815260116020526040902054839060ff16156114655760405162461bcd60e51b81526004016104e490613277565b61146d612350565b6001600160a01b031661147e6118cc565b6001600160a01b0316146114a45760405162461bcd60e51b81526004016104e490613242565b6101f48361ffff1611156114ca5760405162461bcd60e51b81526004016104e4906130bd565b81156114d8576114d8612354565b6001600160a01b03841660008181526011602052604090819020805460ff19166001179055516370a0823160e01b81526370a082319061151c903090600401613014565b60206040518083038186803b15801561153457600080fd5b505afa158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c9190612ee7565b506000600c54431161158057600c54611582565b435b905085600b600082825461159691906134b9565b9091555050604080516101008101825260008082526001600160a01b03888116602084019081528385018b8152606085018781526080860185815261ffff8c811660a0890190815260c089018b815260e08a01898152600880546001810182559a8190529a517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee39a909b02998a019a909a5595517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4890180546001600160a01b031916919098161790965592517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee587015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee6860155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee785015591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee88401805461ffff19169190931617909155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee982015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636eea90910155517f1ea76ba8644ae1d8334006497b07c36bc57ea4066aca9be63ad69be790fa2ee290611786908890889088908890613403565b60405180910390a1505050505050565b6006546001600160a01b031633146117c05760405162461bcd60e51b81526004016104e490613311565b6001600160a01b0381166117e65760405162461bcd60e51b81526004016104e4906131db565b600680546001600160a01b0319166001600160a01b0383161790556040517ff27839648b9860ca5a1e1348e270b5dd324ccc37b450eefc4200ed3abe673fb690610553908390613014565b6004546001600160a01b0316331461185b5760405162461bcd60e51b81526004016104e4906131b8565b6001600160a01b0381166118815760405162461bcd60e51b81526004016104e4906131db565b600480546001600160a01b0319166001600160a01b0383161790556040517f8daa6bb00de042a7d51816fcee4a3d5c1e91a2128fd64fa1a9a38afa0d26beb590610553908390613014565b6001546001600160a01b031690565b600260005414156118fe5760405162461bcd60e51b81526004016104e4906133b4565b60026000908155600880548590811061192757634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600982526040808520338652909252922060089091029091019150611958856124bc565b6119628533612bda565b8315611b7e5760018201546040516370a0823160e01b81526000916001600160a01b0316906370a082319061199b903090600401613014565b60206040518083038186803b1580156119b357600080fd5b505afa1580156119c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119eb9190612ee7565b6001840154909150611a08906001600160a01b0316333088612c7e565b60018301546040516370a0823160e01b815260009183916001600160a01b03909116906370a0823190611a3f903090600401613014565b60206040518083038186803b158015611a5757600080fd5b505afa158015611a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8f9190612ee7565b611a999190613510565b600585015490915061ffff1615611b4957600584015460009061271090611ac49061ffff16846134f1565b611ace91906134d1565b905060006005611adf8360036134f1565b611ae991906134d1565b6006546001880154919250611b0b916001600160a01b03908116911683612c46565b600754611b3a906001600160a01b0316611b258385613510565b60018901546001600160a01b03169190612c46565b611b448284613510565b925050505b80836000016000828254611b5d91906134b9565b9091555050835481908590600090611b769084906134b9565b909155505050505b6004820154815464e8d4a5100091611b95916134f1565b611b9f91906134d1565b60028201556007820154815464e8d4a5100091611bbb916134f1565b611bc591906134d1565b60048201556005810154611bda574360058201555b6001600160a01b03831615801590611bfb57506001600160a01b0383163314155b8015611c1d5750336000908152600d60205260409020546001600160a01b0316155b15611e1757336000908152600d6020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558352600e82528083208380529091528120805460019290611c729084906134b9565b9091555050336000908152600e602081815260408084208480528252808420546001600160a01b0388168552928252808420600185529091528220805491929091611cbe9084906134b9565b9091555050336000908152600e60208181526040808420600185528252808420546001600160a01b0388168552928252808420600285529091528220805491929091611d0b9084906134b9565b90915550506001600160a01b038084166000908152600d6020526040902054168015611e15576001600160a01b0381166000908152600e60209081526040808320600180855292528220805491929091611d669084906134b9565b9091555050336000908152600e602081815260408084208480528252808420546001600160a01b0386168552928252808420600285529091528220805491929091611db29084906134b9565b90915550506001600160a01b038082166000908152600d6020526040902054168015611e13576001600160a01b0381166000908152600e60209081526040808320600284529091528120805460019290611e0d9084906134b9565b90915550505b505b505b84336001600160a01b03167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1586604051611e5191906133fa565b60405180910390a350506001600055505050565b600f6020526000908152604090205481565b6009602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b60008281526009602090815260408083206001600160a01b038516845290915281206064611ee58585610cc9565b611ef09060646134b9565b611efa868661270d565b8360010154611f0991906134b9565b611f1391906134f1565b61063391906134d1565b60026000541415611f405760405162461bcd60e51b81526004016104e4906133b4565b600260009081556008805483908110611f6957634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600982526040808520338652909252922060089091029091019150611f9a836124bc565b6000611fa6843361237f565b8260030154611fb591906134b9565b905060008111611fd75760405162461bcd60e51b81526004016104e490613102565b600354604051634f0d005560e11b81526001600160a01b0390911690639e1a00aa906120099033908590600401613066565b600060405180830381600087803b15801561202357600080fd5b505af1158015612037573d6000803e3d6000fd5b50506000600385015550506007830154825464e8d4a5100091612059916134f1565b61206391906134d1565b600483015560405133907fce3ea4745ffbcdb1833febb705a9558eb9362e915a0ff60625532831df6b375c9061209a9087906133fa565b60405180910390a2505060016000555050565b60116020526000908152604090205460ff1681565b6004546001600160a01b031681565b7f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d181565b6120fd612350565b6001600160a01b031661210e6118cc565b6001600160a01b0316146121345760405162461bcd60e51b81526004016104e490613242565b6101f48261ffff16111561215a5760405162461bcd60e51b81526004016104e4906131fd565b801561216857612168612354565b826008858154811061218a57634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160020154600b546121a99190613510565b6121b391906134b9565b600b8190555082600885815481106121db57634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160020181905550816008858154811061221257634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160050160006101000a81548161ffff021916908361ffff1602179055507f51a590a04784062e03e6e262f0a712722a099fcee9e31c52d100dfdcd71a2e34848484846040516122729493929190613470565b60405180910390a150505050565b612288612350565b6001600160a01b03166122996118cc565b6001600160a01b0316146122bf5760405162461bcd60e51b81526004016104e490613242565b6001600160a01b0381166122e55760405162461bcd60e51b81526004016104e49061312c565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031681565b3390565b60085460005b8181101561237b5761236b816124bc565b61237481613553565b905061235a565b5050565b600080600884815481106123a357634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526009825260408085206001600160a01b03891686529092529220600760089092029092019081015490925060028611156123f05760009350505050610637565b8260060154431180156124035750825415155b801561241157506000600b54115b156124855760006201211084600601544361242c9190613510565b61243691906134d1565b90506000600361244e83670de0b6b3a76400006134f1565b61245891906134d1565b855490915061246c8264e8d4a510006134f1565b61247691906134d1565b61248090846134b9565b925050505b6004820154825464e8d4a510009061249e9084906134f1565b6124a891906134d1565b6124b29190613510565b9695505050505050565b6000600882815481106124df57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060080201905080600301544311612500575061270a565b8054158061251057506002810154155b1561252857436003820181905560069091015561270a565b600081600301544361253a9190613510565b90506000600b5483600201546005548461255491906134f1565b61255e91906134f1565b61256891906134d1565b6002546004549192506001600160a01b03908116916340c10f19911661258f600a856134d1565b6040518363ffffffff1660e01b81526004016125ac929190613066565b600060405180830381600087803b1580156125c657600080fd5b505af11580156125da573d6000803e3d6000fd5b50506002546040516340c10f1960e01b81526001600160a01b0390911692506340c10f1991506126109030908590600401613066565b600060405180830381600087803b15801561262a57600080fd5b505af115801561263e573d6000803e3d6000fd5b50508454915061265590508264e8d4a510006134f1565b61265f91906134d1565b83600401600082825461267291906134b9565b909155505043600384018190556006840154600091620121109161269591613510565b61269f91906134d1565b9050801561270557600060036126bd83670de0b6b3a76400006134f1565b6126c791906134d1565b85549091506126db8264e8d4a510006134f1565b6126e591906134d1565b8560070160008282546126f891906134b9565b9091555050436006860155505b505050505b50565b6000806008848154811061273157634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526009825260408085206001600160a01b0389168652909252922060046008909202909201908101546003820154919350904311801561277d5750825415155b801561278b57506000600b54115b156127fd5760008360030154436127a29190613510565b90506000600b548560020154600554846127bc91906134f1565b6127c691906134f1565b6127d091906134d1565b85549091506127e48264e8d4a510006134f1565b6127ee91906134d1565b6127f890846134b9565b925050505b6002820154825464e8d4a510009061249e9084906134f1565b3360005b60105460ff82161015612953576001600160a01b039182166000908152600d6020526040902054909116908161284f57612953565b600061271060108360ff168154811061287857634e487b7160e01b600052603260045260246000fd5b600091825260209091206010820401546128a291600f166002026101000a900461ffff16866134f1565b6128ac91906134d1565b6002546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906128df9086908590600401613066565b600060405180830381600087803b1580156128f957600080fd5b505af115801561290d573d6000803e3d6000fd5b505050506001600160a01b0383166000908152600f6020526040812080548392906129399084906134b9565b9091555082915061294b90508161356e565b91505061281a565b505050565b600081846001600160a01b031663dd62ed3e30866040518363ffffffff1660e01b8152600401612989929190613028565b60206040518083038186803b1580156129a157600080fd5b505afa1580156129b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d99190612ee7565b6129e391906134b9565b9050612a3b8463095ea7b360e01b8584604051602401612a04929190613066565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612c9f565b50505050565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612a72903090600401613014565b60206040518083038186803b158015612a8a57600080fd5b505afa158015612a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac29190612ee7565b905080821115612b565760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90612afe9086908590600401613066565b602060405180830381600087803b158015612b1857600080fd5b505af1158015612b2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b509190612eb3565b50612953565b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90612b889086908690600401613066565b602060405180830381600087803b158015612ba257600080fd5b505af1158015612bb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3b9190612eb3565b60008281526009602090815260408083206001600160a01b03851684529091529020612c06838361270d565b816001016000828254612c1991906134b9565b90915550612c299050838361237f565b816003016000828254612c3c91906134b9565b9091555050505050565b6129538363a9059cbb60e01b8484604051602401612a04929190613066565b600081831015612c755781612c77565b825b9392505050565b612a3b846323b872dd60e01b858585604051602401612a0493929190613042565b6000612cf4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d2e9092919063ffffffff16565b8051909150156129535780806020019051810190612d129190612eb3565b6129535760405162461bcd60e51b81526004016104e49061336a565b6060612d3d8484600085612d45565b949350505050565b606082471015612d675760405162461bcd60e51b81526004016104e490613172565b612d7085612e05565b612d8c5760405162461bcd60e51b81526004016104e4906132ae565b600080866001600160a01b03168587604051612da89190612ff8565b60006040518083038185875af1925050503d8060008114612de5576040519150601f19603f3d011682016040523d82523d6000602084013e612dea565b606091505b5091509150612dfa828286612e0f565b979650505050505050565b803b15155b919050565b60608315612e1e575081612c77565b825115612e2e5782518084602001fd5b8160405162461bcd60e51b81526004016104e4919061308a565b803561ffff81168114612e0a57600080fd5b600060208284031215612e6b578081fd5b8135612c77816135a4565b60008060408385031215612e88578081fd5b8235612e93816135a4565b9150602083013560ff81168114612ea8578182fd5b809150509250929050565b600060208284031215612ec4578081fd5b8151612c77816135b9565b600060208284031215612ee0578081fd5b5035919050565b600060208284031215612ef8578081fd5b5051919050565b60008060408385031215612f11578182fd5b823591506020830135612ea8816135a4565b60008060008060808587031215612f38578182fd5b843593506020850135612f4a816135a4565b9250612f5860408601612e48565b91506060850135612f68816135b9565b939692955090935050565b60008060408385031215612f85578182fd5b50508035926020909101359150565b600080600060608486031215612fa8578283fd5b83359250602084013591506040840135612fc1816135a4565b809150509250925092565b60008060008060808587031215612fe1578384fd5b8435935060208501359250612f5860408601612e48565b6000825161300a818460208701613527565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60006020825282518060208401526130a9816040850160208701613527565b601f01601f19169190910160400192915050565b60208082526025908201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706040820152646f696e747360d81b606082015260800190565b60208082526010908201526f4e6f7468696e6720746f20636c61696d60801b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252600990820152686465763a207775743f60b81b604082015260600190565b602080825260089082015267216e6f6e7a65726f60c01b604082015260600190565b60208082526025908201527f7365743a20696e76616c6964206465706f7369742066656520626173697320706040820152646f696e747360d81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526018908201527f6e6f6e4475706c6963617465643a6475706c6963617465640000000000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b60208082526018908201527f736574466565416464726573733a20464f5242494444454e0000000000000000604082015260600190565b6020808252600890820152670a8dede40d0d2ced60c31b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b61ffff91909116815260200190565b90815260200190565b9384526001600160a01b0392909216602084015261ffff1660408301521515606082015260800190565b9788526001600160a01b0396909616602088015260408701949094526060860192909252608085015261ffff1660a084015260c083015260e08201526101000190565b938452602084019290925261ffff1660408301521515606082015260800190565b958652602086019490945260408501929092526060840152608083015260a082015260c00190565b600082198211156134cc576134cc61358e565b500190565b6000826134ec57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561350b5761350b61358e565b500290565b6000828210156135225761352261358e565b500390565b60005b8381101561354257818101518382015260200161352a565b83811115612a3b5750506000910152565b60006000198214156135675761356761358e565b5060010190565b600060ff821660ff8114156135855761358561358e565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461270a57600080fd5b801515811461270a57600080fdfea26469706673582212202a35212f2c03bfb44fc5d76d43476c8363441d7800acb7a84d31c536ddd27c7364736f6c63430008000033

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

0000000000000000000000000b502860b730bfaf5fa5566ec9996c53810dfe08000000000000000000000000df7d2df53b1c30543f2dda24fbd21a2935bbf02f00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d10000000000000000000000004b6c21e96d6dcc20c23d1812b68ef2bdac24a67e00000000000000000000000077011f364e4f9a68f822fd9e71e0fd36e89cd96500000000000000000000000043e318ff665c63ab93f6610c2b3dcf0d0ec669a0000000000000000000000000000000000000000000000000000000000128c89000000000000000000000000000000000000000000000000000000000000009c4

-----Decoded View---------------
Arg [0] : _sh (address): 0x0b502860B730BfAf5FA5566EC9996C53810Dfe08
Arg [1] : _shares (address): 0xdF7d2Df53B1C30543F2Dda24fBD21A2935bBF02f
Arg [2] : _locker (address): 0x17737521Abc43F17eA1b4f74e2964E71fF3a42D1
Arg [3] : _devaddr (address): 0x4B6C21E96d6DcC20c23D1812b68Ef2bDAc24a67E
Arg [4] : _feeAddress (address): 0x77011F364E4F9A68F822fD9E71e0Fd36e89cD965
Arg [5] : _sharesAddress (address): 0x43E318FF665C63Ab93F6610c2b3dcf0d0ec669A0
Arg [6] : _startBlock (uint256): 19450000
Arg [7] : _shAllocPoint (uint256): 2500

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000b502860b730bfaf5fa5566ec9996c53810dfe08
Arg [1] : 000000000000000000000000df7d2df53b1c30543f2dda24fbd21a2935bbf02f
Arg [2] : 00000000000000000000000017737521abc43f17ea1b4f74e2964e71ff3a42d1
Arg [3] : 0000000000000000000000004b6c21e96d6dcc20c23d1812b68ef2bdac24a67e
Arg [4] : 00000000000000000000000077011f364e4f9a68f822fd9e71e0fd36e89cd965
Arg [5] : 00000000000000000000000043e318ff665c63ab93f6610c2b3dcf0d0ec669a0
Arg [6] : 000000000000000000000000000000000000000000000000000000000128c890
Arg [7] : 00000000000000000000000000000000000000000000000000000000000009c4


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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