Contract 0x701e3156c4e5abe044f756936792032bb96481b9

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa4b0fe775a2b13df10ef5ec4bba6c79d44229a7d638fac5a7e787fae5d26413eCreate Vault Tok...426144252022-07-12 18:40:4274 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.00607066927
0xaf778da280bd7b11c739e98be7fb7bd16075707a8a305feba3bf150fb6135a8aCreate Vault Tok...426144102022-07-12 18:40:2574 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005995844782
0x9b676a0dfc5a9345ad81b11b4e0147ddf0454d5d742a363350fed40802a28217Create Vault Tok...426144032022-07-12 18:40:1674 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.00597838952
0xdbe2f51bd5ac5397819f896523a3b6f68c8622a3a37bfef177202464a6291369Create Vault Tok...426143972022-07-12 18:40:1074 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005957452288
0x52d9367d0c1b3b08713a4339439098196e54c164579fca4f79b86770f7bbcbd6Create Vault Tok...426143942022-07-12 18:40:0774 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005966679506
0x000198dce1052284bc510e928a318943dc1e5438d9df51eeded407ad123bf55cCreate Vault Tok...426143862022-07-12 18:39:5974 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005967727882
0xc30554da35dab84c0bf82de81bf3cec86c6f415054208378360c4ebbc8f1db49Create Vault Tok...426143812022-07-12 18:39:5574 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005976186796
0xbc6d8b4af65608bbbdd5014ee217a499dda2b1213003b44be064cef5228ac54dCreate Vault Tok...426143762022-07-12 18:39:5074 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.00597959307
0x5450d7921ab28bdc69e7c671544d2431a41101b19cd683a33d21b84801b4378cCreate Vault Tok...426143722022-07-12 18:39:4674 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005995931832
0x129f6729793a14e411dcb2978df3e9490182a5e98dd975074edd87095cc333c9Create Vault Tok...426143682022-07-12 18:39:4274 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.006005582941
0x3f8392aeb685dc4a205c9563721bf76ec7a0ddee1d09dc860acc3b32dc00bf33Create Vault Tok...426143632022-07-12 18:39:3774 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.006017872021
0x3fef16e48afde86f6f6aafbd684b1112bd701ab5caeb7b8e1ac3406747886518Create Vault Tok...426143592022-07-12 18:39:3474 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.006021448609
0x3bddcd346b5f90bc77e40597750912aef363bdd96683e4a52d73fed56927b434Create Vault Tok...426143522022-07-12 18:39:2774 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.006004685956
0x30ba5031978032863b13cfdfd89042026b15ef8f86df47dfbaf6210f1f8454e1Create Vault Tok...426143472022-07-12 18:39:2274 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.00598200774
0x8096b3eadd23076280a28ff21192aa01df9282bb512358f39bc42d7b473de0a5Create Vault Tok...426143432022-07-12 18:39:1674 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005438733514
0xb5370a90ac35c6ed5f5a83c66cfde6077703c95614d61fe0b4751dca1fbe5fc8Create Vault Tok...426143202022-07-12 18:38:4474 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005432193468
0xbafd26782ec231a15c53003927bb5e8f0615097ccf546edb888855b648d6ff94Create Vault Tok...426143162022-07-12 18:38:4074 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005429566852
0x33f3819dd88d324184afeb77846b711b408d87031e35b03d305bd2c6f90668a9Create Vault Tok...426143122022-07-12 18:38:3674 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.00542756472
0xd8a41a0b3efd94badd5249ae5bc1e76dd369dd057c71290ce56d3259c5d5ed2bCreate Vault Tok...426143082022-07-12 18:38:3374 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005426187071
0xdd80a5d1f0a18b7fed48fd103d3416b7496695958dfe0f9c5f31e6cf99210bbaCreate Vault Tok...426143052022-07-12 18:38:2974 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005418992263
0xbef0ac567805245198cc1000805b3b3bb050a1301b14c7540db69347a63dbcb1Create Vault Tok...426143002022-07-12 18:38:2474 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005448456534
0xc942b2ac6aace55d2e424045ebdf9e6403aba4ed9672a58433cf65b7b55fe854Create Vault Tok...426142962022-07-12 18:38:2074 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005452006629
0x572005e8f513d272080934fd88e6715bcea22d1e85a803b7abb8980de1afcd4bCreate Vault Tok...426142932022-07-12 18:38:1674 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005452188297
0x028d28d4310fb7d24e9ba845c4de77b629663e67d32c3be7202c56662db9e1edCreate Vault Tok...426142872022-07-12 18:38:0874 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005846623483
0xc14598f76b6d06400e61ec98cfd3240305f0b78569eb751fcb93ff8dfe563175Create Vault Tok...426142822022-07-12 18:37:5574 days 1 hr agoTarot: Deployer IN  0x701e3156c4e5abe044f756936792032bb96481b90 FTM0.005842108278
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xa4b0fe775a2b13df10ef5ec4bba6c79d44229a7d638fac5a7e787fae5d26413e426144252022-07-12 18:40:4274 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xaf778da280bd7b11c739e98be7fb7bd16075707a8a305feba3bf150fb6135a8a426144102022-07-12 18:40:2574 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x9b676a0dfc5a9345ad81b11b4e0147ddf0454d5d742a363350fed40802a28217426144032022-07-12 18:40:1674 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xdbe2f51bd5ac5397819f896523a3b6f68c8622a3a37bfef177202464a6291369426143972022-07-12 18:40:1074 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x52d9367d0c1b3b08713a4339439098196e54c164579fca4f79b86770f7bbcbd6426143942022-07-12 18:40:0774 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x000198dce1052284bc510e928a318943dc1e5438d9df51eeded407ad123bf55c426143862022-07-12 18:39:5974 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xc30554da35dab84c0bf82de81bf3cec86c6f415054208378360c4ebbc8f1db49426143812022-07-12 18:39:5574 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xbc6d8b4af65608bbbdd5014ee217a499dda2b1213003b44be064cef5228ac54d426143762022-07-12 18:39:5074 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x5450d7921ab28bdc69e7c671544d2431a41101b19cd683a33d21b84801b4378c426143722022-07-12 18:39:4674 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x129f6729793a14e411dcb2978df3e9490182a5e98dd975074edd87095cc333c9426143682022-07-12 18:39:4274 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x3f8392aeb685dc4a205c9563721bf76ec7a0ddee1d09dc860acc3b32dc00bf33426143632022-07-12 18:39:3774 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x3fef16e48afde86f6f6aafbd684b1112bd701ab5caeb7b8e1ac3406747886518426143592022-07-12 18:39:3474 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x3bddcd346b5f90bc77e40597750912aef363bdd96683e4a52d73fed56927b434426143522022-07-12 18:39:2774 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x30ba5031978032863b13cfdfd89042026b15ef8f86df47dfbaf6210f1f8454e1426143472022-07-12 18:39:2274 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x8096b3eadd23076280a28ff21192aa01df9282bb512358f39bc42d7b473de0a5426143432022-07-12 18:39:1674 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xb5370a90ac35c6ed5f5a83c66cfde6077703c95614d61fe0b4751dca1fbe5fc8426143202022-07-12 18:38:4474 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xbafd26782ec231a15c53003927bb5e8f0615097ccf546edb888855b648d6ff94426143162022-07-12 18:38:4074 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x33f3819dd88d324184afeb77846b711b408d87031e35b03d305bd2c6f90668a9426143122022-07-12 18:38:3674 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xd8a41a0b3efd94badd5249ae5bc1e76dd369dd057c71290ce56d3259c5d5ed2b426143082022-07-12 18:38:3374 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xdd80a5d1f0a18b7fed48fd103d3416b7496695958dfe0f9c5f31e6cf99210bba426143052022-07-12 18:38:2974 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xbef0ac567805245198cc1000805b3b3bb050a1301b14c7540db69347a63dbcb1426143002022-07-12 18:38:2474 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xc942b2ac6aace55d2e424045ebdf9e6403aba4ed9672a58433cf65b7b55fe854426142962022-07-12 18:38:2074 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x572005e8f513d272080934fd88e6715bcea22d1e85a803b7abb8980de1afcd4b426142932022-07-12 18:38:1674 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0x028d28d4310fb7d24e9ba845c4de77b629663e67d32c3be7202c56662db9e1ed426142872022-07-12 18:38:0874 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
0xc14598f76b6d06400e61ec98cfd3240305f0b78569eb751fcb93ff8dfe563175426142822022-07-12 18:37:5574 days 1 hr ago 0x701e3156c4e5abe044f756936792032bb96481b9  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SpookyV2VaultTokenFactory

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 18 : SpookyV2VaultTokenFactory.sol
pragma solidity =0.5.16;

import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./SpookyV2VaultToken.sol";
import "./interfaces/IMasterChef.sol";
import "./interfaces/ISpookyV2VaultTokenFactory.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IUniswapV2Router01.sol";

contract SpookyV2VaultTokenFactory is Ownable, ISpookyV2VaultTokenFactory {
    address public optiSwap;
    address public rewarderHelper;
    address public router;
    address public masterChef;
    address public rewardsToken;
    uint256 public swapFeeFactor;

    mapping(uint256 => address) public getVaultToken;
    address[] public allVaultTokens;

    event VaultTokenCreated(
        uint256 indexed pid,
        address vaultToken,
        uint256 vaultTokenIndex
    );

    constructor(
        address _optiSwap,
        address _rewarderHelper,
        address _router,
        address _masterChef,
        address _rewardsToken,
        uint256 _swapFeeFactor
    ) public {
        require(
            _swapFeeFactor >= 900 && _swapFeeFactor <= 1000,
            "VaultTokenFactory: INVALID_FEE_FACTOR"
        );
        optiSwap = _optiSwap;
        rewarderHelper = _rewarderHelper;
        router = _router;
        masterChef = _masterChef;
        rewardsToken = _rewardsToken;
        swapFeeFactor = _swapFeeFactor;
    }

    function allVaultTokensLength() external view returns (uint256) {
        return allVaultTokens.length;
    }

    function createVaultToken(uint256 pid)
        external
        returns (address vaultToken)
    {
        require(
            getVaultToken[pid] == address(0),
            "VaultTokenFactory: PID_EXISTS"
        );
        bytes memory bytecode = type(SpookyV2VaultToken).creationCode;
        assembly {
            vaultToken := create2(0, add(bytecode, 32), mload(bytecode), pid)
        }
        SpookyV2VaultToken(vaultToken)._initialize(
            optiSwap,
            rewarderHelper,
            IUniswapV2Router01(router),
            IMasterChef(masterChef),
            rewardsToken,
            swapFeeFactor,
            pid
        );
        getVaultToken[pid] = vaultToken;
        allVaultTokens.push(vaultToken);
        emit VaultTokenCreated(pid, vaultToken, allVaultTokens.length);
    }
}

File 2 of 18 : Ownable.sol
pragma solidity ^0.5.0;

import "../GSN/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.
 *
 * 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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _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 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 onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 18 : SpookyV2VaultToken.sol
pragma solidity =0.5.16;

import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./PoolToken.sol";
import "./interfaces/IMasterChef.sol";
import "./interfaces/ISpookyV2VaultToken.sol";
import "./interfaces/IOptiSwap.sol";
import "./interfaces/IRewarderHelper.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IUniswapV2Router01.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./libraries/SafeToken.sol";
import "./libraries/Math.sol";

interface OptiSwapPair {
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
}

interface MasterChefV2 {
    function rewarder(uint256 pid) external view returns (address);
    function lpToken(uint256 pid) external view returns (address);
}

contract SpookyV2VaultToken is ISpookyV2VaultToken, IUniswapV2Pair, PoolToken {
    using SafeToken for address;

    bool public constant isVaultToken = true;

    address public optiSwap;
    address public rewarderHelper;
    IUniswapV2Router01 public router;
    IMasterChef public masterChef;
    address public rewardsToken;
    address public WETH;
    address public token0;
    address public token1;
    uint256 public swapFeeFactor;
    uint256 public pid;
    uint256 public constant MIN_REINVEST_BOUNTY = 0.001e18;
    uint256 public constant MAX_REINVEST_BOUNTY = 0.01e18;
    uint256 public REINVEST_BOUNTY = MAX_REINVEST_BOUNTY;

    event ReinvestRewardToken(address indexed caller, address rewardToken, uint256 reward, uint256 bounty);
    event UpdateReinvestBounty(uint256 _newReinvestBounty);

    function _initialize(
        address _optiSwap,
        address _rewarderHelper,
        IUniswapV2Router01 _router,
        IMasterChef _masterChef,
        address _rewardsToken,
        uint256 _swapFeeFactor,
        uint256 _pid
    ) external {
        require(factory == address(0), "VaultToken: FACTORY_ALREADY_SET"); // sufficient check
        optiSwap = _optiSwap;
        rewarderHelper = _rewarderHelper;
        factory = msg.sender;
        _setName("Tarot Vault Token", "vTAROT");
        WETH = _router.WETH();
        router = _router;
        masterChef = _masterChef;
        swapFeeFactor = _swapFeeFactor;
        pid = _pid;
        underlying = MasterChefV2(address(masterChef)).lpToken(_pid);
        token0 = IUniswapV2Pair(underlying).token0();
        token1 = IUniswapV2Pair(underlying).token1();
        rewardsToken = _rewardsToken;
        rewardsToken.safeApprove(address(router), uint256(-1));
        WETH.safeApprove(address(router), uint256(-1));
        underlying.safeApprove(address(masterChef), uint256(-1));
    }

    function updateReinvestBounty(uint256 _newReinvestBounty) external onlyFactoryOwner {
        require(_newReinvestBounty >= MIN_REINVEST_BOUNTY && _newReinvestBounty <= MAX_REINVEST_BOUNTY, "VaultToken: INVLD_REINVEST_BOUNTY");
        REINVEST_BOUNTY = _newReinvestBounty;

        emit UpdateReinvestBounty(_newReinvestBounty);
    }

    function getRewardTokenInfo()
        public
        view
        returns (
            address[] memory rewardTokens,
            uint256[] memory pendingAmounts,
            uint256[] memory rewardRates
        ) {
            MasterChefV2 masterChefV2 = MasterChefV2(address(masterChef));
            address rewarder = masterChefV2.rewarder(pid);
            if (rewarder != address(0)) {
                return IRewarderHelper(rewarderHelper).getRewardTokenInfo(rewarder, address(this));
            }
        }

    function getRewardTokenInfoWithBalances()
        public
        view
        returns (
            address[] memory rewardTokens,
            uint256[] memory pendingAmounts,
            uint256[] memory rewardRates,
            uint256[] memory balances
        ) {
            MasterChefV2 masterChefV2 = MasterChefV2(address(masterChef));
            address rewarder = masterChefV2.rewarder(pid);
            if (rewarder != address(0)) {
                (rewardTokens, pendingAmounts, rewardRates) = IRewarderHelper(rewarderHelper).getRewardTokenInfo(rewarder, address(this));
                balances = new uint256[](rewardTokens.length);
                for (uint256 i = 0; i < rewardTokens.length; i++) {
                    balances[i] = rewardTokens[i].myBalance();
                }
            }
        }

    /*** PoolToken Overrides ***/

    function _update() internal {
        (uint256 _totalBalance, ) = masterChef.userInfo(pid, address(this));
        totalBalance = _totalBalance;
        emit Sync(totalBalance);
    }

    // this low-level function should be called from another contract
    function mint(address minter)
        external
        nonReentrant
        update
        returns (uint256 mintTokens)
    {
        uint256 mintAmount = underlying.myBalance();
        // handle pools with deposit fees by checking balance before and after deposit
        (uint256 _totalBalanceBefore, ) = masterChef.userInfo(
            pid,
            address(this)
        );
        masterChef.deposit(pid, mintAmount);
        (uint256 _totalBalanceAfter, ) = masterChef.userInfo(
            pid,
            address(this)
        );

        mintTokens = _totalBalanceAfter.sub(_totalBalanceBefore).mul(1e18).div(
            exchangeRate()
        );

        if (totalSupply == 0) {
            // permanently lock the first MINIMUM_LIQUIDITY tokens
            mintTokens = mintTokens.sub(MINIMUM_LIQUIDITY);
            _mint(address(0), MINIMUM_LIQUIDITY);
        }
        require(mintTokens > 0, "VaultToken: MINT_AMOUNT_ZERO");
        _mint(minter, mintTokens);
        emit Mint(msg.sender, minter, mintAmount, mintTokens);
    }

    // this low-level function should be called from another contract
    function redeem(address redeemer)
        external
        nonReentrant
        update
        returns (uint256 redeemAmount)
    {
        uint256 redeemTokens = balanceOf[address(this)];
        redeemAmount = redeemTokens.mul(exchangeRate()).div(1e18);

        require(redeemAmount > 0, "VaultToken: REDEEM_AMOUNT_ZERO");
        require(redeemAmount <= totalBalance, "VaultToken: INSUFFICIENT_CASH");
        _burn(address(this), redeemTokens);
        masterChef.withdraw(pid, redeemAmount);
        _safeTransfer(redeemer, redeemAmount);
        emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);
    }

    /*** Reinvest ***/

    function _optimalDepositA(
        uint256 _amountA,
        uint256 _reserveA,
        uint256 _swapFeeFactor
    ) internal pure returns (uint256) {
        uint256 a = uint256(1000).add(_swapFeeFactor).mul(_reserveA);
        uint256 b = _amountA.mul(1000).mul(_reserveA).mul(4).mul(
            _swapFeeFactor
        );
        uint256 c = Math.sqrt(a.mul(a).add(b));
        uint256 d = uint256(2).mul(_swapFeeFactor);
        return c.sub(a).div(d);
    }

    function approveRouter(address token, uint256 amount) internal {
        if (IERC20(token).allowance(address(this), address(router)) >= amount)
            return;
        token.safeApprove(address(router), uint256(-1));
    }

    function swapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint256 amount
    ) internal {
        address[] memory path = new address[](2);
        path[0] = address(tokenIn);
        path[1] = address(tokenOut);
        approveRouter(tokenIn, amount);
        router.swapExactTokensForTokens(amount, 0, path, address(this), now);
    }

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountA,
        uint256 amountB
    ) internal returns (uint256 liquidity) {
        approveRouter(tokenA, amountA);
        approveRouter(tokenB, amountB);
        (, , liquidity) = router.addLiquidity(
            tokenA,
            tokenB,
            amountA,
            amountB,
            0,
            0,
            address(this),
            now
        );
    }

    function swapTokensForBestAmountOut(
        IOptiSwap _optiSwap,
        address tokenIn,
        address tokenOut,
        uint256 amountIn
    ) internal returns (uint256 amountOut) {
        if (tokenIn == tokenOut) {
            return amountIn;
        }
        address pair;
        (pair, amountOut) = _optiSwap.getBestAmountOut(amountIn, tokenIn, tokenOut);
        require(pair != address(0), "NO_PAIR");
        tokenIn.safeTransfer(pair, amountIn);
        if (tokenIn < tokenOut) {
            OptiSwapPair(pair).swap(0, amountOut, address(this), new bytes(0));
        } else {
            OptiSwapPair(pair).swap(amountOut, 0, address(this), new bytes(0));
        }
    }

    function optiSwapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint256 amountIn
    ) internal returns (uint256 amountOut) {
        if (tokenIn == tokenOut) {
            return amountIn;
        }
        IOptiSwap _optiSwap = IOptiSwap(optiSwap);
        address nextHop = _optiSwap.getBridgeToken(tokenIn);
        if (nextHop == tokenOut) {
            return swapTokensForBestAmountOut(_optiSwap, tokenIn, tokenOut, amountIn);
        }
        address waypoint = _optiSwap.getBridgeToken(tokenOut);
        if (tokenIn == waypoint) {
            return swapTokensForBestAmountOut(_optiSwap, tokenIn, tokenOut, amountIn);
        }
        uint256 hopAmountOut;
        if (nextHop != tokenIn) {
            hopAmountOut = swapTokensForBestAmountOut(_optiSwap, tokenIn, nextHop, amountIn);
        } else {
            hopAmountOut = amountIn;
        }
        if (nextHop == waypoint) {
            return swapTokensForBestAmountOut(_optiSwap, nextHop, tokenOut, hopAmountOut);
        } else if (waypoint == tokenOut) {
            return optiSwapExactTokensForTokens(nextHop, tokenOut, hopAmountOut);
        } else {
            uint256 waypointAmountOut = optiSwapExactTokensForTokens(nextHop, waypoint, hopAmountOut);
            return swapTokensForBestAmountOut(_optiSwap, waypoint, tokenOut, waypointAmountOut);
        }
    }

    function reinvest() external nonReentrant update {
        require(msg.sender == tx.origin);
        // 1. Withdraw all the rewards.
        masterChef.withdraw(pid, 0);

        uint256 liquidity = reinvestOne(rewardsToken);
        (address[] memory rewardTokens, ,) = getRewardTokenInfo();
        for (uint256 i = 0; i < rewardTokens.length; i++) {
            liquidity += reinvestOne(rewardTokens[i]);
        }

        // 5. Stake the LP Tokens.
        masterChef.deposit(pid, liquidity);
    }

    function reinvestOne(address _rewardToken) internal returns (uint256 liquidity) {
        uint256 reward = _rewardToken.myBalance();
        if (reward == 0) return 0;
        // 2. Send the reward bounty to the caller.
        uint256 bounty = reward.mul(REINVEST_BOUNTY) / 1e18;
        _rewardToken.safeTransfer(msg.sender, bounty);
        // 3. Convert all the remaining rewards to token0 or token1.
        address tokenA;
        address tokenB;
        if (token0 == _rewardToken || token1 == _rewardToken) {
            (tokenA, tokenB) = token0 == _rewardToken
                ? (token0, token1)
                : (token1, token0);
        } else {
            if (token1 == WETH) {
                (tokenA, tokenB) = (token1, token0);
            } else {
                (tokenA, tokenB) = (token0, token1);
            }
            optiSwapExactTokensForTokens(_rewardToken, tokenA, reward.sub(bounty));
        }
        // 4. Convert tokenA to LP Token underlyings.
        uint256 totalAmountA = tokenA.myBalance();
        assert(totalAmountA > 0);
        (uint256 r0, uint256 r1, ) = IUniswapV2Pair(underlying).getReserves();
        uint256 reserveA = tokenA == token0 ? r0 : r1;
        uint256 swapAmount = _optimalDepositA(
            totalAmountA,
            reserveA,
            swapFeeFactor
        );
        uint256 balanceBeforeB = tokenB.myBalance();
        swapExactTokensForTokens(tokenA, tokenB, swapAmount);
        uint256 balanceAfterB = tokenB.myBalance();
        uint256 deltaB = balanceAfterB.sub(balanceBeforeB);
        liquidity = addLiquidity(
            tokenA,
            tokenB,
            totalAmountA.sub(swapAmount),
            deltaB
        );
        emit ReinvestRewardToken(msg.sender, _rewardToken, reward, bounty);
    }

    /*** Mirrored From uniswapV2Pair ***/

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        )
    {
        (reserve0, reserve1, blockTimestampLast) = IUniswapV2Pair(underlying)
        .getReserves();
        // if no token has been minted yet mirror uniswap getReserves
        if (totalSupply == 0) return (reserve0, reserve1, blockTimestampLast);
        // else, return the underlying reserves of this contract
        uint256 _totalBalance = totalBalance;
        uint256 _totalSupply = IUniswapV2Pair(underlying).totalSupply();
        reserve0 = safe112(_totalBalance.mul(reserve0).div(_totalSupply));
        reserve1 = safe112(_totalBalance.mul(reserve1).div(_totalSupply));
        require(
            reserve0 > 100 && reserve1 > 100,
            "VaultToken: INSUFFICIENT_RESERVES"
        );
    }

    function price0CumulativeLast() external view returns (uint256) {
        return IUniswapV2Pair(underlying).price0CumulativeLast();
    }

    function price1CumulativeLast() external view returns (uint256) {
        return IUniswapV2Pair(underlying).price1CumulativeLast();
    }

    /*** Utilities ***/

    function safe112(uint256 n) internal pure returns (uint112) {
        require(n < 2**112, "VaultToken: SAFE112");
        return uint112(n);
    }

    /*** Modifiers ***/

    modifier onlyFactoryOwner() {
        require(Ownable(factory).owner() == msg.sender, "NOT_AUTHORIZED");
        _;
    }
}

File 4 of 18 : IMasterChef.sol
pragma solidity 0.5.16;

import "./IERC20.sol";

// Making the original MasterChef as an interface leads to compilation fail.
// Use Contract instead of Interface here
contract IMasterChef {
    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. Reward tokens to distribute per block.
        uint256 lastRewardBlock; // Last block number that reward token distribution occurs.
        uint256 accRewardTokenPerShare; // Accumulated reward tokens per share, times 1e12. See below.
    }

    // Info of each user that stakes LP tokens.
    mapping(uint256 => PoolInfo) public poolInfo;
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

    // Deposit LP tokens to MasterChef.
    function deposit(uint256 _pid, uint256 _amount) external {}

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) external {}
}

File 5 of 18 : ISpookyV2VaultTokenFactory.sol
pragma solidity >=0.5.0;

interface ISpookyV2VaultTokenFactory {
    event VaultTokenCreated(
        uint256 indexed pid,
        address vaultToken,
        uint256 vaultTokenIndex
    );

    function optiSwap() external view returns (address);

    function rewarderHelper() external view returns (address);

    function router() external view returns (address);

    function masterChef() external view returns (address);

    function rewardsToken() external view returns (address);

    function swapFeeFactor() external view returns (uint256);

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

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

    function allVaultTokensLength() external view returns (uint256);

    function createVaultToken(uint256 pid)
        external
        returns (address vaultToken);
}

File 6 of 18 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

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

    function totalSupply() external view returns (uint256);

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

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

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

File 7 of 18 : IUniswapV2Router01.sol
pragma solidity >=0.5.0;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 liquidity
        );

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountToken, uint256 amountETH);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapETHForExactTokens(
        uint256 amountOut,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function quote(
        uint256 amountA,
        uint256 reserveA,
        uint256 reserveB
    ) external pure returns (uint256 amountB);

    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountOut);

    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountIn);

    function getAmountsOut(uint256 amountIn, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);

    function getAmountsIn(uint256 amountOut, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);
}

File 8 of 18 : Context.sol
pragma solidity ^0.5.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

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

File 9 of 18 : PoolToken.sol
pragma solidity =0.5.16;

import "./TarotERC20.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IPoolToken.sol";
import "./libraries/SafeMath.sol";

contract PoolToken is IPoolToken, TarotERC20 {
    uint256 internal constant initialExchangeRate = 1e18;
    address public underlying;
    address public factory;
    uint256 public totalBalance;
    uint256 public constant MINIMUM_LIQUIDITY = 1000;

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    /*** Initialize ***/

    // called once by the factory
    function _setFactory() external {
        require(factory == address(0), "Tarot: FACTORY_ALREADY_SET");
        factory = msg.sender;
    }

    /*** PoolToken ***/

    function _update() internal {
        totalBalance = IERC20(underlying).balanceOf(address(this));
        emit Sync(totalBalance);
    }

    function exchangeRate() public view returns (uint256) {
        uint256 _totalSupply = totalSupply; // gas savings
        uint256 _totalBalance = totalBalance; // gas savings
        if (_totalSupply == 0 || _totalBalance == 0) return initialExchangeRate;
        return _totalBalance.mul(1e18).div(_totalSupply);
    }

    // this low-level function should be called from another contract
    function mint(address minter)
        external
        nonReentrant
        update
        returns (uint256 mintTokens)
    {
        uint256 balance = IERC20(underlying).balanceOf(address(this));
        uint256 mintAmount = balance.sub(totalBalance);
        mintTokens = mintAmount.mul(1e18).div(exchangeRate());

        if (totalSupply == 0) {
            // permanently lock the first MINIMUM_LIQUIDITY tokens
            mintTokens = mintTokens.sub(MINIMUM_LIQUIDITY);
            _mint(address(0), MINIMUM_LIQUIDITY);
        }
        require(mintTokens > 0, "Tarot: MINT_AMOUNT_ZERO");
        _mint(minter, mintTokens);
        emit Mint(msg.sender, minter, mintAmount, mintTokens);
    }

    // this low-level function should be called from another contract
    function redeem(address redeemer)
        external
        nonReentrant
        update
        returns (uint256 redeemAmount)
    {
        uint256 redeemTokens = balanceOf[address(this)];
        redeemAmount = redeemTokens.mul(exchangeRate()).div(1e18);

        require(redeemAmount > 0, "Tarot: REDEEM_AMOUNT_ZERO");
        require(redeemAmount <= totalBalance, "Tarot: INSUFFICIENT_CASH");
        _burn(address(this), redeemTokens);
        _safeTransfer(redeemer, redeemAmount);
        emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);
    }

    // force real balance to match totalBalance
    function skim(address to) external nonReentrant {
        _safeTransfer(
            to,
            IERC20(underlying).balanceOf(address(this)).sub(totalBalance)
        );
    }

    // force totalBalance to match real balance
    function sync() external nonReentrant update {}

    /*** Utilities ***/

    // same safe transfer function used by UniSwapV2 (with fixed underlying)
    bytes4 private constant SELECTOR =
        bytes4(keccak256(bytes("transfer(address,uint256)")));

    function _safeTransfer(address to, uint256 amount) internal {
        (bool success, bytes memory data) = underlying.call(
            abi.encodeWithSelector(SELECTOR, to, amount)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "Tarot: TRANSFER_FAILED"
        );
    }

    // prevents a contract from calling itself, directly or indirectly.
    bool internal _notEntered = true;
    modifier nonReentrant() {
        require(_notEntered, "Tarot: REENTERED");
        _notEntered = false;
        _;
        _notEntered = true;
    }

    // update totalBalance with current balance
    modifier update() {
        _;
        _update();
    }
}

File 10 of 18 : ISpookyV2VaultToken.sol
pragma solidity >=0.5.0;

import "./IMasterChef.sol";
import "./IUniswapV2Router01.sol";

interface ISpookyV2VaultToken {
    /*** Tarot ERC20 ***/

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

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /*** Pool Token ***/

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external view returns (uint256);

    function mint(address minter) external returns (uint256 mintTokens);

    function redeem(address redeemer) external returns (uint256 redeemAmount);

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;

    /*** VaultToken ***/

    event Reinvest(address indexed caller, uint256 reward, uint256 bounty);

    function isVaultToken() external pure returns (bool);

    function router() external view returns (IUniswapV2Router01);

    function masterChef() external view returns (IMasterChef);

    function rewardsToken() external view returns (address);

    function WETH() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function swapFeeFactor() external view returns (uint256);

    function pid() external view returns (uint256);

    function REINVEST_BOUNTY() external pure returns (uint256);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function _initialize(
        address _optiSwap,
        address _rewarderHelper,
        IUniswapV2Router01 _router,
        IMasterChef _masterChef,
        address _rewardsToken,
        uint256 _swapFeeFactor,
        uint256 _pid
    ) external;

    function reinvest() external;
}

File 11 of 18 : IOptiSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface IOptiSwap {
    function weth() external view returns (address);

    function bridgeFromTokens(uint256 index) external view returns (address token);

    function bridgeFromTokensLength() external view returns (uint256);

    function getBridgeToken(address _token) external view returns (address bridgeToken);

    function addBridgeToken(address _token, address _bridgeToken) external;

    function getDexInfo(uint256 index) external view returns (address dex, address handler);

    function dexListLength() external view returns (uint256);

    function indexOfDex(address _dex) external view returns (uint256);

    function getDexEnabled(address _dex) external view returns (bool);

    function addDex(address _dex, address _handler) external;

    function removeDex(address _dex) external;

    function getBestAmountOut(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut
    ) external view returns (address pair, uint256 amountOut);
}

File 12 of 18 : IRewarderHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface IRewarderHelper {
    function getRewardTokenInfo(address _rewarder, address _vaultToken)
        external
        view
        returns (
            address[] memory rewardTokens,
            uint256[] memory pendingAmounts,
            uint256[] memory rewardRates
        );
}

File 13 of 18 : IERC20.sol
pragma solidity >=0.5.0;

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

    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 owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);
}

File 14 of 18 : SafeToken.sol
pragma solidity 0.5.16;

interface ERC20Interface {
    function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
    function myBalance(address token) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(address(this));
    }

    function balanceOf(address token, address user)
        internal
        view
        returns (uint256)
    {
        return ERC20Interface(token).balanceOf(user);
    }

    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x095ea7b3, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeApprove"
        );
    }

    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0xa9059cbb, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeTransfer"
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x23b872dd, from, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeTransferFrom"
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call.value(value)(new bytes(0));
        require(success, "!safeTransferETH");
    }
}

File 15 of 18 : Math.sol
pragma solidity =0.5.16;

// a library for performing various math operations
// forked from: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/libraries/Math.sol

library Math {
    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

File 16 of 18 : TarotERC20.sol
pragma solidity =0.5.16;

import "./libraries/SafeMath.sol";

// This contract is basically UniswapV2ERC20 with small modifications
// src: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol

contract TarotERC20 {
    using SafeMath for uint256;

    string public name;
    string public symbol;
    uint8 public decimals = 18;
    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    bytes32 public DOMAIN_SEPARATOR;
    mapping(address => uint256) public nonces;

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

    constructor() public {}

    function _setName(string memory _name, string memory _symbol) internal {
        name = _name;
        symbol = _symbol;
        uint256 chainId;
        assembly {
            chainId := chainid
        }
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                ),
                keccak256(bytes(_name)),
                keccak256(bytes("1")),
                chainId,
                address(this)
            )
        );
    }

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

    function _burn(address from, uint256 value) internal {
        balanceOf[from] = balanceOf[from].sub(value);
        totalSupply = totalSupply.sub(value);
        emit Transfer(from, address(0), value);
    }

    function _approve(
        address owner,
        address spender,
        uint256 value
    ) private {
        allowance[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function _transfer(
        address from,
        address to,
        uint256 value
    ) internal {
        balanceOf[from] = balanceOf[from].sub(
            value,
            "Tarot: TRANSFER_TOO_HIGH"
        );
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(from, to, value);
    }

    function approve(address spender, uint256 value) external returns (bool) {
        _approve(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool) {
        if (allowance[from][msg.sender] != uint256(-1)) {
            allowance[from][msg.sender] = allowance[from][msg.sender].sub(
                value,
                "Tarot: TRANSFER_NOT_ALLOWED"
            );
        }
        _transfer(from, to, value);
        return true;
    }

    function _checkSignature(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s,
        bytes32 typehash
    ) internal {
        require(deadline >= block.timestamp, "Tarot: EXPIRED");
        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR,
                keccak256(
                    abi.encode(
                        typehash,
                        owner,
                        spender,
                        value,
                        nonces[owner]++,
                        deadline
                    )
                )
            )
        );
        address recoveredAddress = ecrecover(digest, v, r, s);
        require(
            recoveredAddress != address(0) && recoveredAddress == owner,
            "Tarot: INVALID_SIGNATURE"
        );
    }

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

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        _checkSignature(
            owner,
            spender,
            value,
            deadline,
            v,
            r,
            s,
            PERMIT_TYPEHASH
        );
        _approve(owner, spender, value);
    }
}

File 17 of 18 : IPoolToken.sol
pragma solidity >=0.5.0;

interface IPoolToken {
    /*** Tarot ERC20 ***/

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

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /*** Pool Token ***/

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external view returns (uint256);

    function mint(address minter) external returns (uint256 mintTokens);

    function redeem(address redeemer) external returns (uint256 redeemAmount);

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;
}

File 18 of 18 : SafeMath.sol
pragma solidity =0.5.16;

// 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_optiSwap","type":"address"},{"internalType":"address","name":"_rewarderHelper","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_masterChef","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"uint256","name":"_swapFeeFactor","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"vaultToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"vaultTokenIndex","type":"uint256"}],"name":"VaultTokenCreated","type":"event"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allVaultTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allVaultTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"createVaultToken","outputs":[{"internalType":"address","name":"vaultToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getVaultToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"masterChef","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"optiSwap","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rewarderHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"swapFeeFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516146b93803806146b9833981810160405260c081101561003357600080fd5b508051602082015160408301516060840151608085015160a0909501519394929391929091600061006b6001600160e01b0361016a16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061038481101580156100c957506103e88111155b6101045760405162461bcd60e51b81526004018080602001828103825260258152602001806146946025913960400191505060405180910390fd5b600180546001600160a01b03199081166001600160a01b039889161790915560028054821696881696909617909555600380548616948716949094179093556004805485169286169290921790915560058054909316931692909217905560065561016e565b3390565b6145178061017d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063b3ac2cbf11610066578063b3ac2cbf146101ad578063d1af0c7d146101ca578063f2fde38b146101d2578063f887ea40146101f8576100ea565b80638da5cb5b1461016c5780638f32d59b14610174578063a9a1e13814610190576100ea565b8063575a86b2116100c8578063575a86b21461014a57806360c2affa1461015257806368f91a441461015a578063715018a614610162576100ea565b806302490768146100ef57806308ee8d6a1461011357806329e15d0b14610130575b600080fd5b6100f7610200565b604080516001600160a01b039092168252519081900360200190f35b6100f76004803603602081101561012957600080fd5b503561020f565b61013861022a565b60408051918252519081900360200190f35b6100f7610230565b6100f761023f565b61013861024e565b61016a610254565b005b6100f76102f7565b61017c610306565b604080519115158252519081900360200190f35b6100f7600480360360208110156101a657600080fd5b503561032a565b6100f7600480360360208110156101c357600080fd5b5035610351565b6100f7610541565b61016a600480360360208110156101e857600080fd5b50356001600160a01b0316610550565b6100f76105b5565b6002546001600160a01b031681565b6007602052600090815260409020546001600160a01b031681565b60085490565b6004546001600160a01b031681565b6001546001600160a01b031681565b60065481565b61025c610306565b6102ad576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b031661031b6105c4565b6001600160a01b031614905090565b6008818154811061033757fe5b6000918252602090912001546001600160a01b0316905081565b6000818152600760205260408120546001600160a01b0316156103bb576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e466163746f72793a205049445f455849535453000000604482015290519081900360640190fd5b6060604051806020016103cd90610668565b6020820181038252601f19601f820116604052509050828151602083016000f5600154600254600354600480546005546006546040805163640ad44560e11b81526001600160a01b03988916958101959095529587166024850152938616604484015290851660648301528416608482015260a481019190915260c4810187905290519294509084169163c815a88a9160e48082019260009290919082900301818387803b15801561047e57600080fd5b505af1158015610492573d6000803e3d6000fd5b505050600084815260076020908152604080832080546001600160a01b0388166001600160a01b0319918216811790925560088054600181018255958190527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909501805490911682179055925481519384529183019190915280518693507f42c2f0d6763288ab9d586235f818373d880de5f012d7a67d672822104747a1349281900390910190a250919050565b6005546001600160a01b031681565b610558610306565b6105a9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6105b2816105c8565b50565b6003546001600160a01b031681565b3390565b6001600160a01b03811661060d5760405162461bcd60e51b81526004018080602001828103825260268152602001806144bd6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b613e47806106768339019056fe60806040526002805460ff19908116601217909155600b80549091166001179055662386f26fc10000601555613e0d8061003a6000396000f3fe608060405234801561001057600080fd5b506004361061027f5760003560e01c80636f307dc31161015c578063bc25cf77116100ce578063d505accf11610087578063d505accf14610827578063dd62ed3e14610878578063f1068454146108a6578063f887ea40146108ae578063fdb5a03e146108b6578063fff6cae9146108be5761027f565b8063bc25cf771461078f578063c45a0155146107b5578063c815a88a146107bd578063c8c4ff8c1461080f578063d1af0c7d14610817578063d21220a71461081f5761027f565b806395d89b411161012057806395d89b411461073b57806396fa4c1114610743578063a9059cbb1461074b578063ad5c464814610777578063ad7a672f1461077f578063ba9a7a56146107875761027f565b80636f307dc31461059657806370a082311461059e5780637ecebe00146105c4578063885f3ee6146105ea57806395a2251f146107155761027f565b806346fb738b116101f557806360c2affa116101b957806360c2affa1461046a578063647428b91461047257806368f91a44146105585780636a627842146105605780636c2a3bc5146105865780636ee272271461058e5761027f565b806346fb738b1461042b5780634a5d316c1461044a578063575a86b2146104525780635909c0d51461045a5780635a3d5493146104625761027f565b806318160ddd1161024757806318160ddd146103a557806323b872dd146103bf57806330adf81f146103f5578063313ce567146103fd5780633644e5151461041b5780633ba0b9a9146104235761027f565b8063024907681461028457806306fdde03146102a85780630902f1ac14610325578063095ea7b31461035d5780630dfe16811461039d575b600080fd5b61028c6108c6565b604080516001600160a01b039092168252519081900360200190f35b6102b06108d5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102ea5781810151838201526020016102d2565b50505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61032d610963565b604080516001600160701b03948516815292909316602083015263ffffffff168183015290519081900360600190f35b6103896004803603604081101561037357600080fd5b506001600160a01b038135169060200135610b33565b604080519115158252519081900360200190f35b61028c610b4a565b6103ad610b59565b60408051918252519081900360200190f35b610389600480360360608110156103d557600080fd5b506001600160a01b03813581169160208101359091169060400135610b5f565b6103ad610c2f565b610405610c53565b6040805160ff9092168252519081900360200190f35b6103ad610c5c565b6103ad610c62565b6104486004803603602081101561044157600080fd5b5035610cb2565b005b610448610e02565b61028c610e74565b6103ad610e83565b6103ad610ef9565b61028c610f3e565b61047a610f52565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156104c25781810151838201526020016104aa565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156105015781810151838201526020016104e9565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015610540578181015183820152602001610528565b50505050905001965050505050505060405180910390f35b6103ad61121d565b6103ad6004803603602081101561057657600080fd5b50356001600160a01b0316611223565b6103ad61152e565b610389611534565b61028c611539565b6103ad600480360360208110156105b457600080fd5b50356001600160a01b0316611548565b6103ad600480360360208110156105da57600080fd5b50356001600160a01b031661155a565b6105f261156c565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561063e578181015183820152602001610626565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561067d578181015183820152602001610665565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156106bc5781810151838201526020016106a4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156106fb5781810151838201526020016106e3565b505050509050019850505050505050505060405180910390f35b6103ad6004803603602081101561072b57600080fd5b50356001600160a01b03166118bd565b6102b0611aca565b6103ad611b24565b6103896004803603604081101561076157600080fd5b506001600160a01b038135169060200135611b2f565b61028c611b3c565b6103ad611b4b565b6103ad611b51565b610448600480360360208110156107a557600080fd5b50356001600160a01b0316611b57565b61028c611c51565b610448600480360360e08110156107d357600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101358216916080820135169060a08101359060c00135611c60565b6103ad612008565b61028c612013565b61028c612022565b610448600480360360e081101561083d57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135612031565b6103ad6004803603604081101561088e57600080fd5b506001600160a01b038135811691602001351661206c565b6103ad612089565b61028c61208f565b61044861209e565b610448612253565b600c546001600160a01b031681565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561095b5780601f106109305761010080835404028352916020019161095b565b820191906000526020600020905b81548152906001019060200180831161093e57829003601f168201915b505050505081565b6000806000600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156109b657600080fd5b505afa1580156109ca573d6000803e3d6000fd5b505050506040513d60608110156109e057600080fd5b5080516020820151604090920151600354919550919350909150610a0357610b2e565b600a54600854604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d6020811015610a7557600080fd5b50519050610aaa610aa582610a99856001600160701b038a1663ffffffff6122af16565b9063ffffffff61230816565b61234a565b9450610acc610aa582610a99856001600160701b03891663ffffffff6122af16565b93506064856001600160701b0316118015610af057506064846001600160701b0316115b610b2b5760405162461bcd60e51b8152600401808060200182810382526021815260200180613db86021913960400191505060405180910390fd5b50505b909192565b6000610b403384846123a2565b5060015b92915050565b6011546001600160a01b031681565b60035481565b6001600160a01b038316600090815260056020908152604080832033845290915281205460001914610c1957604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b0387166000908152600582528381203382529091529190912054610bf491849063ffffffff61240416565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b610c2484848461249b565b5060015b9392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b60065481565b600354600a5460009190811580610c77575080155b15610c8e57670de0b6b3a764000092505050610caf565b610caa82610a9983670de0b6b3a764000063ffffffff6122af16565b925050505b90565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015610cf657600080fd5b505afa158015610d0a573d6000803e3d6000fd5b505050506040513d6020811015610d2057600080fd5b50516001600160a01b031614610d6e576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b604482015290519081900360640190fd5b66038d7ea4c680008110158015610d8c5750662386f26fc100008111155b610dc75760405162461bcd60e51b8152600401808060200182810382526021815260200180613d976021913960400191505060405180910390fd5b60158190556040805182815290517ffa1e13889c5c5294758f01f045a83de15feca61a17e6281f4d11a5110085d9329181900360200190a150565b6009546001600160a01b031615610e60576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600e546001600160a01b031681565b60085460408051635909c0d560e01b815290516000926001600160a01b031691635909c0d5916004808301926020929190829003018186803b158015610ec857600080fd5b505afa158015610edc573d6000803e3d6000fd5b505050506040513d6020811015610ef257600080fd5b5051905090565b60085460408051635a3d549360e01b815290516000926001600160a01b031691635a3d5493916004808301926020929190829003018186803b158015610ec857600080fd5b600b5461010090046001600160a01b031681565b600e546014546040805163c346253d60e01b8152600481019290925251606092839283926001600160a01b0390921691600091839163c346253d91602480820192602092909190829003018186803b158015610fad57600080fd5b505afa158015610fc1573d6000803e3d6000fd5b505050506040513d6020811015610fd757600080fd5b505190506001600160a01b03811615610b2b57600c546040805163bab5705b60e01b81526001600160a01b0384811660048301523060248301529151919092169163bab5705b916044808301926000929190829003018186803b15801561103d57600080fd5b505afa158015611051573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052606081101561107a57600080fd5b8101908080516040519392919084600160201b82111561109957600080fd5b9083019060208201858111156110ae57600080fd5b82518660208202830111600160201b821117156110ca57600080fd5b82525081516020918201928201910280838360005b838110156110f75781810151838201526020016110df565b5050505090500160405260200180516040519392919084600160201b82111561111f57600080fd5b90830190602082018581111561113457600080fd5b82518660208202830111600160201b8211171561115057600080fd5b82525081516020918201928201910280838360005b8381101561117d578181015183820152602001611165565b5050505090500160405260200180516040519392919084600160201b8211156111a557600080fd5b9083019060208201858111156111ba57600080fd5b82518660208202830111600160201b821117156111d657600080fd5b82525081516020918201928201910280838360005b838110156112035781810151838201526020016111eb565b505050509050016040525050509450945094505050610b2e565b60135481565b600b5460009060ff16611270576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854600090611292906001600160a01b031661258d565b600e54601454604080516393f1a40b60e01b8152600481019290925230602483015280519394506000936001600160a01b03909316926393f1a40b926044808201939291829003018186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d604081101561131457600080fd5b5051600e5460145460408051631c57762b60e31b8152600481019290925260248201869052519293506001600160a01b039091169163e2bbb1589160448082019260009290919082900301818387803b15801561137057600080fd5b505af1158015611384573d6000803e3d6000fd5b5050600e54601454604080516393f1a40b60e01b815260048101929092523060248301528051600095506001600160a01b0390931693506393f1a40b92604480840193829003018186803b1580156113db57600080fd5b505afa1580156113ef573d6000803e3d6000fd5b505050506040513d604081101561140557600080fd5b5051905061143c611414610c62565b610a99670de0b6b3a7640000611430858763ffffffff61260916565b9063ffffffff6122af16565b93506003546000141561146a5761145b846103e863ffffffff61260916565b935061146a60006103e861264b565b600084116114bf576040805162461bcd60e51b815260206004820152601c60248201527f5661756c74546f6b656e3a204d494e545f414d4f554e545f5a45524f00000000604482015290519081900360640190fd5b6114c9858561264b565b604080518481526020810186905281516001600160a01b0388169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a350505061151c6126e2565b600b805460ff19166001179055919050565b60155481565b600181565b6008546001600160a01b031681565b60046020526000908152604090205481565b60076020526000908152604090205481565b600e546014546040805163c346253d60e01b81526004810192909252516060928392839283926001600160a01b031691600091839163c346253d916024808301926020929190829003018186803b1580156115c657600080fd5b505afa1580156115da573d6000803e3d6000fd5b505050506040513d60208110156115f057600080fd5b505190506001600160a01b038116156118b557600c546040805163bab5705b60e01b81526001600160a01b0384811660048301523060248301529151919092169163bab5705b916044808301926000929190829003018186803b15801561165657600080fd5b505afa15801561166a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052606081101561169357600080fd5b8101908080516040519392919084600160201b8211156116b257600080fd5b9083019060208201858111156116c757600080fd5b82518660208202830111600160201b821117156116e357600080fd5b82525081516020918201928201910280838360005b838110156117105781810151838201526020016116f8565b5050505090500160405260200180516040519392919084600160201b82111561173857600080fd5b90830190602082018581111561174d57600080fd5b82518660208202830111600160201b8211171561176957600080fd5b82525081516020918201928201910280838360005b8381101561179657818101518382015260200161177e565b5050505090500160405260200180516040519392919084600160201b8211156117be57600080fd5b9083019060208201858111156117d357600080fd5b82518660208202830111600160201b821117156117ef57600080fd5b82525081516020918201928201910280838360005b8381101561181c578181015183820152602001611804565b505050509050016040525050508096508197508298505050508551604051908082528060200260200182016040528015611860578160200160208202803883390190505b50925060005b86518110156118b35761189487828151811061187e57fe5b60200260200101516001600160a01b031661258d565b8482815181106118a057fe5b6020908102919091010152600101611866565b505b505090919293565b600b5460009060ff1661190a576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905530600090815260046020526040902054611948670de0b6b3a7640000610a9961193b610c62565b849063ffffffff6122af16565b91506000821161199f576040805162461bcd60e51b815260206004820152601e60248201527f5661756c74546f6b656e3a2052454445454d5f414d4f554e545f5a45524f0000604482015290519081900360640190fd5b600a548211156119f6576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e3a20494e53554646494349454e545f43415348000000604482015290519081900360640190fd5b611a0030826127a0565b600e5460145460408051630441a3e760e41b8152600481019290925260248201859052516001600160a01b039092169163441a3e709160448082019260009290919082900301818387803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b50505050611a79838361283d565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a35061151c6126e2565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561095b5780601f106109305761010080835404028352916020019161095b565b66038d7ea4c6800081565b6000610b4033848461249b565b6010546001600160a01b031681565b600a5481565b6103e881565b600b5460ff16611ba1576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b81523060048201529051611c41938593611c3c9391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015611c0457600080fd5b505afa158015611c18573d6000803e3d6000fd5b505050506040513d6020811015611c2e57600080fd5b50519063ffffffff61260916565b61283d565b50600b805460ff19166001179055565b6009546001600160a01b031681565b6009546001600160a01b031615611cbe576040805162461bcd60e51b815260206004820152601f60248201527f5661756c74546f6b656e3a20464143544f52595f414c52454144595f53455400604482015290519081900360640190fd5b600b80546001600160a01b03808a1661010002610100600160a81b031990921691909117909155600c80549188166001600160a01b0319928316179055600980549091163317905560408051808201825260118152702a30b937ba102b30bab63a102a37b5b2b760791b602080830191909152825180840190935260068352651d95105493d560d21b90830152611d54916129cf565b846001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d8d57600080fd5b505afa158015611da1573d6000803e3d6000fd5b505050506040513d6020811015611db757600080fd5b5051601080546001600160a01b03199081166001600160a01b0393841617909155600d80548216888416179055600e8054909116868316179081905560138490556014839055604080516378ed5d1f60e01b815260048101859052905191909216916378ed5d1f916024808301926020929190829003018186803b158015611e3e57600080fd5b505afa158015611e52573d6000803e3d6000fd5b505050506040513d6020811015611e6857600080fd5b5051600880546001600160a01b0319166001600160a01b03928316179081905560408051630dfe168160e01b815290519190921691630dfe1681916004808301926020929190829003018186803b158015611ec257600080fd5b505afa158015611ed6573d6000803e3d6000fd5b505050506040513d6020811015611eec57600080fd5b5051601180546001600160a01b0319166001600160a01b039283161790556008546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611f4757600080fd5b505afa158015611f5b573d6000803e3d6000fd5b505050506040513d6020811015611f7157600080fd5b5051601280546001600160a01b03199081166001600160a01b0393841617909155600f80549091168583161790819055600d54611fb5929182169116600019612a97565b600d54601054611fda916001600160a01b03918216911660001963ffffffff612a9716565b600e54600854611fff916001600160a01b03918216911660001963ffffffff612a9716565b50505050505050565b662386f26fc1000081565b600f546001600160a01b031681565b6012546001600160a01b031681565b612061878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612bf0565b611fff8787876123a2565b600560209081526000928352604080842090915290825290205481565b60145481565b600d546001600160a01b031681565b600b5460ff166120e8576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690553332146120fe57600080fd5b600e5460145460408051630441a3e760e41b8152600481019290925260006024830181905290516001600160a01b039093169263441a3e7092604480820193929182900301818387803b15801561215457600080fd5b505af1158015612168573d6000803e3d6000fd5b5050600f546000925061218491506001600160a01b0316612dc5565b90506060612190610f52565b50909150600090505b81518110156121ca576121be8282815181106121b157fe5b6020026020010151612dc5565b90920191600101612199565b50600e5460145460408051631c57762b60e31b8152600481019290925260248201859052516001600160a01b039092169163e2bbb1589160448082019260009290919082900301818387803b15801561222257600080fd5b505af1158015612236573d6000803e3d6000fd5b5050505050506122446126e2565b600b805460ff19166001179055565b600b5460ff1661229d576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690556122446126e2565b6000826122be57506000610b44565b828202828482816122cb57fe5b0414610c285760405162461bcd60e51b8152600401808060200182810382526021815260200180613d766021913960400191505060405180910390fd5b6000610c2883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506130d6565b6000600160701b821061239a576040805162461bcd60e51b81526020600482015260136024820152722b30bab63a2a37b5b2b71d1029a0a32298989960691b604482015290519081900360640190fd5b50805b919050565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600081848411156124935760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612458578181015183820152602001612440565b50505050905090810190601f1680156124855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b0386166000908152600490915291909120546124fc91839063ffffffff61240416565b6001600160a01b038085166000908152600460205260408082209390935590841681522054612531908263ffffffff61313b16565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156125d757600080fd5b505afa1580156125eb573d6000803e3d6000fd5b505050506040513d602081101561260157600080fd5b505192915050565b6000610c2883836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250612404565b60035461265e908263ffffffff61313b16565b6003556001600160a01b03821660009081526004602052604090205461268a908263ffffffff61313b16565b6001600160a01b03831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600e54601454604080516393f1a40b60e01b8152600481019290925230602483015280516000936001600160a01b0316926393f1a40b926044808301939192829003018186803b15801561273557600080fd5b505afa158015612749573d6000803e3d6000fd5b505050506040513d604081101561275f57600080fd5b5051600a8190556040805182815290519192507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4919081900360200190a150565b6001600160a01b0382166000908152600460205260409020546127c9908263ffffffff61260916565b6001600160a01b0383166000908152600460205260409020556003546127f5908263ffffffff61260916565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b602083106128ea5780518252601f1990920191602091820191016128cb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461294c576040519150601f19603f3d011682016040523d82523d6000602084013e612951565b606091505b509150915081801561297f57508051158061297f575080806020019051602081101561297c57600080fd5b50515b6129c9576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b50505050565b81516129e2906000906020850190613c8b565b5080516129f6906001906020840190613c8b565b506040514690806052613d248239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b60208310612b145780518252601f199092019160209182019101612af5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612b76576040519150601f19603f3d011682016040523d82523d6000602084013e612b7b565b606091505b5091509150818015612ba9575080511580612ba95750808060200190516020811015612ba657600080fd5b50515b612be9576040805162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b604482015290519081900360640190fd5b5050505050565b42851015612c36576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa158015612d32573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590612d685750896001600160a01b0316816001600160a01b0316145b612db9576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b600080612dda836001600160a01b031661258d565b905080612deb57600091505061239d565b6000670de0b6b3a7640000612e0b601554846122af90919063ffffffff16565b81612e1257fe5b049050612e2f6001600160a01b038516338363ffffffff61319516565b60115460009081906001600160a01b0387811691161480612e5d57506012546001600160a01b038781169116145b15612ead576011546001600160a01b03878116911614612e8f576012546011546001600160a01b039182169116612ea3565b6011546012546001600160a01b0391821691165b9092509050612f12565b6010546012546001600160a01b0390811691161415612ee05750506012546011546001600160a01b039182169116612ef6565b50506011546012546001600160a01b0391821691165b612f108683612f0b878763ffffffff61260916565b6132e8565b505b6000612f26836001600160a01b031661258d565b905060008111612f3257fe5b600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612f8357600080fd5b505afa158015612f97573d6000803e3d6000fd5b505050506040513d6060811015612fad57600080fd5b5080516020909101516011546001600160701b039283169450911691506000906001600160a01b03878116911614612fe55781612fe7565b825b90506000612ff88583601354613518565b9050600061300e876001600160a01b031661258d565b905061301b8888846135b3565b600061302f886001600160a01b031661258d565b90506000613043828463ffffffff61260916565b90506130608a8a61305a8b8863ffffffff61260916565b846137b6565b9c50336001600160a01b03167f3ab90d36837fc209a4bd86b71ef4e4746ad3bb1f70843745fd00e61d1f1984cb8f8e8e60405180846001600160a01b03166001600160a01b03168152602001838152602001828152602001935050505060405180910390a2505050505050505050505050919050565b600081836131255760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612458578181015183820152602001612440565b50600083858161313157fe5b0495945050505050565b600082820183811015610c28576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106132125780518252601f1990920191602091820191016131f3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613274576040519150601f19603f3d011682016040523d82523d6000602084013e613279565b606091505b50915091508180156132a75750805115806132a757508080602001905160208110156132a457600080fd5b50515b612be9576040805162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b604482015290519081900360640190fd5b6000826001600160a01b0316846001600160a01b0316141561330b575080610c28565b600b546040805163711f958560e11b81526001600160a01b038781166004830152915161010090930490911691600091839163e23f2b0a91602480820192602092909190829003018186803b15801561336357600080fd5b505afa158015613377573d6000803e3d6000fd5b505050506040513d602081101561338d57600080fd5b505190506001600160a01b0380821690861614156133ba576133b182878787613885565b92505050610c28565b6000826001600160a01b031663e23f2b0a876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561341257600080fd5b505afa158015613426573d6000803e3d6000fd5b505050506040513d602081101561343c57600080fd5b505190506001600160a01b03878116908216141561346a5761346083888888613885565b9350505050610c28565b6000876001600160a01b0316836001600160a01b0316146134985761349184898589613885565b905061349b565b50845b816001600160a01b0316836001600160a01b031614156134cc576134c184848984613885565b945050505050610c28565b866001600160a01b0316826001600160a01b031614156134f1576134c18388836132e8565b60006134fe8484846132e8565b905061350c85848a84613885565b95505050505050610c28565b600080613531846114306103e88663ffffffff61313b16565b905060006135508461143060048189818c6103e863ffffffff6122af16565b9050600061357c6135778361356b868063ffffffff6122af16565b9063ffffffff61313b16565b613b8b565b9050600061359160028763ffffffff6122af16565b90506135a781610a99848763ffffffff61260916565b98975050505050505050565b604080516002808252606080830184529260208301908038833901905050905083816000815181106135e157fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061360f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506136398483613bdc565b600d546040516338ed173960e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b03909716966338ed1739968a968a9594939092909160c40190602080880191028083838b5b838110156136bf5781810151838201526020016136a7565b505050509050019650505050505050600060405180830381600087803b1580156136e857600080fd5b505af11580156136fc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561372557600080fd5b8101908080516040519392919084600160201b82111561374457600080fd5b90830190602082018581111561375957600080fd5b82518660208202830111600160201b8211171561377557600080fd5b82525081516020918201928201910280838360005b838110156137a257818101518382015260200161378a565b505050509050016040525050505050505050565b60006137c28584613bdc565b6137cc8483613bdc565b600d546040805162e8e33760e81b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260006084830181905260a483018190523060c48401524260e4840152925193169263e8e337009261010480840193606093929083900390910190829087803b15801561384d57600080fd5b505af1158015613861573d6000803e3d6000fd5b505050506040513d606081101561387757600080fd5b506040015195945050505050565b6000826001600160a01b0316846001600160a01b031614156138a8575080613b83565b60408051630820681160e11b8152600481018490526001600160a01b0386811660248301528581166044830152825160009391891692631040d022926064808301939192829003018186803b15801561390057600080fd5b505afa158015613914573d6000803e3d6000fd5b505050506040513d604081101561392a57600080fd5b508051602090910151925090506001600160a01b03811661397c576040805162461bcd60e51b81526020600482015260076024820152662727afa820a4a960c91b604482015290519081900360640190fd5b6139966001600160a01b038616828563ffffffff61319516565b836001600160a01b0316856001600160a01b03161015613a9a57604080516000808252602082019283905263022c0d9f60e01b835260248201818152604483018690523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a9590939092909160c48501918083838b5b83811015613a2e578181015183820152602001613a16565b50505050905090810190601f168015613a5b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613a7d57600080fd5b505af1158015613a91573d6000803e3d6000fd5b50505050613b81565b604080516000808252602082019283905263022c0d9f60e01b835260248201858152604483018290523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a969590939092909160c48501918083838a5b83811015613b19578181015183820152602001613b01565b50505050905090810190601f168015613b465780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613b6857600080fd5b505af1158015613b7c573d6000803e3d6000fd5b505050505b505b949350505050565b60006003821115613bce575080600160028204015b81811015613bc857809150600281828581613bb757fe5b040181613bc057fe5b049050613ba0565b5061239d565b811561239d57506001919050565b600d5460408051636eb1769f60e11b81523060048201526001600160a01b0392831660248201529051839285169163dd62ed3e916044808301926020929190829003018186803b158015613c2f57600080fd5b505afa158015613c43573d6000803e3d6000fd5b505050506040513d6020811015613c5957600080fd5b505110613c6557613c87565b600d54613c87906001600160a01b03848116911660001963ffffffff612a9716565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613ccc57805160ff1916838001178555613cf9565b82800160010185558215613cf9579182015b82811115613cf9578251825591602001919060010190613cde565b50613d05929150613d09565b5090565b610caf91905b80821115613d055760008155600101613d0f56fe454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775661756c74546f6b656e3a20494e564c445f5245494e564553545f424f554e54595661756c74546f6b656e3a20494e53554646494349454e545f5245534552564553a265627a7a723158209e5008b0c9e43696db83c4073f004cc0cca278e3c581373ded33a467f391d69d64736f6c634300051000324f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a7231582055fa33fe5c944b38b4d2c58a726ad0f0ab2bc598b446d46b0c3c963c9ef3f9a664736f6c634300051000325661756c74546f6b656e466163746f72793a20494e56414c49445f4645455f464143544f52000000000000000000000000d04f1a8182d5670e42ba9ee0ce9ffc71e6d1fc18000000000000000000000000a18c7e6a5378d849574a94252faebc3ee2cbbe45000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c2900000000000000000000000018b4f774fdc7bf685daeef66c2990b1ddd9ea6ad000000000000000000000000841fad6eae12c286d1fd18d1d525dffa75c7effe00000000000000000000000000000000000000000000000000000000000003e6

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

000000000000000000000000d04f1a8182d5670e42ba9ee0ce9ffc71e6d1fc18000000000000000000000000a18c7e6a5378d849574a94252faebc3ee2cbbe45000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c2900000000000000000000000018b4f774fdc7bf685daeef66c2990b1ddd9ea6ad000000000000000000000000841fad6eae12c286d1fd18d1d525dffa75c7effe00000000000000000000000000000000000000000000000000000000000003e6

-----Decoded View---------------
Arg [0] : _optiSwap (address): 0xd04f1a8182d5670e42ba9ee0ce9ffc71e6d1fc18
Arg [1] : _rewarderHelper (address): 0xa18c7e6a5378d849574a94252faebc3ee2cbbe45
Arg [2] : _router (address): 0xf491e7b69e4244ad4002bc14e878a34207e38c29
Arg [3] : _masterChef (address): 0x18b4f774fdc7bf685daeef66c2990b1ddd9ea6ad
Arg [4] : _rewardsToken (address): 0x841fad6eae12c286d1fd18d1d525dffa75c7effe
Arg [5] : _swapFeeFactor (uint256): 998

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000d04f1a8182d5670e42ba9ee0ce9ffc71e6d1fc18
Arg [1] : 000000000000000000000000a18c7e6a5378d849574a94252faebc3ee2cbbe45
Arg [2] : 000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c29
Arg [3] : 00000000000000000000000018b4f774fdc7bf685daeef66c2990b1ddd9ea6ad
Arg [4] : 000000000000000000000000841fad6eae12c286d1fd18d1d525dffa75c7effe
Arg [5] : 00000000000000000000000000000000000000000000000000000000000003e6


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.