Contract 0x164426C091e0d5801Ce86404CB49e9435DBA4569 7

 

Contract Overview

Balance:
0 ETH

EtherValue:
$0.00

Token:
Txn Hash Method
Block
From
To
Value
0xbb7c8f92c91794fa19062c83738f2bf22e602ba729ed70da5e493001f23aa245Reinvest419963182022-11-25 6:00:25457 days 17 hrs ago0x5d6f3d0c92d0564151357b0863e55e9ed4631b8d IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000348160420.001
0x5a33c3609902cecc8030b40dc490cae270bbbee4eb498a32adda1b5ad8e98e4dReinvest361070862022-11-09 4:19:06473 days 19 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000440382050.001
0x6ba3c5655228a5ee3097ec3fa837400520958edcfaa78c0765ff52878cf91099Reinvest360534062022-11-09 1:14:53473 days 22 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000571859660.001
0x960a203d15fae7afd345b52cfd97e1d545b69c7899bffe2a9af9802b68ded23fReinvest360064802022-11-08 21:37:05474 days 2 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0001871454710.001
0x78868a1daaff65cc0d4e8f9e9311a8812ca71b9b6615a2d9a5345152da0547d3Reinvest358033452022-11-08 13:02:13474 days 10 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000427900690.001
0xc8e3b6f0ef360fe2ecb9e1a8af1b761221b94c650687c9875adaab7b2ca58823Reinvest357539512022-11-08 10:06:03474 days 13 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000464509680.001
0x4ca2ec6b9fd524174f6ab96d2462d48db8dafa1db64d3f07430f6414b6d71ea9Reinvest356900282022-11-08 7:04:14474 days 16 hrs ago0x84d0f74d21a89f86b67e9a38d8559d0b4e10f12d IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000519402390.00075
0x7ca70e2b4c312e6d02776d66134b747d2c06dd483ebcf79e1974b62c600b2f37Reinvest356139092022-11-08 3:45:42474 days 20 hrs ago0xddf7eb74bb6d9b2207c5e2685c4337766d8b7933 IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000680090340.001044981
0x70d823fabcedc9446547812ecaaa3a307504202621c62d83996067bc779f73caReinvest355601612022-11-08 0:10:17474 days 23 hrs ago0xf2455a4c6fcc6f41f59222f4244afddc85ff1ed7 IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000538336610.001
0xc621e04704224c4a731404a58f4d9236e96aade62d3628cbfc85c43b9a45f930Reinvest355600472022-11-08 0:09:17474 days 23 hrs ago0x84d0f74d21a89f86b67e9a38d8559d0b4e10f12d IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000597375450.00075
0x7a63635cbe926d886049afa1bdfd6a8a30d88a66f3dc770f47736ec9c5ca9074Reinvest355037242022-11-07 19:20:49475 days 4 hrs ago0x84d0f74d21a89f86b67e9a38d8559d0b4e10f12d IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000628958350.00075
0x4a591358f0c93b5a443df0d64aa01170e7eec8e3e6e1355457b169ce65f3b6a4Reinvest354540392022-11-07 15:12:47475 days 8 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000809034480.001
0xfbe2a72dbaae307ae062439866edbfd531656b8e9b4c04fa94e0d8da8e4e7e94Reinvest353329972022-11-07 8:00:20475 days 15 hrs ago0x84d0f74d21a89f86b67e9a38d8559d0b4e10f12d IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000459004090.00075
0xc030b7c021cd02319b51a7baeececf10e9fcfe88e2943bc0a5a40a1606b155d0Reinvest352261232022-11-07 1:26:28475 days 22 hrs ago0xc23e524325d26e429f749316d6b3115f199a4b78 IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000453973440.001
0xa1a424f5811feda6459903cf5ff033f1f5f57f71c3b59f020db19510a5893315Reinvest351751702022-11-06 21:22:29476 days 2 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000398140780.001
0xaafbb6dc4485983bc374677df703eeec120a198574d92c793c9aa6329d4bcf60Reinvest350689412022-11-06 14:06:07476 days 9 hrs ago0x3d6991085ab1ae3926cb96f25684c40a364b6856 IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000491029960.001
0x585b01f3ff22c563591707654f3a2af945bc65237984381fde913f203a07a24eReinvest349293212022-11-06 7:38:57476 days 16 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000349707370.001
0xa600ae208edb1d7794671fec2f49877a32dfcd2d440de044a5017343805c83a9Reinvest348168822022-11-06 0:14:08476 days 23 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000365302710.001
0x4ea25e6482ad3ede2dfd39f06a7776cc95acab1911df7f05aa52c20d3e856773Reinvest347283642022-11-05 16:36:57477 days 7 hrs ago0xc23e524325d26e429f749316d6b3115f199a4b78 IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000436726170.001
0x36ac400404ca28b3a155a52d038bda2af5ec5f99333867e1750d8eb19f437891Reinvest345778482022-11-05 8:13:59477 days 15 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000408793690.001
0x6523a906008cb26844b803123b8ef311ae793d1689a73b3fe4ab93fc04a362cfReinvest344243892022-11-04 20:11:38478 days 3 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000631244320.001
0x6b01700bd5c787f7135c8c527f7cc16eca95c3542188cd2b4bdfa1f7ad53b9f0Reinvest342269662022-11-04 8:10:02478 days 15 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000534634520.001
0x0b0307917f4a6be42e445e964a6e14358f070d77f10814f067e57453d861bd4eReinvest340906982022-11-03 21:27:50479 days 2 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000612237530.001
0xa5f10f4d446c3f1758400c76a7358d192841f3bb1fdddcdfb8c30e226b4d6c1cReinvest339587962022-11-03 11:08:05479 days 12 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000563468690.001
0xca7dade40023fb2da717c197856451d75378c3db3f9884e4b5cc55e77e6e5383Reinvest338341992022-11-03 1:47:10479 days 22 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0x164426c091e0d5801ce86404cb49e9435dba45690 ETH0.0000458514730.001
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x3fcc34aa22b92e595301b618d113e2651f90e2c835b9d85dcd02330c073c3ea11070868472023-07-19 13:14:31221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x3fcc34aa22b92e595301b618d113e2651f90e2c835b9d85dcd02330c073c3ea11070868472023-07-19 13:14:31221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x3fcc34aa22b92e595301b618d113e2651f90e2c835b9d85dcd02330c073c3ea11070868472023-07-19 13:14:31221 days 10 hrs ago 0x981bd9f77c8aafc14ebc86769503f86a3cc29af5 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x3fcc34aa22b92e595301b618d113e2651f90e2c835b9d85dcd02330c073c3ea11070868472023-07-19 13:14:31221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x3fcc34aa22b92e595301b618d113e2651f90e2c835b9d85dcd02330c073c3ea11070868472023-07-19 13:14:31221 days 10 hrs ago 0x981bd9f77c8aafc14ebc86769503f86a3cc29af5 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x7a491321dbe0bbb94b49703bbd2d39ef000a6d408834b74d64e40342d2199a611070867932023-07-19 13:12:43221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x7a491321dbe0bbb94b49703bbd2d39ef000a6d408834b74d64e40342d2199a611070867932023-07-19 13:12:43221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x7a491321dbe0bbb94b49703bbd2d39ef000a6d408834b74d64e40342d2199a611070867932023-07-19 13:12:43221 days 10 hrs ago 0x981bd9f77c8aafc14ebc86769503f86a3cc29af5 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x7a491321dbe0bbb94b49703bbd2d39ef000a6d408834b74d64e40342d2199a611070867932023-07-19 13:12:43221 days 10 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x7a491321dbe0bbb94b49703bbd2d39ef000a6d408834b74d64e40342d2199a611070867932023-07-19 13:12:43221 days 10 hrs ago 0x981bd9f77c8aafc14ebc86769503f86a3cc29af5 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x1e2f8e5f94f366ef5dc041233c0738b1c1c2cb0c0 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x1e2f8e5f94f366ef5dc041233c0738b1c1c2cb0c0 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0xd4a6a05081fd270dc111332845a778a49fe01741 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x38585c27c99dfff859cc33f19dcd03f897f5156f 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x38585c27c99dfff859cc33f19dcd03f897f5156f 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0xd4a6a05081fd270dc111332845a778a49fe01741 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x38585c27c99dfff859cc33f19dcd03f897f5156f 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x38585c27c99dfff859cc33f19dcd03f897f5156f 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x981bd9f77c8aafc14ebc86769503f86a3cc29af5 0x164426c091e0d5801ce86404cb49e9435dba45690 ETH
0x9100a11d6432796b65cbc92b999cbc685aa5dec004d66a30be8c29244316f2531070635642023-07-19 0:18:25221 days 23 hrs ago 0x164426c091e0d5801ce86404cb49e9435dba4569 0x167dc49c498729223d1565df3207771b4ee198530 ETH
[ Download CSV Export 
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xAaA7CE97Cf8f8487354824D0DF41F2aC864a4790
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ZipVaultToken

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : ZipVaultToken.sol
pragma solidity =0.5.16;

import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./PoolToken.sol";
import "./interfaces/IZipRewards.sol";
import "./interfaces/IZipVaultToken.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;
}

contract ZipVaultToken is IZipVaultToken, IUniswapV2Pair, PoolToken {
    using SafeToken for address;

    bool public constant isVaultToken = true;

    address public optiSwap;
    address public rewarderHelper;
    IUniswapV2Router01 public router;
    IZipRewards 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,
        IZipRewards _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 = 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
        ) {
            address rewarder = masterChef.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
        ) {
            address rewarder = masterChef.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.depositShort(pid, uint128(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.withdrawShort(pid, uint128(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.harvestShort(pid);

        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.depositShort(pid, uint128(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 2 of 16 : 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 16 : 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 4 of 16 : IZipRewards.sol
pragma solidity 0.5.16;

contract IZipRewards {
    struct UserInfo {
        uint128 amount;
        int128 rewardDebt;
    }

    struct PoolInfo {
        uint256 accZipPerShare;
        uint64 lastRewardTime;
        uint64 allocPoint;
    }

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

    function depositShort(uint256 _pid, uint128 _amount) external {}

    function withdrawShort(uint256 _pid, uint128 _amount) external {}

    function harvestShort(uint256 _pid) external returns (uint) {}

    function rewarder(uint256 pid) external view returns (address);

    function lpToken(uint256 pid) external view returns (address);
}

File 5 of 16 : IZipVaultToken.sol
pragma solidity >=0.5.0;

import "./IZipRewards.sol";
import "./IUniswapV2Router01.sol";

interface IZipVaultToken {
    /*** 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 (IZipRewards);

    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,
        IZipRewards _masterChef,
        address _rewardsToken,
        uint256 _swapFeeFactor,
        uint256 _pid
    ) external;

    function reinvest() external;
}

File 6 of 16 : 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 7 of 16 : 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 8 of 16 : 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 9 of 16 : 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 10 of 16 : 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 11 of 16 : 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 12 of 16 : 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 13 of 16 : 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 14 of 16 : 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 15 of 16 : 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 16 of 16 : 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

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintTokens","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bounty","type":"uint256"}],"name":"Reinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bounty","type":"uint256"}],"name":"ReinvestRewardToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalBalance","type":"uint256"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newReinvestBounty","type":"uint256"}],"name":"UpdateReinvestBounty","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_REINVEST_BOUNTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_REINVEST_BOUNTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"REINVEST_BOUNTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_optiSwap","type":"address"},{"internalType":"address","name":"_rewarderHelper","type":"address"},{"internalType":"contract IUniswapV2Router01","name":"_router","type":"address"},{"internalType":"contract IZipRewards","name":"_masterChef","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"uint256","name":"_swapFeeFactor","type":"uint256"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"_initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"_setFactory","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"reserve0","type":"uint112"},{"internalType":"uint112","name":"reserve1","type":"uint112"},{"internalType":"uint32","name":"blockTimestampLast","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRewardTokenInfo","outputs":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint256[]","name":"pendingAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardRates","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRewardTokenInfoWithBalances","outputs":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint256[]","name":"pendingAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardRates","type":"uint256[]"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isVaultToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"masterChef","outputs":[{"internalType":"contract IZipRewards","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"mintTokens","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"optiSwap","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"redeemer","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"reinvest","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":"contract IUniswapV2Router01","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"swapFeeFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"sync","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newReinvestBounty","type":"uint256"}],"name":"updateReinvestBounty","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061027f5760003560e01c80636f307dc31161015c578063bc25cf77116100ce578063d505accf11610087578063d505accf14610827578063dd62ed3e14610878578063f1068454146108a6578063f887ea40146108ae578063fdb5a03e146108b6578063fff6cae9146108be5761027f565b8063bc25cf771461078f578063c45a0155146107b5578063c815a88a146107bd578063c8c4ff8c1461080f578063d1af0c7d14610817578063d21220a71461081f5761027f565b806395d89b411161012057806395d89b411461073b57806396fa4c1114610743578063a9059cbb1461074b578063ad5c464814610777578063ad7a672f1461077f578063ba9a7a56146107875761027f565b80636f307dc31461059657806370a082311461059e5780637ecebe00146105c4578063885f3ee6146105ea57806395a2251f146107155761027f565b806346fb738b116101f557806360c2affa116101b957806360c2affa1461046a578063647428b91461047257806368f91a44146105585780636a627842146105605780636c2a3bc5146105865780636ee272271461058e5761027f565b806346fb738b1461042b5780634a5d316c1461044a578063575a86b2146104525780635909c0d51461045a5780635a3d5493146104625761027f565b806318160ddd1161024757806318160ddd146103a557806323b872dd146103bf57806330adf81f146103f5578063313ce567146103fd5780633644e5151461041b5780633ba0b9a9146104235761027f565b8063024907681461028457806306fdde03146102a85780630902f1ac14610325578063095ea7b31461035d5780630dfe16811461039d575b600080fd5b61028c6108c6565b604080516001600160a01b039092168252519081900360200190f35b6102b06108d5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102ea5781810151838201526020016102d2565b50505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61032d610963565b604080516001600160701b03948516815292909316602083015263ffffffff168183015290519081900360600190f35b6103896004803603604081101561037357600080fd5b506001600160a01b038135169060200135610b33565b604080519115158252519081900360200190f35b61028c610b4a565b6103ad610b59565b60408051918252519081900360200190f35b610389600480360360608110156103d557600080fd5b506001600160a01b03813581169160208101359091169060400135610b5f565b6103ad610c2f565b610405610c53565b6040805160ff9092168252519081900360200190f35b6103ad610c5c565b6103ad610c62565b6104486004803603602081101561044157600080fd5b5035610cb2565b005b610448610e02565b61028c610e74565b6103ad610e83565b6103ad610ef9565b61028c610f3e565b61047a610f52565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156104c25781810151838201526020016104aa565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156105015781810151838201526020016104e9565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015610540578181015183820152602001610528565b50505050905001965050505050505060405180910390f35b6103ad61121d565b6103ad6004803603602081101561057657600080fd5b50356001600160a01b0316611223565b6103ad611542565b610389611548565b61028c61154d565b6103ad600480360360208110156105b457600080fd5b50356001600160a01b031661155c565b6103ad600480360360208110156105da57600080fd5b50356001600160a01b031661156e565b6105f2611580565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561063e578181015183820152602001610626565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561067d578181015183820152602001610665565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156106bc5781810151838201526020016106a4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156106fb5781810151838201526020016106e3565b505050509050019850505050505050505060405180910390f35b6103ad6004803603602081101561072b57600080fd5b50356001600160a01b03166118d9565b6102b0611aee565b6103ad611b48565b6103896004803603604081101561076157600080fd5b506001600160a01b038135169060200135611b53565b61028c611b60565b6103ad611b6f565b6103ad611b75565b610448600480360360208110156107a557600080fd5b50356001600160a01b0316611b7b565b61028c611c75565b610448600480360360e08110156107d357600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101358216916080820135169060a08101359060c00135611c84565b6103ad61202c565b61028c612037565b61028c612046565b610448600480360360e081101561083d57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135612055565b6103ad6004803603604081101561088e57600080fd5b506001600160a01b0381358116916020013516612090565b6103ad6120ad565b61028c6120b3565b6104486120c2565b61044861228e565b600c546001600160a01b031681565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561095b5780601f106109305761010080835404028352916020019161095b565b820191906000526020600020905b81548152906001019060200180831161093e57829003601f168201915b505050505081565b6000806000600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156109b657600080fd5b505afa1580156109ca573d6000803e3d6000fd5b505050506040513d60608110156109e057600080fd5b5080516020820151604090920151600354919550919350909150610a0357610b2e565b600a54600854604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d6020811015610a7557600080fd5b50519050610aaa610aa582610a99856001600160701b038a1663ffffffff6122ea16565b9063ffffffff61234316565b612385565b9450610acc610aa582610a99856001600160701b03891663ffffffff6122ea16565b93506064856001600160701b0316118015610af057506064846001600160701b0316115b610b2b5760405162461bcd60e51b8152600401808060200182810382526021815260200180613dfc6021913960400191505060405180910390fd5b50505b909192565b6000610b403384846123dd565b5060015b92915050565b6011546001600160a01b031681565b60035481565b6001600160a01b038316600090815260056020908152604080832033845290915281205460001914610c1957604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b0387166000908152600582528381203382529091529190912054610bf491849063ffffffff61243f16565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b610c248484846124d6565b5060015b9392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b60065481565b600354600a5460009190811580610c77575080155b15610c8e57670de0b6b3a764000092505050610caf565b610caa82610a9983670de0b6b3a764000063ffffffff6122ea16565b925050505b90565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015610cf657600080fd5b505afa158015610d0a573d6000803e3d6000fd5b505050506040513d6020811015610d2057600080fd5b50516001600160a01b031614610d6e576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b604482015290519081900360640190fd5b66038d7ea4c680008110158015610d8c5750662386f26fc100008111155b610dc75760405162461bcd60e51b8152600401808060200182810382526021815260200180613ddb6021913960400191505060405180910390fd5b60158190556040805182815290517ffa1e13889c5c5294758f01f045a83de15feca61a17e6281f4d11a5110085d9329181900360200190a150565b6009546001600160a01b031615610e60576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600e546001600160a01b031681565b60085460408051635909c0d560e01b815290516000926001600160a01b031691635909c0d5916004808301926020929190829003018186803b158015610ec857600080fd5b505afa158015610edc573d6000803e3d6000fd5b505050506040513d6020811015610ef257600080fd5b5051905090565b60085460408051635a3d549360e01b815290516000926001600160a01b031691635a3d5493916004808301926020929190829003018186803b158015610ec857600080fd5b600b5461010090046001600160a01b031681565b600e546014546040805163c346253d60e01b8152600481019290925251606092839283926000926001600160a01b03169163c346253d916024808301926020929190829003018186803b158015610fa857600080fd5b505afa158015610fbc573d6000803e3d6000fd5b505050506040513d6020811015610fd257600080fd5b505190506001600160a01b0381161561121757600c546040805163bab5705b60e01b81526001600160a01b0384811660048301523060248301529151919092169163bab5705b916044808301926000929190829003018186803b15801561103857600080fd5b505afa15801561104c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052606081101561107557600080fd5b8101908080516040519392919084600160201b82111561109457600080fd5b9083019060208201858111156110a957600080fd5b82518660208202830111600160201b821117156110c557600080fd5b82525081516020918201928201910280838360005b838110156110f25781810151838201526020016110da565b5050505090500160405260200180516040519392919084600160201b82111561111a57600080fd5b90830190602082018581111561112f57600080fd5b82518660208202830111600160201b8211171561114b57600080fd5b82525081516020918201928201910280838360005b83811015611178578181015183820152602001611160565b5050505090500160405260200180516040519392919084600160201b8211156111a057600080fd5b9083019060208201858111156111b557600080fd5b82518660208202830111600160201b821117156111d157600080fd5b82525081516020918201928201910280838360005b838110156111fe5781810151838201526020016111e6565b5050505090500160405250505093509350935050610b2e565b50909192565b60135481565b600b5460009060ff16611270576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854600090611292906001600160a01b03166125c8565b600e54601454604080516393f1a40b60e01b8152600481019290925230602483015280519394506000936001600160a01b03909316926393f1a40b926044808201939291829003018186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d604081101561131457600080fd5b5051600e54601454604080516307031a3760e11b815260048101929092526001600160801b0386811660248401529051931693506001600160a01b0390911691630e06346e9160448082019260009290919082900301818387803b15801561137b57600080fd5b505af115801561138f573d6000803e3d6000fd5b5050600e54601454604080516393f1a40b60e01b815260048101929092523060248301528051600095506001600160a01b0390931693506393f1a40b92604480840193829003018186803b1580156113e657600080fd5b505afa1580156113fa573d6000803e3d6000fd5b505050506040513d604081101561141057600080fd5b50516001600160801b03169050611450611428610c62565b610a99670de0b6b3a7640000611444858763ffffffff61264416565b9063ffffffff6122ea16565b93506003546000141561147e5761146f846103e863ffffffff61264416565b935061147e60006103e8612686565b600084116114d3576040805162461bcd60e51b815260206004820152601c60248201527f5661756c74546f6b656e3a204d494e545f414d4f554e545f5a45524f00000000604482015290519081900360640190fd5b6114dd8585612686565b604080518481526020810186905281516001600160a01b0388169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a350505061153061271d565b600b805460ff19166001179055919050565b60155481565b600181565b6008546001600160a01b031681565b60046020526000908152604090205481565b60076020526000908152604090205481565b6060806060806000600e60009054906101000a90046001600160a01b03166001600160a01b031663c346253d6014546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156115e357600080fd5b505afa1580156115f7573d6000803e3d6000fd5b505050506040513d602081101561160d57600080fd5b505190506001600160a01b038116156118d257600c546040805163bab5705b60e01b81526001600160a01b0384811660048301523060248301529151919092169163bab5705b916044808301926000929190829003018186803b15801561167357600080fd5b505afa158015611687573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260608110156116b057600080fd5b8101908080516040519392919084600160201b8211156116cf57600080fd5b9083019060208201858111156116e457600080fd5b82518660208202830111600160201b8211171561170057600080fd5b82525081516020918201928201910280838360005b8381101561172d578181015183820152602001611715565b5050505090500160405260200180516040519392919084600160201b82111561175557600080fd5b90830190602082018581111561176a57600080fd5b82518660208202830111600160201b8211171561178657600080fd5b82525081516020918201928201910280838360005b838110156117b357818101518382015260200161179b565b5050505090500160405260200180516040519392919084600160201b8211156117db57600080fd5b9083019060208201858111156117f057600080fd5b82518660208202830111600160201b8211171561180c57600080fd5b82525081516020918201928201910280838360005b83811015611839578181015183820152602001611821565b50505050905001604052505050809550819650829750505050845160405190808252806020026020018201604052801561187d578160200160208202803883390190505b50915060005b85518110156118d0576118b186828151811061189b57fe5b60200260200101516001600160a01b03166125c8565b8382815181106118bd57fe5b6020908102919091010152600101611883565b505b5090919293565b600b5460009060ff16611926576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905530600090815260046020526040902054611964670de0b6b3a7640000610a99611957610c62565b849063ffffffff6122ea16565b9150600082116119bb576040805162461bcd60e51b815260206004820152601e60248201527f5661756c74546f6b656e3a2052454445454d5f414d4f554e545f5a45524f0000604482015290519081900360640190fd5b600a54821115611a12576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e3a20494e53554646494349454e545f43415348000000604482015290519081900360640190fd5b611a1c30826127e4565b600e546014546040805163348d748f60e01b815260048101929092526001600160801b0385166024830152516001600160a01b039092169163348d748f9160448082019260009290919082900301818387803b158015611a7b57600080fd5b505af1158015611a8f573d6000803e3d6000fd5b50505050611a9d8383612881565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a35061153061271d565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561095b5780601f106109305761010080835404028352916020019161095b565b66038d7ea4c6800081565b6000610b403384846124d6565b6010546001600160a01b031681565b600a5481565b6103e881565b600b5460ff16611bc5576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b81523060048201529051611c65938593611c609391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015611c2857600080fd5b505afa158015611c3c573d6000803e3d6000fd5b505050506040513d6020811015611c5257600080fd5b50519063ffffffff61264416565b612881565b50600b805460ff19166001179055565b6009546001600160a01b031681565b6009546001600160a01b031615611ce2576040805162461bcd60e51b815260206004820152601f60248201527f5661756c74546f6b656e3a20464143544f52595f414c52454144595f53455400604482015290519081900360640190fd5b600b80546001600160a01b03808a1661010002610100600160a81b031990921691909117909155600c80549188166001600160a01b0319928316179055600980549091163317905560408051808201825260118152702a30b937ba102b30bab63a102a37b5b2b760791b602080830191909152825180840190935260068352651d95105493d560d21b90830152611d7891612a13565b846001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611db157600080fd5b505afa158015611dc5573d6000803e3d6000fd5b505050506040513d6020811015611ddb57600080fd5b5051601080546001600160a01b03199081166001600160a01b0393841617909155600d80548216888416179055600e8054909116868316179081905560138490556014839055604080516378ed5d1f60e01b815260048101859052905191909216916378ed5d1f916024808301926020929190829003018186803b158015611e6257600080fd5b505afa158015611e76573d6000803e3d6000fd5b505050506040513d6020811015611e8c57600080fd5b5051600880546001600160a01b0319166001600160a01b03928316179081905560408051630dfe168160e01b815290519190921691630dfe1681916004808301926020929190829003018186803b158015611ee657600080fd5b505afa158015611efa573d6000803e3d6000fd5b505050506040513d6020811015611f1057600080fd5b5051601180546001600160a01b0319166001600160a01b039283161790556008546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d6020811015611f9557600080fd5b5051601280546001600160a01b03199081166001600160a01b0393841617909155600f80549091168583161790819055600d54611fd9929182169116600019612adb565b600d54601054611ffe916001600160a01b03918216911660001963ffffffff612adb16565b600e54600854612023916001600160a01b03918216911660001963ffffffff612adb16565b50505050505050565b662386f26fc1000081565b600f546001600160a01b031681565b6012546001600160a01b031681565b612085878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612c34565b6120238787876123dd565b600560209081526000928352604080842090915290825290205481565b60145481565b600d546001600160a01b031681565b600b5460ff1661210c576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905533321461212257600080fd5b600e546014546040805163fa50ce1960e01b81526004810192909252516001600160a01b039092169163fa50ce19916024808201926020929091908290030181600087803b15801561217357600080fd5b505af1158015612187573d6000803e3d6000fd5b505050506040513d602081101561219d57600080fd5b5050600f546000906121b7906001600160a01b0316612e09565b905060606121c3610f52565b50909150600090505b81518110156121fd576121f18282815181106121e457fe5b6020026020010151612e09565b909201916001016121cc565b50600e54601454604080516307031a3760e11b815260048101929092526001600160801b0385166024830152516001600160a01b0390921691630e06346e9160448082019260009290919082900301818387803b15801561225d57600080fd5b505af1158015612271573d6000803e3d6000fd5b50505050505061227f61271d565b600b805460ff19166001179055565b600b5460ff166122d8576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561227f61271d565b6000826122f957506000610b44565b8282028284828161230657fe5b0414610c285760405162461bcd60e51b8152600401808060200182810382526021815260200180613dba6021913960400191505060405180910390fd5b6000610c2883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061311a565b6000600160701b82106123d5576040805162461bcd60e51b81526020600482015260136024820152722b30bab63a2a37b5b2b71d1029a0a32298989960691b604482015290519081900360640190fd5b50805b919050565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600081848411156124ce5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561249357818101518382015260200161247b565b50505050905090810190601f1680156124c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b03861660009081526004909152919091205461253791839063ffffffff61243f16565b6001600160a01b03808516600090815260046020526040808220939093559084168152205461256c908263ffffffff61317f16565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561261257600080fd5b505afa158015612626573d6000803e3d6000fd5b505050506040513d602081101561263c57600080fd5b505192915050565b6000610c2883836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061243f565b600354612699908263ffffffff61317f16565b6003556001600160a01b0382166000908152600460205260409020546126c5908263ffffffff61317f16565b6001600160a01b03831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600e54601454604080516393f1a40b60e01b8152600481019290925230602483015280516000936001600160a01b0316926393f1a40b926044808301939192829003018186803b15801561277057600080fd5b505afa158015612784573d6000803e3d6000fd5b505050506040513d604081101561279a57600080fd5b50516001600160801b0316600a8190556040805182815290519192507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4919081900360200190a150565b6001600160a01b03821660009081526004602052604090205461280d908263ffffffff61264416565b6001600160a01b038316600090815260046020526040902055600354612839908263ffffffff61264416565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b6020831061292e5780518252601f19909201916020918201910161290f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612990576040519150601f19603f3d011682016040523d82523d6000602084013e612995565b606091505b50915091508180156129c35750805115806129c357508080602001905160208110156129c057600080fd5b50515b612a0d576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b50505050565b8151612a26906000906020850190613ccf565b508051612a3a906001906020840190613ccf565b506040514690806052613d688239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b60208310612b585780518252601f199092019160209182019101612b39565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612bba576040519150601f19603f3d011682016040523d82523d6000602084013e612bbf565b606091505b5091509150818015612bed575080511580612bed5750808060200190516020811015612bea57600080fd5b50515b612c2d576040805162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b604482015290519081900360640190fd5b5050505050565b42851015612c7a576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa158015612d76573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590612dac5750896001600160a01b0316816001600160a01b0316145b612dfd576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b600080612e1e836001600160a01b03166125c8565b905080612e2f5760009150506123d8565b6000670de0b6b3a7640000612e4f601554846122ea90919063ffffffff16565b81612e5657fe5b049050612e736001600160a01b038516338363ffffffff6131d916565b60115460009081906001600160a01b0387811691161480612ea157506012546001600160a01b038781169116145b15612ef1576011546001600160a01b03878116911614612ed3576012546011546001600160a01b039182169116612ee7565b6011546012546001600160a01b0391821691165b9092509050612f56565b6010546012546001600160a01b0390811691161415612f245750506012546011546001600160a01b039182169116612f3a565b50506011546012546001600160a01b0391821691165b612f548683612f4f878763ffffffff61264416565b61332c565b505b6000612f6a836001600160a01b03166125c8565b905060008111612f7657fe5b600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612fc757600080fd5b505afa158015612fdb573d6000803e3d6000fd5b505050506040513d6060811015612ff157600080fd5b5080516020909101516011546001600160701b039283169450911691506000906001600160a01b03878116911614613029578161302b565b825b9050600061303c858360135461355c565b90506000613052876001600160a01b03166125c8565b905061305f8888846135f7565b6000613073886001600160a01b03166125c8565b90506000613087828463ffffffff61264416565b90506130a48a8a61309e8b8863ffffffff61264416565b846137fa565b9c50336001600160a01b03167f3ab90d36837fc209a4bd86b71ef4e4746ad3bb1f70843745fd00e61d1f1984cb8f8e8e60405180846001600160a01b03166001600160a01b03168152602001838152602001828152602001935050505060405180910390a2505050505050505050505050919050565b600081836131695760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561249357818101518382015260200161247b565b50600083858161317557fe5b0495945050505050565b600082820183811015610c28576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106132565780518252601f199092019160209182019101613237565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146132b8576040519150601f19603f3d011682016040523d82523d6000602084013e6132bd565b606091505b50915091508180156132eb5750805115806132eb57508080602001905160208110156132e857600080fd5b50515b612c2d576040805162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b604482015290519081900360640190fd5b6000826001600160a01b0316846001600160a01b0316141561334f575080610c28565b600b546040805163711f958560e11b81526001600160a01b038781166004830152915161010090930490911691600091839163e23f2b0a91602480820192602092909190829003018186803b1580156133a757600080fd5b505afa1580156133bb573d6000803e3d6000fd5b505050506040513d60208110156133d157600080fd5b505190506001600160a01b0380821690861614156133fe576133f5828787876138c9565b92505050610c28565b6000826001600160a01b031663e23f2b0a876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561345657600080fd5b505afa15801561346a573d6000803e3d6000fd5b505050506040513d602081101561348057600080fd5b505190506001600160a01b0387811690821614156134ae576134a4838888886138c9565b9350505050610c28565b6000876001600160a01b0316836001600160a01b0316146134dc576134d5848985896138c9565b90506134df565b50845b816001600160a01b0316836001600160a01b0316141561351057613505848489846138c9565b945050505050610c28565b866001600160a01b0316826001600160a01b031614156135355761350583888361332c565b600061354284848461332c565b905061355085848a846138c9565b95505050505050610c28565b600080613575846114446103e88663ffffffff61317f16565b905060006135948461144460048189818c6103e863ffffffff6122ea16565b905060006135c06135bb836135af868063ffffffff6122ea16565b9063ffffffff61317f16565b613bcf565b905060006135d560028763ffffffff6122ea16565b90506135eb81610a99848763ffffffff61264416565b98975050505050505050565b6040805160028082526060808301845292602083019080388339019050509050838160008151811061362557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061365357fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061367d8483613c20565b600d546040516338ed173960e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b03909716966338ed1739968a968a9594939092909160c40190602080880191028083838b5b838110156137035781810151838201526020016136eb565b505050509050019650505050505050600060405180830381600087803b15801561372c57600080fd5b505af1158015613740573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561376957600080fd5b8101908080516040519392919084600160201b82111561378857600080fd5b90830190602082018581111561379d57600080fd5b82518660208202830111600160201b821117156137b957600080fd5b82525081516020918201928201910280838360005b838110156137e65781810151838201526020016137ce565b505050509050016040525050505050505050565b60006138068584613c20565b6138108483613c20565b600d546040805162e8e33760e81b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260006084830181905260a483018190523060c48401524260e4840152925193169263e8e337009261010480840193606093929083900390910190829087803b15801561389157600080fd5b505af11580156138a5573d6000803e3d6000fd5b505050506040513d60608110156138bb57600080fd5b506040015195945050505050565b6000826001600160a01b0316846001600160a01b031614156138ec575080613bc7565b60408051630820681160e11b8152600481018490526001600160a01b0386811660248301528581166044830152825160009391891692631040d022926064808301939192829003018186803b15801561394457600080fd5b505afa158015613958573d6000803e3d6000fd5b505050506040513d604081101561396e57600080fd5b508051602090910151925090506001600160a01b0381166139c0576040805162461bcd60e51b81526020600482015260076024820152662727afa820a4a960c91b604482015290519081900360640190fd5b6139da6001600160a01b038616828563ffffffff6131d916565b836001600160a01b0316856001600160a01b03161015613ade57604080516000808252602082019283905263022c0d9f60e01b835260248201818152604483018690523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a9590939092909160c48501918083838b5b83811015613a72578181015183820152602001613a5a565b50505050905090810190601f168015613a9f5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613ac157600080fd5b505af1158015613ad5573d6000803e3d6000fd5b50505050613bc5565b604080516000808252602082019283905263022c0d9f60e01b835260248201858152604483018290523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a969590939092909160c48501918083838a5b83811015613b5d578181015183820152602001613b45565b50505050905090810190601f168015613b8a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613bac57600080fd5b505af1158015613bc0573d6000803e3d6000fd5b505050505b505b949350505050565b60006003821115613c12575080600160028204015b81811015613c0c57809150600281828581613bfb57fe5b040181613c0457fe5b049050613be4565b506123d8565b81156123d857506001919050565b600d5460408051636eb1769f60e11b81523060048201526001600160a01b0392831660248201529051839285169163dd62ed3e916044808301926020929190829003018186803b158015613c7357600080fd5b505afa158015613c87573d6000803e3d6000fd5b505050506040513d6020811015613c9d57600080fd5b505110613ca957613ccb565b600d54613ccb906001600160a01b03848116911660001963ffffffff612adb16565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613d1057805160ff1916838001178555613d3d565b82800160010185558215613d3d579182015b82811115613d3d578251825591602001919060010190613d22565b50613d49929150613d4d565b5090565b610caf91905b80821115613d495760008155600101613d5356fe454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775661756c74546f6b656e3a20494e564c445f5245494e564553545f424f554e54595661756c74546f6b656e3a20494e53554646494349454e545f5245534552564553a265627a7a723158203e5eb9647e59a5b6fd2f1a62a8510ad98d0d6d7bf703e5abaf606b78c371cd7564736f6c63430005100032

Block Transaction Difficulty Gas Used Reward
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.