false
true
0

Contract Address Details

0x7bDCFCc86F69e52eF2866251b8a1ef162AB10368

Contract Name
Booster
Creator
0x00755d–ad4792 at 0x04c38d–c68552
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
18,726 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
26045427
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Booster




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
800
EVM Version
default




Verified at
2024-05-31T23:59:49.191187Z

Constructor Arguments

0x0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d3000000000000000000000000115f3fa979a936167f9d208a7b7c4d85081e84bd0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Arg [0] (address) : 0x3d4abcd29ea9a6117408536a0bbd0235007e28d3
Arg [1] (address) : 0x115f3fa979a936167f9d208a7b7c4d85081e84bd
Arg [2] (address) : 0x9663c2d75ffd5f4017310405fce61720af45b829
Arg [3] (address) : 0x0000000000000000000000000000000000000000
Arg [4] (address) : 0x0000000000000000000000000000000000000000

              

contracts/convex-contracts/contracts/contracts/Booster.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-0.6/utils/ReentrancyGuard.sol";

/**
 * @title   Booster
 * @author  ConvexFinance
 * @notice  Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
 * @dev     They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
 *          It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
 */
contract Booster is ReentrancyGuard {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    address public immutable crv;
    address public immutable voteOwnership;
    address public immutable voteParameter;

    uint256 public lockIncentive = 400; //incentive to crv stakers
    uint256 public stakerIncentive = 2000; //incentive to native token stakers
    uint256 public earmarkIncentive = 1; //incentive to users who spend gas to make calls
    uint256 public platformFee = 99; //possible fee to build treasury
    uint256 public constant MaxFees = 5000;
    uint256 public constant FEE_DENOMINATOR = 10000;

    address public owner;
    address public feeManager;
    address public poolManager;
    address public immutable staker;
    address public immutable minter;
    address public rewardFactory;
    address public stashFactory;
    address public tokenFactory;
    address public rewardArbitrator;
    address public voteDelegate;
    address public treasury;
    address public stakerRewards; //cvx rewards
    address public lockRewards; //cvxCrv rewards(crv)
    address public bridgeDelegate;
    mapping(uint256 => uint256) public l2FeesHistory;
    uint256 immutable epochLength = 1 weeks;

    mapping(address => FeeDistro) public feeTokens;
    struct FeeDistro {
        address distro;
        address rewards;
        bool active;
    }

    bool public isShutdown;

    struct PoolInfo {
        address lptoken;
        address token;
        address gauge;
        address crvRewards;
        address stash;
        bool shutdown;
    }

    //index(pid) -> pool
    PoolInfo[] public poolInfo;
    mapping(address => bool) public gaugeMap;

    // Reward multiplier for increasing or decreasing AURA rewards per PID
    uint256 public constant REWARD_MULTIPLIER_DENOMINATOR = 10000;
    // rewardContract => rewardMultiplier (10000 = 100%)
    mapping(address => uint256) public getRewardMultipliers;

    event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
    event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);

    event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
    event PoolShutdown(uint256 poolId);

    event OwnerUpdated(address newOwner);
    event FeeManagerUpdated(address newFeeManager);
    event PoolManagerUpdated(address newPoolManager);
    event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
    event ArbitratorUpdated(address newArbitrator);
    event VoteDelegateUpdated(address newVoteDelegate);
    event RewardContractsUpdated(address lockRewards, address stakerRewards);
    event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
    event TreasuryUpdated(address newTreasury);
    event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
    event FeeInfoChanged(address feeDistro, bool active);

    /**
     * @dev Constructor doing what constructors do. It is noteworthy that
     *      a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
     * @param _staker                 VoterProxy (locks the crv and adds to all gauges)
     * @param _minter                 CVX token, or the thing that mints it
     * @param _crv                    CRV
     * @param _voteOwnership          Address of the Curve DAO responsible for ownership stuff
     * @param _voteParameter          Address of the Curve DAO responsible for param updates
     */
    constructor(
        address _staker,
        address _minter,
        address _crv,
        address _voteOwnership,
        address _voteParameter
    ) public {
        staker = _staker;
        minter = _minter;
        crv = _crv;
        voteOwnership = _voteOwnership;
        voteParameter = _voteParameter;
        isShutdown = false;

        owner = msg.sender;
        voteDelegate = msg.sender;
        feeManager = msg.sender;
        poolManager = msg.sender;
        treasury = address(0);

        emit OwnerUpdated(msg.sender);
        emit VoteDelegateUpdated(msg.sender);
        emit FeeManagerUpdated(msg.sender);
        emit PoolManagerUpdated(msg.sender);
    }

    /// SETTER SECTION ///

    /**
     * @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
     */
    function setOwner(address _owner) external {
        require(msg.sender == owner, "!auth");
        owner = _owner;

        emit OwnerUpdated(_owner);
    }

    /**
     * @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
     */
    function setFeeManager(address _feeM) external {
        require(msg.sender == owner, "!auth");
        feeManager = _feeM;

        emit FeeManagerUpdated(_feeM);
    }

    /**
     * @notice Pool manager is responsible for adding new pools
     */
    function setPoolManager(address _poolM) external {
        require(msg.sender == poolManager, "!auth");
        poolManager = _poolM;

        emit PoolManagerUpdated(_poolM);
    }

    /**
     * @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
     */
    function setFactories(
        address _rfactory,
        address _sfactory,
        address _tfactory
    ) external {
        require(msg.sender == owner, "!auth");

        //stash factory should be considered more safe to change
        //updating may be required to handle new types of gauges
        stashFactory = _sfactory;

        //reward factory only allow this to be called once even if owner
        //removes ability to inject malicious staking contracts
        //token factory can also be immutable
        if (rewardFactory == address(0)) {
            rewardFactory = _rfactory;
            tokenFactory = _tfactory;

            emit FactoriesUpdated(_rfactory, _sfactory, _tfactory);
        } else {
            emit FactoriesUpdated(address(0), _sfactory, address(0));
        }
    }

    /**
     * @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
     */
    function setArbitrator(address _arb) external {
        require(msg.sender == owner, "!auth");
        rewardArbitrator = _arb;

        emit ArbitratorUpdated(_arb);
    }

    /**
     * @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
     */
    function setVoteDelegate(address _voteDelegate) external {
        require(msg.sender == owner, "!auth");
        voteDelegate = _voteDelegate;

        emit VoteDelegateUpdated(_voteDelegate);
    }

    /**
     * @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
     */
    function setRewardContracts(address _rewards, address _stakerRewards) external {
        require(msg.sender == owner, "!auth");

        //reward contracts are immutable or else the owner
        //has a means to redeploy and mint cvx via rewardClaimed()
        if (lockRewards == address(0)) {
            lockRewards = _rewards;
            stakerRewards = _stakerRewards;
            getRewardMultipliers[lockRewards] = REWARD_MULTIPLIER_DENOMINATOR;
            emit RewardContractsUpdated(_rewards, _stakerRewards);
        }
    }

    /**
     * @notice Set reward token and claim contract
     * @dev    This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
     */
    function setFeeInfo(address _feeToken, address _feeDistro) external nonReentrant {
        require(msg.sender == owner, "!auth");
        require(!isShutdown, "shutdown");
        require(lockRewards != address(0) && rewardFactory != address(0), "!initialised");

        require(_feeToken != address(0) && _feeDistro != address(0), "!addresses");
        require(IFeeDistributor(_feeDistro).getTokenTimeCursor(_feeToken) > 0, "!distro");

        if (feeTokens[_feeToken].distro == address(0)) {
            require(!gaugeMap[_feeToken], "!token");

            // Distributed directly
            if (_feeToken == crv) {
                feeTokens[crv] = FeeDistro({ distro: _feeDistro, rewards: lockRewards, active: true });
                emit FeeInfoUpdated(_feeDistro, lockRewards, crv);
            } else {
                //create a new reward contract for the new token
                require(IRewards(lockRewards).extraRewardsLength() < 10, "too many rewards");
                address rewards = IRewardFactory(rewardFactory).CreateTokenRewards(
                    _feeToken,
                    lockRewards,
                    address(this)
                );
                feeTokens[_feeToken] = FeeDistro({ distro: _feeDistro, rewards: rewards, active: true });
                emit FeeInfoUpdated(_feeDistro, rewards, _feeToken);
            }
        } else {
            feeTokens[_feeToken].distro = _feeDistro;
            emit FeeInfoUpdated(_feeDistro, address(0), _feeToken);
        }
    }

    /**
     * @notice Allows turning off or on for fee distro
     */
    function updateFeeInfo(address _feeToken, bool _active) external {
        require(msg.sender == owner, "!auth");

        require(feeTokens[_feeToken].distro != address(0), "Fee doesn't exist");

        feeTokens[_feeToken].active = _active;

        emit FeeInfoChanged(_feeToken, _active);
    }

    /**
     * @notice Fee manager can set all the relevant fees
     * @param _lockFees     % for cvxCrv stakers where 1% == 100
     * @param _stakerFees   % for CVX stakers where 1% == 100
     * @param _callerFees   % for whoever calls the claim where 1% == 100
     * @param _platform     % for "treasury" or vlCVX where 1% == 100
     */
    //2050, 400, 50, 0
    function setFees(
        uint256 _lockFees,
        uint256 _stakerFees,
        uint256 _callerFees,
        uint256 _platform
    ) external nonReentrant {
        require(msg.sender == feeManager, "!auth");

        uint256 total = _lockFees.add(_stakerFees).add(_callerFees).add(_platform);
        require(total <= MaxFees, ">MaxFees");

        require(_lockFees >= 300 && _lockFees <= 3500, "!lockFees");
        require(_stakerFees >= 300 && _stakerFees <= 3500, "!stakerFees");
        require(_callerFees >= 1 && _callerFees <= 100, "!callerFees");
        require(_platform <= 500, "!platform");

        lockIncentive = _lockFees;
        stakerIncentive = _stakerFees;
        earmarkIncentive = _callerFees;
        platformFee = _platform;

        emit FeesUpdated(_lockFees, _stakerFees, _callerFees, _platform);
    }

    /**
     * @notice Set the address of the treasury (i.e. vlCVX)
     */
    function setTreasury(address _treasury) external {
        require(msg.sender == feeManager, "!auth");
        treasury = _treasury;

        emit TreasuryUpdated(_treasury);
    }

    /**
     * @dev Set bridge delegate
     * @param _bridgeDelegate The bridge delegate address
     */
    function setBridgeDelegate(address _bridgeDelegate) external {
        require(msg.sender == feeManager, "!auth");
        bridgeDelegate = _bridgeDelegate;
    }

    function setRewardMultiplier(address rewardContract, uint256 multiplier) external {
        require(msg.sender == feeManager, "!auth");
        require(multiplier <= REWARD_MULTIPLIER_DENOMINATOR * 2, "too high");
        getRewardMultipliers[rewardContract] = multiplier;
    }

    /// END SETTER SECTION ///

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

    /**
     * @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
     *         contracts (DepositToken, RewardPool, Stash) and then adds to the list!
     */
    function addPool(
        address _lptoken,
        address _gauge,
        uint256 _stashVersion
    ) external returns (bool) {
        require(msg.sender == poolManager && !isShutdown, "!add");
        require(_gauge != address(0) && _lptoken != address(0), "!param");
        require(feeTokens[_gauge].distro == address(0), "!gauge");

        //the next pool's pid
        uint256 pid = poolInfo.length;

        //create a tokenized deposit
        address token = ITokenFactory(tokenFactory).CreateDepositToken(_lptoken);
        //create a reward contract for crv rewards
        address newRewardPool = IRewardFactory(rewardFactory).CreateCrvRewards(pid, token, _lptoken);
        //create a stash to handle extra incentives
        address stash = IStashFactory(stashFactory).CreateStash(pid, _gauge, staker, _stashVersion);

        //add the new pool
        poolInfo.push(
            PoolInfo({
                lptoken: _lptoken,
                token: token,
                gauge: _gauge,
                crvRewards: newRewardPool,
                stash: stash,
                shutdown: false
            })
        );
        gaugeMap[_gauge] = true;
        //give stashes access to rewardfactory and voteproxy
        //   voteproxy so it can grab the incentive tokens off the contract after claiming rewards
        //   reward factory so that stashes can make new extra reward contracts if a new incentive is added to the gauge
        if (stash != address(0)) {
            poolInfo[pid].stash = stash;
            IStaker(staker).setStashAccess(stash, true);
            IRewardFactory(rewardFactory).setAccess(stash, true);
        }

        // Init the pool with the default reward multiplier
        getRewardMultipliers[newRewardPool] = REWARD_MULTIPLIER_DENOMINATOR;

        emit PoolAdded(_lptoken, _gauge, token, newRewardPool, stash, pid);
        return true;
    }

    /**
     * @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
     *         claimed from depositors by using the withdraw fn) and marking it as shut down
     */
    function shutdownPool(uint256 _pid) external nonReentrant returns (bool) {
        require(msg.sender == poolManager, "!auth");
        PoolInfo storage pool = poolInfo[_pid];

        //withdraw from gauge
        try IStaker(staker).withdrawAll(pool.lptoken, pool.gauge) {} catch {}

        pool.shutdown = true;
        gaugeMap[pool.gauge] = false;

        emit PoolShutdown(_pid);
        return true;
    }

    /**
     * @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
     *         for subsequent withdrawal by any depositors.
     */
    function shutdownSystem() external {
        require(msg.sender == owner, "!auth");
        isShutdown = true;

        for (uint256 i = 0; i < poolInfo.length; i++) {
            PoolInfo storage pool = poolInfo[i];
            if (pool.shutdown) continue;

            address token = pool.lptoken;
            address gauge = pool.gauge;

            //withdraw from gauge
            try IStaker(staker).withdrawAll(token, gauge) {
                pool.shutdown = true;
            } catch {}
        }
    }

    /**
     * @notice  Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
     *          and subsequently stakes that on Convex BaseRewardPool
     */
    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _stake
    ) public nonReentrant returns (bool) {
        require(!isShutdown, "shutdown");
        PoolInfo storage pool = poolInfo[_pid];
        require(pool.shutdown == false, "pool is closed");

        //send to proxy to stake
        address lptoken = pool.lptoken;
        IERC20(lptoken).safeTransferFrom(msg.sender, staker, _amount);

        //stake
        address gauge = pool.gauge;
        require(gauge != address(0), "!gauge setting");
        IStaker(staker).deposit(lptoken, gauge);

        //some gauges claim rewards when depositing, stash them in a seperate contract until next claim
        address stash = pool.stash;
        if (stash != address(0)) {
            IStash(stash).stashRewards();
        }

        address token = pool.token;
        if (_stake) {
            //mint here and send to rewards on user behalf
            ITokenMinter(token).mint(address(this), _amount);
            address rewardContract = pool.crvRewards;
            IERC20(token).safeApprove(rewardContract, 0);
            IERC20(token).safeApprove(rewardContract, _amount);
            IRewards(rewardContract).stakeFor(msg.sender, _amount);
        } else {
            //add user balance directly
            ITokenMinter(token).mint(msg.sender, _amount);
        }

        emit Deposited(msg.sender, _pid, _amount);
        return true;
    }

    /**
     * @notice  Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
     *          and subsequently stakes that on Convex BaseRewardPool
     */
    function depositAll(uint256 _pid, bool _stake) external returns (bool) {
        address lptoken = poolInfo[_pid].lptoken;
        uint256 balance = IERC20(lptoken).balanceOf(msg.sender);
        deposit(_pid, balance, _stake);
        return true;
    }

    /**
     * @notice  Withdraws LP tokens from a given PID (& user).
     *          1. Burn the cvxLP balance from "_from" (implicit balance check)
     *          2. If pool !shutdown.. withdraw from gauge
     *          3. If stash, stash rewards
     *          4. Transfer out the LP tokens
     */
    function _withdraw(
        uint256 _pid,
        uint256 _amount,
        address _from,
        address _to
    ) internal nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        address lptoken = pool.lptoken;
        address gauge = pool.gauge;

        //remove lp balance
        address token = pool.token;
        ITokenMinter(token).burn(_from, _amount);

        //pull from gauge if not shutdown
        // if shutdown tokens will be in this contract
        if (!pool.shutdown) {
            IStaker(staker).withdraw(lptoken, gauge, _amount);
        }

        //some gauges claim rewards when withdrawing, stash them in a seperate contract until next claim
        //do not call if shutdown since stashes wont have access
        address stash = pool.stash;
        if (stash != address(0) && !isShutdown && !pool.shutdown) {
            IStash(stash).stashRewards();
        }

        //return lp tokens
        IERC20(lptoken).safeTransfer(_to, _amount);

        emit Withdrawn(_to, _pid, _amount);
    }

    /**
     * @notice  Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
     *          BaseRewardPool uses withdrawAndUnwrap to get around this)
     */
    function withdraw(uint256 _pid, uint256 _amount) public returns (bool) {
        _withdraw(_pid, _amount, msg.sender, msg.sender);
        return true;
    }

    /**
     * @notice  Withdraw all the senders LP tokens from a given gauge
     */
    function withdrawAll(uint256 _pid) public returns (bool) {
        address token = poolInfo[_pid].token;
        uint256 userBal = IERC20(token).balanceOf(msg.sender);
        withdraw(_pid, userBal);
        return true;
    }

    /**
     * @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
     */
    function withdrawTo(
        uint256 _pid,
        uint256 _amount,
        address _to
    ) external returns (bool) {
        address rewardContract = poolInfo[_pid].crvRewards;
        require(msg.sender == rewardContract, "!auth");

        _withdraw(_pid, _amount, msg.sender, _to);
        return true;
    }

    /**
     * @notice set valid vote hash on VoterProxy
     */
    function setVote(bytes32 _hash) external returns (bool) {
        require(msg.sender == voteDelegate, "!auth");

        IStaker(staker).setVote(_hash, false);
        return true;
    }

    /**
     * @notice Set delegate on snapshot
     */
    function setDelegate(
        address _delegateContract,
        address _delegate,
        bytes32 _space
    ) external {
        require(msg.sender == voteDelegate, "!auth");
        bytes memory data = abi.encodeWithSelector(
            bytes4(keccak256("setDelegate(bytes32,address)")),
            _space,
            _delegate
        );
        IStaker(staker).execute(_delegateContract, uint256(0), data);
    }

    /**
     * @notice Delegate address votes on dao via VoterProxy
     */
    function vote(
        uint256 _voteId,
        address _votingAddress,
        bool _support
    ) external returns (bool) {
        require(msg.sender == voteDelegate, "!auth");
        require(_votingAddress == voteOwnership || _votingAddress == voteParameter, "!voteAddr");

        IStaker(staker).vote(_voteId, _votingAddress, _support);
        return true;
    }

    /**
     * @notice Delegate address votes on gauge weight via VoterProxy
     */
    function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight) external returns (bool) {
        require(msg.sender == voteDelegate, "!auth");

        for (uint256 i = 0; i < _gauge.length; i++) {
            IStaker(staker).voteGaugeWeight(_gauge[i], _weight[i]);
        }
        return true;
    }

    /**
     * @notice Allows a stash to claim secondary rewards from a gauge
     */
    function claimRewards(uint256 _pid, address _gauge) external returns (bool) {
        address stash = poolInfo[_pid].stash;
        require(msg.sender == stash, "!auth");

        IStaker(staker).claimRewards(_gauge);
        return true;
    }

    /**
     * @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
     */
    function setGaugeRedirect(uint256 _pid) external returns (bool) {
        address stash = poolInfo[_pid].stash;
        require(msg.sender == stash, "!auth");
        address gauge = poolInfo[_pid].gauge;
        bytes memory data = abi.encodeWithSelector(bytes4(keccak256("set_rewards_receiver(address)")), stash);
        IStaker(staker).execute(gauge, uint256(0), data);
        return true;
    }

    /**
     * @notice Basically a hugely pivotal function.
     *         Responsible for collecting the crv from gauge, and then redistributing to the correct place.
     *         Pays the caller a fee to process this.
     */
    function _earmarkRewards(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        require(pool.shutdown == false, "pool is closed");

        address gauge = pool.gauge;

        // If there is idle CRV in the Booster we need to transfer it out
        // in order that our accounting doesn't get scewed.
        uint256 crvBBalBefore = IERC20(crv).balanceOf(address(this));
        uint256 crvVBalBefore = IERC20(crv).balanceOf(staker);
        uint256 crvBalBefore = crvBBalBefore.add(crvVBalBefore);

        //claim crv
        IStaker(staker).claimCrv(gauge);

        //crv balance
        uint256 crvBalAfter = IERC20(crv).balanceOf(address(this));
        uint256 crvBal = crvBalAfter.sub(crvBalBefore);

        if (crvBalBefore > 0 && treasury != address(0)) {
            IERC20(crv).transfer(treasury, crvBalBefore);
        }

        //check if there are extra rewards
        address stash = pool.stash;
        if (stash != address(0)) {
            //claim extra rewards
            IStash(stash).claimRewards();
            //process extra rewards
            IStash(stash).processStash();
        }

        if (crvBal > 0) {
            // LockIncentive = cvxCrv stakers (currently 10%)
            uint256 _lockIncentive = crvBal.mul(lockIncentive).div(FEE_DENOMINATOR);
            // StakerIncentive = cvx stakers (currently 5%)
            uint256 _stakerIncentive = crvBal.mul(stakerIncentive).div(FEE_DENOMINATOR);
            // CallIncentive = caller of this contract (currently 1%)
            uint256 _callIncentive = crvBal.mul(earmarkIncentive).div(FEE_DENOMINATOR);

            // Treasury = vlCVX (currently 1%)
            if (treasury != address(0) && treasury != address(this) && platformFee > 0) {
                //only subtract after address condition check
                uint256 _platform = crvBal.mul(platformFee).div(FEE_DENOMINATOR);
                crvBal = crvBal.sub(_platform);
                IERC20(crv).safeTransfer(treasury, _platform);
            }

            //remove incentives from balance
            crvBal = crvBal.sub(_lockIncentive).sub(_callIncentive).sub(_stakerIncentive);

            //send incentives for calling
            IERC20(crv).safeTransfer(msg.sender, _callIncentive);

            //send crv to lp provider reward contract
            address rewardContract = pool.crvRewards;
            IERC20(crv).safeTransfer(rewardContract, crvBal);
            IRewards(rewardContract).queueNewRewards(crvBal);

            //send lockers' share of crv to reward contract
            IERC20(crv).safeTransfer(lockRewards, _lockIncentive);
            IRewards(lockRewards).queueNewRewards(_lockIncentive);

            //send stakers's share of crv to reward contract
            IERC20(crv).safeTransfer(stakerRewards, _stakerIncentive);
        }
    }

    /**
     * @notice Basically a hugely pivotal function.
     *         Responsible for collecting the crv from gauge, and then redistributing to the correct place.
     *         Pays the caller a fee to process this.
     */
    function earmarkRewards(uint256 _pid) external nonReentrant returns (bool) {
        require(!isShutdown, "shutdown");
        _earmarkRewards(_pid);
        return true;
    }

    /**
     * @notice Claim fees from curve distro contract, put in lockers' reward contract.
     *         lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
     */
    function earmarkFees(address _feeToken) external nonReentrant returns (bool) {
        require(!isShutdown, "shutdown");
        FeeDistro memory feeDistro = feeTokens[_feeToken];

        require(feeDistro.active, "Inactive distro");
        require(!gaugeMap[_feeToken], "Invalid token");

        //claim fee rewards
        uint256 tokenBalanceVBefore = IERC20(_feeToken).balanceOf(staker);
        uint256 tokenBalanceBBefore = IERC20(_feeToken).balanceOf(address(this));
        uint256 tokenBalanceBefore = tokenBalanceBBefore.add(tokenBalanceVBefore);
        IStaker(staker).claimFees(feeDistro.distro, _feeToken);
        uint256 tokenBalanceAfter = IERC20(_feeToken).balanceOf(address(this));
        uint256 feesClaimed = tokenBalanceAfter.sub(tokenBalanceBefore);

        // Treasury = vlCVX (currently 1%)
        if (treasury != address(0) && treasury != address(this) && platformFee > 0) {
            //only subtract after address condition check
            uint256 _platform = feesClaimed.mul(platformFee).div(FEE_DENOMINATOR);
            feesClaimed = feesClaimed.sub(_platform);
            IERC20(_feeToken).safeTransfer(treasury, _platform);
        }

        //send fee rewards to reward contract
        IERC20(_feeToken).safeTransfer(feeDistro.rewards, feesClaimed);
        IRewards(feeDistro.rewards).queueNewRewards(feesClaimed);

        return true;
    }

    /**
     * @notice Callback from reward contract when crv is received.
     * @dev    Goes off and mints a relative amount of `CVX` based on the distribution schedule.
     */
    function rewardClaimed(
        uint256 _pid,
        address _address,
        uint256 _amount
    ) external returns (bool) {
        address rewardContract = poolInfo[_pid].crvRewards;
        require(msg.sender == rewardContract || msg.sender == lockRewards, "!auth");

        uint256 mintAmount = _amount.mul(getRewardMultipliers[msg.sender]).div(REWARD_MULTIPLIER_DENOMINATOR);

        if (mintAmount > 0) {
            //mint reward tokens
            ITokenMinter(minter).mint(_address, mintAmount);
        }

        return true;
    }

    /**
     * @dev Distribute fees from L2 to L1 reward contracts
     * @param _amount Amount of fees to distribute
     */
    function distributeL2Fees(uint256 _amount) external nonReentrant {
        require(msg.sender == bridgeDelegate, "!auth");

        // calculate the rewards that were paid based on the incentives that
        // are being distributed
        uint256 totalIncentives = lockIncentive.add(stakerIncentive);
        uint256 totalFarmed = _amount.mul(FEE_DENOMINATOR).div(totalIncentives);
        uint256 eligibleForMint = totalFarmed.sub(_amount);

        // Ensure that the total amount of rewards claimed per epoch is less than 70k
        uint256 epoch = block.timestamp.div(epochLength);
        l2FeesHistory[epoch] = l2FeesHistory[epoch].add(totalFarmed);
        require(l2FeesHistory[epoch] <= 70000e18, "Too many L2 Fees");

        // Calculate fees for individual reward contracts
        uint256 _lockIncentive = _amount.mul(lockIncentive).div(totalIncentives);
        uint256 _stakerIncentive = _amount.sub(_lockIncentive);

        //send lockers' share of crv to reward contract
        IERC20(crv).safeTransferFrom(bridgeDelegate, lockRewards, _lockIncentive);
        IRewards(lockRewards).queueNewRewards(_lockIncentive);

        //send stakers's share of crv to reward contract
        IERC20(crv).safeTransferFrom(bridgeDelegate, stakerRewards, _stakerIncentive);

        // Mint CVX to bridge delegate
        ITokenMinter(minter).mint(bridgeDelegate, eligibleForMint);
    }
}
        

@openzeppelin/contracts-0.6/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

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

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}
          

@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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);
}
          

@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

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

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

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
          

@openzeppelin/contracts-0.6/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

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

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

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

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

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

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

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

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

@openzeppelin/contracts-0.6/utils/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

contracts/convex-contracts/contracts/contracts/Interfaces.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

interface ICurveGauge {
    function deposit(uint256) external;

    function balanceOf(address) external view returns (uint256);

    function withdraw(uint256) external;

    function claim_rewards() external;

    function reward_tokens(uint256) external view returns (address); //v2

    function rewarded_token() external view returns (address); //v1

    function lp_token() external view returns (address);
}

interface ICurveVoteEscrow {
    function create_lock(uint256, uint256) external;

    function increase_amount(uint256) external;

    function increase_unlock_time(uint256) external;

    function withdraw() external;

    function smart_wallet_checker() external view returns (address);

    function commit_smart_wallet_checker(address) external;

    function apply_smart_wallet_checker() external;
}

interface IWalletChecker {
    function check(address) external view returns (bool);

    function approveWallet(address) external;

    function dao() external view returns (address);
}

interface IVoting {
    function vote(
        uint256,
        bool,
        bool
    ) external; //voteId, support, executeIfDecided

    function getVote(uint256)
        external
        view
        returns (
            bool,
            bool,
            uint64,
            uint64,
            uint64,
            uint64,
            uint256,
            uint256,
            uint256,
            bytes memory
        );

    function vote_for_gauge_weights(address, uint256) external;
}

interface IMinter {
    function mint(address) external;
}

interface IStaker {
    function deposit(address, address) external returns (bool);

    function withdraw(address) external returns (uint256);

    function withdraw(
        address,
        address,
        uint256
    ) external returns (bool);

    function withdrawAll(address, address) external returns (bool);

    function createLock(uint256, uint256) external returns (bool);

    function increaseAmount(uint256) external returns (bool);

    function increaseTime(uint256) external returns (bool);

    function release() external returns (bool);

    function claimCrv(address) external returns (uint256);

    function claimRewards(address) external returns (bool);

    function claimFees(address, address) external returns (uint256);

    function setStashAccess(address, bool) external returns (bool);

    function vote(
        uint256,
        address,
        bool
    ) external returns (bool);

    function voteGaugeWeight(address, uint256) external returns (bool);

    function balanceOfPool(address) external view returns (uint256);

    function operator() external view returns (address);

    function execute(
        address _to,
        uint256 _value,
        bytes calldata _data
    ) external returns (bool, bytes memory);

    function setVote(bytes32 hash, bool valid) external;

    function migrate(address to) external;
}

interface IRewards {
    function stake(address, uint256) external;

    function stakeFor(address, uint256) external;

    function withdraw(address, uint256) external;

    function exit(address) external;

    function getReward(address) external;

    function queueNewRewards(uint256) external;

    function notifyRewardAmount(uint256) external;

    function addExtraReward(address) external;

    function extraRewardsLength() external view returns (uint256);

    function stakingToken() external view returns (address);

    function rewardToken() external view returns (address);

    function earned(address account) external view returns (uint256);
}

interface IStash {
    function stashRewards() external returns (bool);

    function processStash() external returns (bool);

    function claimRewards() external returns (bool);

    function initialize(
        uint256 _pid,
        address _operator,
        address _staker,
        address _gauge,
        address _rewardFactory
    ) external;

    function setExtraReward(address) external;
}

interface IFeeDistributor {
    function claimToken(address user, address token) external returns (uint256);

    function claimTokens(address user, address[] calldata tokens) external returns (uint256[] memory);

    function getTokenTimeCursor(address token) external view returns (uint256);
}

interface ITokenMinter {
    function mint(address, uint256) external;

    function burn(address, uint256) external;
}

interface IDeposit {
    function isShutdown() external view returns (bool);

    function balanceOf(address _account) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function poolInfo(uint256)
        external
        view
        returns (
            address,
            address,
            address,
            address,
            address,
            bool
        );

    function rewardClaimed(
        uint256,
        address,
        uint256
    ) external;

    function withdrawTo(
        uint256,
        uint256,
        address
    ) external;

    function claimRewards(uint256, address) external returns (bool);

    function rewardArbitrator() external returns (address);

    function setGaugeRedirect(uint256 _pid) external returns (bool);

    function owner() external returns (address);

    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _stake
    ) external returns (bool);
}

interface ICrvDeposit {
    function deposit(uint256, bool) external;

    function lockIncentive() external view returns (uint256);
}

interface IRewardFactory {
    function setAccess(address, bool) external;

    function CreateCrvRewards(
        uint256,
        address,
        address
    ) external returns (address);

    function CreateTokenRewards(
        address,
        address,
        address
    ) external returns (address);

    function activeRewardCount(address) external view returns (uint256);

    function addActiveReward(address, uint256) external returns (bool);

    function removeActiveReward(address, uint256) external returns (bool);
}

interface IStashFactory {
    function CreateStash(
        uint256,
        address,
        address,
        uint256
    ) external returns (address);

    function setImplementation(
        address,
        address,
        address
    ) external;
}

interface ITokenFactory {
    function CreateDepositToken(address) external returns (address);
}

interface IPools {
    function addPool(
        address _lptoken,
        address _gauge,
        uint256 _stashVersion
    ) external returns (bool);

    function forceAddPool(
        address _lptoken,
        address _gauge,
        uint256 _stashVersion
    ) external returns (bool);

    function shutdownPool(uint256 _pid) external returns (bool);

    function poolInfo(uint256)
        external
        view
        returns (
            address,
            address,
            address,
            address,
            address,
            bool
        );

    function poolLength() external view returns (uint256);

    function gaugeMap(address) external view returns (bool);

    function setPoolManager(address _poolM) external;

    function shutdownSystem() external;

    function setUsedAddress(address[] memory) external;
}

interface IVestedEscrow {
    function fund(address[] calldata _recipient, uint256[] calldata _amount) external returns (bool);
}

interface IRewardDeposit {
    function addReward(address, uint256) external;
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":800,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_staker","internalType":"address"},{"type":"address","name":"_minter","internalType":"address"},{"type":"address","name":"_crv","internalType":"address"},{"type":"address","name":"_voteOwnership","internalType":"address"},{"type":"address","name":"_voteParameter","internalType":"address"}]},{"type":"event","name":"ArbitratorUpdated","inputs":[{"type":"address","name":"newArbitrator","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Deposited","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"poolid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FactoriesUpdated","inputs":[{"type":"address","name":"rewardFactory","internalType":"address","indexed":false},{"type":"address","name":"stashFactory","internalType":"address","indexed":false},{"type":"address","name":"tokenFactory","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"FeeInfoChanged","inputs":[{"type":"address","name":"feeDistro","internalType":"address","indexed":false},{"type":"bool","name":"active","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"FeeInfoUpdated","inputs":[{"type":"address","name":"feeDistro","internalType":"address","indexed":false},{"type":"address","name":"lockFees","internalType":"address","indexed":false},{"type":"address","name":"feeToken","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"FeeManagerUpdated","inputs":[{"type":"address","name":"newFeeManager","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"FeesUpdated","inputs":[{"type":"uint256","name":"lockIncentive","internalType":"uint256","indexed":false},{"type":"uint256","name":"stakerIncentive","internalType":"uint256","indexed":false},{"type":"uint256","name":"earmarkIncentive","internalType":"uint256","indexed":false},{"type":"uint256","name":"platformFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnerUpdated","inputs":[{"type":"address","name":"newOwner","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PoolAdded","inputs":[{"type":"address","name":"lpToken","internalType":"address","indexed":false},{"type":"address","name":"gauge","internalType":"address","indexed":false},{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"address","name":"rewardPool","internalType":"address","indexed":false},{"type":"address","name":"stash","internalType":"address","indexed":false},{"type":"uint256","name":"pid","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"PoolManagerUpdated","inputs":[{"type":"address","name":"newPoolManager","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PoolShutdown","inputs":[{"type":"uint256","name":"poolId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardContractsUpdated","inputs":[{"type":"address","name":"lockRewards","internalType":"address","indexed":false},{"type":"address","name":"stakerRewards","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TreasuryUpdated","inputs":[{"type":"address","name":"newTreasury","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"VoteDelegateUpdated","inputs":[{"type":"address","name":"newVoteDelegate","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawn","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"poolid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"FEE_DENOMINATOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MaxFees","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"REWARD_MULTIPLIER_DENOMINATOR","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"addPool","inputs":[{"type":"address","name":"_lptoken","internalType":"address"},{"type":"address","name":"_gauge","internalType":"address"},{"type":"uint256","name":"_stashVersion","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"bridgeDelegate","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"claimRewards","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_gauge","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"crv","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"deposit","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bool","name":"_stake","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"depositAll","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"bool","name":"_stake","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"distributeL2Fees","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"earmarkFees","inputs":[{"type":"address","name":"_feeToken","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"earmarkIncentive","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"earmarkRewards","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeManager","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"distro","internalType":"address"},{"type":"address","name":"rewards","internalType":"address"},{"type":"bool","name":"active","internalType":"bool"}],"name":"feeTokens","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"gaugeMap","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRewardMultipliers","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isShutdown","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"l2FeesHistory","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockIncentive","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lockRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"minter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"platformFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"lptoken","internalType":"address"},{"type":"address","name":"token","internalType":"address"},{"type":"address","name":"gauge","internalType":"address"},{"type":"address","name":"crvRewards","internalType":"address"},{"type":"address","name":"stash","internalType":"address"},{"type":"bool","name":"shutdown","internalType":"bool"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"poolManager","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rewardArbitrator","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"rewardClaimed","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_address","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rewardFactory","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setArbitrator","inputs":[{"type":"address","name":"_arb","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBridgeDelegate","inputs":[{"type":"address","name":"_bridgeDelegate","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDelegate","inputs":[{"type":"address","name":"_delegateContract","internalType":"address"},{"type":"address","name":"_delegate","internalType":"address"},{"type":"bytes32","name":"_space","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFactories","inputs":[{"type":"address","name":"_rfactory","internalType":"address"},{"type":"address","name":"_sfactory","internalType":"address"},{"type":"address","name":"_tfactory","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeInfo","inputs":[{"type":"address","name":"_feeToken","internalType":"address"},{"type":"address","name":"_feeDistro","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeManager","inputs":[{"type":"address","name":"_feeM","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFees","inputs":[{"type":"uint256","name":"_lockFees","internalType":"uint256"},{"type":"uint256","name":"_stakerFees","internalType":"uint256"},{"type":"uint256","name":"_callerFees","internalType":"uint256"},{"type":"uint256","name":"_platform","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setGaugeRedirect","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOwner","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPoolManager","inputs":[{"type":"address","name":"_poolM","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardContracts","inputs":[{"type":"address","name":"_rewards","internalType":"address"},{"type":"address","name":"_stakerRewards","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardMultiplier","inputs":[{"type":"address","name":"rewardContract","internalType":"address"},{"type":"uint256","name":"multiplier","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTreasury","inputs":[{"type":"address","name":"_treasury","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setVote","inputs":[{"type":"bytes32","name":"_hash","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVoteDelegate","inputs":[{"type":"address","name":"_voteDelegate","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"shutdownPool","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"shutdownSystem","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"staker","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"stakerIncentive","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakerRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stashFactory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"tokenFactory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"treasury","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateFeeInfo","inputs":[{"type":"address","name":"_feeToken","internalType":"address"},{"type":"bool","name":"_active","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"vote","inputs":[{"type":"uint256","name":"_voteId","internalType":"uint256"},{"type":"address","name":"_votingAddress","internalType":"address"},{"type":"bool","name":"_support","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"voteDelegate","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"voteGaugeWeight","inputs":[{"type":"address[]","name":"_gauge","internalType":"address[]"},{"type":"uint256[]","name":"_weight","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"voteOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"voteParameter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"withdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"withdrawAll","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"withdrawTo","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"address","name":"_to","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x61014060405261019060019081556107d0600255600355606360045562093a80610120523480156200003057600080fd5b506040516200580138038062005801833981810160405260a08110156200005657600080fd5b50805160208083015160408085015160608087015160809788015160016000556001600160601b031988841b811660e05286841b81166101005284841b811690995281831b891660a0529182901b90971660c0526013805460ff19169055600580546001600160a01b031990811633908117909255600c80548216831790556006805482168317905560078054821683179055600d805490911690558351908152925195969395919490927f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b929081900390910190a16040805133815290517f49f087c09fe6698eda82449a671bd8d38e44bed601118018a7cc7f1e0c808df49181900360200190a16040805133815290517fe45f5e140399b0a7e12971ab020724b828fbed8ac408c420884dc7d1bbe506b49181900360200190a16040805133815290517f70a64736553c84939f57deec269299882abbbee8dc4f316eccbc6fce57e4d3cf9181900360200190a1505050505060805160601c60a05160601c60c05160601c60e05160601c6101005160601c61012051615534620002cd60003980610c5c525080610e495280610ebb52806121b152508061117d52806112f752806115d252806116595280611a065280611bcf5280611d6d5280612e04528061308852806134e752806139ed5280613aff5280613e8752806141f4528061439152806146cc5280614b1a5280614bd1525080613e05528061416d525080613d465280614132525080610d4b5280610def5280611cde528061257352806125dc5280614a8d5280614b4a5280614c8d5280614d5b5280614f965280614fe6528061502452806150b9528061515852506155346000f3fe608060405234801561001057600080fd5b50600436106103ba5760003560e01c806374874323116101f4578063bf86d6901161011a578063dc4c90d3116100ad578063e31c0bf61161007c578063e31c0bf614610a74578063e77772fe14610b04578063f0f4426014610b0c578063f85008a214610b32576103ba565b8063dc4c90d314610a7c578063dee5522714610a84578063e032520814610aaa578063e2cdd42a14610ad0576103ba565b8063ce726e63116100e9578063ce726e6314610a5c578063cfb9cfba14610a64578063d0fb020314610a6c578063d73792a914610a74576103ba565b8063bf86d6901461094f578063bfad96ba14610957578063cb0d5b5214610a19578063cc956f3f14610a3f576103ba565b80639123d40411610192578063a0e0c54d11610161578063a0e0c54d146108f3578063a386a08014610919578063b0eefabe14610921578063b42eda7114610947576103ba565b80639123d4041461088357806395539a1d146108a0578063958e2d31146108ce5780639f00332b146108eb576103ba565b80637e29d6c2116101ce5780637e29d6c2146107eb5780637e8df27a1461082157806389e778961461084f5780638da5cb5b1461087b576103ba565b806374874323146107675780637aef67151461078d5780637bd3b995146107b3576103ba565b80633c781cbd116102e457806361d027b3116102775780636fcba377116102465780636fcba377146106d057806371192b17146106ff578063728706ed146107315780637303df9a1461075f576103ba565b806361d027b31461068c57806362d28ac7146106945780636a4874a11461069c5780636c7b69cb146106a4576103ba565b806350940618116102b3578063509406181461063a5780635ebaf1db1461064257806360759fce1461064a57806360cafe841461066f576103ba565b80633c781cbd146105a957806343a0d066146105c6578063441a3e70146105f1578063472d35b914610614576103ba565b80631526fe271161035c578063354af9191161032b578063354af9191461055b578063376d771a146105635780633a088cd21461056b5780633b788da914610573576103ba565b80631526fe271461049857806316605a0d146104f9578063245e4bf01461054b57806326232a2e14610553576103ba565b80630754617211610398578063075461721461040a578063081e3eda1461041257806313af40351461042c57806314cd70e414610452576103ba565b8063043b684a146103bf578063068eb19e146103e357806306caad9f146103eb575b600080fd5b6103c7610b4f565b604080516001600160a01b039092168252519081900360200190f35b6103c7610b5e565b6104086004803603602081101561040157600080fd5b5035610b6d565b005b6103c7610eb9565b61041a610edd565b60408051918252519081900360200190f35b6104086004803603602081101561044257600080fd5b50356001600160a01b0316610ee3565b6104846004803603606081101561046857600080fd5b50803590602081013590604001356001600160a01b0316610f7e565b604080519115158252519081900360200190f35b6104b5600480360360208110156104ae57600080fd5b5035611002565b604080516001600160a01b0397881681529587166020870152938616858501529185166060850152909316608083015291151560a082015290519081900360c00190f35b61051f6004803603602081101561050f57600080fd5b50356001600160a01b0316611060565b604080516001600160a01b03948516815292909316602083015215158183015290519081900360600190f35b6103c7611092565b61041a6110a1565b6104086110a7565b6103c761121c565b61041a61122b565b6104086004803603606081101561058957600080fd5b506001600160a01b03813581169160208101359091169060400135611231565b61041a600480360360208110156105bf57600080fd5b5035611498565b610484600480360360608110156105dc57600080fd5b508035906020810135906040013515156114aa565b6104846004803603604081101561060757600080fd5b508035906020013561194b565b6104086004803603602081101561062a57600080fd5b50356001600160a01b0316611963565b61041a6119fe565b6103c7611a04565b6104846004803603604081101561066057600080fd5b50803590602001351515611a28565b6104846004803603602081101561068557600080fd5b5035611ad5565b6103c7611cc7565b61041a611cd6565b6103c7611cdc565b610484600480360360408110156106ba57600080fd5b50803590602001356001600160a01b0316611d00565b610408600480360360808110156106e657600080fd5b5080359060208101359060408101359060600135611e04565b6104846004803603606081101561071557600080fd5b508035906001600160a01b036020820135169060400135612104565b6104086004803603604081101561074757600080fd5b506001600160a01b038135811691602001351661224a565b61041a612926565b6104086004803603602081101561077d57600080fd5b50356001600160a01b031661292c565b610408600480360360208110156107a357600080fd5b50356001600160a01b03166129c7565b610408600480360360608110156107c957600080fd5b506001600160a01b038135811691602081013582169160409091013516612a62565b6104846004803603606081101561080157600080fd5b506001600160a01b03813581169160208101359091169060400135612b92565b6104086004803603604081101561083757600080fd5b506001600160a01b03813516906020013515156131f2565b6104086004803603604081101561086557600080fd5b506001600160a01b038135169060200135613318565b6103c76133d2565b6104846004803603602081101561089957600080fd5b50356133e1565b610408600480360360408110156108b657600080fd5b506001600160a01b038135811691602001351661368a565b610484600480360360208110156108e457600080fd5b5035613764565b6103c7613813565b6104846004803603602081101561090957600080fd5b50356001600160a01b0316613822565b6103c7613d44565b6104086004803603602081101561093757600080fd5b50356001600160a01b0316613d68565b6103c7613e03565b610484613e27565b6104846004803603604081101561096d57600080fd5b81019060208101813564010000000081111561098857600080fd5b82018360208201111561099a57600080fd5b803590602001918460208302840111640100000000831117156109bc57600080fd5b9193909290916020810190356401000000008111156109da57600080fd5b8201836020820111156109ec57600080fd5b80359060200191846020830284011164010000000083111715610a0e57600080fd5b509092509050613e30565b61048460048036036020811015610a2f57600080fd5b50356001600160a01b0316613f5d565b61048460048036036020811015610a5557600080fd5b5035613f72565b6103c7614029565b6103c7614038565b6103c7614047565b61041a614056565b6103c761405c565b61041a60048036036020811015610a9a57600080fd5b50356001600160a01b031661406b565b61040860048036036020811015610ac057600080fd5b50356001600160a01b031661407d565b61048460048036036060811015610ae657600080fd5b508035906001600160a01b03602082013516906040013515156140e6565b6103c7614273565b61040860048036036020811015610b2257600080fd5b50356001600160a01b0316614282565b61048460048036036020811015610b4857600080fd5b503561431d565b600b546001600160a01b031681565b6009546001600160a01b031681565b60026000541415610bc5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556010546001600160a01b03163314610c11576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6000610c2a6002546001546143e890919063ffffffff16565b90506000610c4482610c3e85612710614442565b9061449b565b90506000610c528285614502565b90506000610c80427f000000000000000000000000000000000000000000000000000000000000000061449b565b600081815260116020526040902054909150610c9c90846143e8565b6000828152601160205260409020819055690ed2b525841adfc000001015610d0b576040805162461bcd60e51b815260206004820152601060248201527f546f6f206d616e79204c32204665657300000000000000000000000000000000604482015290519081900360640190fd5b6000610d2685610c3e6001548961444290919063ffffffff16565b90506000610d348783614502565b601054600f54919250610d77916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692811691168561455f565b600f546040805163590a41f560e01b81526004810185905290516001600160a01b039092169163590a41f59160248082019260009290919082900301818387803b158015610dc457600080fd5b505af1158015610dd8573d6000803e3d6000fd5b5050601054600e54610e1d93506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116935091821691168461455f565b601054604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290517f0000000000000000000000000000000000000000000000000000000000000000909216916340c10f199160448082019260009290919082900301818387803b158015610e9357600080fd5b505af1158015610ea7573d6000803e3d6000fd5b50506001600055505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60145490565b6005546001600160a01b03163314610f2a576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600580546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b9181900360200190a150565b60008060148581548110610f8e57fe5b60009182526020909120600360059092020101546001600160a01b03169050338114610fe9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b610ff5858533866145bf565b60019150505b9392505050565b6014818154811061100f57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b03938416955091831693908316929081169190811690600160a01b900460ff1686565b601260205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b6008546001600160a01b031681565b60045481565b6005546001600160a01b031633146110ee576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6013805460ff1916600117905560005b6014548110156112195760006014828154811061111757fe5b906000526020600020906005020190508060040160149054906101000a900460ff16156111445750611211565b80546002820154604080516301395c5960e31b81526001600160a01b0393841660048201819052928416602482018190529151929391927f0000000000000000000000000000000000000000000000000000000000000000909216916309cae2c8916044808201926020929091908290030181600087803b1580156111c857600080fd5b505af19250505080156111ed57506040513d60208110156111e857600080fd5b505160015b6111f65761120d565b5060048301805460ff60a01b1916600160a01b1790555b5050505b6001016110fe565b50565b600f546001600160a01b031681565b60035481565b600c546001600160a01b03163314611278576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6040805160248082018490526001600160a01b03808616604480850191909152845180850382018152606494850186526020810180516001600160e01b03166317b0dca160e31b1781529551635b0e93fb60e11b81528984166004820190815260009582018690526060938201938452825196820196909652815191967f00000000000000000000000000000000000000000000000000000000000000009094169563b61d27f6958b95909489949293909260849091019190808383895b8381101561134e578181015183820152602001611336565b50505050905090810190601f16801561137b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561139c57600080fd5b505af11580156113b0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156113d957600080fd5b81516020830180516040519294929383019291908464010000000082111561140057600080fd5b90830190602082018581111561141557600080fd5b825164010000000081118282018810171561142f57600080fd5b82525081516020918201929091019080838360005b8381101561145c578181015183820152602001611444565b50505050905090810190601f1680156114895780820380516001836020036101000a031916815260200191505b50604052505050505050505050565b60116020526000908152604090205481565b600060026000541415611504576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff161561154c576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b60006014858154811061155b57fe5b600091825260209091206005909102016004810154909150600160a01b900460ff16156115c0576040805162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081a5cc818db1bdcd95960921b604482015290519081900360640190fd5b80546001600160a01b03166115f781337f00000000000000000000000000000000000000000000000000000000000000008861455f565b60028201546001600160a01b031680611657576040805162461bcd60e51b815260206004820152600e60248201527f2167617567652073657474696e67000000000000000000000000000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f9609f0883836040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b1580156116d757600080fd5b505af11580156116eb573d6000803e3d6000fd5b505050506040513d602081101561170157600080fd5b505060048301546001600160a01b0316801561177f57806001600160a01b031663b87bd4816040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d602081101561177c57600080fd5b50505b60018401546001600160a01b0316861561189857604080516340c10f1960e01b8152306004820152602481018a905290516001600160a01b038316916340c10f1991604480830192600092919082900301818387803b1580156117e157600080fd5b505af11580156117f5573d6000803e3d6000fd5b50505060038601546001600160a01b039081169150611818908316826000614888565b61182c6001600160a01b038316828b614888565b604080516305dc812160e31b8152336004820152602481018b905290516001600160a01b03831691632ee4090891604480830192600092919082900301818387803b15801561187a57600080fd5b505af115801561188e573d6000803e3d6000fd5b50505050506118ff565b604080516340c10f1960e01b8152336004820152602481018a905290516001600160a01b038316916340c10f1991604480830192600092919082900301818387803b1580156118e657600080fd5b505af11580156118fa573d6000803e3d6000fd5b505050505b6040805189815290518a9133917f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca9181900360200190a360019550505050505060016000559392505050565b6000611959838333336145bf565b5060015b92915050565b6005546001600160a01b031633146119aa576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600680546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fe45f5e140399b0a7e12971ab020724b828fbed8ac408c420884dc7d1bbe506b49181900360200190a150565b60015481565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060148481548110611a3857fe5b60009182526020808320600590920290910154604080516370a0823160e01b815233600482015290516001600160a01b03909216945084926370a0823192602480840193829003018186803b158015611a9057600080fd5b505afa158015611aa4573d6000803e3d6000fd5b505050506040513d6020811015611aba57600080fd5b50519050611ac98582866114aa565b50600195945050505050565b600060026000541415611b2f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556007546001600160a01b03163314611b7b576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600060148381548110611b8a57fe5b60009182526020808320600590920290910180546002820154604080516301395c5960e31b81526001600160a01b0393841660048201529183166024830152519295507f000000000000000000000000000000000000000000000000000000000000000091909116936309cae2c89360448084019491939192918390030190829087803b158015611c1a57600080fd5b505af1925050508015611c3f57506040513d6020811015611c3a57600080fd5b505160015b611c4857611c4a565b505b60048101805460ff60a01b1916600160a01b17905560028101546001600160a01b0316600090815260156020908152604091829020805460ff19169055815185815291517f2ccd633716c6ce12394d1c984ad04b6173d18aedc4f505d1537a94a98a07b6e79281900390910190a160019150506001600055919050565b600d546001600160a01b031681565b60025481565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060148481548110611d1057fe5b60009182526020909120600460059092020101546001600160a01b03169050338114611d6b576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ef5cfb8c846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611dda57600080fd5b505af1158015611dee573d6000803e3d6000fd5b505050506040513d6020811015611ac957600080fd5b60026000541415611e5c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556006546001600160a01b03163314611ea8576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6000611ec082611eba858189896143e8565b906143e8565b9050611388811115611f19576040805162461bcd60e51b815260206004820152600860248201527f3e4d617846656573000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61012c8510158015611f2d5750610dac8511155b611f7e576040805162461bcd60e51b815260206004820152600960248201527f216c6f636b466565730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61012c8410158015611f925750610dac8411155b611fe3576040805162461bcd60e51b815260206004820152600b60248201527f217374616b657246656573000000000000000000000000000000000000000000604482015290519081900360640190fd5b60018310158015611ff5575060648311155b612046576040805162461bcd60e51b815260206004820152600b60248201527f2163616c6c657246656573000000000000000000000000000000000000000000604482015290519081900360640190fd5b6101f482111561209d576040805162461bcd60e51b815260206004820152600960248201527f21706c6174666f726d0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600185905560028490556003839055600482905560408051868152602081018690528082018590526060810184905290517f16e6f67290546b8dd0e587f4b7f67d4f61932ae17ffd8c60d3509dbc05c175fe9181900360800190a150506001600055505050565b6000806014858154811061211457fe5b60009182526020909120600360059092020101546001600160a01b031690503381148061214b5750600f546001600160a01b031633145b612184576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b336000908152601660205260408120546121a79061271090610c3e908790614442565b90508015611ac9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166340c10f1986836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561222657600080fd5b505af115801561223a573d6000803e3d6000fd5b5050505050600195945050505050565b600260005414156122a2576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556005546001600160a01b031633146122ee576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60135460ff1615612331576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b600f546001600160a01b03161580159061235557506008546001600160a01b031615155b6123a6576040805162461bcd60e51b815260206004820152600c60248201527f21696e697469616c697365640000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038216158015906123c657506001600160a01b03811615155b612417576040805162461bcd60e51b815260206004820152600a60248201527f2161646472657373657300000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000816001600160a01b031663acbc1428846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561246657600080fd5b505afa15801561247a573d6000803e3d6000fd5b505050506040513d602081101561249057600080fd5b5051116124e4576040805162461bcd60e51b815260206004820152600760248201527f2164697374726f00000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03828116600090815260126020526040902054166128ad576001600160a01b03821660009081526015602052604090205460ff1615612571576040805162461bcd60e51b815260206004820152600660248201527f21746f6b656e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156126945760408051606080820183526001600160a01b03808516808452600f80548316602080870191825260018789018181527f000000000000000000000000000000000000000000000000000000000000000087166000818152601285528b902099518a549089166001600160a01b0319918216178b55945199909201805491511515600160a01b0260ff60a01b199a89169290951691909117989098169290921790965590548651928352909216938101939093528284015291517f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc8929181900390910190a16128a8565b600f546040805163355688fd60e21b81529051600a926001600160a01b03169163d55a23f4916004808301926020929190829003018186803b1580156126d957600080fd5b505afa1580156126ed573d6000803e3d6000fd5b505050506040513d602081101561270357600080fd5b505110612757576040805162461bcd60e51b815260206004820152601060248201527f746f6f206d616e79207265776172647300000000000000000000000000000000604482015290519081900360640190fd5b600854600f5460408051637c6b091760e11b81526001600160a01b03868116600483015292831660248201523060448201529051600093929092169163f8d6122e9160648082019260209290919082900301818787803b1580156127ba57600080fd5b505af11580156127ce573d6000803e3d6000fd5b505050506040513d60208110156127e457600080fd5b505160408051606080820183526001600160a01b03808716808452818616602085810182815260018789018181528d87166000818152601286528b902099518a549089166001600160a01b0319918216178b55935199909201805491511515600160a01b0260ff60a01b199a909816919093161797909716949094179093558551918252918101919091528084019290925291519293507f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc8929081900390910190a1505b61291d565b6001600160a01b03808316600081815260126020908152604080832080549587166001600160a01b03199096168617905580519485529084019190915282810191909152517f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc89181900360600190a15b50506001600055565b61138881565b6005546001600160a01b03163314612973576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600c80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f49f087c09fe6698eda82449a671bd8d38e44bed601118018a7cc7f1e0c808df49181900360200190a150565b6007546001600160a01b03163314612a0e576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600780546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f70a64736553c84939f57deec269299882abbbee8dc4f316eccbc6fce57e4d3cf9181900360200190a150565b6005546001600160a01b03163314612aa9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b038481169190911790915560085416612b4457600880546001600160a01b038086166001600160a01b03199283168117909355600a805485831693168317905560408051938452908516602084015282810191909152517f013ea07699fbd5315b997a706906fb94a81c616771f1052b406707d7bfc6aa279181900360600190a1612b8d565b6040805160008082526001600160a01b03851660208301528183015290517f013ea07699fbd5315b997a706906fb94a81c616771f1052b406707d7bfc6aa279181900360600190a15b505050565b6007546000906001600160a01b031633148015612bb2575060135460ff16155b612bec576040805162461bcd60e51b815260206004808301919091526024820152630858591960e21b604482015290519081900360640190fd5b6001600160a01b03831615801590612c0c57506001600160a01b03841615155b612c5d576040805162461bcd60e51b815260206004820152600660248201527f21706172616d0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038381166000908152601260205260409020541615612cca576040805162461bcd60e51b815260206004820152600660248201527f2167617567650000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b601454600a5460408051630452a26760e21b81526001600160a01b0388811660048301529151600093929092169163114a899c9160248082019260209290919082900301818787803b158015612d1f57600080fd5b505af1158015612d33573d6000803e3d6000fd5b505050506040513d6020811015612d4957600080fd5b505160085460408051632f7260f160e01b8152600481018690526001600160a01b0380851660248301528a8116604483015291519394506000939190921691632f7260f191606480830192602092919082900301818787803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b505050506040513d6020811015612dd857600080fd5b505160095460408051634ce5896f60e11b8152600481018790526001600160a01b038a811660248301527f000000000000000000000000000000000000000000000000000000000000000081166044830152606482018a9052915193945060009391909216916399cb12de91608480830192602092919082900301818787803b158015612e6457600080fd5b505af1158015612e78573d6000803e3d6000fd5b505050506040513d6020811015612e8e57600080fd5b50516040805160c0810182526001600160a01b03808c16825286811660208381019182528c83168486018181528985166060870190815285891660808801818152600060a08a0181815260148054600181810183559184529b516005909c027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec810180549d8d166001600160a01b03199e8f1617905599517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed8b018054918d16918e1691909117905595517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ee8a018054918c16918d1691909117905593517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ef89018054918b16918c1691909117905590517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4f0909701805493511515600160a01b0260ff60a01b199890991693909916929092179590951695909517909555835260159052929020805460ff191690911790559091501561316757806014858154811061303657fe5b600091825260208083206004600590930201820180546001600160a01b039586166001600160a01b031990911617905560408051637d1cb25960e11b81528686169381019390935260016024840152517f00000000000000000000000000000000000000000000000000000000000000009094169363fa3964b2936044808501948390030190829087803b1580156130cd57600080fd5b505af11580156130e1573d6000803e3d6000fd5b505050506040513d60208110156130f757600080fd5b50506008546040805163b84614a560e01b81526001600160a01b038481166004830152600160248301529151919092169163b84614a591604480830192600092919082900301818387803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050505b6001600160a01b03808316600081815260166020908152604091829020612710905581518c851681528b851691810191909152868416818301526060810192909252918316608082015260a0810186905290517fca1a6de26e4422518df9ab614eefa07fac43e4f4c7d704dbf82e903e582659ca9181900360c00190a1506001979650505050505050565b6005546001600160a01b03163314613239576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6001600160a01b03828116600090815260126020526040902054166132a5576040805162461bcd60e51b815260206004820152601160248201527f46656520646f65736e2774206578697374000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038216600081815260126020908152604091829020600101805460ff60a01b1916600160a01b8615159081029190911790915582519384529083015280517ff1d91b931944e49fd30c1dc6fd08ad8bb25ef1fe12c369b10a4675c4bf3974409281900390910190a15050565b6006546001600160a01b0316331461335f576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b614e208111156133b6576040805162461bcd60e51b815260206004820152600860248201527f746f6f2068696768000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03909116600090815260166020526040902055565b6005546001600160a01b031681565b600080601483815481106133f157fe5b60009182526020909120600460059092020101546001600160a01b0316905033811461344c576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60006014848154811061345b57fe5b6000918252602080832060026005909302019190910154604080516001600160a01b038781166024808401919091528351808403820181526044938401855295860180516001600160e01b0316635efcc08b60e11b1781529351635b0e93fb60e11b815294821660048601818152918601889052606093860193845286516064870152865190985095967f00000000000000000000000000000000000000000000000000000000000000009092169563b61d27f6958995939489949092608490920191808383895b8381101561353b578181015183820152602001613523565b50505050905090810190601f1680156135685780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561358957600080fd5b505af115801561359d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156135c657600080fd5b8151602083018051604051929492938301929190846401000000008211156135ed57600080fd5b90830190602082018581111561360257600080fd5b825164010000000081118282018810171561361c57600080fd5b82525081516020918201929091019080838360005b83811015613649578181015183820152602001613631565b50505050905090810190601f1680156136765780820380516001836020036101000a031916815260200191505b506040525060019998505050505050505050565b6005546001600160a01b031633146136d1576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600f546001600160a01b031661376057600f80546001600160a01b038085166001600160a01b0319928316811793849055600e805486841694168417905592166000908152601660209081526040918290206127109055815193845283019190915280517f601d75fd094819eb2644514a732ecc4ff7953787e92258e47c118aa83b0311159281900390910190a15b5050565b6000806014838154811061377457fe5b6000918252602080832060016005909302019190910154604080516370a0823160e01b815233600482015290516001600160a01b03909216945084926370a0823192602480840193829003018186803b1580156137d057600080fd5b505afa1580156137e4573d6000803e3d6000fd5b505050506040513d60208110156137fa57600080fd5b50519050613808848261194b565b506001949350505050565b600c546001600160a01b031681565b60006002600054141561387c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff16156138c4576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b6138cc615460565b506001600160a01b03828116600090815260126020908152604091829020825160608101845281548516815260019091015493841691810191909152600160a01b90920460ff16151590820181905261396c576040805162461bcd60e51b815260206004820152600f60248201527f496e6163746976652064697374726f0000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660009081526015602052604090205460ff16156139da576040805162461bcd60e51b815260206004820152600d60248201527f496e76616c696420746f6b656e00000000000000000000000000000000000000604482015290519081900360640190fd5b6000836001600160a01b03166370a082317f00000000000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015613a4957600080fd5b505afa158015613a5d573d6000803e3d6000fd5b505050506040513d6020811015613a7357600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038716916370a08231916024808301926020929190829003018186803b158015613ac157600080fd5b505afa158015613ad5573d6000803e3d6000fd5b505050506040513d6020811015613aeb57600080fd5b505190506000613afb82846143e8565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632dbfa7358560000151886040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b158015613b8157600080fd5b505af1158015613b95573d6000803e3d6000fd5b505050506040513d6020811015613bab57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b158015613bf757600080fd5b505afa158015613c0b573d6000803e3d6000fd5b505050506040513d6020811015613c2157600080fd5b505190506000613c318284614502565b600d549091506001600160a01b031615801590613c595750600d546001600160a01b03163014155b8015613c6757506000600454115b15613cb4576000613c89612710610c3e6004548561444290919063ffffffff16565b9050613c958282614502565b600d54909250613cb2906001600160a01b038b811691168361499b565b505b6020860151613cce906001600160a01b038a16908361499b565b85602001516001600160a01b031663590a41f5826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015613d1857600080fd5b505af1158015613d2c573d6000803e3d6000fd5b50505050600196505050505050506001600055919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6005546001600160a01b03163314613daf576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600b80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f961c543f04f95b46a6d6af9e463eb4f186ceea8ca52f869ec568c0197080401b9181900360200190a150565b7f000000000000000000000000000000000000000000000000000000000000000081565b60135460ff1681565b600c546000906001600160a01b03163314613e7a576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60005b84811015611ac9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635d7e9bcb878784818110613ec057fe5b905060200201356001600160a01b0316868685818110613edc57fe5b905060200201356040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613f2957600080fd5b505af1158015613f3d573d6000803e3d6000fd5b505050506040513d6020811015613f5357600080fd5b5050600101613e7d565b60156020526000908152604090205460ff1681565b600060026000541415613fcc576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff1615614014576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b61401d826149ed565b50600180600055919050565b6010546001600160a01b031681565b600e546001600160a01b031681565b6006546001600160a01b031681565b61271081565b6007546001600160a01b031681565b60166020526000908152604090205481565b6006546001600160a01b031633146140c4576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b600c546000906001600160a01b03163314614130576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806141a157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316145b6141f2576040805162461bcd60e51b815260206004820152600960248201527f21766f7465416464720000000000000000000000000000000000000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e2cdd42a8585856040518463ffffffff1660e01b815260040180848152602001836001600160a01b0316815260200182151581526020019350505050602060405180830381600087803b158015611dda57600080fd5b600a546001600160a01b031681565b6006546001600160a01b031633146142c9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600d80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d19181900360200190a150565b600c546000906001600160a01b03163314614367576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b604080516307ef625d60e21b81526004810184905260006024820181905291516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692631fbd8974926044808201939182900301818387803b1580156143d457600080fd5b505af1158015611ac9573d6000803e3d6000fd5b600082820183811015610ffb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826144515750600061195d565b8282028284828161445e57fe5b0414610ffb5760405162461bcd60e51b81526004018080602001828103825260218152602001806154a76021913960400191505060405180910390fd5b60008082116144f1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816144fa57fe5b049392505050565b600082821115614559576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526145b9908590615192565b50505050565b60026000541415614617576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155601480548690811061462c57fe5b60009182526020822060059091020180546002820154600183015460408051632770a7eb60e21b81526001600160a01b038a81166004830152602482018c9052915195975093811695928116949116928392639dc29fac9260448084019382900301818387803b15801561469f57600080fd5b505af11580156146b3573d6000803e3d6000fd5b505050506004840154600160a01b900460ff1661477f577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d9caed1284848a6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561475257600080fd5b505af1158015614766573d6000803e3d6000fd5b505050506040513d602081101561477c57600080fd5b50505b60048401546001600160a01b0316801580159061479f575060135460ff16155b80156147b757506004850154600160a01b900460ff16155b1561482457806001600160a01b031663b87bd4816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156147f757600080fd5b505af115801561480b573d6000803e3d6000fd5b505050506040513d602081101561482157600080fd5b50505b6148386001600160a01b038516878a61499b565b6040805189815290518a916001600160a01b038916917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc69181900360200190a35050600160005550505050505050565b80158061490e575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156148e057600080fd5b505afa1580156148f4573d6000803e3d6000fd5b505050506040513d602081101561490a57600080fd5b5051155b6149495760405162461bcd60e51b81526004018080602001828103825260368152602001806154f26036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052612b8d908490615192565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612b8d908490615192565b6000601482815481106149fc57fe5b600091825260209091206005909102016004810154909150600160a01b900460ff1615614a61576040805162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081a5cc818db1bdcd95960921b604482015290519081900360640190fd5b6002810154604080516370a0823160e01b815230600482015290516001600160a01b03928316926000927f0000000000000000000000000000000000000000000000000000000000000000909116916370a0823191602480820192602092909190829003018186803b158015614ad657600080fd5b505afa158015614aea573d6000803e3d6000fd5b505050506040513d6020811015614b0057600080fd5b5051604080516370a0823160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015291519293506000927f0000000000000000000000000000000000000000000000000000000000000000909216916370a0823191602480820192602092909190829003018186803b158015614b9357600080fd5b505afa158015614ba7573d6000803e3d6000fd5b505050506040513d6020811015614bbd57600080fd5b505190506000614bcd83836143e8565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633fe9bc06856040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015614c3e57600080fd5b505af1158015614c52573d6000803e3d6000fd5b505050506040513d6020811015614c6857600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b158015614cd457600080fd5b505afa158015614ce8573d6000803e3d6000fd5b505050506040513d6020811015614cfe57600080fd5b505190506000614d0e8284614502565b9050600083118015614d2a5750600d546001600160a01b031615155b15614dd357600d546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810186905290517f00000000000000000000000000000000000000000000000000000000000000009092169163a9059cbb916044808201926020929091908290030181600087803b158015614da657600080fd5b505af1158015614dba573d6000803e3d6000fd5b505050506040513d6020811015614dd057600080fd5b50505b60048701546001600160a01b03168015614ebd57806001600160a01b031663372500ab6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614e2257600080fd5b505af1158015614e36573d6000803e3d6000fd5b505050506040513d6020811015614e4c57600080fd5b50506040805163654580bb60e11b815290516001600160a01b0383169163ca8b01769160048083019260209291908290030181600087803b158015614e9057600080fd5b505af1158015614ea4573d6000803e3d6000fd5b505050506040513d6020811015614eba57600080fd5b50505b8115615187576000614ee0612710610c3e6001548661444290919063ffffffff16565b90506000614eff612710610c3e6002548761444290919063ffffffff16565b90506000614f1e612710610c3e6003548861444290919063ffffffff16565b600d549091506001600160a01b031615801590614f465750600d546001600160a01b03163014155b8015614f5457506000600454115b15614fc1576000614f76612710610c3e6004548961444290919063ffffffff16565b9050614f828682614502565b600d54909650614fbf906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691168361499b565b505b614fd782614fd183818988614502565b90614502565b945061500d6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338361499b565b60038b01546001600160a01b039081169061504b907f000000000000000000000000000000000000000000000000000000000000000016828861499b565b806001600160a01b031663590a41f5876040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561509157600080fd5b505af11580156150a5573d6000803e3d6000fd5b5050600f546150e392506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169250168661499b565b600f546040805163590a41f560e01b81526004810187905290516001600160a01b039092169163590a41f59160248082019260009290919082900301818387803b15801561513057600080fd5b505af1158015615144573d6000803e3d6000fd5b5050600e5461518292506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169250168561499b565b505050505b505050505050505050565b60606151e7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166152439092919063ffffffff16565b805190915015612b8d5780806020019051602081101561520657600080fd5b5051612b8d5760405162461bcd60e51b815260040180806020018281038252602a8152602001806154c8602a913960400191505060405180910390fd5b6060615252848460008561525a565b949350505050565b60608247101561529b5760405162461bcd60e51b81526004018080602001828103825260268152602001806154816026913960400191505060405180910390fd5b6152a4856153b6565b6152f5576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106153345780518252601f199092019160209182019101615315565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615396576040519150601f19603f3d011682016040523d82523d6000602084013e61539b565b606091505b50915091506153ab8282866153bc565b979650505050505050565b3b151590565b606083156153cb575081610ffb565b8251156153db5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561542557818101518382015260200161540d565b50505050905090810190601f1680156154525780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60408051606081018252600080825260208201819052918101919091529056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c634300060c000a0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d3000000000000000000000000115f3fa979a936167f9d208a7b7c4d85081e84bd0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106103ba5760003560e01c806374874323116101f4578063bf86d6901161011a578063dc4c90d3116100ad578063e31c0bf61161007c578063e31c0bf614610a74578063e77772fe14610b04578063f0f4426014610b0c578063f85008a214610b32576103ba565b8063dc4c90d314610a7c578063dee5522714610a84578063e032520814610aaa578063e2cdd42a14610ad0576103ba565b8063ce726e63116100e9578063ce726e6314610a5c578063cfb9cfba14610a64578063d0fb020314610a6c578063d73792a914610a74576103ba565b8063bf86d6901461094f578063bfad96ba14610957578063cb0d5b5214610a19578063cc956f3f14610a3f576103ba565b80639123d40411610192578063a0e0c54d11610161578063a0e0c54d146108f3578063a386a08014610919578063b0eefabe14610921578063b42eda7114610947576103ba565b80639123d4041461088357806395539a1d146108a0578063958e2d31146108ce5780639f00332b146108eb576103ba565b80637e29d6c2116101ce5780637e29d6c2146107eb5780637e8df27a1461082157806389e778961461084f5780638da5cb5b1461087b576103ba565b806374874323146107675780637aef67151461078d5780637bd3b995146107b3576103ba565b80633c781cbd116102e457806361d027b3116102775780636fcba377116102465780636fcba377146106d057806371192b17146106ff578063728706ed146107315780637303df9a1461075f576103ba565b806361d027b31461068c57806362d28ac7146106945780636a4874a11461069c5780636c7b69cb146106a4576103ba565b806350940618116102b3578063509406181461063a5780635ebaf1db1461064257806360759fce1461064a57806360cafe841461066f576103ba565b80633c781cbd146105a957806343a0d066146105c6578063441a3e70146105f1578063472d35b914610614576103ba565b80631526fe271161035c578063354af9191161032b578063354af9191461055b578063376d771a146105635780633a088cd21461056b5780633b788da914610573576103ba565b80631526fe271461049857806316605a0d146104f9578063245e4bf01461054b57806326232a2e14610553576103ba565b80630754617211610398578063075461721461040a578063081e3eda1461041257806313af40351461042c57806314cd70e414610452576103ba565b8063043b684a146103bf578063068eb19e146103e357806306caad9f146103eb575b600080fd5b6103c7610b4f565b604080516001600160a01b039092168252519081900360200190f35b6103c7610b5e565b6104086004803603602081101561040157600080fd5b5035610b6d565b005b6103c7610eb9565b61041a610edd565b60408051918252519081900360200190f35b6104086004803603602081101561044257600080fd5b50356001600160a01b0316610ee3565b6104846004803603606081101561046857600080fd5b50803590602081013590604001356001600160a01b0316610f7e565b604080519115158252519081900360200190f35b6104b5600480360360208110156104ae57600080fd5b5035611002565b604080516001600160a01b0397881681529587166020870152938616858501529185166060850152909316608083015291151560a082015290519081900360c00190f35b61051f6004803603602081101561050f57600080fd5b50356001600160a01b0316611060565b604080516001600160a01b03948516815292909316602083015215158183015290519081900360600190f35b6103c7611092565b61041a6110a1565b6104086110a7565b6103c761121c565b61041a61122b565b6104086004803603606081101561058957600080fd5b506001600160a01b03813581169160208101359091169060400135611231565b61041a600480360360208110156105bf57600080fd5b5035611498565b610484600480360360608110156105dc57600080fd5b508035906020810135906040013515156114aa565b6104846004803603604081101561060757600080fd5b508035906020013561194b565b6104086004803603602081101561062a57600080fd5b50356001600160a01b0316611963565b61041a6119fe565b6103c7611a04565b6104846004803603604081101561066057600080fd5b50803590602001351515611a28565b6104846004803603602081101561068557600080fd5b5035611ad5565b6103c7611cc7565b61041a611cd6565b6103c7611cdc565b610484600480360360408110156106ba57600080fd5b50803590602001356001600160a01b0316611d00565b610408600480360360808110156106e657600080fd5b5080359060208101359060408101359060600135611e04565b6104846004803603606081101561071557600080fd5b508035906001600160a01b036020820135169060400135612104565b6104086004803603604081101561074757600080fd5b506001600160a01b038135811691602001351661224a565b61041a612926565b6104086004803603602081101561077d57600080fd5b50356001600160a01b031661292c565b610408600480360360208110156107a357600080fd5b50356001600160a01b03166129c7565b610408600480360360608110156107c957600080fd5b506001600160a01b038135811691602081013582169160409091013516612a62565b6104846004803603606081101561080157600080fd5b506001600160a01b03813581169160208101359091169060400135612b92565b6104086004803603604081101561083757600080fd5b506001600160a01b03813516906020013515156131f2565b6104086004803603604081101561086557600080fd5b506001600160a01b038135169060200135613318565b6103c76133d2565b6104846004803603602081101561089957600080fd5b50356133e1565b610408600480360360408110156108b657600080fd5b506001600160a01b038135811691602001351661368a565b610484600480360360208110156108e457600080fd5b5035613764565b6103c7613813565b6104846004803603602081101561090957600080fd5b50356001600160a01b0316613822565b6103c7613d44565b6104086004803603602081101561093757600080fd5b50356001600160a01b0316613d68565b6103c7613e03565b610484613e27565b6104846004803603604081101561096d57600080fd5b81019060208101813564010000000081111561098857600080fd5b82018360208201111561099a57600080fd5b803590602001918460208302840111640100000000831117156109bc57600080fd5b9193909290916020810190356401000000008111156109da57600080fd5b8201836020820111156109ec57600080fd5b80359060200191846020830284011164010000000083111715610a0e57600080fd5b509092509050613e30565b61048460048036036020811015610a2f57600080fd5b50356001600160a01b0316613f5d565b61048460048036036020811015610a5557600080fd5b5035613f72565b6103c7614029565b6103c7614038565b6103c7614047565b61041a614056565b6103c761405c565b61041a60048036036020811015610a9a57600080fd5b50356001600160a01b031661406b565b61040860048036036020811015610ac057600080fd5b50356001600160a01b031661407d565b61048460048036036060811015610ae657600080fd5b508035906001600160a01b03602082013516906040013515156140e6565b6103c7614273565b61040860048036036020811015610b2257600080fd5b50356001600160a01b0316614282565b61048460048036036020811015610b4857600080fd5b503561431d565b600b546001600160a01b031681565b6009546001600160a01b031681565b60026000541415610bc5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556010546001600160a01b03163314610c11576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6000610c2a6002546001546143e890919063ffffffff16565b90506000610c4482610c3e85612710614442565b9061449b565b90506000610c528285614502565b90506000610c80427f0000000000000000000000000000000000000000000000000000000000093a8061449b565b600081815260116020526040902054909150610c9c90846143e8565b6000828152601160205260409020819055690ed2b525841adfc000001015610d0b576040805162461bcd60e51b815260206004820152601060248201527f546f6f206d616e79204c32204665657300000000000000000000000000000000604482015290519081900360640190fd5b6000610d2685610c3e6001548961444290919063ffffffff16565b90506000610d348783614502565b601054600f54919250610d77916001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b829811692811691168561455f565b600f546040805163590a41f560e01b81526004810185905290516001600160a01b039092169163590a41f59160248082019260009290919082900301818387803b158015610dc457600080fd5b505af1158015610dd8573d6000803e3d6000fd5b5050601054600e54610e1d93506001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b8298116935091821691168461455f565b601054604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290517f000000000000000000000000115f3fa979a936167f9d208a7b7c4d85081e84bd909216916340c10f199160448082019260009290919082900301818387803b158015610e9357600080fd5b505af1158015610ea7573d6000803e3d6000fd5b50506001600055505050505050505050565b7f000000000000000000000000115f3fa979a936167f9d208a7b7c4d85081e84bd81565b60145490565b6005546001600160a01b03163314610f2a576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600580546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b9181900360200190a150565b60008060148581548110610f8e57fe5b60009182526020909120600360059092020101546001600160a01b03169050338114610fe9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b610ff5858533866145bf565b60019150505b9392505050565b6014818154811061100f57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b03938416955091831693908316929081169190811690600160a01b900460ff1686565b601260205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b6008546001600160a01b031681565b60045481565b6005546001600160a01b031633146110ee576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6013805460ff1916600117905560005b6014548110156112195760006014828154811061111757fe5b906000526020600020906005020190508060040160149054906101000a900460ff16156111445750611211565b80546002820154604080516301395c5960e31b81526001600160a01b0393841660048201819052928416602482018190529151929391927f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d3909216916309cae2c8916044808201926020929091908290030181600087803b1580156111c857600080fd5b505af19250505080156111ed57506040513d60208110156111e857600080fd5b505160015b6111f65761120d565b5060048301805460ff60a01b1916600160a01b1790555b5050505b6001016110fe565b50565b600f546001600160a01b031681565b60035481565b600c546001600160a01b03163314611278576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6040805160248082018490526001600160a01b03808616604480850191909152845180850382018152606494850186526020810180516001600160e01b03166317b0dca160e31b1781529551635b0e93fb60e11b81528984166004820190815260009582018690526060938201938452825196820196909652815191967f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d39094169563b61d27f6958b95909489949293909260849091019190808383895b8381101561134e578181015183820152602001611336565b50505050905090810190601f16801561137b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561139c57600080fd5b505af11580156113b0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156113d957600080fd5b81516020830180516040519294929383019291908464010000000082111561140057600080fd5b90830190602082018581111561141557600080fd5b825164010000000081118282018810171561142f57600080fd5b82525081516020918201929091019080838360005b8381101561145c578181015183820152602001611444565b50505050905090810190601f1680156114895780820380516001836020036101000a031916815260200191505b50604052505050505050505050565b60116020526000908152604090205481565b600060026000541415611504576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff161561154c576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b60006014858154811061155b57fe5b600091825260209091206005909102016004810154909150600160a01b900460ff16156115c0576040805162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081a5cc818db1bdcd95960921b604482015290519081900360640190fd5b80546001600160a01b03166115f781337f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d38861455f565b60028201546001600160a01b031680611657576040805162461bcd60e51b815260206004820152600e60248201527f2167617567652073657474696e67000000000000000000000000000000000000604482015290519081900360640190fd5b7f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b031663f9609f0883836040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b1580156116d757600080fd5b505af11580156116eb573d6000803e3d6000fd5b505050506040513d602081101561170157600080fd5b505060048301546001600160a01b0316801561177f57806001600160a01b031663b87bd4816040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d602081101561177c57600080fd5b50505b60018401546001600160a01b0316861561189857604080516340c10f1960e01b8152306004820152602481018a905290516001600160a01b038316916340c10f1991604480830192600092919082900301818387803b1580156117e157600080fd5b505af11580156117f5573d6000803e3d6000fd5b50505060038601546001600160a01b039081169150611818908316826000614888565b61182c6001600160a01b038316828b614888565b604080516305dc812160e31b8152336004820152602481018b905290516001600160a01b03831691632ee4090891604480830192600092919082900301818387803b15801561187a57600080fd5b505af115801561188e573d6000803e3d6000fd5b50505050506118ff565b604080516340c10f1960e01b8152336004820152602481018a905290516001600160a01b038316916340c10f1991604480830192600092919082900301818387803b1580156118e657600080fd5b505af11580156118fa573d6000803e3d6000fd5b505050505b6040805189815290518a9133917f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca9181900360200190a360019550505050505060016000559392505050565b6000611959838333336145bf565b5060015b92915050565b6005546001600160a01b031633146119aa576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600680546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fe45f5e140399b0a7e12971ab020724b828fbed8ac408c420884dc7d1bbe506b49181900360200190a150565b60015481565b7f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d381565b60008060148481548110611a3857fe5b60009182526020808320600590920290910154604080516370a0823160e01b815233600482015290516001600160a01b03909216945084926370a0823192602480840193829003018186803b158015611a9057600080fd5b505afa158015611aa4573d6000803e3d6000fd5b505050506040513d6020811015611aba57600080fd5b50519050611ac98582866114aa565b50600195945050505050565b600060026000541415611b2f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556007546001600160a01b03163314611b7b576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600060148381548110611b8a57fe5b60009182526020808320600590920290910180546002820154604080516301395c5960e31b81526001600160a01b0393841660048201529183166024830152519295507f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d391909116936309cae2c89360448084019491939192918390030190829087803b158015611c1a57600080fd5b505af1925050508015611c3f57506040513d6020811015611c3a57600080fd5b505160015b611c4857611c4a565b505b60048101805460ff60a01b1916600160a01b17905560028101546001600160a01b0316600090815260156020908152604091829020805460ff19169055815185815291517f2ccd633716c6ce12394d1c984ad04b6173d18aedc4f505d1537a94a98a07b6e79281900390910190a160019150506001600055919050565b600d546001600160a01b031681565b60025481565b7f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82981565b60008060148481548110611d1057fe5b60009182526020909120600460059092020101546001600160a01b03169050338114611d6b576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b7f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b031663ef5cfb8c846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611dda57600080fd5b505af1158015611dee573d6000803e3d6000fd5b505050506040513d6020811015611ac957600080fd5b60026000541415611e5c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556006546001600160a01b03163314611ea8576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6000611ec082611eba858189896143e8565b906143e8565b9050611388811115611f19576040805162461bcd60e51b815260206004820152600860248201527f3e4d617846656573000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61012c8510158015611f2d5750610dac8511155b611f7e576040805162461bcd60e51b815260206004820152600960248201527f216c6f636b466565730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61012c8410158015611f925750610dac8411155b611fe3576040805162461bcd60e51b815260206004820152600b60248201527f217374616b657246656573000000000000000000000000000000000000000000604482015290519081900360640190fd5b60018310158015611ff5575060648311155b612046576040805162461bcd60e51b815260206004820152600b60248201527f2163616c6c657246656573000000000000000000000000000000000000000000604482015290519081900360640190fd5b6101f482111561209d576040805162461bcd60e51b815260206004820152600960248201527f21706c6174666f726d0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600185905560028490556003839055600482905560408051868152602081018690528082018590526060810184905290517f16e6f67290546b8dd0e587f4b7f67d4f61932ae17ffd8c60d3509dbc05c175fe9181900360800190a150506001600055505050565b6000806014858154811061211457fe5b60009182526020909120600360059092020101546001600160a01b031690503381148061214b5750600f546001600160a01b031633145b612184576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b336000908152601660205260408120546121a79061271090610c3e908790614442565b90508015611ac9577f000000000000000000000000115f3fa979a936167f9d208a7b7c4d85081e84bd6001600160a01b03166340c10f1986836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561222657600080fd5b505af115801561223a573d6000803e3d6000fd5b5050505050600195945050505050565b600260005414156122a2576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556005546001600160a01b031633146122ee576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60135460ff1615612331576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b600f546001600160a01b03161580159061235557506008546001600160a01b031615155b6123a6576040805162461bcd60e51b815260206004820152600c60248201527f21696e697469616c697365640000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038216158015906123c657506001600160a01b03811615155b612417576040805162461bcd60e51b815260206004820152600a60248201527f2161646472657373657300000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000816001600160a01b031663acbc1428846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561246657600080fd5b505afa15801561247a573d6000803e3d6000fd5b505050506040513d602081101561249057600080fd5b5051116124e4576040805162461bcd60e51b815260206004820152600760248201527f2164697374726f00000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03828116600090815260126020526040902054166128ad576001600160a01b03821660009081526015602052604090205460ff1615612571576040805162461bcd60e51b815260206004820152600660248201527f21746f6b656e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b7f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b8296001600160a01b0316826001600160a01b031614156126945760408051606080820183526001600160a01b03808516808452600f80548316602080870191825260018789018181527f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82987166000818152601285528b902099518a549089166001600160a01b0319918216178b55945199909201805491511515600160a01b0260ff60a01b199a89169290951691909117989098169290921790965590548651928352909216938101939093528284015291517f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc8929181900390910190a16128a8565b600f546040805163355688fd60e21b81529051600a926001600160a01b03169163d55a23f4916004808301926020929190829003018186803b1580156126d957600080fd5b505afa1580156126ed573d6000803e3d6000fd5b505050506040513d602081101561270357600080fd5b505110612757576040805162461bcd60e51b815260206004820152601060248201527f746f6f206d616e79207265776172647300000000000000000000000000000000604482015290519081900360640190fd5b600854600f5460408051637c6b091760e11b81526001600160a01b03868116600483015292831660248201523060448201529051600093929092169163f8d6122e9160648082019260209290919082900301818787803b1580156127ba57600080fd5b505af11580156127ce573d6000803e3d6000fd5b505050506040513d60208110156127e457600080fd5b505160408051606080820183526001600160a01b03808716808452818616602085810182815260018789018181528d87166000818152601286528b902099518a549089166001600160a01b0319918216178b55935199909201805491511515600160a01b0260ff60a01b199a909816919093161797909716949094179093558551918252918101919091528084019290925291519293507f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc8929081900390910190a1505b61291d565b6001600160a01b03808316600081815260126020908152604080832080549587166001600160a01b03199096168617905580519485529084019190915282810191909152517f125af409731fa78089d37e0f7f166b726398745c97b932f061cf486d6ee4fcc89181900360600190a15b50506001600055565b61138881565b6005546001600160a01b03163314612973576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600c80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f49f087c09fe6698eda82449a671bd8d38e44bed601118018a7cc7f1e0c808df49181900360200190a150565b6007546001600160a01b03163314612a0e576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600780546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f70a64736553c84939f57deec269299882abbbee8dc4f316eccbc6fce57e4d3cf9181900360200190a150565b6005546001600160a01b03163314612aa9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b038481169190911790915560085416612b4457600880546001600160a01b038086166001600160a01b03199283168117909355600a805485831693168317905560408051938452908516602084015282810191909152517f013ea07699fbd5315b997a706906fb94a81c616771f1052b406707d7bfc6aa279181900360600190a1612b8d565b6040805160008082526001600160a01b03851660208301528183015290517f013ea07699fbd5315b997a706906fb94a81c616771f1052b406707d7bfc6aa279181900360600190a15b505050565b6007546000906001600160a01b031633148015612bb2575060135460ff16155b612bec576040805162461bcd60e51b815260206004808301919091526024820152630858591960e21b604482015290519081900360640190fd5b6001600160a01b03831615801590612c0c57506001600160a01b03841615155b612c5d576040805162461bcd60e51b815260206004820152600660248201527f21706172616d0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038381166000908152601260205260409020541615612cca576040805162461bcd60e51b815260206004820152600660248201527f2167617567650000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b601454600a5460408051630452a26760e21b81526001600160a01b0388811660048301529151600093929092169163114a899c9160248082019260209290919082900301818787803b158015612d1f57600080fd5b505af1158015612d33573d6000803e3d6000fd5b505050506040513d6020811015612d4957600080fd5b505160085460408051632f7260f160e01b8152600481018690526001600160a01b0380851660248301528a8116604483015291519394506000939190921691632f7260f191606480830192602092919082900301818787803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b505050506040513d6020811015612dd857600080fd5b505160095460408051634ce5896f60e11b8152600481018790526001600160a01b038a811660248301527f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d381166044830152606482018a9052915193945060009391909216916399cb12de91608480830192602092919082900301818787803b158015612e6457600080fd5b505af1158015612e78573d6000803e3d6000fd5b505050506040513d6020811015612e8e57600080fd5b50516040805160c0810182526001600160a01b03808c16825286811660208381019182528c83168486018181528985166060870190815285891660808801818152600060a08a0181815260148054600181810183559184529b516005909c027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec810180549d8d166001600160a01b03199e8f1617905599517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed8b018054918d16918e1691909117905595517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ee8a018054918c16918d1691909117905593517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ef89018054918b16918c1691909117905590517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4f0909701805493511515600160a01b0260ff60a01b199890991693909916929092179590951695909517909555835260159052929020805460ff191690911790559091501561316757806014858154811061303657fe5b600091825260208083206004600590930201820180546001600160a01b039586166001600160a01b031990911617905560408051637d1cb25960e11b81528686169381019390935260016024840152517f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d39094169363fa3964b2936044808501948390030190829087803b1580156130cd57600080fd5b505af11580156130e1573d6000803e3d6000fd5b505050506040513d60208110156130f757600080fd5b50506008546040805163b84614a560e01b81526001600160a01b038481166004830152600160248301529151919092169163b84614a591604480830192600092919082900301818387803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050505b6001600160a01b03808316600081815260166020908152604091829020612710905581518c851681528b851691810191909152868416818301526060810192909252918316608082015260a0810186905290517fca1a6de26e4422518df9ab614eefa07fac43e4f4c7d704dbf82e903e582659ca9181900360c00190a1506001979650505050505050565b6005546001600160a01b03163314613239576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b6001600160a01b03828116600090815260126020526040902054166132a5576040805162461bcd60e51b815260206004820152601160248201527f46656520646f65736e2774206578697374000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038216600081815260126020908152604091829020600101805460ff60a01b1916600160a01b8615159081029190911790915582519384529083015280517ff1d91b931944e49fd30c1dc6fd08ad8bb25ef1fe12c369b10a4675c4bf3974409281900390910190a15050565b6006546001600160a01b0316331461335f576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b614e208111156133b6576040805162461bcd60e51b815260206004820152600860248201527f746f6f2068696768000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03909116600090815260166020526040902055565b6005546001600160a01b031681565b600080601483815481106133f157fe5b60009182526020909120600460059092020101546001600160a01b0316905033811461344c576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60006014848154811061345b57fe5b6000918252602080832060026005909302019190910154604080516001600160a01b038781166024808401919091528351808403820181526044938401855295860180516001600160e01b0316635efcc08b60e11b1781529351635b0e93fb60e11b815294821660048601818152918601889052606093860193845286516064870152865190985095967f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d39092169563b61d27f6958995939489949092608490920191808383895b8381101561353b578181015183820152602001613523565b50505050905090810190601f1680156135685780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561358957600080fd5b505af115801561359d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156135c657600080fd5b8151602083018051604051929492938301929190846401000000008211156135ed57600080fd5b90830190602082018581111561360257600080fd5b825164010000000081118282018810171561361c57600080fd5b82525081516020918201929091019080838360005b83811015613649578181015183820152602001613631565b50505050905090810190601f1680156136765780820380516001836020036101000a031916815260200191505b506040525060019998505050505050505050565b6005546001600160a01b031633146136d1576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600f546001600160a01b031661376057600f80546001600160a01b038085166001600160a01b0319928316811793849055600e805486841694168417905592166000908152601660209081526040918290206127109055815193845283019190915280517f601d75fd094819eb2644514a732ecc4ff7953787e92258e47c118aa83b0311159281900390910190a15b5050565b6000806014838154811061377457fe5b6000918252602080832060016005909302019190910154604080516370a0823160e01b815233600482015290516001600160a01b03909216945084926370a0823192602480840193829003018186803b1580156137d057600080fd5b505afa1580156137e4573d6000803e3d6000fd5b505050506040513d60208110156137fa57600080fd5b50519050613808848261194b565b506001949350505050565b600c546001600160a01b031681565b60006002600054141561387c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff16156138c4576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b6138cc615460565b506001600160a01b03828116600090815260126020908152604091829020825160608101845281548516815260019091015493841691810191909152600160a01b90920460ff16151590820181905261396c576040805162461bcd60e51b815260206004820152600f60248201527f496e6163746976652064697374726f0000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660009081526015602052604090205460ff16156139da576040805162461bcd60e51b815260206004820152600d60248201527f496e76616c696420746f6b656e00000000000000000000000000000000000000604482015290519081900360640190fd5b6000836001600160a01b03166370a082317f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015613a4957600080fd5b505afa158015613a5d573d6000803e3d6000fd5b505050506040513d6020811015613a7357600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038716916370a08231916024808301926020929190829003018186803b158015613ac157600080fd5b505afa158015613ad5573d6000803e3d6000fd5b505050506040513d6020811015613aeb57600080fd5b505190506000613afb82846143e8565b90507f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b0316632dbfa7358560000151886040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b158015613b8157600080fd5b505af1158015613b95573d6000803e3d6000fd5b505050506040513d6020811015613bab57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b158015613bf757600080fd5b505afa158015613c0b573d6000803e3d6000fd5b505050506040513d6020811015613c2157600080fd5b505190506000613c318284614502565b600d549091506001600160a01b031615801590613c595750600d546001600160a01b03163014155b8015613c6757506000600454115b15613cb4576000613c89612710610c3e6004548561444290919063ffffffff16565b9050613c958282614502565b600d54909250613cb2906001600160a01b038b811691168361499b565b505b6020860151613cce906001600160a01b038a16908361499b565b85602001516001600160a01b031663590a41f5826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015613d1857600080fd5b505af1158015613d2c573d6000803e3d6000fd5b50505050600196505050505050506001600055919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6005546001600160a01b03163314613daf576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600b80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f961c543f04f95b46a6d6af9e463eb4f186ceea8ca52f869ec568c0197080401b9181900360200190a150565b7f000000000000000000000000000000000000000000000000000000000000000081565b60135460ff1681565b600c546000906001600160a01b03163314613e7a576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b60005b84811015611ac9577f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b0316635d7e9bcb878784818110613ec057fe5b905060200201356001600160a01b0316868685818110613edc57fe5b905060200201356040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613f2957600080fd5b505af1158015613f3d573d6000803e3d6000fd5b505050506040513d6020811015613f5357600080fd5b5050600101613e7d565b60156020526000908152604090205460ff1681565b600060026000541415613fcc576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560135460ff1615614014576040805162461bcd60e51b815260206004820152600860248201526739b43aba3237bbb760c11b604482015290519081900360640190fd5b61401d826149ed565b50600180600055919050565b6010546001600160a01b031681565b600e546001600160a01b031681565b6006546001600160a01b031681565b61271081565b6007546001600160a01b031681565b60166020526000908152604090205481565b6006546001600160a01b031633146140c4576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b600c546000906001600160a01b03163314614130576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806141a157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316145b6141f2576040805162461bcd60e51b815260206004820152600960248201527f21766f7465416464720000000000000000000000000000000000000000000000604482015290519081900360640190fd5b7f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b031663e2cdd42a8585856040518463ffffffff1660e01b815260040180848152602001836001600160a01b0316815260200182151581526020019350505050602060405180830381600087803b158015611dda57600080fd5b600a546001600160a01b031681565b6006546001600160a01b031633146142c9576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b600d80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d19181900360200190a150565b600c546000906001600160a01b03163314614367576040805162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015290519081900360640190fd5b604080516307ef625d60e21b81526004810184905260006024820181905291516001600160a01b037f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d31692631fbd8974926044808201939182900301818387803b1580156143d457600080fd5b505af1158015611ac9573d6000803e3d6000fd5b600082820183811015610ffb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826144515750600061195d565b8282028284828161445e57fe5b0414610ffb5760405162461bcd60e51b81526004018080602001828103825260218152602001806154a76021913960400191505060405180910390fd5b60008082116144f1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816144fa57fe5b049392505050565b600082821115614559576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526145b9908590615192565b50505050565b60026000541415614617576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155601480548690811061462c57fe5b60009182526020822060059091020180546002820154600183015460408051632770a7eb60e21b81526001600160a01b038a81166004830152602482018c9052915195975093811695928116949116928392639dc29fac9260448084019382900301818387803b15801561469f57600080fd5b505af11580156146b3573d6000803e3d6000fd5b505050506004840154600160a01b900460ff1661477f577f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b031663d9caed1284848a6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561475257600080fd5b505af1158015614766573d6000803e3d6000fd5b505050506040513d602081101561477c57600080fd5b50505b60048401546001600160a01b0316801580159061479f575060135460ff16155b80156147b757506004850154600160a01b900460ff16155b1561482457806001600160a01b031663b87bd4816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156147f757600080fd5b505af115801561480b573d6000803e3d6000fd5b505050506040513d602081101561482157600080fd5b50505b6148386001600160a01b038516878a61499b565b6040805189815290518a916001600160a01b038916917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc69181900360200190a35050600160005550505050505050565b80158061490e575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156148e057600080fd5b505afa1580156148f4573d6000803e3d6000fd5b505050506040513d602081101561490a57600080fd5b5051155b6149495760405162461bcd60e51b81526004018080602001828103825260368152602001806154f26036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052612b8d908490615192565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612b8d908490615192565b6000601482815481106149fc57fe5b600091825260209091206005909102016004810154909150600160a01b900460ff1615614a61576040805162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081a5cc818db1bdcd95960921b604482015290519081900360640190fd5b6002810154604080516370a0823160e01b815230600482015290516001600160a01b03928316926000927f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b829909116916370a0823191602480820192602092909190829003018186803b158015614ad657600080fd5b505afa158015614aea573d6000803e3d6000fd5b505050506040513d6020811015614b0057600080fd5b5051604080516370a0823160e01b81526001600160a01b037f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d38116600483015291519293506000927f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b829909216916370a0823191602480820192602092909190829003018186803b158015614b9357600080fd5b505afa158015614ba7573d6000803e3d6000fd5b505050506040513d6020811015614bbd57600080fd5b505190506000614bcd83836143e8565b90507f0000000000000000000000003d4abcd29ea9a6117408536a0bbd0235007e28d36001600160a01b0316633fe9bc06856040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015614c3e57600080fd5b505af1158015614c52573d6000803e3d6000fd5b505050506040513d6020811015614c6857600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82916916370a0823191602480820192602092909190829003018186803b158015614cd457600080fd5b505afa158015614ce8573d6000803e3d6000fd5b505050506040513d6020811015614cfe57600080fd5b505190506000614d0e8284614502565b9050600083118015614d2a5750600d546001600160a01b031615155b15614dd357600d546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810186905290517f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b8299092169163a9059cbb916044808201926020929091908290030181600087803b158015614da657600080fd5b505af1158015614dba573d6000803e3d6000fd5b505050506040513d6020811015614dd057600080fd5b50505b60048701546001600160a01b03168015614ebd57806001600160a01b031663372500ab6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614e2257600080fd5b505af1158015614e36573d6000803e3d6000fd5b505050506040513d6020811015614e4c57600080fd5b50506040805163654580bb60e11b815290516001600160a01b0383169163ca8b01769160048083019260209291908290030181600087803b158015614e9057600080fd5b505af1158015614ea4573d6000803e3d6000fd5b505050506040513d6020811015614eba57600080fd5b50505b8115615187576000614ee0612710610c3e6001548661444290919063ffffffff16565b90506000614eff612710610c3e6002548761444290919063ffffffff16565b90506000614f1e612710610c3e6003548861444290919063ffffffff16565b600d549091506001600160a01b031615801590614f465750600d546001600160a01b03163014155b8015614f5457506000600454115b15614fc1576000614f76612710610c3e6004548961444290919063ffffffff16565b9050614f828682614502565b600d54909650614fbf906001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b829811691168361499b565b505b614fd782614fd183818988614502565b90614502565b945061500d6001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82916338361499b565b60038b01546001600160a01b039081169061504b907f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82916828861499b565b806001600160a01b031663590a41f5876040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561509157600080fd5b505af11580156150a5573d6000803e3d6000fd5b5050600f546150e392506001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82981169250168661499b565b600f546040805163590a41f560e01b81526004810187905290516001600160a01b039092169163590a41f59160248082019260009290919082900301818387803b15801561513057600080fd5b505af1158015615144573d6000803e3d6000fd5b5050600e5461518292506001600160a01b037f0000000000000000000000009663c2d75ffd5f4017310405fce61720af45b82981169250168561499b565b505050505b505050505050505050565b60606151e7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166152439092919063ffffffff16565b805190915015612b8d5780806020019051602081101561520657600080fd5b5051612b8d5760405162461bcd60e51b815260040180806020018281038252602a8152602001806154c8602a913960400191505060405180910390fd5b6060615252848460008561525a565b949350505050565b60608247101561529b5760405162461bcd60e51b81526004018080602001828103825260268152602001806154816026913960400191505060405180910390fd5b6152a4856153b6565b6152f5576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106153345780518252601f199092019160209182019101615315565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615396576040519150601f19603f3d011682016040523d82523d6000602084013e61539b565b606091505b50915091506153ab8282866153bc565b979650505050505050565b3b151590565b606083156153cb575081610ffb565b8251156153db5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561542557818101518382015260200161540d565b50505050905090810190601f1680156154525780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60408051606081018252600080825260208201819052918101919091529056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c634300060c000a