Contract 0x480345f79d6c26fb8d6c12f1a9bf9af6663cec48

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x71ccbd054c36515b28cbb81c5244b8ccb1de0a47e38698ff6b2605bc726d772fReinvest165574622022-06-26 21:18:481 day 3 hrs ago0xd33d869765a83bd5c9cad8b8abefcf857b9b0157 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.04850481528.75
0xc4bd63ee6e142bd75e5aa1cf88f437479e4d7b1a0ef6197047cde51280b49d1aReinvest165210752022-06-26 1:02:421 day 23 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.042318116927 25.00001
0xe82d6f66313c221fada7723dea2fc6864c2f748e6f8521f1f08406171b83e204Reinvest164274272022-06-23 21:04:084 days 3 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.042318116927 25.00001
0x041088dfdac0e74c7ff0126149a8a9fb0fa1869cd1cbb615e9156f94499d7791Reinvest163381142022-06-21 19:28:036 days 5 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.041890616756 25.00001
0xf5d7908c296a863a33bfc89794b886f69e24239393f3b2ceb3547dab46113713Deposit162896232022-06-20 16:29:267 days 8 hrs ago0x95d2e6fee9a59acfee42e674cd4ff77545fe9475 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.0210982665 26.5
0x4af344f392214aa3868eb6f0d58cdb163f1664faf6d910c7f064a5bc2f560318Reinvest162517552022-06-19 19:29:018 days 5 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.042680604783 25.21415469
0x818338a62b466baa05e6c1b3a2d29bfeba1aa824513b21e6c9dfc5bf2303991eReinvest161665832022-06-17 20:35:2910 days 4 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.041512916605 25.00001
0x91503a8c4fcce8b0513146df6e5ee7df6edea9e78c501340efb8bc97c2b38cebDeposit161555542022-06-17 14:28:1510 days 10 hrs ago0x918cbdbbad90f1fd4f648b09981d72f84b768a8e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.0201920725 26.5
0x8d8760c97283a575897ffb7331131f53c9f37fcd5ce6b9aaab900ac9a262dcbaReinvest160911612022-06-16 2:50:3011 days 22 hrs ago0x000010ed59bcb8fac3aecb568aefbf8b49daea02 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.002558494126 29.935461955
0x26c16aded5d3322b39686236ac7231470506a46dbdb4a1fc488d5b86095aad64Reinvest160911602022-06-16 2:50:2811 days 22 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.050627210295 30.213944355
0x37e7fd44059287ed10e87e4e04ed3fa1d8576e0c1f1d4ae9506e045fb8c59a9aWithdraw160546472022-06-15 7:02:0512 days 17 hrs ago0x4220d7449f104603a5649f11f5550f63c8120961 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.019989162 26.5
0xd321315dcf22f84a4cf128b26296b27d2d7ca017fec885d20951507bebc1edb6Reinvest160198322022-06-14 11:49:0113 days 13 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.041890616756 25.00001
0x8cdd055f983c0c935b45e6d8f2ce208a5e7e37ded0b3c8914c76fa408b211821Withdraw159700502022-06-13 8:55:3014 days 16 hrs ago0x58f51c03786ab3fe5e5a38eeeb3b1e2f55c00919 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.051960779781 68.361711413
0xf53808fc54965c4edfc070a94d21e80687dfcff07dd6acb901264ce13b5ff3fcReinvest159480562022-06-12 21:02:0515 days 3 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.041510416604 25.00001
0x57aa0d883645a8352c880916965f3f0495b4e4ed41e5d09f7bbb25328668da5dWithdraw158883602022-06-11 12:02:3716 days 12 hrs ago0x9f0811ab8f27620d91af227fa06bf325fb09cc83 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.021469249875 27.425
0x948d6cdc791de9b90e5a83989d953c3e06b0aefbf304dc0f4b5f25461929f9a6Reinvest158869802022-06-11 11:17:3316 days 13 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.042563467025 25.00001
0xdf3d47e952ba6cec5f189ca854f262ce47458c62664dd3da9526472088b516efReinvest158336142022-06-10 5:33:5217 days 19 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.002098300839 25.00001
0x6d466d9a1c9aadb52e4a608d11568e2cf2af9eea0546e8b013cf5db3a6a2bbe4Reinvest158336142022-06-10 5:33:5217 days 19 hrs ago0x000010ed59bcb8fac3aecb568aefbf8b49daea02 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.057669918444 34.37611375
0x4a84899bd6d1fc3429fa467f1a0fdbdefedcc3a66e87c988b89846ffe1e31248Reinvest157771532022-06-08 21:59:2019 days 3 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.041890616756 25.00001
0x429b86e943fd5a91304874f3fc61e1ac688c7dec53baf598775364d531ac6203Deposit157522932022-06-08 8:06:5319 days 16 hrs ago0xdcb8e242c5f159c78e76030020d93dedd8decbca IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.02025558626
0x6ebda87cb83cc6a5029949bffbd0d1ebea83a932dc0c67d0d63d9656095110c9Withdraw157204162022-06-07 14:26:4120 days 10 hrs ago0x3abad2a81fed1884971121d778fc7d25b46f494a IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.019573483 26.5
0x02791bc3bed79bf52f5345e1c1b36deea4827938d80de68d868d7185eebcc467Withdraw157177052022-06-07 12:56:0720 days 12 hrs ago0x5be8c6bc76df0e461f7bab5d50914de598afa375 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.0727114 100
0xab664e818beec18573899e9db4eeb73540bb810c9eed72a917fc1cf64607c240Reinvest157172742022-06-07 12:41:3520 days 12 hrs ago0xdaa99a4826b3d0e9998cb55c8c648c53a5be677e IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.042135966854 25.00001
0x685c7d5711e7c623d05a889fea1b5d7c86ef980840ee29c5e48242425ee46085Withdraw156796942022-06-06 15:24:5021 days 9 hrs ago0x5be8c6bc76df0e461f7bab5d50914de598afa375 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.0710002 100
0x38726749e5e49500129908f9c78063d81ddf32eab5072eb96d1fd2431bf37ecbDeposit156741282022-06-06 12:10:4621 days 12 hrs ago0x5be8c6bc76df0e461f7bab5d50914de598afa375 IN  0x480345f79d6c26fb8d6c12f1a9bf9af6663cec480 AVAX0.0780475 100
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MoreMoneyStrategy

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 21 : MoreMoneyStrategy.sol
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity 0.7.3;

import "../interfaces/IERC20.sol";
import "../interfaces/IPair.sol";
import "../interfaces/IMoreMoneyStakingRewards.sol";
import "../lib/DexLibrary.sol";
import "../lib/CurveSwap.sol";
import "./MasterChefStrategy.sol";

contract MoreMoneyStrategy is MasterChefStrategy {
    using SafeMath for uint256;

    IWAVAX private constant WAVAX = IWAVAX(0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7);

    CurveSwap.Settings private zapSettings;
    address private curvePool;
    IMoreMoneyStakingRewards public stakingContract;

    constructor(
        string memory _name,
        address _depositToken,
        address _poolRewardToken,
        address _swapPairPoolReward,
        address _stakingContract,
        CurveSwap.Settings memory _curveSwapSettings,
        address _timelock,
        StrategySettings memory _strategySettings
    )
        MasterChefStrategy(
            _name,
            _depositToken,
            address(WAVAX), /*rewardToken=*/
            _poolRewardToken,
            _swapPairPoolReward,
            address(0),
            _timelock,
            0,
            _strategySettings
        )
    {
        stakingContract = IMoreMoneyStakingRewards(_stakingContract);
        curvePool = _depositToken;
        zapSettings = _curveSwapSettings;
        IERC20(zapSettings.zapToken).approve(zapSettings.zapContract, type(uint256).max);
    }

    function setMaxSlippageBips(uint256 _maxSlippageBips) external onlyDev {
        zapSettings.maxSlippage = _maxSlippageBips;
    }

    function _depositMasterchef(
        uint256, /*pid*/
        uint256 _amount
    ) internal override {
        depositToken.approve(address(stakingContract), _amount);
        stakingContract.stake(_amount);
        depositToken.approve(address(stakingContract), 0);
    }

    function _withdrawMasterchef(
        uint256, /*pid*/
        uint256 _amount
    ) internal override {
        stakingContract.withdraw(_amount);
    }

    function _min(uint256 a, uint256 b) private pure returns (uint256) {
        if (a >= b) {
            return b;
        } else {
            return a;
        }
    }

    function _earned(address account) private view returns (uint256) {
        return
            (
                stakingContract.balanceOf(account).mul(
                    (stakingContract.rewardPerToken() - stakingContract.userRewardPerTokenAccountedFor(account))
                )
            ).div(1e18);
    }

    function _calculateReward(address account) private view returns (uint256) {
        uint256 vStart = stakingContract.vestingStart(account);
        uint256 timeDelta = block.timestamp - vStart;
        uint256 totalRewards = stakingContract.rewards(account).add(_earned(account));

        if (stakingContract.vestingPeriod() == 0) {
            return totalRewards;
        } else {
            uint256 rewardVested = vStart > 0 && timeDelta > 0
                ? _min(totalRewards, (totalRewards * timeDelta) / stakingContract.vestingPeriod())
                : 0;
            return rewardVested;
        }
    }

    function _pendingRewards(
        uint256, /*pid*/
        address _user
    )
        internal
        view
        override
        returns (
            uint256,
            uint256,
            address
        )
    {
        uint256 pendingReward = _calculateReward(_user);
        return (pendingReward, 0, address(0));
    }

    function _getRewards(
        uint256 /*_pid*/
    ) internal override {
        stakingContract.withdrawVestedReward();
    }

    function _getDepositBalance(
        uint256, /*pid*/
        address user
    ) internal view override returns (uint256 amount) {
        return stakingContract.balanceOf(user);
    }

    function _bip() internal pure override returns (uint256) {
        return 10000;
    }

    function _convertRewardTokenToDepositToken(uint256 fromAmount) internal override returns (uint256 toAmount) {
        return
            CurveSwap.zapToFactory4AssetsPoolLP(fromAmount, address(rewardToken), address(depositToken), zapSettings);
    }

    function _emergencyWithdraw(
        uint256 /*pid*/
    ) internal override {
        stakingContract.exit();
    }

    function _getDepositFeeBips(
        uint256 /* pid */
    ) internal pure override returns (uint256) {
        return 0;
    }

    function _getWithdrawFeeBips(
        uint256 /* pid */
    ) internal pure override returns (uint256) {
        return 0;
    }
}

File 2 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface IERC20 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 3 of 21 : IPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./IERC20.sol";

interface IPair is IERC20 {
    function token0() external pure returns (address);
    function token1() external pure returns (address);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function mint(address to) external returns (uint liquidity);
    function sync() external;
}

File 4 of 21 : IMoreMoneyStakingRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface IMoreMoneyStakingRewards {
    function stake(uint256 amount) external;

    function withdraw(uint256 amount) external;

    function withdrawVestedReward() external;

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

    function rewardPerToken() external view returns (uint256);

    function vestingPeriod() external view returns (uint256);

    function userRewardPerTokenAccountedFor(address account) external view returns (uint256);

    function vestingStart(address account) external view returns (uint256);

    function rewards(address account) external view returns (uint256);

    function exit() external;
}

File 5 of 21 : DexLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./SafeMath.sol";
import "../interfaces/IPair.sol";
import "../interfaces/IWAVAX.sol";

library DexLibrary {
    using SafeMath for uint;
    bytes private constant zeroBytes = new bytes(0);
    IWAVAX private constant WAVAX = IWAVAX(0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7);

    /**
     * @notice Swap directly through a Pair
     * @param amountIn input amount
     * @param fromToken address
     * @param toToken address
     * @param pair Pair used for swap
     * @return output amount
     */
    function swap(uint amountIn, address fromToken, address toToken, IPair pair) internal returns (uint) {
        (address token0,) = sortTokens(fromToken, toToken);
        (uint112 reserve0, uint112 reserve1,) = pair.getReserves();
        if (token0 != fromToken) (reserve0, reserve1) = (reserve1, reserve0);
        uint amountOut1 = 0;
        uint amountOut2 = getAmountOut(amountIn, reserve0, reserve1);
        if (token0 != fromToken) (amountOut1, amountOut2) = (amountOut2, amountOut1);
        safeTransfer(fromToken, address(pair), amountIn);
        pair.swap(amountOut1, amountOut2, address(this), zeroBytes);
        return amountOut2 > amountOut1 ? amountOut2 : amountOut1;
    }

    function checkSwapPairCompatibility(IPair pair, address tokenA, address tokenB) internal pure returns (bool) {
        return (tokenA == pair.token0() || tokenA == pair.token1()) && (tokenB == pair.token0() || tokenB == pair.token1()) && tokenA != tokenB;
    }

    function estimateConversionThroughPair(uint amountIn, address fromToken, address toToken, IPair swapPair) internal view returns (uint) {
        (address token0,) = sortTokens(fromToken, toToken);
        (uint112 reserve0, uint112 reserve1,) = swapPair.getReserves();
        if (token0 != fromToken) (reserve0, reserve1) = (reserve1, reserve0);
        return getAmountOut(amountIn, reserve0, reserve1);
    }

    /**
     * @notice Converts reward tokens to deposit tokens
     * @dev No price checks enforced
     * @param amount reward tokens
     * @return deposit tokens
     */
    function convertRewardTokensToDepositTokens(uint amount, address rewardToken, address depositToken, IPair swapPairToken0, IPair swapPairToken1) internal returns (uint) {
        uint amountIn = amount.div(2);
        require(amountIn > 0, "DexLibrary::_convertRewardTokensToDepositTokens");

        address token0 = IPair(depositToken).token0();
        uint amountOutToken0 = amountIn;
        if (rewardToken != token0) {
            amountOutToken0 = DexLibrary.swap(amountIn, rewardToken, token0, swapPairToken0);
        }

        address token1 = IPair(depositToken).token1();
        uint amountOutToken1 = amountIn;
        if (rewardToken != token1) {
            amountOutToken1 = DexLibrary.swap(amountIn, rewardToken, token1, swapPairToken1);
        }

        return DexLibrary.addLiquidity(depositToken, amountOutToken0, amountOutToken1);
    }

    /**
     * @notice Add liquidity directly through a Pair
     * @dev Checks adding the max of each token amount
     * @param depositToken address
     * @param maxAmountIn0 amount token0
     * @param maxAmountIn1 amount token1
     * @return liquidity tokens
     */
    function addLiquidity(address depositToken, uint maxAmountIn0, uint maxAmountIn1) internal returns (uint) {
        (uint112 reserve0, uint112 reserve1,) = IPair(address(depositToken)).getReserves();
        uint amountIn1 = _quoteLiquidityAmountOut(maxAmountIn0, reserve0, reserve1);
        if (amountIn1 > maxAmountIn1) {
            amountIn1 = maxAmountIn1;
            maxAmountIn0 = _quoteLiquidityAmountOut(maxAmountIn1, reserve1, reserve0);
        }

        safeTransfer(IPair(depositToken).token0(), depositToken, maxAmountIn0);
        safeTransfer(IPair(depositToken).token1(), depositToken, amountIn1);
        return IPair(depositToken).mint(address(this));
    }

    /**
     * @notice Quote liquidity amount out
     * @param amountIn input tokens
     * @param reserve0 size of input asset reserve
     * @param reserve1 size of output asset reserve
     * @return liquidity tokens
     */
    function _quoteLiquidityAmountOut(uint amountIn, uint reserve0, uint reserve1) private pure returns (uint) {
        return amountIn.mul(reserve1).div(reserve0);
    }

    /**
     * @notice Given two tokens, it'll return the tokens in the right order for the tokens pair
     * @dev TokenA must be different from TokenB, and both shouldn't be address(0), no validations
     * @param tokenA address
     * @param tokenB address
     * @return sorted tokens
     */
    function sortTokens(address tokenA, address tokenB) internal pure returns (address, address) {
        return tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
    }

    /**
     * @notice Given an input amount of an asset and pair reserves, returns maximum output amount of the other asset
     * @dev Assumes swap fee is 0.30%
     * @param amountIn input asset
     * @param reserveIn size of input asset reserve
     * @param reserveOut size of output asset reserve
     * @return maximum output amount
     */
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint) {
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        return numerator.div(denominator);
    }

    /**
     * @notice Safely transfer using an anonymous ERC20 token
     * @dev Requires token to return true on transfer
     * @param token address
     * @param to recipient address
     * @param value amount
     */
    function safeTransfer(address token, address to, uint256 value) internal {
        require(IERC20(token).transfer(to, value), "DexLibrary::TRANSFER_FROM_FAILED");
    }
}

File 6 of 21 : CurveSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./SafeMath.sol";
import "./SafeERC20.sol";
import "./DexLibrary.sol";
import "../interfaces/IPair.sol";
import "../interfaces/ICurveCryptoSwap.sol";
import "../interfaces/ICurveStableSwap.sol";
import "../interfaces/ICurveStableSwapAave.sol";
import "../interfaces/ICurveBtcSwap.sol";
import "../interfaces/ICurveFactory4AssetsZap.sol";

library CurveSwap {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    enum PoolType {
        AAVE,
        CRYPTO,
        BTC,
        STABLE,
        FACTORY4
    }

    struct Settings {
        PoolType poolType;
        address swapPairRewardZap;
        address zapToken;
        address zapContract;
        uint256 zapTokenIndex;
        uint256 maxSlippage;
    }

    uint256 private constant BIPS_DIVISOR = 10000;

    function zapToAaveLP(
        uint256 amount,
        address rewardToken,
        address, /* depositToken */
        Settings memory zapSettings
    ) internal returns (uint256) {
        uint256 zapTokenAmount = DexLibrary.swap(
            amount,
            rewardToken,
            zapSettings.zapToken,
            IPair(zapSettings.swapPairRewardZap)
        );
        uint256[3] memory amounts = [uint256(0), uint256(0), uint256(0)];
        amounts[zapSettings.zapTokenIndex] = zapTokenAmount;
        uint256 expectedAmount = ICurveStableSwapAave(zapSettings.zapContract).calc_token_amount(amounts, true);
        uint256 slippage = expectedAmount.mul(zapSettings.maxSlippage).div(BIPS_DIVISOR);
        return ICurveStableSwapAave(zapSettings.zapContract).add_liquidity(amounts, expectedAmount.sub(slippage), true);
    }

    function zapToStableLP(
        uint256 amount,
        address rewardToken,
        address, /* depositToken */
        Settings memory zapSettings
    ) internal returns (uint256) {
        uint256 zapTokenAmount = DexLibrary.swap(
            amount,
            rewardToken,
            zapSettings.zapToken,
            IPair(zapSettings.swapPairRewardZap)
        );
        uint256[3] memory amounts = [uint256(0), uint256(0), uint256(0)];
        amounts[zapSettings.zapTokenIndex] = zapTokenAmount;
        uint256 expectedAmount = ICurveStableSwap(zapSettings.zapContract).calc_token_amount(amounts, true);
        uint256 slippage = expectedAmount.mul(zapSettings.maxSlippage).div(BIPS_DIVISOR);
        return ICurveStableSwap(zapSettings.zapContract).add_liquidity(amounts, expectedAmount.sub(slippage));
    }

    function zapToCryptoLP(
        uint256 amount,
        address rewardToken,
        address depositToken,
        Settings memory zapSettings
    ) internal returns (uint256) {
        uint256 zapTokenAmount = DexLibrary.swap(
            amount,
            rewardToken,
            zapSettings.zapToken,
            IPair(zapSettings.swapPairRewardZap)
        );
        uint256[5] memory amounts = [uint256(0), uint256(0), uint256(0), uint256(0), uint256(0)];
        amounts[zapSettings.zapTokenIndex] = zapTokenAmount;
        uint256 expectedAmount = ICurveCryptoSwap(zapSettings.zapContract).calc_token_amount(amounts, true);
        uint256 slippage = expectedAmount.mul(zapSettings.maxSlippage).div(BIPS_DIVISOR);
        ICurveCryptoSwap(zapSettings.zapContract).add_liquidity(amounts, expectedAmount.sub(slippage));
        return IERC20(depositToken).balanceOf(address(this));
    }

    function zapToTwoPoolLP(
        uint256 amount,
        address rewardToken,
        address depositToken,
        Settings memory zapSettings
    ) internal returns (uint256) {
        uint256 zapTokenAmount = DexLibrary.swap(
            amount,
            rewardToken,
            zapSettings.zapToken,
            IPair(zapSettings.swapPairRewardZap)
        );
        uint256[2] memory amounts = [uint256(0), uint256(0)];
        amounts[zapSettings.zapTokenIndex] = zapTokenAmount;
        uint256 expectedAmount = ICurveBtcSwap(zapSettings.zapContract).calc_token_amount(amounts, true);
        uint256 slippage = expectedAmount.mul(zapSettings.maxSlippage).div(BIPS_DIVISOR);
        ICurveBtcSwap(zapSettings.zapContract).add_liquidity(amounts, expectedAmount.sub(slippage), true);
        return IERC20(depositToken).balanceOf(address(this));
    }

    function zapToFactory4AssetsPoolLP(
        uint256 amount,
        address from,
        address to,
        Settings memory zapSettings
    ) internal returns (uint256) {
        if (from != zapSettings.zapToken) {
            amount = DexLibrary.swap(amount, from, zapSettings.zapToken, IPair(zapSettings.swapPairRewardZap));
        }
        uint256[4] memory amounts = [uint256(0), uint256(0), uint256(0), uint256(0)];
        amounts[zapSettings.zapTokenIndex] = amount;
        uint256 expectedAmount = ICurveFactory4AssetsZap(zapSettings.zapContract).calc_token_amount(to, amounts, true);
        uint256 slippage = expectedAmount.mul(zapSettings.maxSlippage).div(BIPS_DIVISOR);
        ICurveFactory4AssetsZap(zapSettings.zapContract).add_liquidity(to, amounts, expectedAmount.sub(slippage));
        return IERC20(to).balanceOf(address(this));
    }

    function setZap(Settings memory zapSettings)
        internal
        view
        returns (function(uint256, address, address, Settings memory) returns (uint256))
    {
        function(uint256, address, address, Settings memory) returns (uint256) zapFunction;
        if (zapSettings.poolType == CurveSwap.PoolType.AAVE) {
            require(
                zapSettings.zapToken ==
                    ICurveStableSwap(zapSettings.zapContract).underlying_coins(zapSettings.zapTokenIndex),
                "Wrong zap token index"
            );
            zapFunction = zapToAaveLP;
        } else if (zapSettings.poolType == CurveSwap.PoolType.CRYPTO) {
            require(
                zapSettings.zapToken ==
                    ICurveCryptoSwap(zapSettings.zapContract).underlying_coins(zapSettings.zapTokenIndex),
                "Wrong zap token index"
            );
            zapFunction = zapToCryptoLP;
        } else if (zapSettings.poolType == CurveSwap.PoolType.BTC) {
            require(
                zapSettings.zapToken ==
                    ICurveBtcSwap(zapSettings.zapContract).underlying_coins(zapSettings.zapTokenIndex),
                "Wrong zap token index"
            );
            zapFunction = zapToTwoPoolLP;
        }
        return zapFunction;
    }
}

File 7 of 21 : MasterChefStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "../YakStrategyV2.sol";
import "../interfaces/IPair.sol";
import "../lib/DexLibrary.sol";

/**
 * @notice Adapter strategy for MasterChef.
 */
abstract contract MasterChefStrategy is YakStrategyV2 {
    using SafeMath for uint256;

    IWAVAX private constant WAVAX = IWAVAX(0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7);

    struct StrategySettings {
        uint256 minTokensToReinvest;
        uint256 adminFeeBips;
        uint256 devFeeBips;
        uint256 reinvestRewardBips;
    }

    uint256 public immutable PID;
    address private poolRewardToken;
    IPair private swapPairPoolReward;
    address public swapPairExtraReward;
    address public extraToken;

    constructor(
        string memory _name,
        address _depositToken,
        address _ecosystemToken,
        address _poolRewardToken,
        address _swapPairPoolReward,
        address _swapPairExtraReward,
        address _timelock,
        uint256 _pid,
        StrategySettings memory _strategySettings
    ) {
        name = _name;
        depositToken = IERC20(_depositToken);
        rewardToken = IERC20(_ecosystemToken);
        PID = _pid;
        devAddr = 0x2D580F9CF2fB2D09BC411532988F2aFdA4E7BefF;

        assignSwapPairSafely(_ecosystemToken, _poolRewardToken, _swapPairPoolReward);
        _setExtraRewardSwapPair(_swapPairExtraReward);
        updateMinTokensToReinvest(_strategySettings.minTokensToReinvest);
        updateAdminFee(_strategySettings.adminFeeBips);
        updateDevFee(_strategySettings.devFeeBips);
        updateReinvestReward(_strategySettings.reinvestRewardBips);
        updateDepositsEnabled(true);
        transferOwnership(_timelock);
        emit Reinvest(0, 0);
    }

    /**
     * @notice Initialization helper for Pair deposit tokens
     * @dev Checks that selected Pairs are valid for trading reward tokens
     * @dev Assigns values to IPair(swapPairToken0) and IPair(swapPairToken1)
     */
    function assignSwapPairSafely(
        address _ecosystemToken,
        address _poolRewardToken,
        address _swapPairPoolReward
    ) private {
        if (_poolRewardToken != _ecosystemToken) {
            if (_poolRewardToken == IPair(_swapPairPoolReward).token0()) {
                require(
                    IPair(_swapPairPoolReward).token1() == _ecosystemToken,
                    "Swap pair 'swapPairPoolReward' does not contain ecosystem token"
                );
            } else if (_poolRewardToken == IPair(_swapPairPoolReward).token1()) {
                require(
                    IPair(_swapPairPoolReward).token0() == _ecosystemToken,
                    "Swap pair 'swapPairPoolReward' does not contain ecosystem token"
                );
            } else {
                revert("Swap pair 'swapPairPoolReward' does not contain pool reward token");
            }
        }
        poolRewardToken = _poolRewardToken;
        swapPairPoolReward = IPair(_swapPairPoolReward);
    }

    /**
     * @notice Approve tokens for use in Strategy
     * @dev Deprecated; approvals should be handled in context of staking
     */
    function setAllowances() public override onlyOwner {
        revert("setAllowances::deprecated");
    }

    function setExtraRewardSwapPair(address _extraTokenSwapPair) external onlyDev {
        _setExtraRewardSwapPair(_extraTokenSwapPair);
    }

    function _setExtraRewardSwapPair(address _extraTokenSwapPair) internal {
        if (_extraTokenSwapPair > address(0)) {
            if (IPair(_extraTokenSwapPair).token0() == address(rewardToken)) {
                extraToken = IPair(_extraTokenSwapPair).token1();
            } else {
                extraToken = IPair(_extraTokenSwapPair).token0();
            }
            swapPairExtraReward = _extraTokenSwapPair;
        } else {
            swapPairExtraReward = address(0);
            extraToken = address(0);
        }
    }

    /**
     * @notice Deposit tokens to receive receipt tokens
     * @param amount Amount of tokens to deposit
     */
    function deposit(uint256 amount) external override {
        _deposit(msg.sender, amount);
    }

    /**
     * @notice Deposit using Permit
     * @param amount Amount of tokens to deposit
     * @param deadline The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function depositWithPermit(
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external override {
        depositToken.permit(msg.sender, address(this), amount, deadline, v, r, s);
        _deposit(msg.sender, amount);
    }

    function depositFor(address account, uint256 amount) external override {
        _deposit(account, amount);
    }

    function _deposit(address account, uint256 amount) internal {
        require(DEPOSITS_ENABLED == true, "MasterChefStrategyV1::_deposit");
        if (MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST > 0) {
            (
                uint256 poolTokenAmount,
                uint256 extraTokenAmount,
                uint256 rewardTokenBalance,
                uint256 estimatedTotalReward
            ) = _checkReward();
            if (estimatedTotalReward > MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST) {
                _reinvest(rewardTokenBalance, poolTokenAmount, extraTokenAmount);
            }
        }
        require(
            depositToken.transferFrom(msg.sender, address(this), amount),
            "MasterChefStrategyV1::transfer failed"
        );
        uint256 depositFeeBips = _getDepositFeeBips(PID);
        uint256 depositFee = amount.mul(depositFeeBips).div(_bip());
        _mint(account, getSharesForDepositTokens(amount.sub(depositFee)));
        _stakeDepositTokens(amount);
        emit Deposit(account, amount);
    }

    function withdraw(uint256 amount) external override {
        uint256 depositTokenAmount = getDepositTokensForShares(amount);
        require(depositTokenAmount > 0, "MasterChefStrategyV1::withdraw");
        _withdrawDepositTokens(depositTokenAmount);
        uint256 withdrawFeeBips = _getWithdrawFeeBips(PID);
        uint256 withdrawFee = depositTokenAmount.mul(withdrawFeeBips).div(_bip());
        _safeTransfer(
            address(depositToken),
            msg.sender,
            depositTokenAmount.sub(withdrawFee)
        );
        _burn(msg.sender, amount);
        emit Withdraw(msg.sender, depositTokenAmount);
    }

    function _withdrawDepositTokens(uint256 amount) private {
        _withdrawMasterchef(PID, amount);
    }

    function reinvest() external override onlyEOA {
        (
            uint256 poolTokenAmount,
            uint256 extraTokenAmount,
            uint256 rewardTokenBalance,
            uint256 estimatedTotalReward
        ) = _checkReward();
        require(
            estimatedTotalReward >= MIN_TOKENS_TO_REINVEST,
            "MasterChefStrategyV1::reinvest"
        );
        _reinvest(rewardTokenBalance, poolTokenAmount, extraTokenAmount);
    }

    function _convertPoolTokensIntoReward(uint256 poolTokenAmount)
        private
        returns (uint256)
    {
        if (address(rewardToken) == poolRewardToken) {
            return poolTokenAmount;
        }
        return
            DexLibrary.swap(
                poolTokenAmount,
                address(poolRewardToken),
                address(rewardToken),
                swapPairPoolReward
            );
    }

    function _convertExtraTokensIntoReward(
        uint256 rewardTokenBalance,
        uint256 extraTokenAmount
    ) internal returns (uint256) {
        if (extraTokenAmount > 0) {
            if (swapPairExtraReward > address(0)) {
                return
                    DexLibrary.swap(
                        extraTokenAmount,
                        extraToken,
                        address(rewardToken),
                        IPair(swapPairExtraReward)
                    );
            }

            uint256 avaxBalance = address(this).balance;
            if (avaxBalance > 0) {
                WAVAX.deposit{value: avaxBalance}();
            }
            return WAVAX.balanceOf(address(this)).sub(rewardTokenBalance);
        }
        return 0;
    }

    /**
     * @notice Reinvest rewards from staking contract to deposit tokens
     * @dev Reverts if the expected amount of tokens are not returned from `MasterChef`
     */
    function _reinvest(
        uint256 rewardTokenBalance,
        uint256 poolTokenAmount,
        uint256 extraTokenAmount
    ) private {
        _getRewards(PID);
        uint256 amount = rewardTokenBalance.add(
            _convertPoolTokensIntoReward(poolTokenAmount)
        );
        amount.add(_convertExtraTokensIntoReward(rewardTokenBalance, extraTokenAmount));

        uint256 devFee = amount.mul(DEV_FEE_BIPS).div(BIPS_DIVISOR);
        if (devFee > 0) {
            _safeTransfer(address(rewardToken), devAddr, devFee);
        }

        uint256 reinvestFee = amount.mul(REINVEST_REWARD_BIPS).div(BIPS_DIVISOR);
        if (reinvestFee > 0) {
            _safeTransfer(address(rewardToken), msg.sender, reinvestFee);
        }

        uint256 depositTokenAmount = _convertRewardTokenToDepositToken(amount.sub(devFee).sub(reinvestFee));

        _stakeDepositTokens(depositTokenAmount);
        emit Reinvest(totalDeposits(), totalSupply);
    }

    function _stakeDepositTokens(uint256 amount) private {
        require(amount > 0, "MasterChefStrategyV1::_stakeDepositTokens");
        _depositMasterchef(PID, amount);
    }

    /**
     * @notice Safely transfer using an anonymous ERC20 token
     * @dev Requires token to return true on transfer
     * @param token address
     * @param to recipient address
     * @param value amount
     */
    function _safeTransfer(
        address token,
        address to,
        uint256 value
    ) private {
        require(
            IERC20(token).transfer(to, value),
            "MasterChefStrategyV1::TRANSFER_FROM_FAILED"
        );
    }

    function _checkReward()
        internal
        view
        returns (
            uint256 _poolTokenAmount,
            uint256 _extraTokenAmount,
            uint256 _rewardTokenBalance,
            uint256 _estimatedTotalReward
        )
    {
        uint256 poolTokenBalance = IERC20(poolRewardToken).balanceOf(address(this));
        (
            uint256 pendingPoolTokenAmount,
            uint256 pendingExtraTokenAmount,
            address extraTokenAddress
        ) = _pendingRewards(PID, address(this));
        uint256 poolTokenAmount = poolTokenBalance.add(pendingPoolTokenAmount);

        uint256 pendingRewardTokenAmount = poolRewardToken != address(rewardToken)
            ? DexLibrary.estimateConversionThroughPair(
                poolTokenAmount,
                poolRewardToken,
                address(rewardToken),
                swapPairPoolReward
            )
            : pendingPoolTokenAmount;
        uint256 pendingExtraTokenRewardAmount = 0;
        if (extraTokenAddress > address(0)) {
            if (extraTokenAddress == address(WAVAX)) {
                pendingExtraTokenRewardAmount = pendingExtraTokenAmount;
            } else if (swapPairExtraReward > address(0)) {
                pendingExtraTokenAmount = pendingExtraTokenAmount.add(IERC20(extraToken).balanceOf(address(this)));
                pendingExtraTokenRewardAmount = DexLibrary.estimateConversionThroughPair(
                        pendingExtraTokenAmount,
                        extraTokenAddress,
                        address(rewardToken),
                        IPair(swapPairExtraReward)
                    );
            }
        }
        uint256 rewardTokenBalance = rewardToken.balanceOf(address(this)).add(
            pendingExtraTokenRewardAmount
        );
        uint256 estimatedTotalReward = rewardTokenBalance.add(pendingRewardTokenAmount);
        return (
            poolTokenAmount,
            pendingExtraTokenAmount,
            rewardTokenBalance,
            estimatedTotalReward
        );
    }

    function checkReward() public view override returns (uint256) {
        (, , , uint256 estimatedTotalReward) = _checkReward();
        return estimatedTotalReward;
    }

    /**
     * @notice Estimate recoverable balance after withdraw fee
     * @return deposit tokens after withdraw fee
     */
    function estimateDeployedBalance() external view override returns (uint256) {
        uint256 depositBalance = totalDeposits();
        uint256 withdrawFeeBips = _getWithdrawFeeBips(PID);
        uint256 withdrawFee = depositBalance.mul(withdrawFeeBips).div(_bip());
        return depositBalance.sub(withdrawFee);
    }

    function totalDeposits() public view override returns (uint256) {
        uint256 depositBalance = _getDepositBalance(PID, address(this));
        return depositBalance;
    }

    function rescueDeployedFunds(uint256 minReturnAmountAccepted, bool disableDeposits)
        external
        override
        onlyOwner
    {
        uint256 balanceBefore = depositToken.balanceOf(address(this));
        _emergencyWithdraw(PID);
        uint256 balanceAfter = depositToken.balanceOf(address(this));
        require(
            balanceAfter.sub(balanceBefore) >= minReturnAmountAccepted,
            "MasterChefStrategyV1::rescueDeployedFunds"
        );
        emit Reinvest(totalDeposits(), totalSupply);
        if (DEPOSITS_ENABLED == true && disableDeposits == true) {
            updateDepositsEnabled(false);
        }
    }

    /* VIRTUAL */
    function _convertRewardTokenToDepositToken(uint256 fromAmount)
        internal
        virtual
        returns (uint256 toAmount);

    function _depositMasterchef(uint256 pid, uint256 amount) internal virtual;

    function _withdrawMasterchef(uint256 pid, uint256 amount) internal virtual;

    function _emergencyWithdraw(uint256 pid) internal virtual;

    function _getRewards(uint256 pid) internal virtual;

    function _pendingRewards(uint256 pid, address user)
        internal
        view
        virtual
        returns (
            uint256 poolTokenAmount,
            uint256 extraTokenAmount,
            address extraTokenAddress
        );

    function _getDepositBalance(uint256 pid, address user)
        internal
        view
        virtual
        returns (uint256 amount);

    function _getDepositFeeBips(uint256 pid) internal view virtual returns (uint256);

    function _getWithdrawFeeBips(uint256 pid) internal view virtual returns (uint256);

    function _bip() internal view virtual returns (uint256);
}

File 8 of 21 : SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.

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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, errorMessage);

        return c;
    }

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

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

        return c;
    }

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

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

File 9 of 21 : IWAVAX.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface IWAVAX {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function balanceOf(address owner) external view returns (uint); 
    function withdraw(uint) external;
    function approve(address to, uint value) external returns (bool);
}

File 10 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../interfaces/IERC20.sol";
import "./SafeMath.sol";
import "./Address.sol";

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

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

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

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

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

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

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

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

File 11 of 21 : ICurveCryptoSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface ICurveCryptoSwap {
    function calc_token_amount(uint256[5] memory _amounts, bool _is_deposit)
        external
        view
        returns (uint256);

    function add_liquidity(uint256[5] memory _amounts, uint256 _min_mint_amount)
        external;

    function underlying_coins(uint256 index) external view returns (address);
}

File 12 of 21 : ICurveStableSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface ICurveStableSwap {
    function calc_token_amount(uint256[3] memory _amounts, bool _is_deposit) external view returns (uint256);

    function add_liquidity(uint256[3] memory _amounts, uint256 _min_mint_amount) external returns (uint256);

    function underlying_coins(uint256 index) external view returns (address);
}

File 13 of 21 : ICurveStableSwapAave.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface ICurveStableSwapAave {
    function calc_token_amount(uint256[3] memory _amounts, bool _is_deposit) external view returns(uint);
    function add_liquidity(uint256[3] memory _amounts, uint256 _min_mint_amount, bool _use_underlying) external returns(uint);
    function underlying_coins(uint index) external view returns(address);
}

File 14 of 21 : ICurveBtcSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface ICurveBtcSwap {
    function calc_token_amount(uint256[2] memory _amounts, bool _is_deposit)
        external
        view
        returns (uint256);

    function add_liquidity(
        uint256[2] memory _amounts,
        uint256 _min_mint_amount,
        bool _use_underlying
    ) external;

    function underlying_coins(uint256 index) external view returns (address);
}

File 15 of 21 : ICurveFactory4AssetsZap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

interface ICurveFactory4AssetsZap {
    function calc_token_amount(
        address _pool,
        uint256[4] memory _amounts,
        bool _is_deposit
    ) external view returns (uint256);

    function add_liquidity(
        address _pool,
        uint256[4] memory _amounts,
        uint256 _min_mint_amount
    ) external;
}

File 16 of 21 : 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);
            }
        }
    }
}

File 17 of 21 : YakStrategyV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./lib/SafeMath.sol";
import "./lib/Ownable.sol";
import "./lib/Permissioned.sol";
import "./interfaces/IERC20.sol";
import "./YakERC20.sol";

/**
 * @notice YakStrategy should be inherited by new strategies
 */
abstract contract YakStrategyV2 is YakERC20, Ownable, Permissioned {
    using SafeMath for uint;


    IERC20 public depositToken;
    IERC20 public rewardToken;
    address public devAddr;

    uint public MIN_TOKENS_TO_REINVEST;
    uint public MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST;
    bool public DEPOSITS_ENABLED;

    uint public REINVEST_REWARD_BIPS;
    uint public ADMIN_FEE_BIPS;
    uint public DEV_FEE_BIPS;

    uint constant internal BIPS_DIVISOR = 10000;
    uint constant internal MAX_UINT = uint(-1);

    event Deposit(address indexed account, uint amount);
    event Withdraw(address indexed account, uint amount);
    event Reinvest(uint newTotalDeposits, uint newTotalSupply);
    event Recovered(address token, uint amount);
    event UpdateAdminFee(uint oldValue, uint newValue);
    event UpdateDevFee(uint oldValue, uint newValue);
    event UpdateReinvestReward(uint oldValue, uint newValue);
    event UpdateMinTokensToReinvest(uint oldValue, uint newValue);
    event UpdateMaxTokensToDepositWithoutReinvest(uint oldValue, uint newValue);
    event UpdateDevAddr(address oldValue, address newValue);
    event DepositsEnabled(bool newValue);

    /**
     * @notice Throws if called by smart contract
     */
    modifier onlyEOA() {
        require(tx.origin == msg.sender, "YakStrategy::onlyEOA");
        _;
    }

    /**
     * @notice Only called by dev
     */
    modifier onlyDev() {
        require(msg.sender == devAddr, "YakStrategy::onlyDev");
        _;
    }

    /**
     * @notice Approve tokens for use in Strategy
     * @dev Should use modifier `onlyOwner` to avoid griefing
     */
    function setAllowances() public virtual;

    /**
     * @notice Revoke token allowance
     * @param token address
     * @param spender address
     */
    function revokeAllowance(address token, address spender) external onlyOwner {
        require(IERC20(token).approve(spender, 0));
    }

    /**
     * @notice Deposit and deploy deposits tokens to the strategy
     * @dev Must mint receipt tokens to `msg.sender`
     * @param amount deposit tokens
     */
    function deposit(uint amount) external virtual;

    /**
    * @notice Deposit using Permit
    * @dev Should revert for tokens without Permit
    * @param amount Amount of tokens to deposit
    * @param deadline The time at which to expire the signature
    * @param v The recovery byte of the signature
    * @param r Half of the ECDSA signature pair
    * @param s Half of the ECDSA signature pair
    */
    function depositWithPermit(uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external virtual;

    /**
     * @notice Deposit on behalf of another account
     * @dev Must mint receipt tokens to `account`
     * @param account address to receive receipt tokens
     * @param amount deposit tokens
     */
    function depositFor(address account, uint amount) external virtual;

    /**
     * @notice Redeem receipt tokens for deposit tokens
     * @param amount receipt tokens
     */
    function withdraw(uint amount) external virtual;

    /**
     * @notice Reinvest reward tokens into deposit tokens
     */
    function reinvest() external virtual;

    /**
     * @notice Estimate reinvest reward
     * @return reward tokens
     */
    function estimateReinvestReward() external view returns (uint) {
        uint unclaimedRewards = checkReward();
        if (unclaimedRewards >= MIN_TOKENS_TO_REINVEST) {
            return unclaimedRewards.mul(REINVEST_REWARD_BIPS).div(BIPS_DIVISOR);
        }
        return 0;
    }

    /**
     * @notice Reward tokens avialable to strategy, including balance
     * @return reward tokens
     */
    function checkReward() public virtual view returns (uint);

    /**
     * @notice Estimated deposit token balance deployed by strategy, excluding balance
     * @return deposit tokens
     */
    function estimateDeployedBalance() external virtual view returns (uint);

    /**
     * @notice Rescue all available deployed deposit tokens back to Strategy
     * @param minReturnAmountAccepted min deposit tokens to receive
     * @param disableDeposits bool
     */
    function rescueDeployedFunds(uint minReturnAmountAccepted, bool disableDeposits) external virtual;

    /**
     * @notice This function returns a snapshot of last available quotes
     * @return total deposits available on the contract
     */
    function totalDeposits() public virtual view returns (uint);
    /**
     * @notice Calculate receipt tokens for a given amount of deposit tokens
     * @dev If contract is empty, use 1:1 ratio
     * @dev Could return zero shares for very low amounts of deposit tokens
     * @param amount deposit tokens
     * @return receipt tokens
     */
    function getSharesForDepositTokens(uint amount) public view returns (uint) {
        if (totalSupply.mul(totalDeposits()) == 0) {
            return amount;
        }
        return amount.mul(totalSupply).div(totalDeposits());
    }

    /**
     * @notice Calculate deposit tokens for a given amount of receipt tokens
     * @param amount receipt tokens
     * @return deposit tokens
     */
    function getDepositTokensForShares(uint amount) public view returns (uint) {
        if (totalSupply.mul(totalDeposits()) == 0) {
            return 0;
        }
        return amount.mul(totalDeposits()).div(totalSupply);
    }

    /**
     * @notice Update reinvest min threshold
     * @param newValue threshold
     */
    function updateMinTokensToReinvest(uint newValue) public onlyOwner {
        emit UpdateMinTokensToReinvest(MIN_TOKENS_TO_REINVEST, newValue);
        MIN_TOKENS_TO_REINVEST = newValue;
    }

    /**
     * @notice Update reinvest max threshold before a deposit
     * @param newValue threshold
     */
    function updateMaxTokensToDepositWithoutReinvest(uint newValue) public onlyOwner {
        emit UpdateMaxTokensToDepositWithoutReinvest(MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST, newValue);
        MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST = newValue;
    }

    /**
     * @notice Update developer fee
     * @param newValue fee in BIPS
     */
    function updateDevFee(uint newValue) public onlyOwner {
        require(newValue.add(ADMIN_FEE_BIPS).add(REINVEST_REWARD_BIPS) <= BIPS_DIVISOR);
        emit UpdateDevFee(DEV_FEE_BIPS, newValue);
        DEV_FEE_BIPS = newValue;
    }

    /**
     * @notice Update admin fee
     * @param newValue fee in BIPS
     */
    function updateAdminFee(uint newValue) public onlyOwner {
        require(newValue.add(DEV_FEE_BIPS).add(REINVEST_REWARD_BIPS) <= BIPS_DIVISOR);
        emit UpdateAdminFee(ADMIN_FEE_BIPS, newValue);
        ADMIN_FEE_BIPS = newValue;
    }

    /**
     * @notice Update reinvest reward
     * @param newValue fee in BIPS
     */
    function updateReinvestReward(uint newValue) public onlyOwner {
        require(newValue.add(ADMIN_FEE_BIPS).add(DEV_FEE_BIPS) <= BIPS_DIVISOR);
        emit UpdateReinvestReward(REINVEST_REWARD_BIPS, newValue);
        REINVEST_REWARD_BIPS = newValue;
    }

    /**
     * @notice Enable/disable deposits
     * @param newValue bool
     */
    function updateDepositsEnabled(bool newValue) public onlyOwner {
        require(DEPOSITS_ENABLED != newValue);
        DEPOSITS_ENABLED = newValue;
        emit DepositsEnabled(newValue);
    }

    /**
     * @notice Update devAddr
     * @param newValue address
     */
    function updateDevAddr(address newValue) public onlyDev {
        emit UpdateDevAddr(devAddr, newValue);
        devAddr = newValue;
    }

    /**
     * @notice Recover ERC20 from contract
     * @param tokenAddress token address
     * @param tokenAmount amount to recover
     */
    function recoverERC20(address tokenAddress, uint tokenAmount) external onlyOwner {
        require(tokenAmount > 0);
        require(IERC20(tokenAddress).transfer(msg.sender, tokenAmount));
        emit Recovered(tokenAddress, tokenAmount);
    }

    /**
     * @notice Recover AVAX from contract
     * @param amount amount
     */
    function recoverAVAX(uint amount) external onlyOwner {
        require(amount > 0);
        msg.sender.transfer(amount);
        emit Recovered(address(0), amount);
    }
}

File 18 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./Context.sol";

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

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

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

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

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

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

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

File 19 of 21 : Permissioned.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

import "./Ownable.sol";
import "./SafeMath.sol";

abstract contract Permissioned is Ownable {
    using SafeMath for uint;

    uint public numberOfAllowedDepositors;
    mapping(address => bool) public allowedDepositors;

    event AllowDepositor(address indexed account);
    event RemoveDepositor(address indexed account);

    modifier onlyAllowedDeposits() {
        if (numberOfAllowedDepositors > 0) {
            require(allowedDepositors[msg.sender] == true, "Permissioned::onlyAllowedDeposits, not allowed");
        }
        _;
    }

    /**
     * @notice Add an allowed depositor
     * @param depositor address
     */
    function allowDepositor(address depositor) external onlyOwner {
        require(allowedDepositors[depositor] == false, "Permissioned::allowDepositor");
        allowedDepositors[depositor] = true;
        numberOfAllowedDepositors = numberOfAllowedDepositors.add(1);
        emit AllowDepositor(depositor);
    }

    /**
     * @notice Remove an allowed depositor
     * @param depositor address
     */
    function removeDepositor(address depositor) external onlyOwner {
        require(numberOfAllowedDepositors > 0, "Permissioned::removeDepositor, no allowed depositors");
        require(allowedDepositors[depositor] == true, "Permissioned::removeDepositor, not allowed");
        allowedDepositors[depositor] = false;
        numberOfAllowedDepositors = numberOfAllowedDepositors.sub(1);
        emit RemoveDepositor(depositor);
    }
}

File 20 of 21 : YakERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
pragma experimental ABIEncoderV2;

import "./lib/SafeMath.sol";
import "./interfaces/IERC20.sol";

abstract contract YakERC20 {
    using SafeMath for uint256;

    string public name = "Yield Yak";
    string public symbol = "YRT";
    uint8 public constant decimals = 18;
    uint256 public totalSupply;
  
    mapping (address => mapping (address => uint256)) internal allowances;
    mapping (address => uint256) internal balances;

    /// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
    bytes32 public constant DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;

    /// @dev keccak256("1");
    bytes32 public constant VERSION_HASH = 0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;

    /// @dev keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

    mapping(address => uint) public nonces;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    constructor() {}

    /**
     * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
     * @param account The address of the account holding the funds
     * @param spender The address of the account spending the funds
     * @return The number of tokens approved
     */
    function allowance(address account, address spender) external view returns (uint) {
        return allowances[account][spender];
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * It is recommended to use increaseAllowance and decreaseAllowance instead
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (2^256-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    /**
     * @notice Get the number of tokens held by the `account`
     * @param account The address of the account to get the balance of
     * @return The number of tokens held
     */
    function balanceOf(address account) external view returns (uint) {
        return balances[account];
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint256 amount) external returns (bool) {
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(address src, address dst, uint256 amount) external returns (bool) {
        address spender = msg.sender;
        uint256 spenderAllowance = allowances[src][spender];

        if (spender != src && spenderAllowance != uint256(-1)) {
            uint256 newAllowance = spenderAllowance.sub(amount, "transferFrom: transfer amount exceeds allowance");
            allowances[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }


    /**
     * @notice Approval implementation
     * @param owner The address of the account which owns tokens
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (2^256-1 means infinite)
     */
    function _approve(address owner, address spender, uint256 amount) internal {
        require(owner != address(0), "_approve::owner zero address");
        require(spender != address(0), "_approve::spender zero address");
        allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @notice Transfer implementation
     * @param from The address of the account which owns tokens
     * @param to The address of the account which is receiving tokens
     * @param value The number of tokens that are being transferred
     */
    function _transferTokens(address from, address to, uint256 value) internal {
        require(to != address(0), "_transferTokens: cannot transfer to the zero address");

        balances[from] = balances[from].sub(value, "_transferTokens: transfer exceeds from balance");
        balances[to] = balances[to].add(value);
        emit Transfer(from, to, value);
    }

    function _mint(address to, uint256 value) internal {
        totalSupply = totalSupply.add(value);
        balances[to] = balances[to].add(value);
        emit Transfer(address(0), to, value);
    }

    function _burn(address from, uint256 value) internal {
        balances[from] = balances[from].sub(value, "_burn: burn amount exceeds from balance");
        totalSupply = totalSupply.sub(value, "_burn: burn amount exceeds total supply");
        emit Transfer(from, address(0), value);
    }

    /**
     * @notice Triggers an approval from owner to spender
     * @param owner The address to approve from
     * @param spender The address to be approved
     * @param value The number of tokens that are approved (2^256-1 means infinite)
     * @param deadline The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
        require(deadline >= block.timestamp, "permit::expired");

        bytes32 encodeData = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline));
        _validateSignedData(owner, encodeData, v, r, s);

        _approve(owner, spender, value);
    }

    /**
     * @notice Recovers address from signed data and validates the signature
     * @param signer Address that signed the data
     * @param encodeData Data signed by the address
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function _validateSignedData(address signer, bytes32 encodeData, uint8 v, bytes32 r, bytes32 s) internal view {
        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                getDomainSeparator(),
                encodeData
            )
        );
        address recoveredAddress = ecrecover(digest, v, r, s);
        // Explicitly disallow authorizations for address(0) as ecrecover returns address(0) on malformed messages
        require(recoveredAddress != address(0) && recoveredAddress == signer, "Arch::validateSig: invalid signature");
    }

    /**
     * @notice EIP-712 Domain separator
     * @return Separator
     */
    function getDomainSeparator() public view returns (bytes32) {
        return keccak256(
            abi.encode(
                DOMAIN_TYPEHASH,
                keccak256(bytes(name)),
                VERSION_HASH,
                _getChainId(),
                address(this)
            )
        );
    }

    /**
     * @notice Current id of the chain where this contract is deployed
     * @return Chain id
     */
    function _getChainId() internal pure returns (uint) {
        uint256 chainId;
        assembly { chainId := chainid() }
        return chainId;
    }
}

File 21 of 21 : Context.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"address","name":"_poolRewardToken","type":"address"},{"internalType":"address","name":"_swapPairPoolReward","type":"address"},{"internalType":"address","name":"_stakingContract","type":"address"},{"components":[{"internalType":"enum CurveSwap.PoolType","name":"poolType","type":"uint8"},{"internalType":"address","name":"swapPairRewardZap","type":"address"},{"internalType":"address","name":"zapToken","type":"address"},{"internalType":"address","name":"zapContract","type":"address"},{"internalType":"uint256","name":"zapTokenIndex","type":"uint256"},{"internalType":"uint256","name":"maxSlippage","type":"uint256"}],"internalType":"struct CurveSwap.Settings","name":"_curveSwapSettings","type":"tuple"},{"internalType":"address","name":"_timelock","type":"address"},{"components":[{"internalType":"uint256","name":"minTokensToReinvest","type":"uint256"},{"internalType":"uint256","name":"adminFeeBips","type":"uint256"},{"internalType":"uint256","name":"devFeeBips","type":"uint256"},{"internalType":"uint256","name":"reinvestRewardBips","type":"uint256"}],"internalType":"struct MasterChefStrategy.StrategySettings","name":"_strategySettings","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AllowDepositor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"newValue","type":"bool"}],"name":"DepositsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTotalDeposits","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalSupply","type":"uint256"}],"name":"Reinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"RemoveDepositor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdateAdminFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"UpdateDevAddr","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdateDevFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdateMaxTokensToDepositWithoutReinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdateMinTokensToReinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdateReinvestReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ADMIN_FEE_BIPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITS_ENABLED","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEV_FEE_BIPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TOKENS_TO_REINVEST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REINVEST_REWARD_BIPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"}],"name":"allowDepositor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedDepositors","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"estimateDeployedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"estimateReinvestReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getDepositTokensForShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getSharesForDepositTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfAllowedDepositors","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverAVAX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"}],"name":"removeDepositor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minReturnAmountAccepted","type":"uint256"},{"internalType":"bool","name":"disableDeposits","type":"bool"}],"name":"rescueDeployedFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"revokeAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setAllowances","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_extraTokenSwapPair","type":"address"}],"name":"setExtraRewardSwapPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSlippageBips","type":"uint256"}],"name":"setMaxSlippageBips","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingContract","outputs":[{"internalType":"contract IMoreMoneyStakingRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapPairExtraReward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateAdminFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newValue","type":"bool"}],"name":"updateDepositsEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newValue","type":"address"}],"name":"updateDevAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateDevFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateMaxTokensToDepositWithoutReinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateMinTokensToReinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateReinvestReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e0604052600960a0819052685969656c642059616b60b81b60c09081526200002c916000919062000c8a565b506040805180820190915260038082526216549560ea1b6020909201918252620000599160019162000c8a565b503480156200006757600080fd5b50604051620058a9380380620058a98339810160408190526200008a9162000e7f565b878773b31f66aa3c1e785363f0875a1b74e27b85fd66c78888600087818881620000b36200038b565b600680546001600160a01b0319166001600160a01b0383169081179091556040519192509060009060008051602062005889833981519152908290a3508851620001059060009060208c019062000c8a565b50600980546001600160a01b03808b166001600160a01b031992831617909255600a8054928a16928216929092179091556080839052600b8054909116732d580f9cf2fb2d09bc411532988f2afda4e7beff179055620001678787876200038f565b62000172846200060b565b80516200017f9062000820565b60208101516200018f90620008a8565b60408101516200019f9062000976565b6060810151620001af9062000a30565b620001bb600162000aea565b620001c68362000b92565b7fc7606d21ac05cd309191543e409f0845c016120563783d70e4f41419dc0ef234600080604051620001fa92919062000fdb565b60405180910390a150505050505050505083601c60006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086601b60006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082601660008201518160000160006101000a81548160ff021916908360048111156200028157fe5b0217905550602082015181546001600160a01b0391821661010002610100600160a81b03199091161782556040808401516001840180549184166001600160a01b03199283161790556060850151600285018054918516919092161790556080840151600384015560a090930151600492830155601754601854935163095ea7b360e01b81529082169363095ea7b39362000326939190911691600019910162000fb7565b602060405180830381600087803b1580156200034157600080fd5b505af115801562000356573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200037c919062000e5d565b50505050505050505062001161565b3390565b826001600160a01b0316826001600160a01b031614620005dc57806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620003e357600080fd5b505afa158015620003f8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041e919062000e40565b6001600160a01b0316826001600160a01b03161415620004ef57826001600160a01b0316816001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200047c57600080fd5b505afa15801562000491573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004b7919062000e40565b6001600160a01b031614620004e95760405162461bcd60e51b8152600401620004e090620010bc565b60405180910390fd5b620005dc565b806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200052957600080fd5b505afa1580156200053e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000564919062000e40565b6001600160a01b0316826001600160a01b03161415620005c257826001600160a01b0316816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156200047c57600080fd5b60405162461bcd60e51b8152600401620004e09062001066565b601280546001600160a01b039384166001600160a01b0319918216179091556013805492909316911617905550565b6001600160a01b038116156200080057600a5460408051630dfe168160e01b815290516001600160a01b0392831692841691630dfe1681916004808301926020929190829003018186803b1580156200066357600080fd5b505afa15801562000678573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200069e919062000e40565b6001600160a01b031614156200074957806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015620006e857600080fd5b505afa158015620006fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000723919062000e40565b601580546001600160a01b0319166001600160a01b0392909216919091179055620007df565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156200078357600080fd5b505afa15801562000798573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007be919062000e40565b601580546001600160a01b0319166001600160a01b03929092169190911790555b601480546001600160a01b0319166001600160a01b0383161790556200081d565b601480546001600160a01b03199081169091556015805490911690555b50565b6200082a6200038b565b6001600160a01b03166200083d62000c4c565b6001600160a01b031614620008665760405162461bcd60e51b8152600401620004e09062001108565b7f481f79ac3a523b6d6db3c5a720e190e986d1cc1b41adcdf50f9caef849901100600c54826040516200089b92919062000fdb565b60405180910390a1600c55565b620008b26200038b565b6001600160a01b0316620008c562000c4c565b6001600160a01b031614620008ee5760405162461bcd60e51b8152600401620004e09062001108565b61271062000928600f54620009146011548562000c5b60201b62001c091790919060201c565b62000c5b60201b62001c091790919060201c565b11156200093457600080fd5b7f3cc372f330f95ac9540626dc8a25f5bf21ba607215a5d58304cb804d446f104a601054826040516200096992919062000fdb565b60405180910390a1601055565b620009806200038b565b6001600160a01b03166200099362000c4c565b6001600160a01b031614620009bc5760405162461bcd60e51b8152600401620004e09062001108565b612710620009e2600f54620009146010548562000c5b60201b62001c091790919060201c565b1115620009ee57600080fd5b7f2a42303d002f0ba6cfe8259c91d4684443fb0b3de286ba74991175d6517261316011548260405162000a2392919062000fdb565b60405180910390a1601155565b62000a3a6200038b565b6001600160a01b031662000a4d62000c4c565b6001600160a01b03161462000a765760405162461bcd60e51b8152600401620004e09062001108565b61271062000a9c601154620009146010548562000c5b60201b62001c091790919060201c565b111562000aa857600080fd5b7fe7f97d51d307dc44045597c9978bec0f842e6bb40d19b9444084cfa30d9ed4f2600f548260405162000add92919062000fdb565b60405180910390a1600f55565b62000af46200038b565b6001600160a01b031662000b0762000c4c565b6001600160a01b03161462000b305760405162461bcd60e51b8152600401620004e09062001108565b600e5460ff161515811515141562000b4757600080fd5b600e805460ff19168215151790556040517f7b014ed3854e7f5cb0218d58b3c6ae7d53a68bb0af2f67bfb029ea42c38a7e859062000b8790839062000fd0565b60405180910390a150565b62000b9c6200038b565b6001600160a01b031662000baf62000c4c565b6001600160a01b03161462000bd85760405162461bcd60e51b8152600401620004e09062001108565b6001600160a01b03811662000c015760405162461bcd60e51b8152600401620004e09062000fe9565b6006546040516001600160a01b038084169216906000805160206200588983398151915290600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031690565b60008282018381101562000c835760405162461bcd60e51b8152600401620004e0906200102f565b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000ccd57805160ff191683800117855562000cfd565b8280016001018555821562000cfd579182015b8281111562000cfd57825182559160200191906001019062000ce0565b5062000d0b92915062000d0f565b5090565b5b8082111562000d0b576000815560010162000d10565b80516001600160a01b038116811462000d3e57600080fd5b919050565b600060c0828403121562000d55578081fd5b60405160c081016001600160401b038111828210171562000d7257fe5b806040525080915082516005811062000d8a57600080fd5b815262000d9a6020840162000d26565b602082015262000dad6040840162000d26565b604082015262000dc06060840162000d26565b60608201526080830151608082015260a083015160a08201525092915050565b60006080828403121562000df2578081fd5b604051608081016001600160401b038111828210171562000e0f57fe5b8060405250809150825181526020830151602082015260408301516040820152606083015160608201525092915050565b60006020828403121562000e52578081fd5b62000c838262000d26565b60006020828403121562000e6f578081fd5b8151801515811462000c83578182fd5b600080600080600080600080610200898b03121562000e9c578384fd5b88516001600160401b038082111562000eb3578586fd5b818b0191508b601f83011262000ec7578586fd5b81518181111562000ed457fe5b6020915062000eec601f8201601f191683016200113d565b8181528d8383860101111562000f00578788fd5b875b8281101562000f1f57848101840151828201850152830162000f02565b8281111562000f3057888484840101525b509a5062000f4290508b820162000d26565b9850505062000f5460408a0162000d26565b955062000f6460608a0162000d26565b945062000f7460808a0162000d26565b935062000f858a60a08b0162000d43565b925062000f966101608a0162000d26565b915062000fa88a6101808b0162000de0565b90509295985092959890939650565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b918252602082015260400190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526041908201526000805160206200586983398151915260408201527f6f6573206e6f7420636f6e7461696e20706f6f6c2072657761726420746f6b656060820152603760f91b608082015260a00190565b6020808252603f908201526000805160206200586983398151915260408201527f6f6573206e6f7420636f6e7461696e2065636f73797374656d20746f6b656e00606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6040518181016001600160401b03811182821017156200115957fe5b604052919050565b6080516146c0620011a9600039806107de528061098d5280610d545280610f24528061159c5280611ec4528061218552806125ad52806128b85280612b5752506146c06000f3fe608060405234801561001057600080fd5b50600436106103a45760003560e01c80638b73e606116101e9578063c4b24a461161010f578063dd8ce4d6116100ad578063ee99205c1161007c578063ee99205c146106f4578063f2fde38b146106fc578063f7c618c11461070f578063fdb5a03e14610717576103a4565b8063dd8ce4d6146106b3578063e21ac825146106c6578063eab89a5a146106d9578063ed24911d146106ec576103a4565b8063d505accf116100e9578063d505accf1461067d578063da09c72c14610690578063dbd9a4d414610698578063dd62ed3e146106a0576103a4565b8063c4b24a461461065a578063c89039c514610662578063cff1b6ef1461066a576103a4565b8063a1a4ddeb11610187578063b52a321f11610156578063b52a321f1461062f578063b6b55f2514610637578063b9e57b801461064a578063bd079f5514610652576103a4565b8063a1a4ddeb146105ee578063a8ae2b7c146105f6578063a9059cbb14610609578063ac0d31ff1461061c576103a4565b80639291d563116101c35780639291d563146105b857806395d89b41146105cb57806399729ec1146105d35780639e4e7318146105e6576103a4565b80638b73e606146105885780638da5cb5b1461059b578063909ac8f4146105b0576103a4565b80634e77ace5116102ce578063789139bc1161026c578063818372301161023b57806381837230146105475780638432e8941461055a5780638980f11f1461056d5780638aff733d14610580576103a4565b8063789139bc146105115780637ae26773146105195780637d8820971461052c5780637ecebe0014610534576103a4565b80635eaec0e4116102a85780635eaec0e4146104db57806370a08231146104e3578063715018a6146104f6578063733ba2e4146104fe576103a4565b80634e77ace5146104ad5780634ebb7916146104c05780635ea682ea146104d3576103a4565b80632e1a7d4d116103465780633bdc6e72116103155780633bdc6e721461046c578063483c2ef0146104745780634a970be7146104875780634bebd1e71461049a576103a4565b80632e1a7d4d146104275780632f4f21e21461043c57806330adf81f1461044f578063313ce56714610457576103a4565b80630f23475d116103825780630f23475d146103fc57806318160ddd1461040457806320606b701461040c57806323b872dd14610414576103a4565b806306fdde03146103a957806307677111146103c7578063095ea7b3146103dc575b600080fd5b6103b161071f565b6040516103be9190613eec565b60405180910390f35b6103cf6107ad565b6040516103be9190613e65565b6103ef6103ea366004613af7565b6107b3565b6040516103be9190613e5a565b6103cf6107ca565b6103cf610836565b6103cf61083c565b6103ef610422366004613a4a565b610860565b61043a610435366004613ba8565b610947565b005b61043a61044a366004613af7565b610a34565b6103cf610a42565b61045f610a66565b6040516103be91906145ae565b6103cf610a6b565b6103ef6104823660046139da565b610a71565b61043a610495366004613bfc565b610a86565b61043a6104a83660046139da565b610b1e565b61043a6104bb366004613b22565b610c02565b61043a6104ce366004613ba8565b610ca0565b6103cf610d4c565b6103cf610d52565b6103cf6104f13660046139da565b610d76565b61043a610d95565b61043a61050c366004613ba8565b610e1e565b6103cf610e4d565b61043a610527366004613a12565b610e53565b6103cf610f1c565b6103cf6105423660046139da565b610f4f565b61043a610555366004613ba8565b610f61565b61043a6105683660046139da565b610fe0565b61043a61057b366004613af7565b611016565b6103cf611128565b61043a6105963660046139da565b61112e565b6105a3611234565b6040516103be9190613d56565b6105a3611243565b61043a6105c63660046139da565b611252565b6103b16112e5565b61043a6105e1366004613ba8565b61133f565b6103cf6113ed565b6105a3611411565b61043a610604366004613ba8565b611420565b6103ef610617366004613af7565b6114c8565b61043a61062a366004613bd8565b6114d5565b6103ef6116dc565b61043a610645366004613ba8565b6116e5565b6103cf6116ef565b6103cf611730565b6103cf611736565b6105a361174a565b61043a610678366004613ba8565b611759565b61043a61068b366004613a8a565b611801565b6105a36118b6565b61043a6118c5565b6103cf6106ae366004613a12565b61191c565b6103cf6106c1366004613ba8565b611947565b61043a6106d4366004613ba8565b611981565b6103cf6106e7366004613ba8565b611a00565b6103cf611a31565b6105a3611ac8565b61043a61070a3660046139da565b611ad7565b6105a3611b98565b61043a611ba7565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107a55780601f1061077a576101008083540402835291602001916107a5565b820191906000526020600020905b81548152906001019060200180831161078857829003601f168201915b505050505081565b60105481565b60006107c0338484611c35565b5060015b92915050565b6000806107d5610f1c565b905060006108027f0000000000000000000000000000000000000000000000000000000000000000611ce9565b90506000610821610811611cef565b61081b8585611cf5565b90611d2f565b905061082d8382611d71565b93505050505b90565b60025481565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6001600160a01b03831660008181526003602090815260408083203380855292528220549192909190821480159061089a57506000198114155b156109305760006108c6856040518060600160405280602f8152602001614607602f9139849190611daf565b6001600160a01b03808916600081815260036020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610926908590613e65565b60405180910390a3505b61093b868686611ddb565b50600195945050505050565b600061095282611a00565b90506000811161097d5760405162461bcd60e51b8152600401610974906141ac565b60405180910390fd5b61098681611ebf565b60006109b17f0000000000000000000000000000000000000000000000000000000000000000611ce9565b905060006109c0610811611cef565b6009549091506109e3906001600160a01b0316336109de8685611d71565b611ee9565b6109ed3385611f8a565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436484604051610a269190613e65565b60405180910390a250505050565b610a3e8282612064565b5050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60075481565b60086020526000908152604090205460ff1681565b6009546040517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063d505accf90610adb90339030908a908a908a908a908a90600401613d8e565b600060405180830381600087803b158015610af557600080fd5b505af1158015610b09573d6000803e3d6000fd5b50505050610b173386612064565b5050505050565b610b26612212565b6001600160a01b0316610b37611234565b6001600160a01b031614610b5d5760405162461bcd60e51b8152600401610974906142fa565b6001600160a01b03811660009081526008602052604090205460ff1615610b965760405162461bcd60e51b815260040161097490614084565b6001600160a01b0381166000908152600860205260409020805460ff19166001908117909155600754610bc891611c09565b6007556040516001600160a01b038216907fc0a1035c16faf8d1304056d92c00edf028f87e62b8235a938f00af9e3c0312c590600090a250565b610c0a612212565b6001600160a01b0316610c1b611234565b6001600160a01b031614610c415760405162461bcd60e51b8152600401610974906142fa565b600e5460ff1615158115151415610c5757600080fd5b600e805460ff19168215151790556040517f7b014ed3854e7f5cb0218d58b3c6ae7d53a68bb0af2f67bfb029ea42c38a7e8590610c95908390613e5a565b60405180910390a150565b610ca8612212565b6001600160a01b0316610cb9611234565b6001600160a01b031614610cdf5760405162461bcd60e51b8152600401610974906142fa565b60008111610cec57600080fd5b604051339082156108fc029083906000818181858888f19350505050158015610d19573d6000803e3d6000fd5b507f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28600082604051610c95929190613dcf565b60115481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b0381166000908152600460205260409020545b919050565b610d9d612212565b6001600160a01b0316610dae611234565b6001600160a01b031614610dd45760405162461bcd60e51b8152600401610974906142fa565b6006546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600680546001600160a01b0319169055565b600b546001600160a01b03163314610e485760405162461bcd60e51b815260040161097490614457565b601a55565b600d5481565b610e5b612212565b6001600160a01b0316610e6c611234565b6001600160a01b031614610e925760405162461bcd60e51b8152600401610974906142fa565b60405163095ea7b360e01b81526001600160a01b0383169063095ea7b390610ec1908490600090600401613dcf565b602060405180830381600087803b158015610edb57600080fd5b505af1158015610eef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f139190613b3e565b610a3e57600080fd5b600080610f497f000000000000000000000000000000000000000000000000000000000000000030612216565b91505090565b60056020526000908152604090205481565b610f69612212565b6001600160a01b0316610f7a611234565b6001600160a01b031614610fa05760405162461bcd60e51b8152600401610974906142fa565b7f481f79ac3a523b6d6db3c5a720e190e986d1cc1b41adcdf50f9caef849901100600c5482604051610fd3929190614568565b60405180910390a1600c55565b600b546001600160a01b0316331461100a5760405162461bcd60e51b815260040161097490614457565b61101381612297565b50565b61101e612212565b6001600160a01b031661102f611234565b6001600160a01b0316146110555760405162461bcd60e51b8152600401610974906142fa565b6000811161106257600080fd5b60405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb906110909033908590600401613dcf565b602060405180830381600087803b1580156110aa57600080fd5b505af11580156110be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e29190613b3e565b6110eb57600080fd5b7f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28828260405161111c929190613dcf565b60405180910390a15050565b600f5481565b611136612212565b6001600160a01b0316611147611234565b6001600160a01b03161461116d5760405162461bcd60e51b8152600401610974906142fa565b60006007541161118f5760405162461bcd60e51b815260040161097490613fca565b6001600160a01b03811660009081526008602052604090205460ff1615156001146111cc5760405162461bcd60e51b8152600401610974906141e3565b6001600160a01b0381166000908152600860205260409020805460ff191690556007546111fa906001611d71565b6007556040516001600160a01b038216907f0e86f6608b536e5339a25b65ff531f5ea91e1313d056ecd4752b35cbd16137d490600090a250565b6006546001600160a01b031690565b6014546001600160a01b031681565b600b546001600160a01b0316331461127c5760405162461bcd60e51b815260040161097490614457565b600b546040517fa8e91499ed37682f43cffb045fcc7d379a91e8c9a14e6321877ee34dee564c00916112bb916001600160a01b03909116908490613de8565b60405180910390a1600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107a55780601f1061077a576101008083540402835291602001916107a5565b611347612212565b6001600160a01b0316611358611234565b6001600160a01b03161461137e5760405162461bcd60e51b8152600401610974906142fa565b6127106113a2600f5461139c60105485611c0990919063ffffffff16565b90611c09565b11156113ad57600080fd5b7f2a42303d002f0ba6cfe8259c91d4684443fb0b3de286ba74991175d651726131601154826040516113e0929190614568565b60405180910390a1601155565b7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc681565b6015546001600160a01b031681565b611428612212565b6001600160a01b0316611439611234565b6001600160a01b03161461145f5760405162461bcd60e51b8152600401610974906142fa565b61271061147d60115461139c60105485611c0990919063ffffffff16565b111561148857600080fd5b7fe7f97d51d307dc44045597c9978bec0f842e6bb40d19b9444084cfa30d9ed4f2600f54826040516114bb929190614568565b60405180910390a1600f55565b60006107c0338484611ddb565b6114dd612212565b6001600160a01b03166114ee611234565b6001600160a01b0316146115145760405162461bcd60e51b8152600401610974906142fa565b6009546040516370a0823160e01b81526000916001600160a01b0316906370a0823190611545903090600401613d56565b60206040518083038186803b15801561155d57600080fd5b505afa158015611571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115959190613bc0565b90506115c07f00000000000000000000000000000000000000000000000000000000000000006124b4565b6009546040516370a0823160e01b81526000916001600160a01b0316906370a08231906115f1903090600401613d56565b60206040518083038186803b15801561160957600080fd5b505afa15801561161d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116419190613bc0565b90508361164e8284611d71565b101561166c5760405162461bcd60e51b8152600401610974906140bb565b7fc7606d21ac05cd309191543e409f0845c016120563783d70e4f41419dc0ef234611695610f1c565b6002546040516116a6929190614568565b60405180910390a1600e5460ff16151560011480156116c757506001831515145b156116d6576116d66000610c02565b50505050565b600e5460ff1681565b6110133382612064565b6000806116fa611736565b9050600c5481106117285761172061271061081b600f5484611cf590919063ffffffff16565b915050610833565b600091505090565b600c5481565b600080611741612518565b94505050505090565b6009546001600160a01b031681565b611761612212565b6001600160a01b0316611772611234565b6001600160a01b0316146117985760405162461bcd60e51b8152600401610974906142fa565b6127106117b6600f5461139c60115485611c0990919063ffffffff16565b11156117c157600080fd5b7f3cc372f330f95ac9540626dc8a25f5bf21ba607215a5d58304cb804d446f104a601054826040516117f4929190614568565b60405180910390a1601055565b428410156118215760405162461bcd60e51b815260040161097490614175565b6001600160a01b0387166000908152600560209081526040808320805460018101909155905161187c927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92918c9101613e6e565b6040516020818303038152906040528051906020012090506118a188828686866127d9565b6118ac888888611c35565b5050505050505050565b600b546001600160a01b031681565b6118cd612212565b6001600160a01b03166118de611234565b6001600160a01b0316146119045760405162461bcd60e51b8152600401610974906142fa565b60405162461bcd60e51b815260040161097490614420565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061195d611954610f1c565b60025490611cf5565b611968575080610d90565b6107c4611973610f1c565b60025461081b908590611cf5565b611989612212565b6001600160a01b031661199a611234565b6001600160a01b0316146119c05760405162461bcd60e51b8152600401610974906142fa565b7fa5dae50539d56dfe1fb5273d883b0c39bc76750a25d036fc5fbd09ad8fd5f57f600d54826040516119f3929190614568565b60405180910390a1600d55565b6000611a0d611954610f1c565b611a1957506000610d90565b6107c460025461081b611a2a610f1c565b8590611cf5565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60001b6000604051611a669190613cb0565b6040519081900390207fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6611a986128af565b30604051602001611aad959493929190613ea2565b60405160208183030381529060405280519060200120905090565b601c546001600160a01b031681565b611adf612212565b6001600160a01b0316611af0611234565b6001600160a01b031614611b165760405162461bcd60e51b8152600401610974906142fa565b6001600160a01b038116611b3c5760405162461bcd60e51b815260040161097490613eff565b6006546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031681565b323314611bc65760405162461bcd60e51b815260040161097490613f5c565b600080600080611bd4612518565b9350935093509350600c54811015611bfe5760405162461bcd60e51b81526004016109749061448e565b6116d68285856128b3565b600082820183811015611c2e5760405162461bcd60e51b815260040161097490613f93565b9392505050565b6001600160a01b038316611c5b5760405162461bcd60e51b81526004016109749061432f565b6001600160a01b038216611c815760405162461bcd60e51b8152600401610974906144fc565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611cdc908590613e65565b60405180910390a3505050565b50600090565b61271090565b600082611d04575060006107c4565b82820282848281611d1157fe5b0414611c2e5760405162461bcd60e51b81526004016109749061429d565b6000611c2e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129fa565b6000611c2e83836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f77008152505b60008184841115611dd35760405162461bcd60e51b81526004016109749190613eec565b505050900390565b6001600160a01b038216611e015760405162461bcd60e51b815260040161097490614366565b611e3e816040518060600160405280602e815260200161465d602e91396001600160a01b0386166000908152600460205260409020549190611daf565b6001600160a01b038085166000908152600460205260408082209390935590841681522054611e6d9082611c09565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611cdc908590613e65565b6110137f000000000000000000000000000000000000000000000000000000000000000082612a31565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90611f179085908590600401613dcf565b602060405180830381600087803b158015611f3157600080fd5b505af1158015611f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f699190613b3e565b611f855760405162461bcd60e51b815260040161097490614118565b505050565b611fc781604051806060016040528060278152602001614636602791396001600160a01b0385166000908152600460205260409020549190611daf565b60046000846001600160a01b03166001600160a01b0316815260200190815260200160002081905550612017816040518060600160405280602781526020016145e0602791396002549190611daf565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612058908590613e65565b60405180910390a35050565b600e5460ff16151560011461208b5760405162461bcd60e51b8152600401610974906144c5565b600d54156120c3576000806000806120a1612518565b9350935093509350600d548111156120be576120be8285856128b3565b505050505b6009546040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906323b872dd9061211090339030908690600401613d6a565b602060405180830381600087803b15801561212a57600080fd5b505af115801561213e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121629190613b3e565b61217e5760405162461bcd60e51b8152600401610974906143c3565b60006121a97f0000000000000000000000000000000000000000000000000000000000000000611ce9565b905060006121b8610811611cef565b90506121d0846121cb6106c18685611d71565b612ab0565b6121d983612b32565b836001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c84604051610a269190613e65565b3390565b601c546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612247908590600401613d56565b60206040518083038186803b15801561225f57600080fd5b505afa158015612273573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2e9190613bc0565b6001600160a01b0381161561249557600a54604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516001600160a01b0392831692841691630dfe1681916004808301926020929190829003018186803b15801561230657600080fd5b505afa15801561231a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233e91906139f6565b6001600160a01b031614156123e357806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561238657600080fd5b505afa15801561239a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123be91906139f6565b601580546001600160a01b0319166001600160a01b0392909216919091179055612475565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561241c57600080fd5b505afa158015612430573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245491906139f6565b601580546001600160a01b0319166001600160a01b03929092169190911790555b601480546001600160a01b0319166001600160a01b038316179055611013565b601480546001600160a01b031990811690915560158054909116905550565b601c60009054906101000a90046001600160a01b03166001600160a01b031663e9fad8ee6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561250457600080fd5b505af1158015610b17573d6000803e3d6000fd5b6012546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612551903090600401613d56565b60206040518083038186803b15801561256957600080fd5b505afa15801561257d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a19190613bc0565b905060008060006125d27f000000000000000000000000000000000000000000000000000000000000000030612b7c565b9194509250905060006125e58585611c09565b600a546012549192506000916001600160a01b039081169116141561260a578461262f565b601254600a5460135461262f9285926001600160a01b03918216929082169116612b9a565b905060006001600160a01b0384161561272e576001600160a01b03841673b31f66aa3c1e785363f0875a1b74e27b85fd66c7141561266e57508361272e565b6014546001600160a01b03161561272e576015546040516370a0823160e01b8152612708916001600160a01b0316906370a08231906126b1903090600401613d56565b60206040518083038186803b1580156126c957600080fd5b505afa1580156126dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127019190613bc0565b8690611c09565b600a5460145491965061272b91879187916001600160a01b039182169116612b9a565b90505b600a546040516370a0823160e01b81526000916127b59184916001600160a01b0316906370a0823190612765903090600401613d56565b60206040518083038186803b15801561277d57600080fd5b505afa158015612791573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139c9190613bc0565b905060006127c38285611c09565b949d969c50909a50929850939650505050505050565b60006127e3611a31565b856040516020016127f5929190613d20565b6040516020818303038152906040528051906020012090506000600182868686604051600081526020016040526040516128329493929190613ece565b6020604051602081039080840390855afa158015612854573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061288a5750866001600160a01b0316816001600160a01b0316145b6128a65760405162461bcd60e51b815260040161097490614027565b50505050505050565b4690565b6128dc7f0000000000000000000000000000000000000000000000000000000000000000612c75565b60006128f16128ea84612cc5565b8590611c09565b90506129076129008584612d0d565b8290611c09565b50600061292561271061081b60115485611cf590919063ffffffff16565b9050801561294a57600a54600b5461294a916001600160a01b03908116911683611ee9565b600061296761271061081b600f5486611cf590919063ffffffff16565b9050801561298657600a54612986906001600160a01b03163383611ee9565b60006129a461299f836129998787611d71565b90611d71565b612e60565b90506129af81612b32565b7fc7606d21ac05cd309191543e409f0845c016120563783d70e4f41419dc0ef2346129d8610f1c565b6002546040516129e9929190614568565b60405180910390a150505050505050565b60008183612a1b5760405162461bcd60e51b81526004016109749190613eec565b506000838581612a2757fe5b0495945050505050565b601c546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690632e1a7d4d90612a7a908490600401613e65565b600060405180830381600087803b158015612a9457600080fd5b505af1158015612aa8573d6000803e3d6000fd5b505050505050565b600254612abd9082611c09565b6002556001600160a01b038216600090815260046020526040902054612ae39082611c09565b6001600160a01b0383166000818152600460205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612058908590613e65565b60008111612b525760405162461bcd60e51b815260040161097490614240565b6110137f000000000000000000000000000000000000000000000000000000000000000082612ef5565b600080600080612b8b85613083565b96600096508695509350505050565b600080612ba785856132d6565b509050600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612be657600080fd5b505afa158015612bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1e9190613b5a565b5091509150866001600160a01b0316836001600160a01b031614612c3e57905b612c6988836dffffffffffffffffffffffffffff16836dffffffffffffffffffffffffffff16613307565b98975050505050505050565b601c60009054906101000a90046001600160a01b03166001600160a01b0316636c3f3ab36040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561250457600080fd5b601254600a546000916001600160a01b0391821691161415612ce8575080610d90565b601254600a546013546107c49285926001600160a01b0391821692908216911661334f565b60008115612e57576014546001600160a01b031615612d5257601554600a54601454612d4b9285926001600160a01b0391821692908216911661334f565b90506107c4565b478015612dc25773b31f66aa3c1e785363f0875a1b74e27b85fd66c76001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015612da857600080fd5b505af1158015612dbc573d6000803e3d6000fd5b50505050505b6040516370a0823160e01b8152612e4f90859073b31f66aa3c1e785363f0875a1b74e27b85fd66c7906370a0823190612dff903090600401613d56565b60206040518083038186803b158015612e1757600080fd5b505afa158015612e2b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129999190613bc0565b9150506107c4565b50600092915050565b600a546009546040805160c08101909152601680546000946107c49487946001600160a01b03928316949190921692829060ff166004811115612e9f57fe5b6004811115612eaa57fe5b815281546001600160a01b036101009091048116602083015260018301548116604083015260028301541660608201526003820154608082015260049091015460a0909101526134f0565b600954601c5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392612f2b929116908590600401613dcf565b602060405180830381600087803b158015612f4557600080fd5b505af1158015612f59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f7d9190613b3e565b50601c546040517fa694fc3a0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063a694fc3a90612fc7908490600401613e65565b600060405180830381600087803b158015612fe157600080fd5b505af1158015612ff5573d6000803e3d6000fd5b5050600954601c5460405163095ea7b360e01b81526001600160a01b03928316945063095ea7b393506130319290911690600090600401613dcf565b602060405180830381600087803b15801561304b57600080fd5b505af115801561305f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f859190613b3e565b601c546040517f032bbf4f00000000000000000000000000000000000000000000000000000000815260009182916001600160a01b039091169063032bbf4f906130d1908690600401613d56565b60206040518083038186803b1580156130e957600080fd5b505afa1580156130fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131219190613bc0565b905042819003600061317e6131358661371b565b601c546040517f0700037d0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690630700037d90612765908a90600401613d56565b9050601c60009054906101000a90046001600160a01b03166001600160a01b0316637313ee5a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131ce57600080fd5b505afa1580156131e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132069190613bc0565b613214579250610d90915050565b600080841180156132255750600083115b6132305760006132ca565b6132ca82601c60009054906101000a90046001600160a01b03166001600160a01b0316637313ee5a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561328257600080fd5b505afa158015613296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ba9190613bc0565b858502816132c457fe5b046138da565b9450610d909350505050565b600080826001600160a01b0316846001600160a01b0316106132f95782846132fc565b83835b915091509250929050565b600080613316856103e5611cf5565b905060006133248285611cf5565b905060006133388361139c886103e8611cf5565b90506133448282611d2f565b979650505050505050565b60008061335c85856132d6565b509050600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561339b57600080fd5b505afa1580156133af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133d39190613b5a565b5091509150866001600160a01b0316836001600160a01b0316146133f357905b6000806134218a856dffffffffffffffffffffffffffff16856dffffffffffffffffffffffffffff16613307565b9050886001600160a01b0316856001600160a01b03161461343e57905b61344989888c6138f1565b604080516000815260208101918290527f022c0d9f000000000000000000000000000000000000000000000000000000009091526001600160a01b0388169063022c0d9f906134a19085908590309060248101614576565b600060405180830381600087803b1580156134bb57600080fd5b505af11580156134cf573d6000803e3d6000fd5b505050508181116134e057816134e2565b805b9a9950505050505050505050565b600081604001516001600160a01b0316846001600160a01b0316146135265761352385858460400151856020015161334f565b94505b61352e61398d565b604051806080016040528060008152602001600081526020016000815260200160008152509050858184608001516004811061356657fe5b602002015260608301516040517f861cdef00000000000000000000000000000000000000000000000000000000081526000916001600160a01b03169063861cdef0906135bc9088908690600190600401613e02565b60206040518083038186803b1580156135d457600080fd5b505afa1580156135e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061360c9190613bc0565b9050600061362d61271061081b8760a0015185611cf590919063ffffffff16565b60608601519091506001600160a01b031663384e03db878561364f8686611d71565b6040518463ffffffff1660e01b815260040161366d93929190613e2f565b600060405180830381600087803b15801561368757600080fd5b505af115801561369b573d6000803e3d6000fd5b50506040516370a0823160e01b81526001600160a01b03891692506370a0823191506136cb903090600401613d56565b60206040518083038186803b1580156136e357600080fd5b505afa1580156136f7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c699190613bc0565b601c546040517fc3d3df2e0000000000000000000000000000000000000000000000000000000081526000916107c491670de0b6b3a76400009161081b916001600160a01b039091169063c3d3df2e90613779908890600401613d56565b60206040518083038186803b15801561379157600080fd5b505afa1580156137a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c99190613bc0565b601c60009054906101000a90046001600160a01b03166001600160a01b031663cd3daf9d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561381757600080fd5b505afa15801561382b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061384f9190613bc0565b601c546040516370a0823160e01b815292909103916001600160a01b03909116906370a0823190613884908990600401613d56565b60206040518083038186803b15801561389c57600080fd5b505afa1580156138b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138d49190613bc0565b90611cf5565b60008183106138ea5750806107c4565b50816107c4565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb9061391f9085908590600401613dcf565b602060405180830381600087803b15801561393957600080fd5b505af115801561394d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139719190613b3e565b611f855760405162461bcd60e51b815260040161097490614533565b60405180608001604052806004906020820280368337509192915050565b80516dffffffffffffffffffffffffffff81168114610d9057600080fd5b803560ff81168114610d9057600080fd5b6000602082840312156139eb578081fd5b8135611c2e816145bc565b600060208284031215613a07578081fd5b8151611c2e816145bc565b60008060408385031215613a24578081fd5b8235613a2f816145bc565b91506020830135613a3f816145bc565b809150509250929050565b600080600060608486031215613a5e578081fd5b8335613a69816145bc565b92506020840135613a79816145bc565b929592945050506040919091013590565b600080600080600080600060e0888a031215613aa4578283fd5b8735613aaf816145bc565b96506020880135613abf816145bc565b95506040880135945060608801359350613adb608089016139c9565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215613b09578182fd5b8235613b14816145bc565b946020939093013593505050565b600060208284031215613b33578081fd5b8135611c2e816145d1565b600060208284031215613b4f578081fd5b8151611c2e816145d1565b600080600060608486031215613b6e578283fd5b613b77846139ab565b9250613b85602085016139ab565b9150604084015163ffffffff81168114613b9d578182fd5b809150509250925092565b600060208284031215613bb9578081fd5b5035919050565b600060208284031215613bd1578081fd5b5051919050565b60008060408385031215613bea578182fd5b823591506020830135613a3f816145d1565b600080600080600060a08688031215613c13578081fd5b8535945060208601359350613c2a604087016139c9565b94979396509394606081013594506080013592915050565b8060005b60048110156116d6578151845260209384019390910190600101613c46565b60008151808452815b81811015613c8a57602081850181015186830182015201613c6e565b81811115613c9b5782602083870101525b50601f01601f19169290920160200192915050565b6000808354600180821660008114613ccf5760018114613ce657613d15565b60ff198316865260028304607f1686019350613d15565b600283048786526020808720875b83811015613d0d5781548a820152908501908201613cf4565b505050860193505b509195945050505050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038416815260c08101613e1f6020830185613c42565b82151560a0830152949350505050565b6001600160a01b038416815260c08101613e4c6020830185613c42565b8260a0830152949350505050565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b600060208252611c2e6020830184613c65565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f59616b53747261746567793a3a6f6e6c79454f41000000000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526034908201527f5065726d697373696f6e65643a3a72656d6f76654465706f7369746f722c206e60408201527f6f20616c6c6f776564206465706f7369746f7273000000000000000000000000606082015260800190565b60208082526024908201527f417263683a3a76616c69646174655369673a20696e76616c6964207369676e6160408201527f7475726500000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f5065726d697373696f6e65643a3a616c6c6f774465706f7369746f7200000000604082015260600190565b60208082526029908201527f4d617374657243686566537472617465677956313a3a7265736375654465706c60408201527f6f79656446756e64730000000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4d617374657243686566537472617465677956313a3a5452414e534645525f4660408201527f524f4d5f4641494c454400000000000000000000000000000000000000000000606082015260800190565b6020808252600f908201527f7065726d69743a3a657870697265640000000000000000000000000000000000604082015260600190565b6020808252601e908201527f4d617374657243686566537472617465677956313a3a77697468647261770000604082015260600190565b6020808252602a908201527f5065726d697373696f6e65643a3a72656d6f76654465706f7369746f722c206e60408201527f6f7420616c6c6f77656400000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4d617374657243686566537472617465677956313a3a5f7374616b654465706f60408201527f736974546f6b656e730000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601c908201527f5f617070726f76653a3a6f776e6572207a65726f206164647265737300000000604082015260600190565b60208082526034908201527f5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657260408201527f20746f20746865207a65726f2061646472657373000000000000000000000000606082015260800190565b60208082526025908201527f4d617374657243686566537472617465677956313a3a7472616e73666572206660408201527f61696c6564000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f736574416c6c6f77616e6365733a3a6465707265636174656400000000000000604082015260600190565b60208082526014908201527f59616b53747261746567793a3a6f6e6c79446576000000000000000000000000604082015260600190565b6020808252601e908201527f4d617374657243686566537472617465677956313a3a7265696e766573740000604082015260600190565b6020808252601e908201527f4d617374657243686566537472617465677956313a3a5f6465706f7369740000604082015260600190565b6020808252601e908201527f5f617070726f76653a3a7370656e646572207a65726f20616464726573730000604082015260600190565b6020808252818101527f4465784c6962726172793a3a5452414e534645525f46524f4d5f4641494c4544604082015260600190565b918252602082015260400190565b60008582528460208301526001600160a01b0384166040830152608060608301526145a46080830184613c65565b9695505050505050565b60ff91909116815260200190565b6001600160a01b038116811461101357600080fd5b801515811461101357600080fdfe5f6275726e3a206275726e20616d6f756e74206578636565647320746f74616c20737570706c797472616e7366657246726f6d3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655f6275726e3a206275726e20616d6f756e7420657863656564732066726f6d2062616c616e63655f7472616e73666572546f6b656e733a207472616e7366657220657863656564732066726f6d2062616c616e6365a2646970667358221220a603a7ba754b30059882debe94b99e8957acad6c392c8261e217a8e5fb8dfda064736f6c6343000703003353776170207061697220277377617050616972506f6f6c5265776172642720648be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b3f21fc59bc06209d5fb82c474f21582aef09a20000000000000000000000000d9d90f882cddd6063959a9d837b05cb748718a05000000000000000000000000b8361d0e3f3b0fc5e6071f3a3c3271223c49e3d90000000000000000000000009727d535165e19590013bddea8fd85dd618b9af7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000087dee1cc9ffd464b79e058ba20387c1984aed86a000000000000000000000000d586e7f844cea2f87f50152665bcbc2c279d8d70000000000000000000000000001e3ba199b4ff4b5b6e97acd96dafc0e2e4156e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032000000000000000000000000302404cb8f34713a8b8dbf9b4989a41252332068000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000384000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000285969656c642059616b3a204d6f72656d6f6e65792078204375727665204d4f4e4559334352562d66000000000000000000000000000000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b3f21fc59bc06209d5fb82c474f21582aef09a20000000000000000000000000d9d90f882cddd6063959a9d837b05cb748718a05000000000000000000000000b8361d0e3f3b0fc5e6071f3a3c3271223c49e3d90000000000000000000000009727d535165e19590013bddea8fd85dd618b9af7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000087dee1cc9ffd464b79e058ba20387c1984aed86a000000000000000000000000d586e7f844cea2f87f50152665bcbc2c279d8d70000000000000000000000000001e3ba199b4ff4b5b6e97acd96dafc0e2e4156e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032000000000000000000000000302404cb8f34713a8b8dbf9b4989a41252332068000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000384000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000285969656c642059616b3a204d6f72656d6f6e65792078204375727665204d4f4e4559334352562d66000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): Yield Yak: Moremoney x Curve MONEY3CRV-f
Arg [1] : _depositToken (address): 0xb3f21fc59bc06209d5fb82c474f21582aef09a20
Arg [2] : _poolRewardToken (address): 0xd9d90f882cddd6063959a9d837b05cb748718a05
Arg [3] : _swapPairPoolReward (address): 0xb8361d0e3f3b0fc5e6071f3a3c3271223c49e3d9
Arg [4] : _stakingContract (address): 0x9727d535165e19590013bddea8fd85dd618b9af7
Arg [5] : _curveSwapSettings (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [6] : _timelock (address): 0x302404cb8f34713a8b8dbf9b4989a41252332068
Arg [7] : _strategySettings (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
19 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [1] : 000000000000000000000000b3f21fc59bc06209d5fb82c474f21582aef09a20
Arg [2] : 000000000000000000000000d9d90f882cddd6063959a9d837b05cb748718a05
Arg [3] : 000000000000000000000000b8361d0e3f3b0fc5e6071f3a3c3271223c49e3d9
Arg [4] : 0000000000000000000000009727d535165e19590013bddea8fd85dd618b9af7
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 00000000000000000000000087dee1cc9ffd464b79e058ba20387c1984aed86a
Arg [7] : 000000000000000000000000d586e7f844cea2f87f50152665bcbc2c279d8d70
Arg [8] : 000000000000000000000000001e3ba199b4ff4b5b6e97acd96dafc0e2e4156e
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [11] : 000000000000000000000000302404cb8f34713a8b8dbf9b4989a41252332068
Arg [12] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000384
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000028
Arg [17] : 5969656c642059616b3a204d6f72656d6f6e65792078204375727665204d4f4e
Arg [18] : 4559334352562d66000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.