ETH Price: $2,674.74 (-0.83%)
Gas: 4.97 Gwei

Contract

0x1751ACB6486F904b4Dca82dca76d69C96dfeFD8c
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deposit208508672024-09-28 18:16:355 hrs ago1727547395IN
0x1751ACB6...96dfeFD8c
0 ETH0.000750196.10299765
Deposit208508522024-09-28 18:13:355 hrs ago1727547215IN
0x1751ACB6...96dfeFD8c
0 ETH0.000799516.50420361
Deposit208508412024-09-28 18:11:235 hrs ago1727547083IN
0x1751ACB6...96dfeFD8c
0 ETH0.000726256.86288719
Deposit207711712024-09-17 15:17:2311 days ago1726586243IN
0x1751ACB6...96dfeFD8c
0 ETH0.0026044824.6117532
Deposit207429282024-09-13 16:37:1115 days ago1726245431IN
0x1751ACB6...96dfeFD8c
0 ETH0.000902797.34442818
Deposit207149412024-09-09 18:47:5919 days ago1725907679IN
0x1751ACB6...96dfeFD8c
0 ETH0.000973147.91668836
Deposit207076892024-09-08 18:29:5920 days ago1725820199IN
0x1751ACB6...96dfeFD8c
0 ETH0.000416751.77285129
Deposit207076302024-09-08 18:17:5920 days ago1725819479IN
0x1751ACB6...96dfeFD8c
0 ETH0.000187611.77287711
Deposit206903162024-09-06 8:19:5922 days ago1725610799IN
0x1751ACB6...96dfeFD8c
0 ETH0.000397043.75201538
Deposit206223692024-08-27 20:39:4732 days ago1724791187IN
0x1751ACB6...96dfeFD8c
0 ETH0.000185511.75304277
Deposit205410322024-08-16 11:56:2343 days ago1723809383IN
0x1751ACB6...96dfeFD8c
0 ETH0.00021612.04213056
Deposit205367772024-08-15 21:41:4744 days ago1723758107IN
0x1751ACB6...96dfeFD8c
0 ETH0.000960244.08478103
Deposit205367602024-08-15 21:38:2344 days ago1723757903IN
0x1751ACB6...96dfeFD8c
0 ETH0.000488633.97513555
Deposit205284422024-08-14 17:44:2345 days ago1723657463IN
0x1751ACB6...96dfeFD8c
0 ETH0.000738946.98287912
Deposit205284272024-08-14 17:41:2345 days ago1723657283IN
0x1751ACB6...96dfeFD8c
0 ETH0.001660457.06340359
Deposit205283852024-08-14 17:32:5945 days ago1723656779IN
0x1751ACB6...96dfeFD8c
0 ETH0.000871048.23117644
Deposit204384012024-08-02 4:13:3557 days ago1722572015IN
0x1751ACB6...96dfeFD8c
0 ETH0.000322232.62142905
Deposit204232812024-07-31 1:34:3559 days ago1722389675IN
0x1751ACB6...96dfeFD8c
0 ETH0.000702825.71759651
Deposit203782772024-07-24 18:45:3566 days ago1721846735IN
0x1751ACB6...96dfeFD8c
0 ETH0.001673187.11757856
Deposit203782402024-07-24 18:38:1166 days ago1721846291IN
0x1751ACB6...96dfeFD8c
0 ETH0.000718495.84508959
Deposit203132942024-07-15 17:06:3575 days ago1721063195IN
0x1751ACB6...96dfeFD8c
0 ETH0.005537423.55562012
Deposit203132662024-07-15 17:00:4775 days ago1721062847IN
0x1751ACB6...96dfeFD8c
0 ETH0.0030372824.7088178
Withdraw202957072024-07-13 6:10:5977 days ago1720851059IN
0x1751ACB6...96dfeFD8c
0 ETH0.000383671.90397826
Deposit202844942024-07-11 16:35:1179 days ago1720715711IN
0x1751ACB6...96dfeFD8c
0 ETH0.0015990713.00872631
Deposit202704082024-07-09 17:24:3581 days ago1720545875IN
0x1751ACB6...96dfeFD8c
0 ETH0.001924178.18566975
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardsManager

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license
File 1 of 15 : RewardsManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/IMasterChef.sol";
import "./interfaces/IVault.sol";
import "./interfaces/ILockManager.sol";
import "./interfaces/IERC20Extended.sol";
import "./lib/SafeERC20.sol";
import "./lib/ReentrancyGuard.sol";

/**
 * @title RewardsManager
 * @dev Controls rewards distribution for network
 */
contract RewardsManager is ReentrancyGuard {
    using SafeERC20 for IERC20Extended;

    /// @notice Current owner of this contract
    address public owner;

    /// @notice Info of each user.
    struct UserInfo {
        uint256 amount;          // How many tokens the user has provided.
        uint256 rewardTokenDebt; // Reward debt for reward token. See explanation below.
        uint256 sushiRewardDebt; // Reward debt for Sushi rewards. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of reward tokens
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accRewardsPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws tokens to a pool. Here's what happens:
        //   1. The pool's `accRewardsPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    /// @notice Info of each pool.
    struct PoolInfo {
        IERC20Extended token;       // Address of token contract.
        uint256 allocPoint;         // How many allocation points assigned to this pool. Reward tokens to distribute per block.
        uint256 lastRewardBlock;    // Last block number where reward tokens were distributed.
        uint256 accRewardsPerShare; // Accumulated reward tokens per share, times 1e12. See below.
        uint32 vestingPercent;      // Percentage of rewards that vest (measured in bips: 500,000 bips = 50% of rewards)
        uint16 vestingPeriod;       // Vesting period in days for vesting rewards
        uint16 vestingCliff;        // Vesting cliff in days for vesting rewards
        uint256 totalStaked;        // Total amount of token staked via Rewards Manager
        bool vpForDeposit;          // Do users get voting power for deposits of this token?
        bool vpForVesting;          // Do users get voting power for vesting balances?
    }

    /// @notice Reward token
    IERC20Extended public rewardToken;

    /// @notice SUSHI token
    IERC20Extended public sushiToken;

    /// @notice Sushi Master Chef
    IMasterChef public masterChef;

    /// @notice Vault for vesting tokens
    IVault public vault;

    /// @notice LockManager contract
    ILockManager public lockManager;

    /// @notice Reward tokens rewarded per block.
    uint256 public rewardTokensPerBlock;

    /// @notice Info of each pool.
    PoolInfo[] public poolInfo;
    
    /// @notice Mapping of Sushi tokens to MasterChef pids 
    mapping (address => uint256) public sushiPools;

    /// @notice Info of each user that stakes tokens.
    mapping (uint256 => mapping (address => UserInfo)) public userInfo;
    
    /// @notice Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;

    /// @notice The block number when rewards start.
    uint256 public startBlock;

    /// @notice only owner can call function
    modifier onlyOwner {
        require(msg.sender == owner, "not owner");
        _;
    }

    /// @notice Event emitted when a user deposits funds in the rewards manager
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);

    /// @notice Event emitted when a user withdraws their original funds + rewards from the rewards manager
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);

    /// @notice Event emitted when a user withdraws their original funds from the rewards manager without claiming rewards
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);

    /// @notice Event emitted when new pool is added to the rewards manager
    event PoolAdded(uint256 indexed pid, address indexed token, uint256 allocPoints, uint256 totalAllocPoints, uint256 rewardStartBlock, uint256 sushiPid, bool vpForDeposit, bool vpForVesting);
    
    /// @notice Event emitted when pool allocation points are updated
    event PoolUpdated(uint256 indexed pid, uint256 oldAllocPoints, uint256 newAllocPoints, uint256 newTotalAllocPoints);

    /// @notice Event emitted when the owner of the rewards manager contract is updated
    event ChangedOwner(address indexed oldOwner, address indexed newOwner);

    /// @notice Event emitted when the amount of reward tokens per block is updated
    event ChangedRewardTokensPerBlock(uint256 indexed oldRewardTokensPerBlock, uint256 indexed newRewardTokensPerBlock);

    /// @notice Event emitted when the rewards start block is set
    event SetRewardsStartBlock(uint256 indexed startBlock);

    /// @notice Event emitted when contract address is changed
    event ChangedAddress(string indexed addressType, address indexed oldAddress, address indexed newAddress);

    /**
     * @notice Create a new Rewards Manager contract
     * @param _owner owner of contract
     * @param _lockManager address of LockManager contract
     * @param _vault address of Vault contract
     * @param _rewardToken address of token that is being offered as a reward
     * @param _sushiToken address of SUSHI token
     * @param _masterChef address of SushiSwap MasterChef contract
     * @param _startBlock block number when rewards will start
     * @param _rewardTokensPerBlock initial amount of reward tokens to be distributed per block
     */
    constructor(
        address _owner, 
        address _lockManager,
        address _vault,
        address _rewardToken,
        address _sushiToken,
        address _masterChef,
        uint256 _startBlock,
        uint256 _rewardTokensPerBlock
    ) {
        owner = _owner;
        emit ChangedOwner(address(0), _owner);

        lockManager = ILockManager(_lockManager);
        emit ChangedAddress("LOCK_MANAGER", address(0), _lockManager);

        vault = IVault(_vault);
        emit ChangedAddress("VAULT", address(0), _vault);

        rewardToken = IERC20Extended(_rewardToken);
        emit ChangedAddress("REWARD_TOKEN", address(0), _rewardToken);

        sushiToken = IERC20Extended(_sushiToken);
        emit ChangedAddress("SUSHI_TOKEN", address(0), _sushiToken);

        masterChef = IMasterChef(_masterChef);
        emit ChangedAddress("MASTER_CHEF", address(0), _masterChef);

        startBlock = _startBlock == 0 ? block.number : _startBlock;
        emit SetRewardsStartBlock(startBlock);

        rewardTokensPerBlock = _rewardTokensPerBlock;
        emit ChangedRewardTokensPerBlock(0, _rewardTokensPerBlock);

        rewardToken.safeIncreaseAllowance(address(vault), type(uint256).max);
    }

    /**
     * @notice View function to see current poolInfo array length
     * @return pool length
     */
    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    /**
     * @notice Add a new reward token to the pool
     * @dev Can only be called by the owner. DO NOT add the same token more than once. Rewards will be messed up if you do.
     * @param allocPoint Number of allocation points to allot to this token/pool
     * @param token The token that will be staked for rewards
     * @param vestingPercent The percentage of rewards from this pool that will vest
     * @param vestingPeriod The number of days for the vesting period
     * @param vestingCliff The number of days for the vesting cliff
     * @param withUpdate if specified, update all pools before adding new pool
     * @param sushiPid The pid of the Sushiswap pool in the Masterchef contract (if exists, otherwise provide zero)
     * @param vpForDeposit If true, users get voting power for deposits
     * @param vpForVesting If true, users get voting power for vesting balances
     */
    function add(
        uint256 allocPoint, 
        address token,
        uint32 vestingPercent,
        uint16 vestingPeriod,
        uint16 vestingCliff,
        bool withUpdate,
        uint256 sushiPid,
        bool vpForDeposit,
        bool vpForVesting
    ) external onlyOwner {
        if (withUpdate) {
            massUpdatePools();
        }
        uint256 rewardStartBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint + allocPoint;
        poolInfo.push(PoolInfo({
            token: IERC20Extended(token),
            allocPoint: allocPoint,
            lastRewardBlock: rewardStartBlock,
            accRewardsPerShare: 0,
            vestingPercent: vestingPercent,
            vestingPeriod: vestingPeriod,
            vestingCliff: vestingCliff,
            totalStaked: 0,
            vpForDeposit: vpForDeposit,
            vpForVesting: vpForVesting
        }));
        if (sushiPid != uint256(0)) {
            sushiPools[token] = sushiPid;
            IERC20Extended(token).safeIncreaseAllowance(address(masterChef), type(uint256).max);
        }
        IERC20Extended(token).safeIncreaseAllowance(address(vault), type(uint256).max);
        emit PoolAdded(poolInfo.length - 1, token, allocPoint, totalAllocPoint, rewardStartBlock, sushiPid, vpForDeposit, vpForVesting);
    }

    /**
     * @notice Update the given pool's allocation points
     * @dev Can only be called by the owner
     * @param pid The RewardManager pool id
     * @param allocPoint New number of allocation points for pool
     * @param withUpdate if specified, update all pools before setting allocation points
     */
    function set(
        uint256 pid, 
        uint256 allocPoint, 
        bool withUpdate
    ) external onlyOwner {
        if (withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - poolInfo[pid].allocPoint + allocPoint;
        emit PoolUpdated(pid, poolInfo[pid].allocPoint, allocPoint, totalAllocPoint);
        poolInfo[pid].allocPoint = allocPoint;
    }

    /**
     * @notice Returns true if rewards are actively being accumulated
     */
    function rewardsActive() public view returns (bool) {
        return block.number >= startBlock && totalAllocPoint > 0 ? true : false;
    }

    /**
     * @notice Return reward multiplier over the given from to to block.
     * @param from From block number
     * @param to To block number
     * @return multiplier
     */
    function getMultiplier(uint256 from, uint256 to) public pure returns (uint256) {
        return to > from ? to - from : 0;
    }

    /**
     * @notice View function to see pending reward tokens on frontend.
     * @param pid pool id
     * @param account user account to check
     * @return pending rewards
     */
    function pendingRewardTokens(uint256 pid, address account) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][account];
        uint256 accRewardsPerShare = pool.accRewardsPerShare;
        uint256 tokenSupply = pool.totalStaked;
        if (block.number > pool.lastRewardBlock && tokenSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 totalReward = multiplier * rewardTokensPerBlock * pool.allocPoint / totalAllocPoint;
            accRewardsPerShare = accRewardsPerShare + totalReward * 1e12 / tokenSupply;
        }

        uint256 accumulatedRewards = user.amount * accRewardsPerShare / 1e12;
        
        if (accumulatedRewards < user.rewardTokenDebt) {
            return 0;
        }

        return accumulatedRewards - user.rewardTokenDebt;
    }

    /**
     * @notice View function to see pending SUSHI on frontend.
     * @param pid pool id
     * @param account user account to check
     * @return pending SUSHI rewards
     */
    function pendingSushi(uint256 pid, address account) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][account];
        uint256 sushiPid = sushiPools[address(pool.token)];
        if (sushiPid == uint256(0)) {
            return 0;
        }
        IMasterChef.PoolInfo memory sushiPool = masterChef.poolInfo(sushiPid);
        uint256 sushiPerBlock = masterChef.sushiPerBlock();
        uint256 totalSushiAllocPoint = masterChef.totalAllocPoint();
        uint256 accSushiPerShare = sushiPool.accSushiPerShare;
        uint256 lpSupply = sushiPool.lpToken.balanceOf(address(masterChef));
        if (block.number > sushiPool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = masterChef.getMultiplier(sushiPool.lastRewardBlock, block.number);
            uint256 sushiReward = multiplier * sushiPerBlock * sushiPool.allocPoint / totalSushiAllocPoint;
            accSushiPerShare = accSushiPerShare + sushiReward * 1e12 / lpSupply;
        }
        
        uint256 accumulatedSushi = user.amount * accSushiPerShare / 1e12;
        
        if (accumulatedSushi < user.sushiRewardDebt) {
            return 0;
        }

        return accumulatedSushi - user.sushiRewardDebt;
        
    }

    /**
     * @notice Update reward variables for all pools
     * @dev Be careful of gas spending!
     */
    function massUpdatePools() public {
        for (uint256 pid = 0; pid < poolInfo.length; ++pid) {
            updatePool(pid);
        }
    }

    /**
     * @notice Update reward variables of the given pool to be up-to-date
     * @param pid pool id
     */
    function updatePool(uint256 pid) public {
        PoolInfo storage pool = poolInfo[pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }

        uint256 tokenSupply = pool.totalStaked;
        if (tokenSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 totalReward = multiplier * rewardTokensPerBlock * pool.allocPoint / totalAllocPoint;
        pool.accRewardsPerShare = pool.accRewardsPerShare + totalReward * 1e12 / tokenSupply;
        pool.lastRewardBlock = block.number;
    }

    /**
     * @notice Deposit tokens to RewardsManager for rewards allocation.
     * @param pid pool id
     * @param amount number of tokens to deposit
     */
    function deposit(uint256 pid, uint256 amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        _deposit(pid, amount, pool, user);
    }

    /**
     * @notice Deposit tokens to RewardsManager for rewards allocation, using permit for approval
     * @dev It is up to the frontend developer to ensure the pool token implements permit - otherwise this will fail
     * @param pid pool id
     * @param amount number of tokens to deposit
     * @param deadline The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function depositWithPermit(
        uint256 pid, 
        uint256 amount,
        uint256 deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s
    ) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        pool.token.permit(msg.sender, address(this), amount, deadline, v, r, s);
        _deposit(pid, amount, pool, user);
    }

    /**
     * @notice Withdraw tokens from RewardsManager, claiming rewards.
     * @param pid pool id
     * @param amount number of tokens to withdraw
     */
    function withdraw(uint256 pid, uint256 amount) external nonReentrant {
        require(amount > 0, "RM::withdraw: amount must be > 0");
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        _withdraw(pid, amount, pool, user);
    }

    /**
     * @notice Withdraw without caring about rewards. EMERGENCY ONLY.
     * @param pid pool id
     */
    function emergencyWithdraw(uint256 pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];

        if (user.amount > 0) {
            uint256 sushiPid = sushiPools[address(pool.token)];
            if (sushiPid != uint256(0)) {
                masterChef.withdraw(sushiPid, user.amount);
            }

            if (pool.vpForDeposit) {
                lockManager.removeVotingPower(msg.sender, address(pool.token), user.amount);
            }

            pool.totalStaked = pool.totalStaked - user.amount;
            pool.token.safeTransfer(msg.sender, user.amount);

            emit EmergencyWithdraw(msg.sender, pid, user.amount);

            user.amount = 0;
            user.rewardTokenDebt = 0;
            user.sushiRewardDebt = 0;
        }
    }

    /**
     * @notice Set approvals for external addresses to use contract tokens
     * @dev Can only be called by the owner
     * @param tokensToApprove the tokens to approve
     * @param approvalAmounts the token approval amounts
     * @param spender the address to allow spending of token
     */
    function tokenAllow(
        address[] memory tokensToApprove, 
        uint256[] memory approvalAmounts, 
        address spender
    ) external onlyOwner {
        require(tokensToApprove.length == approvalAmounts.length, "RM::tokenAllow: not same length");
        for(uint i = 0; i < tokensToApprove.length; i++) {
            IERC20Extended token = IERC20Extended(tokensToApprove[i]);
            if (token.allowance(address(this), spender) != type(uint256).max) {
                token.safeApprove(spender, approvalAmounts[i]);
            }
        }
    }

    /**
     * @notice Rescue (withdraw) tokens from the smart contract
     * @dev Can only be called by the owner
     * @param tokens the tokens to withdraw
     * @param amounts the amount of each token to withdraw.  If zero, withdraws the maximum allowed amount for each token
     * @param receiver the address that will receive the tokens
     */
    function rescueTokens(
        address[] calldata tokens, 
        uint256[] calldata amounts, 
        address receiver
    ) external onlyOwner {
        require(tokens.length == amounts.length, "RM::rescueTokens: not same length");
        for (uint i = 0; i < tokens.length; i++) {
            IERC20Extended token = IERC20Extended(tokens[i]);
            uint256 withdrawalAmount;
            uint256 tokenBalance = token.balanceOf(address(this));
            uint256 tokenAllowance = token.allowance(address(this), receiver);
            if (amounts[i] == 0) {
                if (tokenBalance > tokenAllowance) {
                    withdrawalAmount = tokenAllowance;
                } else {
                    withdrawalAmount = tokenBalance;
                }
            } else {
                require(tokenBalance >= amounts[i], "RM::rescueTokens: contract balance too low");
                require(tokenAllowance >= amounts[i], "RM::rescueTokens: increase token allowance");
                withdrawalAmount = amounts[i];
            }
            token.safeTransferFrom(address(this), receiver, withdrawalAmount);
        }
    }

    /**
     * @notice Set new rewards per block
     * @dev Can only be called by the owner
     * @param newRewardTokensPerBlock new amount of reward token to reward each block
     */
    function setRewardsPerBlock(uint256 newRewardTokensPerBlock) external onlyOwner {
        emit ChangedRewardTokensPerBlock(rewardTokensPerBlock, newRewardTokensPerBlock);
        rewardTokensPerBlock = newRewardTokensPerBlock;
    }

    /**
     * @notice Set new SUSHI token address
     * @dev Can only be called by the owner
     * @param newToken address of new SUSHI token
     */
    function setSushiToken(address newToken) external onlyOwner {
        emit ChangedAddress("SUSHI_TOKEN", address(sushiToken), newToken);
        sushiToken = IERC20Extended(newToken);
    }

    /**
     * @notice Set new MasterChef address
     * @dev Can only be called by the owner
     * @param newAddress address of new MasterChef
     */
    function setMasterChef(address newAddress) external onlyOwner {
        emit ChangedAddress("MASTER_CHEF", address(masterChef), newAddress);
        masterChef = IMasterChef(newAddress);
    }
        
    /**
     * @notice Set new Vault address
     * @param newAddress address of new Vault
     */
    function setVault(address newAddress) external onlyOwner {
        emit ChangedAddress("VAULT", address(vault), newAddress);
        vault = IVault(newAddress);
    }

    /**
     * @notice Set new LockManager address
     * @param newAddress address of new LockManager
     */
    function setLockManager(address newAddress) external onlyOwner {
        emit ChangedAddress("LOCK_MANAGER", address(lockManager), newAddress);
        lockManager = ILockManager(newAddress);
    }

    /**
     * @notice Change owner of Rewards Manager contract
     * @dev Can only be called by the owner
     * @param newOwner New owner address
     */
    function changeOwner(address newOwner) external onlyOwner {
        require(newOwner != address(0) && newOwner != address(this), "RM::changeOwner: not valid address");
        emit ChangedOwner(owner, newOwner);
        owner = newOwner;
    }

    /**
     * @notice Internal implementation of deposit
     * @param pid pool id
     * @param amount number of tokens to deposit
     * @param pool the pool info
     * @param user the user info 
     */
    function _deposit(
        uint256 pid, 
        uint256 amount, 
        PoolInfo storage pool, 
        UserInfo storage user
    ) internal {
        updatePool(pid);

        uint256 sushiPid = sushiPools[address(pool.token)];
        uint256 pendingSushiTokens = 0;

        if (user.amount > 0) {
            uint256 pendingRewards = user.amount * pool.accRewardsPerShare / 1e12 - user.rewardTokenDebt;

            if (pendingRewards > 0) {
                _distributeRewards(msg.sender, pendingRewards, pool.vestingPercent, pool.vestingPeriod, pool.vestingCliff, pool.vpForVesting);
            }

            if (sushiPid != uint256(0)) {
                masterChef.updatePool(sushiPid);
                pendingSushiTokens = user.amount * masterChef.poolInfo(sushiPid).accSushiPerShare / 1e12 - user.sushiRewardDebt;
            }
        }
       
        pool.token.safeTransferFrom(msg.sender, address(this), amount);
        pool.totalStaked = pool.totalStaked + amount;
        user.amount = user.amount + amount;
        user.rewardTokenDebt = user.amount * pool.accRewardsPerShare / 1e12;

        if (sushiPid != uint256(0)) {
            masterChef.updatePool(sushiPid);
            user.sushiRewardDebt = user.amount * masterChef.poolInfo(sushiPid).accSushiPerShare / 1e12;
            masterChef.deposit(sushiPid, amount);
        }

        if (amount > 0 && pool.vpForDeposit) {
            lockManager.grantVotingPower(msg.sender, address(pool.token), amount);
        }

        if (pendingSushiTokens > 0) {
            _safeSushiTransfer(msg.sender, pendingSushiTokens);
        }

        emit Deposit(msg.sender, pid, amount);
    }

    /**
     * @notice Internal implementation of withdraw
     * @param pid pool id
     * @param amount number of tokens to withdraw
     * @param pool the pool info
     * @param user the user info 
     */
    function _withdraw(
        uint256 pid,
        uint256 amount,
        PoolInfo storage pool,
        UserInfo storage user
    ) internal {
        require(user.amount >= amount, "RM::_withdraw: amount > user balance");

        updatePool(pid);

        uint256 sushiPid = sushiPools[address(pool.token)];

        if (sushiPid != uint256(0)) {
            masterChef.updatePool(sushiPid);
            uint256 pendingSushiTokens = user.amount * masterChef.poolInfo(sushiPid).accSushiPerShare / 1e12 - user.sushiRewardDebt;
            masterChef.withdraw(sushiPid, amount);
            user.sushiRewardDebt = (user.amount - amount) * masterChef.poolInfo(sushiPid).accSushiPerShare / 1e12;
            if (pendingSushiTokens > 0) {
                _safeSushiTransfer(msg.sender, pendingSushiTokens);
            }
        }

        uint256 pendingRewards = user.amount * pool.accRewardsPerShare / 1e12 - user.rewardTokenDebt;
        user.amount = user.amount - amount;
        user.rewardTokenDebt = user.amount * pool.accRewardsPerShare / 1e12;

        if (pendingRewards > 0) {
            _distributeRewards(msg.sender, pendingRewards, pool.vestingPercent, pool.vestingPeriod, pool.vestingCliff, pool.vpForVesting);
        }
        
        if (pool.vpForDeposit) {
            lockManager.removeVotingPower(msg.sender, address(pool.token), amount);
        }

        pool.totalStaked = pool.totalStaked - amount;
        pool.token.safeTransfer(msg.sender, amount);

        emit Withdraw(msg.sender, pid, amount);
    }

    /**
     * @notice Internal function used to distribute rewards, optionally vesting a %
     * @param account account that is due rewards
     * @param rewardAmount amount of rewards to distribute
     * @param vestingPercent percent of rewards to vest in bips
     * @param vestingPeriod number of days over which to vest rewards
     * @param vestingCliff number of days for vesting cliff
     * @param vestingVotingPower if true, grant voting power for vesting balance
     */
    function _distributeRewards(
        address account, 
        uint256 rewardAmount, 
        uint32 vestingPercent, 
        uint16 vestingPeriod, 
        uint16 vestingCliff,
        bool vestingVotingPower
    ) internal {
        rewardToken.mint(address(this), rewardAmount);
        uint256 vestingRewards = rewardAmount * vestingPercent / 1000000;
        if(vestingRewards > 0) {
            vault.lockTokens(address(rewardToken), address(this), account, 0, vestingRewards, vestingPeriod, vestingCliff, vestingVotingPower);
        }
        rewardToken.safeTransfer(msg.sender, rewardAmount - vestingRewards);
    }

    /**
     * @notice Safe SUSHI transfer function, just in case if rounding error causes pool to not have enough SUSHI.
     * @param to account that is receiving SUSHI
     * @param amount amount of SUSHI to send
     */
    function _safeSushiTransfer(address to, uint256 amount) internal {
        uint256 sushiBalance = sushiToken.balanceOf(address(this));
        if (amount > sushiBalance) {
            sushiToken.safeTransfer(to, sushiBalance);
        } else {
            sushiToken.safeTransfer(to, amount);
        }
    }
}

File 2 of 15 : 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 3 of 15 : IERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20Burnable is IERC20 {
    function burn(uint256 amount) external returns (bool);
}

File 4 of 15 : IERC20Extended.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20Metadata.sol";
import "./IERC20Mintable.sol";
import "./IERC20Burnable.sol";
import "./IERC20Permit.sol";
import "./IERC20TransferWithAuth.sol";
import "./IERC20SafeAllowance.sol";

interface IERC20Extended is 
    IERC20Metadata, 
    IERC20Mintable, 
    IERC20Burnable, 
    IERC20Permit,
    IERC20TransferWithAuth,
    IERC20SafeAllowance 
{}

File 5 of 15 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

File 6 of 15 : IERC20Mintable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20Mintable is IERC20 {
    function mint(address dst, uint256 amount) external returns (bool);
}

File 7 of 15 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20Permit is IERC20 {
    function getDomainSeparator() external view returns (bytes32);
    function DOMAIN_TYPEHASH() external view returns (bytes32);
    function VERSION_HASH() external view returns (bytes32);
    function PERMIT_TYPEHASH() external view returns (bytes32);
    function nonces(address) external view returns (uint);
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 8 of 15 : IERC20SafeAllowance.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20SafeAllowance is IERC20 {
    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
}

File 9 of 15 : IERC20TransferWithAuth.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IERC20TransferWithAuth is IERC20 {
    function transferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external;
    function receiveWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external;
    function TRANSFER_WITH_AUTHORIZATION_TYPEHASH() external view returns (bytes32);
    function RECEIVE_WITH_AUTHORIZATION_TYPEHASH() external view returns (bytes32);
    event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);
}

File 10 of 15 : ILockManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILockManager {
    struct LockedStake {
        uint256 amount;
        uint256 votingPower;
    }

    function getAmountStaked(address staker, address stakedToken) external view returns (uint256);
    function getStake(address staker, address stakedToken) external view returns (LockedStake memory);
    function calculateVotingPower(address token, uint256 amount) external view returns (uint256);
    function grantVotingPower(address receiver, address token, uint256 tokenAmount) external returns (uint256 votingPowerGranted);
    function removeVotingPower(address receiver, address token, uint256 tokenAmount) external returns (uint256 votingPowerRemoved);
}

File 11 of 15 : IMasterChef.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IMasterChef {
    struct PoolInfo {
        IERC20 lpToken;           // Address of LP token contract.
        uint256 allocPoint;       // How many allocation points assigned to this pool. SUSHIs to distribute per block.
        uint256 lastRewardBlock;  // Last block number that SUSHIs distribution occurs.
        uint256 accSushiPerShare; // Accumulated SUSHIs per share, times 1e12.
    }
    function deposit(uint256 _pid, uint256 _amount) external;
    function withdraw(uint256 _pid, uint256 _amount) external;
    function poolInfo(uint256 _pid) external view returns (PoolInfo memory);
    function pendingSushi(uint256 _pid, address _user) external view returns (uint256);
    function updatePool(uint256 _pid) external;
    function sushiPerBlock() external view returns (uint256);
    function totalAllocPoint() external view returns (uint256);
    function getMultiplier(uint256 _from, uint256 _to) external view returns (uint256);
}

File 12 of 15 : IVault.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IVault {
    
    struct Lock {
        address token;
        address receiver;
        uint48 startTime;
        uint16 vestingDurationInDays;
        uint16 cliffDurationInDays;
        uint256 amount;
        uint256 amountClaimed;
        uint256 votingPower;
    }

    struct LockBalance {
        uint256 id;
        uint256 claimableAmount;
        Lock lock;
    }

    struct TokenBalance {
        uint256 totalAmount;
        uint256 claimableAmount;
        uint256 claimedAmount;
        uint256 votingPower;
    }

    function lockTokens(address token, address locker, address receiver, uint48 startTime, uint256 amount, uint16 lockDurationInDays, uint16 cliffDurationInDays, bool grantVotingPower) external;
    function lockTokensWithPermit(address token, address locker, address receiver, uint48 startTime, uint256 amount, uint16 lockDurationInDays, uint16 cliffDurationInDays, bool grantVotingPower, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
    function claimUnlockedTokenAmounts(uint256[] memory lockIds, uint256[] memory amounts) external;
    function claimAllUnlockedTokens(uint256[] memory lockIds) external;
    function tokenLocks(uint256 lockId) external view returns(Lock memory);
    function allActiveLockIds() external view returns(uint256[] memory);
    function allActiveLocks() external view returns(Lock[] memory);
    function allActiveLockBalances() external view returns(LockBalance[] memory);
    function activeLockIds(address receiver) external view returns(uint256[] memory);
    function allLocks(address receiver) external view returns(Lock[] memory);
    function activeLocks(address receiver) external view returns(Lock[] memory);
    function activeLockBalances(address receiver) external view returns(LockBalance[] memory);
    function totalTokenBalance(address token) external view returns(TokenBalance memory balance);
    function tokenBalance(address token, address receiver) external view returns(TokenBalance memory balance);
    function lockBalance(uint256 lockId) external view returns (LockBalance memory);
    function claimableBalance(uint256 lockId) external view returns (uint256);
    function extendLock(uint256 lockId, uint16 vestingDaysToAdd, uint16 cliffDaysToAdd) external;
}

File 13 of 15 : 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;
        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");

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

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

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

        (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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 15 : 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 15 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/IERC20.sol";
import "./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'
        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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_lockManager","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_sushiToken","type":"address"},{"internalType":"address","name":"_masterChef","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_rewardTokensPerBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"addressType","type":"string"},{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ChangedAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"ChangedOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"oldRewardTokensPerBlock","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newRewardTokensPerBlock","type":"uint256"}],"name":"ChangedRewardTokensPerBlock","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":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"allocPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAllocPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardStartBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sushiPid","type":"uint256"},{"indexed":false,"internalType":"bool","name":"vpForDeposit","type":"bool"},{"indexed":false,"internalType":"bool","name":"vpForVesting","type":"bool"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldAllocPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAllocPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalAllocPoints","type":"uint256"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"startBlock","type":"uint256"}],"name":"SetRewardsStartBlock","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":"address","name":"token","type":"address"},{"internalType":"uint32","name":"vestingPercent","type":"uint32"},{"internalType":"uint16","name":"vestingPeriod","type":"uint16"},{"internalType":"uint16","name":"vestingCliff","type":"uint16"},{"internalType":"bool","name":"withUpdate","type":"bool"},{"internalType":"uint256","name":"sushiPid","type":"uint256"},{"internalType":"bool","name":"vpForDeposit","type":"bool"},{"internalType":"bool","name":"vpForVesting","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"lockManager","outputs":[{"internalType":"contract ILockManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"masterChef","outputs":[{"internalType":"contract IMasterChef","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":"account","type":"address"}],"name":"pendingRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"pendingSushi","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20Extended","name":"token","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardsPerShare","type":"uint256"},{"internalType":"uint32","name":"vestingPercent","type":"uint32"},{"internalType":"uint16","name":"vestingPeriod","type":"uint16"},{"internalType":"uint16","name":"vestingCliff","type":"uint16"},{"internalType":"uint256","name":"totalStaked","type":"uint256"},{"internalType":"bool","name":"vpForDeposit","type":"bool"},{"internalType":"bool","name":"vpForVesting","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"receiver","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Extended","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardTokensPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setLockManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setMasterChef","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRewardTokensPerBlock","type":"uint256"}],"name":"setRewardsPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newToken","type":"address"}],"name":"setSushiToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sushiPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sushiToken","outputs":[{"internalType":"contract IERC20Extended","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokensToApprove","type":"address[]"},{"internalType":"uint256[]","name":"approvalAmounts","type":"uint256[]"},{"internalType":"address","name":"spender","type":"address"}],"name":"tokenAllow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"updatePool","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":"rewardTokenDebt","type":"uint256"},{"internalType":"uint256","name":"sushiRewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004ad338038062004ad383398101604081905262000034916200065e565b6001600081815581546001600160a01b0319166001600160a01b038b169081179092556040517f2748503f8f31d8071821d1d5144384ba6a465036cda17fa1629a8a2509ccee0e908290a3600680546001600160a01b0319166001600160a01b0389169081179091556040516b2627a1a5afa6a0a720a3a2a960a11b8152600090600c016040519081900381209060008051602062004ab383398151915290600090a4600580546001600160a01b0319166001600160a01b038816908117825560405164159055531560da1b81529091600091016040519081900381209060008051602062004ab383398151915290600090a4600280546001600160a01b0319166001600160a01b0387169081179091556040516b2922aba0a9222faa27a5a2a760a11b8152600090600c016040519081900381209060008051602062004ab383398151915290600090a4600380546001600160a01b0319166001600160a01b0386169081179091556040516a29aaa9a424afaa27a5a2a760a91b8152600090600b016040519081900381209060008051602062004ab383398151915290600090a4600480546001600160a01b0319166001600160a01b0385169081179091556040516a26a0a9aa22a92fa1a422a360a91b8152600090600b016040519081900381209060008051602062004ab383398151915290600090a481156200023b57816200023d565b435b600c8190556040517f1b190b90c41faf64e3c69c95576c9ab1ad9fdbd9f620f05d271ab76202a56bd390600090a2600781905560405181906000907f946161e5739a4430df1991fae9a81c63724a1971bf00a784a024333d7a7489eb908290a3600554600254620002ca916001600160a01b039182169116600019620002d8602090811b620026c617901c565b5050505050505050620007da565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b1580156200032557600080fd5b505afa1580156200033a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000360919062000717565b6200036c919062000784565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152919250620003c891869190620003ce16565b50505050565b60006200042a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620004b560201b62002851179092919060201c565b805190915015620004b057808060200190518101906200044b9190620006f3565b620004b05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b505050565b6060620004c68484600085620004d0565b90505b9392505050565b606082471015620005335760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620004a7565b843b620005835760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620004a7565b600080866001600160a01b03168587604051620005a1919062000731565b60006040518083038185875af1925050503d8060008114620005e0576040519150601f19603f3d011682016040523d82523d6000602084013e620005e5565b606091505b509092509050620005f882828662000603565b979650505050505050565b6060831562000614575081620004c9565b825115620006255782518084602001fd5b8160405162461bcd60e51b8152600401620004a791906200074f565b80516001600160a01b03811681146200065957600080fd5b919050565b600080600080600080600080610100898b0312156200067c57600080fd5b620006878962000641565b97506200069760208a0162000641565b9650620006a760408a0162000641565b9550620006b760608a0162000641565b9450620006c760808a0162000641565b9350620006d760a08a0162000641565b60c08a015160e0909a0151989b979a5095989497939692505050565b6000602082840312156200070657600080fd5b81518015158114620004c957600080fd5b6000602082840312156200072a57600080fd5b5051919050565b6000825162000745818460208701620007ab565b9190910192915050565b602081526000825180602084015262000770816040850160208701620007ab565b601f01601f19169190910160400192915050565b60008219821115620007a657634e487b7160e01b600052601160045260246000fd5b500190565b60005b83811015620007c8578181015183820152602001620007ae565b83811115620003c85750506000910152565b6142c980620007ea6000396000f3fe608060405234801561001057600080fd5b506004361061020b5760003560e01c80636817031b1161012a578063a519121a116100bd578063deedfdbd1161008c578063e2bbb15811610071578063e2bbb15814610545578063f7c618c114610558578063fbfa77cf1461057857600080fd5b8063deedfdbd1461051f578063e1ea3dee1461053257600080fd5b8063a519121a146104b4578063a6f9dae1146104cc578063acca30a2146104df578063d4614c63146104ff57600080fd5b80638dbb1e3a116100f95780638dbb1e3a1461042657806393f1a40b14610439578063a1003b291461048e578063a2d9f4dc146104a157600080fd5b80636817031b146103c057806369af90b9146103d357806379f645f0146103f35780638da5cb5b1461040657600080fd5b806348cd4cb1116101a25780635312ea8e116101715780635312ea8e1461034d578063575a86b214610360578063630b5ba1146103a557806364482f79146103ad57600080fd5b806348cd4cb11461030b5780634cb5969814610314578063515bc3231461032757806351eb05a61461033a57600080fd5b8063195426ec116101de578063195426ec146102c957806329d0fa3e146102dc5780633bb82023146102e5578063441a3e70146102f857600080fd5b8063081e3eda146102105780631526fe271461022757806317caf6f1146102ab578063186bbe22146102b4575b600080fd5b6008545b6040519081526020015b60405180910390f35b61023a610235366004613e25565b610598565b6040805173ffffffffffffffffffffffffffffffffffffffff909b168b5260208b019990995297890196909652606088019490945263ffffffff909216608087015261ffff90811660a08701521660c085015260e0840152151561010083015215156101208201526101400161021e565b610214600b5481565b6102c76102c2366004613c3c565b61062b565b005b6102146102d7366004613e57565b610aac565b61021460075481565b6102146102f3366004613e57565b610f44565b6102c7610306366004613f36565b61107f565b610214600c5481565b6102c7610322366004613e87565b6111ac565b6102c7610335366004613f91565b611555565b6102c7610348366004613e25565b6116cf565b6102c761035b366004613e25565b611796565b6004546103809073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021e565b6102c7611a5d565b6102c76103bb366004613f58565b611a86565b6102c76103ce366004613c1f565b611bf9565b6102146103e1366004613c1f565b60096020526000908152604090205481565b6102c7610401366004613cc0565b611d38565b6001546103809073ffffffffffffffffffffffffffffffffffffffff1681565b610214610434366004613f36565b611f7b565b610473610447366004613e57565b600a60209081526000928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021e565b6102c761049c366004613e25565b611f9c565b6102c76104af366004613c1f565b612051565b6104bc612190565b604051901515815260200161021e565b6102c76104da366004613c1f565b6121b6565b6006546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6003546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6102c761052d366004613c1f565b61238c565b6102c7610540366004613c1f565b6124cb565b6102c7610553366004613f36565b61260a565b6002546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6005546103809073ffffffffffffffffffffffffffffffffffffffff1681565b600881815481106105a857600080fd5b6000918252602090912060079091020180546001820154600283015460038401546004850154600586015460069096015473ffffffffffffffffffffffffffffffffffffffff909516965092949193909263ffffffff81169261ffff64010000000083048116936601000000000000909304169160ff808216916101009004168a565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b838214610740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524d3a3a726573637565546f6b656e733a206e6f742073616d65206c656e677460448201527f680000000000000000000000000000000000000000000000000000000000000060648201526084016106a8565b60005b84811015610aa457600086868381811061075f5761075f614205565b90506020020160208101906107749190613c1f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150600090819073ffffffffffffffffffffffffffffffffffffffff8416906370a082319060240160206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108199190613e3e565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff878116602483015291925060009185169063dd62ed3e9060440160206040518083038186803b15801561088c57600080fd5b505afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c49190613e3e565b90508787868181106108d8576108d8614205565b90506020020135600014156108ff57808211156108f757809250610a6b565b819250610a6b565b87878681811061091157610911614205565b905060200201358210156109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f524d3a3a726573637565546f6b656e733a20636f6e74726163742062616c616e60448201527f636520746f6f206c6f770000000000000000000000000000000000000000000060648201526084016106a8565b8787868181106109b9576109b9614205565b90506020020135811015610a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f524d3a3a726573637565546f6b656e733a20696e63726561736520746f6b656e60448201527f20616c6c6f77616e63650000000000000000000000000000000000000000000060648201526084016106a8565b878786818110610a6157610a61614205565b9050602002013592505b610a8d73ffffffffffffffffffffffffffffffffffffffff8516308886612868565b505050508080610a9c9061419d565b915050610743565b505050505050565b60008060088481548110610ac257610ac2614205565b60009182526020808320878452600a8252604080852073ffffffffffffffffffffffffffffffffffffffff808a16875290845281862060079095029092018054909216855260099092529220549192509080610b245760009350505050610f3e565b600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820183905260009173ffffffffffffffffffffffffffffffffffffffff90911690631526fe279060240160806040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190613db6565b90506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b0bcf42a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3557600080fd5b505afa158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190613e3e565b90506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317caf6f16040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd957600080fd5b505afa158015610ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d119190613e3e565b60608401518451600480546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182169281019290925293945091926000929116906370a082319060240160206040518083038186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc59190613e3e565b9050846040015143118015610dd957508015155b15610ee1576004805460408781015190517f8dbb1e3a0000000000000000000000000000000000000000000000000000000081529283015243602483015260009173ffffffffffffffffffffffffffffffffffffffff90911690638dbb1e3a9060440160206040518083038186803b158015610e5457600080fd5b505afa158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c9190613e3e565b905060008487602001518784610ea2919061411d565b610eac919061411d565b610eb691906140e2565b905082610ec88264e8d4a5100061411d565b610ed291906140e2565b610edc90856140ca565b935050505b600064e8d4a51000838960000154610ef9919061411d565b610f0391906140e2565b90508760020154811015610f235760009950505050505050505050610f3e565b6002880154610f32908261415a565b99505050505050505050505b92915050565b60008060088481548110610f5a57610f5a614205565b60009182526020808320878452600a8252604080852073ffffffffffffffffffffffffffffffffffffffff891686529092529220600360079092029092019081015460058201546002830154929450909143118015610fb857508015155b15611026576000610fcd856002015443611f7b565b90506000600b54866001015460075484610fe7919061411d565b610ff1919061411d565b610ffb91906140e2565b90508261100d8264e8d4a5100061411d565b61101791906140e2565b61102190856140ca565b935050505b600064e8d4a5100083856000015461103e919061411d565b61104891906140e2565b9050836001015481101561106457600095505050505050610f3e565b6001840154611073908261415a565b98975050505050505050565b600260005414156110ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b600260005580611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f524d3a3a77697468647261773a20616d6f756e74206d757374206265203e203060448201526064016106a8565b60006008838154811061116d5761116d614205565b60009182526020808320868452600a825260408085203386529092529220600790910290910191506111a1848484846128c6565b505060016000555050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461122d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b831561123b5761123b611a5d565b6000600c54431161124e57600c54611250565b435b905089600b5461126091906140ca565b600b8190555060086040518061014001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001838152602001600081526020018a63ffffffff1681526020018961ffff1681526020018861ffff168152602001600081526020018515158152602001841515815250908060018154018082558091505060019003906000526020600020906007020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160040160046101000a81548161ffff021916908361ffff16021790555060c08201518160040160066101000a81548161ffff021916908361ffff16021790555060e082015181600501556101008201518160060160006101000a81548160ff0219169083151502179055506101208201518160060160016101000a81548160ff0219169083151502179055505050600084146114805773ffffffffffffffffffffffffffffffffffffffff808a16600081815260096020526040902086905560045461148092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6126c6565b6005546114c79073ffffffffffffffffffffffffffffffffffffffff8b811691167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6126c6565b60085473ffffffffffffffffffffffffffffffffffffffff8a16906114ee9060019061415a565b600b54604080518e81526020810192909252810184905260608101879052851515608082015284151560a08201527fcd9dd3b9c8ad5dc0bb8a3af1af7ead00b197d8341021a209fb64b736abe815b19060c00160405180910390a350505050505050505050565b600260005414156115c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b6002600090815560088054889081106115dd576115dd614205565b600091825260208083208a8452600a825260408085203380875293529384902060079390930201805493517fd505accf0000000000000000000000000000000000000000000000000000000081526004810192909252306024830152604482018a90526064820189905260ff8816608483015260a4820187905260c482018690529350909173ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b15801561169c57600080fd5b505af11580156116b0573d6000803e3d6000fd5b505050506116c088888484612e47565b50506001600055505050505050565b6000600882815481106116e4576116e4614205565b9060005260206000209060070201905080600201544311611703575050565b60058101548061171857504360029091015550565b6000611728836002015443611f7b565b90506000600b54846001015460075484611742919061411d565b61174c919061411d565b61175691906140e2565b9050826117688264e8d4a5100061411d565b61177291906140e2565b846003015461178191906140ca565b60038501555050436002909201919091555050565b60026000541415611803576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b60026000908155600880548390811061181e5761181e614205565b60009182526020808320858452600a82526040808520338652909252922080546007909202909201925015611a5357815473ffffffffffffffffffffffffffffffffffffffff166000908152600960205260409020548015611904576004805483546040517f441a3e70000000000000000000000000000000000000000000000000000000008152928301849052602483015273ffffffffffffffffffffffffffffffffffffffff169063441a3e7090604401600060405180830381600087803b1580156118eb57600080fd5b505af11580156118ff573d6000803e3d6000fd5b505050505b600683015460ff16156119c957600654835483546040517fbc3e1b7a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9283166024820152604481019190915291169063bc3e1b7a90606401602060405180830381600087803b15801561198f57600080fd5b505af11580156119a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c79190613e3e565b505b815460058401546119da919061415a565b600584015581548354611a079173ffffffffffffffffffffffffffffffffffffffff9091169033906133b7565b8154604051908152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35060008082556001820181905560028201555b5050600160005550565b60005b600854811015611a8357611a73816116cf565b611a7c8161419d565b9050611a60565b50565b60015473ffffffffffffffffffffffffffffffffffffffff163314611b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b8015611b1557611b15611a5d565b8160088481548110611b2957611b29614205565b906000526020600020906007020160010154600b54611b48919061415a565b611b5291906140ca565b600b81905550827fb0a2ded49817748754bcca0474b24011f01d4574dd5c40e14197ffa2e6540fef60088581548110611b8d57611b8d614205565b90600052602060002090600702016001015484600b54604051611bc3939291909283526020830191909152604082015260600190565b60405180910390a28160088481548110611bdf57611bdf614205565b906000526020600020906007020160010181905550505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611c7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b600580546040517f5641554c54000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481169392169101604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b8151835114611e24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f524d3a3a746f6b656e416c6c6f773a206e6f742073616d65206c656e6774680060448201526064016106a8565b60005b8351811015611f75576000848281518110611e4457611e44614205565b60209081029190910101516040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301529192507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9183169063dd62ed3e9060440160206040518083038186803b158015611ee157600080fd5b505afa158015611ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f199190613e3e565b14611f6257611f6283858481518110611f3457611f34614205565b60200260200101518373ffffffffffffffffffffffffffffffffffffffff166134129092919063ffffffff16565b5080611f6d8161419d565b915050611e27565b50505050565b6000828211611f8b576000611f95565b611f95838361415a565b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461201d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6007546040518291907f946161e5739a4430df1991fae9a81c63724a1971bf00a784a024333d7a7489eb90600090a3600755565b60015473ffffffffffffffffffffffffffffffffffffffff1633146120d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6004546040517f4d41535445525f43484546000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600b01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000600c5443101580156121a657506000600b54115b6121b05750600090565b50600190565b60015473ffffffffffffffffffffffffffffffffffffffff163314612237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b73ffffffffffffffffffffffffffffffffffffffff811615801590612272575073ffffffffffffffffffffffffffffffffffffffff81163014155b6122fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524d3a3a6368616e67654f776e65723a206e6f742076616c696420616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106a8565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f2748503f8f31d8071821d1d5144384ba6a465036cda17fa1629a8a2509ccee0e90600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff16331461240d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6006546040517f4c4f434b5f4d414e414745520000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600c01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff16331461254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6003546040517f53555348495f544f4b454e000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600b01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60026000541415612677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b60026000908155600880548490811061269257612692614205565b60009182526020808320868452600a825260408085203386529092529220600790910290910191506111a184848484612e47565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b15801561273857600080fd5b505afa15801561274c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127709190613e3e565b61277a91906140ca565b60405173ffffffffffffffffffffffffffffffffffffffff8516602482015260448101829052909150611f759085907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526135a3565b606061286084846000856136af565b949350505050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611f759085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016127cf565b8054831115612956576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f524d3a3a5f77697468647261773a20616d6f756e74203e20757365722062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016106a8565b61295f846116cf565b815473ffffffffffffffffffffffffffffffffffffffff166000908152600960205260409020548015612c5857600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820183905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b1580156129f657600080fd5b505af1158015612a0a573d6000803e3d6000fd5b505050506002820154600480546040517f1526fe270000000000000000000000000000000000000000000000000000000081529182018490526000929164e8d4a510009173ffffffffffffffffffffffffffffffffffffffff1690631526fe279060240160806040518083038186803b158015612a8657600080fd5b505afa158015612a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612abe9190613db6565b606001518554612ace919061411d565b612ad891906140e2565b612ae2919061415a565b600480546040517f441a3e7000000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff169163441a3e7091612b439186918a9101918252602082015260400190565b600060405180830381600087803b158015612b5d57600080fd5b505af1158015612b71573d6000803e3d6000fd5b5050600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a51000935073ffffffffffffffffffffffffffffffffffffffff169150631526fe279060240160806040518083038186803b158015612be457600080fd5b505afa158015612bf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1c9190613db6565b606001518454612c2d90889061415a565b612c37919061411d565b612c4191906140e2565b60028401558015612c5657612c56338261382f565b505b6000826001015464e8d4a5100085600301548560000154612c79919061411d565b612c8391906140e2565b612c8d919061415a565b8354909150612c9d90869061415a565b808455600385015464e8d4a5100091612cb6919061411d565b612cc091906140e2565b60018401558015612d0d5760048401546006850154612d0d913391849163ffffffff81169161ffff640100000000830481169266010000000000009004169060ff61010090910416613923565b600684015460ff1615612dcf5760065484546040517fbc3e1b7a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526044810188905291169063bc3e1b7a90606401602060405180830381600087803b158015612d9557600080fd5b505af1158015612da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dcd9190613e3e565b505b848460050154612ddf919061415a565b60058501558354612e079073ffffffffffffffffffffffffffffffffffffffff1633876133b7565b604051858152869033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a3505050505050565b612e50846116cf565b815473ffffffffffffffffffffffffffffffffffffffff1660009081526009602052604081205482549091901561305f576000836001015464e8d4a5100086600301548660000154612ea2919061411d565b612eac91906140e2565b612eb6919061415a565b90508015612f005760048501546006860154612f00913391849163ffffffff81169161ffff640100000000830481169266010000000000009004169060ff61010090910416613923565b821561305d57600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820185905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b158015612f7057600080fd5b505af1158015612f84573d6000803e3d6000fd5b505050506002840154600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a510009173ffffffffffffffffffffffffffffffffffffffff90911690631526fe279060240160806040518083038186803b158015612ffe57600080fd5b505afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190613db6565b606001518654613046919061411d565b61305091906140e2565b61305a919061415a565b91505b505b83546130839073ffffffffffffffffffffffffffffffffffffffff16333088612868565b84846005015461309391906140ca565b600585015582546130a59086906140ca565b808455600385015464e8d4a51000916130be919061411d565b6130c891906140e2565b600184015581156132a557600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820184905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b15801561313d57600080fd5b505af1158015613151573d6000803e3d6000fd5b5050600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a51000935073ffffffffffffffffffffffffffffffffffffffff169150631526fe279060240160806040518083038186803b1580156131c457600080fd5b505afa1580156131d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131fc9190613db6565b60600151845461320c919061411d565b61321691906140e2565b6002840155600480546040517fe2bbb1580000000000000000000000000000000000000000000000000000000081529182018490526024820187905273ffffffffffffffffffffffffffffffffffffffff169063e2bbb15890604401600060405180830381600087803b15801561328c57600080fd5b505af11580156132a0573d6000803e3d6000fd5b505050505b6000851180156132b95750600684015460ff165b156133735760065484546040517fbc61256e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526044810188905291169063bc61256e90606401602060405180830381600087803b15801561333957600080fd5b505af115801561334d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133719190613e3e565b505b801561338357613383338261382f565b604051858152869033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590602001612e37565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261340d9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016127cf565b505050565b8015806134c157506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561348757600080fd5b505afa15801561349b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bf9190613e3e565b155b61354d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016106a8565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261340d9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016127cf565b6000613605826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166128519092919063ffffffff16565b80519091501561340d57808060200190518101906136239190613d99565b61340d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106a8565b606082471015613741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106a8565b843b6137a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106a8565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516137d29190613fea565b60006040518083038185875af1925050503d806000811461380f576040519150601f19603f3d011682016040523d82523d6000602084013e613814565b606091505b5091509150613824828286613aec565b979650505050505050565b6003546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b15801561389957600080fd5b505afa1580156138ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138d19190613e3e565b9050808211156138ff5760035461340d9073ffffffffffffffffffffffffffffffffffffffff1684836133b7565b60035461340d9073ffffffffffffffffffffffffffffffffffffffff1684846133b7565b6002546040517f40c10f190000000000000000000000000000000000000000000000000000000081523060048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906340c10f1990604401602060405180830381600087803b15801561399557600080fd5b505af11580156139a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139cd9190613d99565b506000620f42406139e463ffffffff87168861411d565b6139ee91906140e2565b90508015613ab5576005546002546040517f19ac0d9000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201523060248201528982166044820152600060648201526084810184905261ffff80881660a4830152861660c482015284151560e48201529116906319ac0d909061010401600060405180830381600087803b158015613a9c57600080fd5b505af1158015613ab0573d6000803e3d6000fd5b505050505b613ae333613ac3838961415a565b60025473ffffffffffffffffffffffffffffffffffffffff1691906133b7565b50505050505050565b60608315613afb575081611f95565b825115613b0b5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a89190614006565b8035613b4a81614263565b919050565b60008083601f840112613b6157600080fd5b50813567ffffffffffffffff811115613b7957600080fd5b6020830191508360208260051b8501011115613b9457600080fd5b9250929050565b600082601f830112613bac57600080fd5b81356020613bc1613bbc836140a6565b614057565b80838252828201915082860187848660051b8901011115613be157600080fd5b60005b85811015613c0057813584529284019290840190600101613be4565b5090979650505050505050565b803561ffff81168114613b4a57600080fd5b600060208284031215613c3157600080fd5b8135611f9581614263565b600080600080600060608688031215613c5457600080fd5b853567ffffffffffffffff80821115613c6c57600080fd5b613c7889838a01613b4f565b90975095506020880135915080821115613c9157600080fd5b50613c9e88828901613b4f565b9094509250506040860135613cb281614263565b809150509295509295909350565b600080600060608486031215613cd557600080fd5b833567ffffffffffffffff80821115613ced57600080fd5b818601915086601f830112613d0157600080fd5b81356020613d11613bbc836140a6565b8083825282820191508286018b848660051b8901011115613d3157600080fd5b600096505b84871015613d5d578035613d4981614263565b835260019690960195918301918301613d36565b5097505087013592505080821115613d7457600080fd5b50613d8186828701613b9b565b925050613d9060408501613b3f565b90509250925092565b600060208284031215613dab57600080fd5b8151611f9581614285565b600060808284031215613dc857600080fd5b6040516080810181811067ffffffffffffffff82111715613deb57613deb614234565b6040528251613df981614263565b808252506020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215613e3757600080fd5b5035919050565b600060208284031215613e5057600080fd5b5051919050565b60008060408385031215613e6a57600080fd5b823591506020830135613e7c81614263565b809150509250929050565b60008060008060008060008060006101208a8c031215613ea657600080fd5b8935985060208a0135613eb881614263565b975060408a013563ffffffff81168114613ed157600080fd5b9650613edf60608b01613c0d565b9550613eed60808b01613c0d565b945060a08a0135613efd81614285565b935060c08a0135925060e08a0135613f1481614285565b91506101008a0135613f2581614285565b809150509295985092959850929598565b60008060408385031215613f4957600080fd5b50508035926020909101359150565b600080600060608486031215613f6d57600080fd5b83359250602084013591506040840135613f8681614285565b809150509250925092565b60008060008060008060c08789031215613faa57600080fd5b863595506020870135945060408701359350606087013560ff81168114613fd057600080fd5b9598949750929560808101359460a0909101359350915050565b60008251613ffc818460208701614171565b9190910192915050565b6020815260008251806020840152614025816040850160208701614171565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561409e5761409e614234565b604052919050565b600067ffffffffffffffff8211156140c0576140c0614234565b5060051b60200190565b600082198211156140dd576140dd6141d6565b500190565b600082614118577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614155576141556141d6565b500290565b60008282101561416c5761416c6141d6565b500390565b60005b8381101561418c578181015183820152602001614174565b83811115611f755750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156141cf576141cf6141d6565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114611a8357600080fd5b8015158114611a8357600080fdfea2646970667358221220b4cba8f093a464aa3c7b2c9f01defa75e5911bd09aeed9e8b8839417be125e6564736f6c63430008060033629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f40000000000000000000000008f48fe27f68a86786fbbd5d38ea53c2748b234b6000000000000000000000000dce455355c2993c18ab5a34dfee4525d66eadaf500000000000000000000000064b517250d9774939472675507dad84d822c67e20000000000000000000000001559fa1b8f28238fd5d76d9f434ad86fd20d15590000000000000000000000006b3595068778dd592e39a122f4f5a5cf09c90fe2000000000000000000000000c2edad668740f1aa35e4d8f227fb8e17dca888cd0000000000000000000000000000000000000000000000000000000000c5973400000000000000000000000000000000000000000000000266fe1047af9446d2

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061020b5760003560e01c80636817031b1161012a578063a519121a116100bd578063deedfdbd1161008c578063e2bbb15811610071578063e2bbb15814610545578063f7c618c114610558578063fbfa77cf1461057857600080fd5b8063deedfdbd1461051f578063e1ea3dee1461053257600080fd5b8063a519121a146104b4578063a6f9dae1146104cc578063acca30a2146104df578063d4614c63146104ff57600080fd5b80638dbb1e3a116100f95780638dbb1e3a1461042657806393f1a40b14610439578063a1003b291461048e578063a2d9f4dc146104a157600080fd5b80636817031b146103c057806369af90b9146103d357806379f645f0146103f35780638da5cb5b1461040657600080fd5b806348cd4cb1116101a25780635312ea8e116101715780635312ea8e1461034d578063575a86b214610360578063630b5ba1146103a557806364482f79146103ad57600080fd5b806348cd4cb11461030b5780634cb5969814610314578063515bc3231461032757806351eb05a61461033a57600080fd5b8063195426ec116101de578063195426ec146102c957806329d0fa3e146102dc5780633bb82023146102e5578063441a3e70146102f857600080fd5b8063081e3eda146102105780631526fe271461022757806317caf6f1146102ab578063186bbe22146102b4575b600080fd5b6008545b6040519081526020015b60405180910390f35b61023a610235366004613e25565b610598565b6040805173ffffffffffffffffffffffffffffffffffffffff909b168b5260208b019990995297890196909652606088019490945263ffffffff909216608087015261ffff90811660a08701521660c085015260e0840152151561010083015215156101208201526101400161021e565b610214600b5481565b6102c76102c2366004613c3c565b61062b565b005b6102146102d7366004613e57565b610aac565b61021460075481565b6102146102f3366004613e57565b610f44565b6102c7610306366004613f36565b61107f565b610214600c5481565b6102c7610322366004613e87565b6111ac565b6102c7610335366004613f91565b611555565b6102c7610348366004613e25565b6116cf565b6102c761035b366004613e25565b611796565b6004546103809073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021e565b6102c7611a5d565b6102c76103bb366004613f58565b611a86565b6102c76103ce366004613c1f565b611bf9565b6102146103e1366004613c1f565b60096020526000908152604090205481565b6102c7610401366004613cc0565b611d38565b6001546103809073ffffffffffffffffffffffffffffffffffffffff1681565b610214610434366004613f36565b611f7b565b610473610447366004613e57565b600a60209081526000928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021e565b6102c761049c366004613e25565b611f9c565b6102c76104af366004613c1f565b612051565b6104bc612190565b604051901515815260200161021e565b6102c76104da366004613c1f565b6121b6565b6006546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6003546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6102c761052d366004613c1f565b61238c565b6102c7610540366004613c1f565b6124cb565b6102c7610553366004613f36565b61260a565b6002546103809073ffffffffffffffffffffffffffffffffffffffff1681565b6005546103809073ffffffffffffffffffffffffffffffffffffffff1681565b600881815481106105a857600080fd5b6000918252602090912060079091020180546001820154600283015460038401546004850154600586015460069096015473ffffffffffffffffffffffffffffffffffffffff909516965092949193909263ffffffff81169261ffff64010000000083048116936601000000000000909304169160ff808216916101009004168a565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b838214610740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524d3a3a726573637565546f6b656e733a206e6f742073616d65206c656e677460448201527f680000000000000000000000000000000000000000000000000000000000000060648201526084016106a8565b60005b84811015610aa457600086868381811061075f5761075f614205565b90506020020160208101906107749190613c1f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150600090819073ffffffffffffffffffffffffffffffffffffffff8416906370a082319060240160206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108199190613e3e565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff878116602483015291925060009185169063dd62ed3e9060440160206040518083038186803b15801561088c57600080fd5b505afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c49190613e3e565b90508787868181106108d8576108d8614205565b90506020020135600014156108ff57808211156108f757809250610a6b565b819250610a6b565b87878681811061091157610911614205565b905060200201358210156109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f524d3a3a726573637565546f6b656e733a20636f6e74726163742062616c616e60448201527f636520746f6f206c6f770000000000000000000000000000000000000000000060648201526084016106a8565b8787868181106109b9576109b9614205565b90506020020135811015610a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f524d3a3a726573637565546f6b656e733a20696e63726561736520746f6b656e60448201527f20616c6c6f77616e63650000000000000000000000000000000000000000000060648201526084016106a8565b878786818110610a6157610a61614205565b9050602002013592505b610a8d73ffffffffffffffffffffffffffffffffffffffff8516308886612868565b505050508080610a9c9061419d565b915050610743565b505050505050565b60008060088481548110610ac257610ac2614205565b60009182526020808320878452600a8252604080852073ffffffffffffffffffffffffffffffffffffffff808a16875290845281862060079095029092018054909216855260099092529220549192509080610b245760009350505050610f3e565b600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820183905260009173ffffffffffffffffffffffffffffffffffffffff90911690631526fe279060240160806040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190613db6565b90506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b0bcf42a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3557600080fd5b505afa158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190613e3e565b90506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317caf6f16040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd957600080fd5b505afa158015610ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d119190613e3e565b60608401518451600480546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182169281019290925293945091926000929116906370a082319060240160206040518083038186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc59190613e3e565b9050846040015143118015610dd957508015155b15610ee1576004805460408781015190517f8dbb1e3a0000000000000000000000000000000000000000000000000000000081529283015243602483015260009173ffffffffffffffffffffffffffffffffffffffff90911690638dbb1e3a9060440160206040518083038186803b158015610e5457600080fd5b505afa158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c9190613e3e565b905060008487602001518784610ea2919061411d565b610eac919061411d565b610eb691906140e2565b905082610ec88264e8d4a5100061411d565b610ed291906140e2565b610edc90856140ca565b935050505b600064e8d4a51000838960000154610ef9919061411d565b610f0391906140e2565b90508760020154811015610f235760009950505050505050505050610f3e565b6002880154610f32908261415a565b99505050505050505050505b92915050565b60008060088481548110610f5a57610f5a614205565b60009182526020808320878452600a8252604080852073ffffffffffffffffffffffffffffffffffffffff891686529092529220600360079092029092019081015460058201546002830154929450909143118015610fb857508015155b15611026576000610fcd856002015443611f7b565b90506000600b54866001015460075484610fe7919061411d565b610ff1919061411d565b610ffb91906140e2565b90508261100d8264e8d4a5100061411d565b61101791906140e2565b61102190856140ca565b935050505b600064e8d4a5100083856000015461103e919061411d565b61104891906140e2565b9050836001015481101561106457600095505050505050610f3e565b6001840154611073908261415a565b98975050505050505050565b600260005414156110ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b600260005580611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f524d3a3a77697468647261773a20616d6f756e74206d757374206265203e203060448201526064016106a8565b60006008838154811061116d5761116d614205565b60009182526020808320868452600a825260408085203386529092529220600790910290910191506111a1848484846128c6565b505060016000555050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461122d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b831561123b5761123b611a5d565b6000600c54431161124e57600c54611250565b435b905089600b5461126091906140ca565b600b8190555060086040518061014001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001838152602001600081526020018a63ffffffff1681526020018961ffff1681526020018861ffff168152602001600081526020018515158152602001841515815250908060018154018082558091505060019003906000526020600020906007020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160040160046101000a81548161ffff021916908361ffff16021790555060c08201518160040160066101000a81548161ffff021916908361ffff16021790555060e082015181600501556101008201518160060160006101000a81548160ff0219169083151502179055506101208201518160060160016101000a81548160ff0219169083151502179055505050600084146114805773ffffffffffffffffffffffffffffffffffffffff808a16600081815260096020526040902086905560045461148092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6126c6565b6005546114c79073ffffffffffffffffffffffffffffffffffffffff8b811691167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6126c6565b60085473ffffffffffffffffffffffffffffffffffffffff8a16906114ee9060019061415a565b600b54604080518e81526020810192909252810184905260608101879052851515608082015284151560a08201527fcd9dd3b9c8ad5dc0bb8a3af1af7ead00b197d8341021a209fb64b736abe815b19060c00160405180910390a350505050505050505050565b600260005414156115c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b6002600090815560088054889081106115dd576115dd614205565b600091825260208083208a8452600a825260408085203380875293529384902060079390930201805493517fd505accf0000000000000000000000000000000000000000000000000000000081526004810192909252306024830152604482018a90526064820189905260ff8816608483015260a4820187905260c482018690529350909173ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b15801561169c57600080fd5b505af11580156116b0573d6000803e3d6000fd5b505050506116c088888484612e47565b50506001600055505050505050565b6000600882815481106116e4576116e4614205565b9060005260206000209060070201905080600201544311611703575050565b60058101548061171857504360029091015550565b6000611728836002015443611f7b565b90506000600b54846001015460075484611742919061411d565b61174c919061411d565b61175691906140e2565b9050826117688264e8d4a5100061411d565b61177291906140e2565b846003015461178191906140ca565b60038501555050436002909201919091555050565b60026000541415611803576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b60026000908155600880548390811061181e5761181e614205565b60009182526020808320858452600a82526040808520338652909252922080546007909202909201925015611a5357815473ffffffffffffffffffffffffffffffffffffffff166000908152600960205260409020548015611904576004805483546040517f441a3e70000000000000000000000000000000000000000000000000000000008152928301849052602483015273ffffffffffffffffffffffffffffffffffffffff169063441a3e7090604401600060405180830381600087803b1580156118eb57600080fd5b505af11580156118ff573d6000803e3d6000fd5b505050505b600683015460ff16156119c957600654835483546040517fbc3e1b7a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9283166024820152604481019190915291169063bc3e1b7a90606401602060405180830381600087803b15801561198f57600080fd5b505af11580156119a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c79190613e3e565b505b815460058401546119da919061415a565b600584015581548354611a079173ffffffffffffffffffffffffffffffffffffffff9091169033906133b7565b8154604051908152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35060008082556001820181905560028201555b5050600160005550565b60005b600854811015611a8357611a73816116cf565b611a7c8161419d565b9050611a60565b50565b60015473ffffffffffffffffffffffffffffffffffffffff163314611b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b8015611b1557611b15611a5d565b8160088481548110611b2957611b29614205565b906000526020600020906007020160010154600b54611b48919061415a565b611b5291906140ca565b600b81905550827fb0a2ded49817748754bcca0474b24011f01d4574dd5c40e14197ffa2e6540fef60088581548110611b8d57611b8d614205565b90600052602060002090600702016001015484600b54604051611bc3939291909283526020830191909152604082015260600190565b60405180910390a28160088481548110611bdf57611bdf614205565b906000526020600020906007020160010181905550505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611c7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b600580546040517f5641554c54000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481169392169101604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b8151835114611e24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f524d3a3a746f6b656e416c6c6f773a206e6f742073616d65206c656e6774680060448201526064016106a8565b60005b8351811015611f75576000848281518110611e4457611e44614205565b60209081029190910101516040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301529192507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9183169063dd62ed3e9060440160206040518083038186803b158015611ee157600080fd5b505afa158015611ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f199190613e3e565b14611f6257611f6283858481518110611f3457611f34614205565b60200260200101518373ffffffffffffffffffffffffffffffffffffffff166134129092919063ffffffff16565b5080611f6d8161419d565b915050611e27565b50505050565b6000828211611f8b576000611f95565b611f95838361415a565b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461201d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6007546040518291907f946161e5739a4430df1991fae9a81c63724a1971bf00a784a024333d7a7489eb90600090a3600755565b60015473ffffffffffffffffffffffffffffffffffffffff1633146120d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6004546040517f4d41535445525f43484546000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600b01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000600c5443101580156121a657506000600b54115b6121b05750600090565b50600190565b60015473ffffffffffffffffffffffffffffffffffffffff163314612237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b73ffffffffffffffffffffffffffffffffffffffff811615801590612272575073ffffffffffffffffffffffffffffffffffffffff81163014155b6122fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524d3a3a6368616e67654f776e65723a206e6f742076616c696420616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106a8565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f2748503f8f31d8071821d1d5144384ba6a465036cda17fa1629a8a2509ccee0e90600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff16331461240d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6006546040517f4c4f434b5f4d414e414745520000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600c01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff16331461254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f6e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016106a8565b6003546040517f53555348495f544f4b454e000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116921690600b01604051908190038120907f629c91fc9de3db5e699d8bad8523995c8e14e7f52fb91b49725e6625f2ea45f490600090a4600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60026000541415612677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b60026000908155600880548490811061269257612692614205565b60009182526020808320868452600a825260408085203386529092529220600790910290910191506111a184848484612e47565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b15801561273857600080fd5b505afa15801561274c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127709190613e3e565b61277a91906140ca565b60405173ffffffffffffffffffffffffffffffffffffffff8516602482015260448101829052909150611f759085907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526135a3565b606061286084846000856136af565b949350505050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611f759085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016127cf565b8054831115612956576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f524d3a3a5f77697468647261773a20616d6f756e74203e20757365722062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016106a8565b61295f846116cf565b815473ffffffffffffffffffffffffffffffffffffffff166000908152600960205260409020548015612c5857600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820183905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b1580156129f657600080fd5b505af1158015612a0a573d6000803e3d6000fd5b505050506002820154600480546040517f1526fe270000000000000000000000000000000000000000000000000000000081529182018490526000929164e8d4a510009173ffffffffffffffffffffffffffffffffffffffff1690631526fe279060240160806040518083038186803b158015612a8657600080fd5b505afa158015612a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612abe9190613db6565b606001518554612ace919061411d565b612ad891906140e2565b612ae2919061415a565b600480546040517f441a3e7000000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff169163441a3e7091612b439186918a9101918252602082015260400190565b600060405180830381600087803b158015612b5d57600080fd5b505af1158015612b71573d6000803e3d6000fd5b5050600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a51000935073ffffffffffffffffffffffffffffffffffffffff169150631526fe279060240160806040518083038186803b158015612be457600080fd5b505afa158015612bf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1c9190613db6565b606001518454612c2d90889061415a565b612c37919061411d565b612c4191906140e2565b60028401558015612c5657612c56338261382f565b505b6000826001015464e8d4a5100085600301548560000154612c79919061411d565b612c8391906140e2565b612c8d919061415a565b8354909150612c9d90869061415a565b808455600385015464e8d4a5100091612cb6919061411d565b612cc091906140e2565b60018401558015612d0d5760048401546006850154612d0d913391849163ffffffff81169161ffff640100000000830481169266010000000000009004169060ff61010090910416613923565b600684015460ff1615612dcf5760065484546040517fbc3e1b7a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526044810188905291169063bc3e1b7a90606401602060405180830381600087803b158015612d9557600080fd5b505af1158015612da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dcd9190613e3e565b505b848460050154612ddf919061415a565b60058501558354612e079073ffffffffffffffffffffffffffffffffffffffff1633876133b7565b604051858152869033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a3505050505050565b612e50846116cf565b815473ffffffffffffffffffffffffffffffffffffffff1660009081526009602052604081205482549091901561305f576000836001015464e8d4a5100086600301548660000154612ea2919061411d565b612eac91906140e2565b612eb6919061415a565b90508015612f005760048501546006860154612f00913391849163ffffffff81169161ffff640100000000830481169266010000000000009004169060ff61010090910416613923565b821561305d57600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820185905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b158015612f7057600080fd5b505af1158015612f84573d6000803e3d6000fd5b505050506002840154600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a510009173ffffffffffffffffffffffffffffffffffffffff90911690631526fe279060240160806040518083038186803b158015612ffe57600080fd5b505afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190613db6565b606001518654613046919061411d565b61305091906140e2565b61305a919061415a565b91505b505b83546130839073ffffffffffffffffffffffffffffffffffffffff16333088612868565b84846005015461309391906140ca565b600585015582546130a59086906140ca565b808455600385015464e8d4a51000916130be919061411d565b6130c891906140e2565b600184015581156132a557600480546040517f51eb05a600000000000000000000000000000000000000000000000000000000815291820184905273ffffffffffffffffffffffffffffffffffffffff16906351eb05a690602401600060405180830381600087803b15801561313d57600080fd5b505af1158015613151573d6000803e3d6000fd5b5050600480546040517f1526fe2700000000000000000000000000000000000000000000000000000000815291820186905264e8d4a51000935073ffffffffffffffffffffffffffffffffffffffff169150631526fe279060240160806040518083038186803b1580156131c457600080fd5b505afa1580156131d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131fc9190613db6565b60600151845461320c919061411d565b61321691906140e2565b6002840155600480546040517fe2bbb1580000000000000000000000000000000000000000000000000000000081529182018490526024820187905273ffffffffffffffffffffffffffffffffffffffff169063e2bbb15890604401600060405180830381600087803b15801561328c57600080fd5b505af11580156132a0573d6000803e3d6000fd5b505050505b6000851180156132b95750600684015460ff165b156133735760065484546040517fbc61256e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91821660248201526044810188905291169063bc61256e90606401602060405180830381600087803b15801561333957600080fd5b505af115801561334d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133719190613e3e565b505b801561338357613383338261382f565b604051858152869033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590602001612e37565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261340d9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016127cf565b505050565b8015806134c157506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561348757600080fd5b505afa15801561349b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bf9190613e3e565b155b61354d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016106a8565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261340d9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016127cf565b6000613605826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166128519092919063ffffffff16565b80519091501561340d57808060200190518101906136239190613d99565b61340d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106a8565b606082471015613741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106a8565b843b6137a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106a8565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516137d29190613fea565b60006040518083038185875af1925050503d806000811461380f576040519150601f19603f3d011682016040523d82523d6000602084013e613814565b606091505b5091509150613824828286613aec565b979650505050505050565b6003546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b15801561389957600080fd5b505afa1580156138ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138d19190613e3e565b9050808211156138ff5760035461340d9073ffffffffffffffffffffffffffffffffffffffff1684836133b7565b60035461340d9073ffffffffffffffffffffffffffffffffffffffff1684846133b7565b6002546040517f40c10f190000000000000000000000000000000000000000000000000000000081523060048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906340c10f1990604401602060405180830381600087803b15801561399557600080fd5b505af11580156139a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139cd9190613d99565b506000620f42406139e463ffffffff87168861411d565b6139ee91906140e2565b90508015613ab5576005546002546040517f19ac0d9000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201523060248201528982166044820152600060648201526084810184905261ffff80881660a4830152861660c482015284151560e48201529116906319ac0d909061010401600060405180830381600087803b158015613a9c57600080fd5b505af1158015613ab0573d6000803e3d6000fd5b505050505b613ae333613ac3838961415a565b60025473ffffffffffffffffffffffffffffffffffffffff1691906133b7565b50505050505050565b60608315613afb575081611f95565b825115613b0b5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a89190614006565b8035613b4a81614263565b919050565b60008083601f840112613b6157600080fd5b50813567ffffffffffffffff811115613b7957600080fd5b6020830191508360208260051b8501011115613b9457600080fd5b9250929050565b600082601f830112613bac57600080fd5b81356020613bc1613bbc836140a6565b614057565b80838252828201915082860187848660051b8901011115613be157600080fd5b60005b85811015613c0057813584529284019290840190600101613be4565b5090979650505050505050565b803561ffff81168114613b4a57600080fd5b600060208284031215613c3157600080fd5b8135611f9581614263565b600080600080600060608688031215613c5457600080fd5b853567ffffffffffffffff80821115613c6c57600080fd5b613c7889838a01613b4f565b90975095506020880135915080821115613c9157600080fd5b50613c9e88828901613b4f565b9094509250506040860135613cb281614263565b809150509295509295909350565b600080600060608486031215613cd557600080fd5b833567ffffffffffffffff80821115613ced57600080fd5b818601915086601f830112613d0157600080fd5b81356020613d11613bbc836140a6565b8083825282820191508286018b848660051b8901011115613d3157600080fd5b600096505b84871015613d5d578035613d4981614263565b835260019690960195918301918301613d36565b5097505087013592505080821115613d7457600080fd5b50613d8186828701613b9b565b925050613d9060408501613b3f565b90509250925092565b600060208284031215613dab57600080fd5b8151611f9581614285565b600060808284031215613dc857600080fd5b6040516080810181811067ffffffffffffffff82111715613deb57613deb614234565b6040528251613df981614263565b808252506020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215613e3757600080fd5b5035919050565b600060208284031215613e5057600080fd5b5051919050565b60008060408385031215613e6a57600080fd5b823591506020830135613e7c81614263565b809150509250929050565b60008060008060008060008060006101208a8c031215613ea657600080fd5b8935985060208a0135613eb881614263565b975060408a013563ffffffff81168114613ed157600080fd5b9650613edf60608b01613c0d565b9550613eed60808b01613c0d565b945060a08a0135613efd81614285565b935060c08a0135925060e08a0135613f1481614285565b91506101008a0135613f2581614285565b809150509295985092959850929598565b60008060408385031215613f4957600080fd5b50508035926020909101359150565b600080600060608486031215613f6d57600080fd5b83359250602084013591506040840135613f8681614285565b809150509250925092565b60008060008060008060c08789031215613faa57600080fd5b863595506020870135945060408701359350606087013560ff81168114613fd057600080fd5b9598949750929560808101359460a0909101359350915050565b60008251613ffc818460208701614171565b9190910192915050565b6020815260008251806020840152614025816040850160208701614171565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561409e5761409e614234565b604052919050565b600067ffffffffffffffff8211156140c0576140c0614234565b5060051b60200190565b600082198211156140dd576140dd6141d6565b500190565b600082614118577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614155576141556141d6565b500290565b60008282101561416c5761416c6141d6565b500390565b60005b8381101561418c578181015183820152602001614174565b83811115611f755750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156141cf576141cf6141d6565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114611a8357600080fd5b8015158114611a8357600080fdfea2646970667358221220b4cba8f093a464aa3c7b2c9f01defa75e5911bd09aeed9e8b8839417be125e6564736f6c63430008060033

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

0000000000000000000000008f48fe27f68a86786fbbd5d38ea53c2748b234b6000000000000000000000000dce455355c2993c18ab5a34dfee4525d66eadaf500000000000000000000000064b517250d9774939472675507dad84d822c67e20000000000000000000000001559fa1b8f28238fd5d76d9f434ad86fd20d15590000000000000000000000006b3595068778dd592e39a122f4f5a5cf09c90fe2000000000000000000000000c2edad668740f1aa35e4d8f227fb8e17dca888cd0000000000000000000000000000000000000000000000000000000000c5973400000000000000000000000000000000000000000000000266fe1047af9446d2

-----Decoded View---------------
Arg [0] : _owner (address): 0x8F48fe27f68a86786fbBD5D38Ea53C2748B234B6
Arg [1] : _lockManager (address): 0xdCE455355c2993C18ab5a34DfeE4525D66EAdAf5
Arg [2] : _vault (address): 0x64b517250D9774939472675507Dad84D822C67e2
Arg [3] : _rewardToken (address): 0x1559FA1b8F28238FD5D76D9f434ad86FD20D1559
Arg [4] : _sushiToken (address): 0x6B3595068778DD592e39A122f4f5a5cF09C90fE2
Arg [5] : _masterChef (address): 0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd
Arg [6] : _startBlock (uint256): 12949300
Arg [7] : _rewardTokensPerBlock (uint256): 44314875283446712018

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000008f48fe27f68a86786fbbd5d38ea53c2748b234b6
Arg [1] : 000000000000000000000000dce455355c2993c18ab5a34dfee4525d66eadaf5
Arg [2] : 00000000000000000000000064b517250d9774939472675507dad84d822c67e2
Arg [3] : 0000000000000000000000001559fa1b8f28238fd5d76d9f434ad86fd20d1559
Arg [4] : 0000000000000000000000006b3595068778dd592e39a122f4f5a5cf09c90fe2
Arg [5] : 000000000000000000000000c2edad668740f1aa35e4d8f227fb8e17dca888cd
Arg [6] : 0000000000000000000000000000000000000000000000000000000000c59734
Arg [7] : 00000000000000000000000000000000000000000000000266fe1047af9446d2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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