ETH Price: $3,068.34 (+0.50%)

Contract

0xfcf05EAcfA3F70Df1FcC0248532103c77bb14476
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Reinvest1188511122024-04-16 20:56:4114 hrs ago1713301001IN
0xfcf05EAc...77bb14476
0 ETH0.00001030.01305131
Reinvest1188352542024-04-16 12:08:0523 hrs ago1713269285IN
0xfcf05EAc...77bb14476
0 ETH0.000049110.06081269
Reinvest1187786972024-04-15 4:42:512 days ago1713156171IN
0xfcf05EAc...77bb14476
0 ETH0.000049620.05995084
Reinvest1187308412024-04-14 2:07:393 days ago1713060459IN
0xfcf05EAc...77bb14476
0 ETH0.000048110.05795998
Reinvest1186804462024-04-12 22:07:494 days ago1712959669IN
0xfcf05EAc...77bb14476
0 ETH0.000008650.01004372
Reinvest1186707462024-04-12 16:44:294 days ago1712940269IN
0xfcf05EAc...77bb14476
0 ETH0.000051730.05836669
Reinvest1186427992024-04-12 1:12:555 days ago1712884375IN
0xfcf05EAc...77bb14476
0 ETH0.000050490.05696124
Reinvest1186157032024-04-11 10:09:436 days ago1712830183IN
0xfcf05EAc...77bb14476
0 ETH0.000045920.05831471
Reinvest1185815972024-04-10 15:12:516 days ago1712761971IN
0xfcf05EAc...77bb14476
0 ETH0.000047930.06087097
Reinvest1185423382024-04-09 17:24:137 days ago1712683453IN
0xfcf05EAc...77bb14476
0 ETH0.000056890.05882929
Reinvest1185102532024-04-08 23:34:438 days ago1712619283IN
0xfcf05EAc...77bb14476
0 ETH0.000045380.05763407
Reinvest1184803402024-04-08 6:57:379 days ago1712559457IN
0xfcf05EAc...77bb14476
0 ETH0.000006670.00799787
Reinvest1184766072024-04-08 4:53:119 days ago1712551991IN
0xfcf05EAc...77bb14476
0 ETH0.000005190.00579644
Reinvest1184738492024-04-08 3:21:159 days ago1712546475IN
0xfcf05EAc...77bb14476
0 ETH0.000004320.00477023
Reinvest1184713332024-04-08 1:57:239 days ago1712541443IN
0xfcf05EAc...77bb14476
0 ETH0.000004760.00567573
Reinvest1184687742024-04-08 0:32:059 days ago1712536325IN
0xfcf05EAc...77bb14476
0 ETH0.000004810.005823
Reinvest1184661382024-04-07 23:04:139 days ago1712531053IN
0xfcf05EAc...77bb14476
0 ETH0.00000450.00565855
Reinvest1184636172024-04-07 21:40:119 days ago1712526011IN
0xfcf05EAc...77bb14476
0 ETH0.000006020.00672184
Reinvest1184605702024-04-07 19:58:379 days ago1712519917IN
0xfcf05EAc...77bb14476
0 ETH0.000005120.00643347
Reinvest1184576922024-04-07 18:22:419 days ago1712514161IN
0xfcf05EAc...77bb14476
0 ETH0.000005680.00628538
Reinvest1184549052024-04-07 16:49:479 days ago1712508587IN
0xfcf05EAc...77bb14476
0 ETH0.000006340.0076049
Reinvest1184515112024-04-07 14:56:399 days ago1712501799IN
0xfcf05EAc...77bb14476
0 ETH0.000005530.00574703
Reinvest1184488222024-04-07 13:27:019 days ago1712496421IN
0xfcf05EAc...77bb14476
0 ETH0.000004780.00571359
Reinvest1184458992024-04-07 11:49:359 days ago1712490575IN
0xfcf05EAc...77bb14476
0 ETH0.000005460.00610522
Reinvest1184427802024-04-07 10:05:3710 days ago1712484337IN
0xfcf05EAc...77bb14476
0 ETH0.000005970.00658945
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075581392023-07-30 11:04:15262 days ago1690715055
0xfcf05EAc...77bb14476
0 ETH
1075575612023-07-30 10:44:59262 days ago1690713899
0xfcf05EAc...77bb14476
0 ETH
View All Internal Transactions

Loading...
Loading

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

Contract Name:
VeloV2VaultToken

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : VeloV2VaultToken.sol
pragma solidity =0.5.16;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./PoolToken.sol";
import "./interfaces/IOptiSwap.sol";
import "./interfaces/IVeloVoter.sol";
import "./interfaces/IVeloV2PoolFactory.sol";
import "./interfaces/IVeloV2Gauge.sol";
import "./interfaces/IVeloV2Pool.sol";
import "./interfaces/IVeloV2Router.sol";
import "./interfaces/IBaseV1Pair.sol";
import "./interfaces/IVeloV2VaultToken.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IERC20.sol";
import "./libraries/SafeToken.sol";
import "./libraries/Math.sol";

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

contract VeloV2VaultToken is IVeloV2VaultToken, PoolToken {
    using SafeToken for address;

    bool public constant isVaultToken = true;
    bool public constant stable = false;

    address public optiSwap;
    address public router;
    address public voter;
    address public gauge;
    address public pairFactory;
    address public rewardsToken;
    address public WETH;
    address public reinvestFeeTo;
    address public token0;
    address public token1;

    uint256 public constant MIN_REINVEST_BOUNTY = 0;
    uint256 public constant MAX_REINVEST_BOUNTY = 0.05e18;
    uint256 public REINVEST_BOUNTY = 0.02e18;
    uint256 public constant MIN_REINVEST_FEE = 0;
    uint256 public constant MAX_REINVEST_FEE = 0.05e18;
    uint256 public REINVEST_FEE = 0.02e18;
    uint256 public constant MIN_WITHDRAW_FEE_BPS = 0;
    uint256 public constant MAX_WITHDRAW_FEE_BPS = 100;
    uint256 public WITHDRAW_FEE = 1;
    uint256 public constant MAX_BPS = 10000;

    address[] reinvestorList;
    mapping(address => bool) reinvestorEnabled;

    event Reinvest(address indexed caller, uint256 reward, uint256 bounty, uint256 fee);
    event UpdateReinvestBounty(uint256 _newReinvestBounty);
    event UpdateReinvestFee(uint256 _newReinvestFee);
    event UpdateWithdrawFee(uint256 _newWithdrawFee);
    event UpdateReinvestFeeTo(address _newReinvestFeeTo);

    function _initialize(
        address _underlying,
        address _optiSwap,
        address _router,
        address _voter,
        address _pairFactory,
        address _rewardsToken,
        address _reinvestFeeTo
    ) external {
        require(factory == address(0), "VaultToken: FACTORY_ALREADY_SET"); // sufficient check
        factory = msg.sender;
        _setName("Tarot Vault Token", "vTAROT");
        underlying = _underlying;
        optiSwap = _optiSwap;
        voter = _voter;
        gauge = IVeloVoter(voter).gauges(underlying);
        require(gauge != address(0), "VaultToken: NO_GAUGE");
        router = _router;
        pairFactory = _pairFactory;
        WETH = IVeloV2Router(_router).weth();
        (token0, token1) = IBaseV1Pair(_underlying).tokens();
        rewardsToken = _rewardsToken;
        reinvestFeeTo = _reinvestFeeTo;
        rewardsToken.safeApprove(address(router), uint256(-1));
        WETH.safeApprove(address(router), uint256(-1));
        underlying.safeApprove(address(gauge), uint256(-1));
    }

    function reinvestorListLength() external view returns (uint256) {
        return reinvestorList.length;
    }

    function reinvestorListItem(uint256 index) external view returns (address) {
        return reinvestorList[index];
    }

    function isReinvestorEnabled(address reinvestor) external view returns (bool) {
        return reinvestorEnabled[reinvestor];
    }

    function _addReinvestor(address reinvestor) private {
        require(!reinvestorEnabled[reinvestor], "VaultToken: REINVESTOR_ENABLED");

        reinvestorEnabled[reinvestor] = true;
        reinvestorList.push(reinvestor);
    }

    function addReinvestor(address reinvestor) external onlyFactoryOwner {
        _addReinvestor(reinvestor);
    }

    function _indexOfReinvestor(address reinvestor) private view returns (uint256 index) {
        uint256 count = reinvestorList.length;
        for (uint256 i = 0; i < count; i++) {
            if (reinvestorList[i] == reinvestor) {
                return i;
            }
        }
        require(false, "VaultToken: REINVESTOR_NOT_FOUND");
    }

    function removeReinvestor(address reinvestor) external onlyFactoryOwner {
        require(reinvestorEnabled[reinvestor], "VaultToken: REINVESTOR_ENABLED");

        uint256 index = _indexOfReinvestor(reinvestor);
        address last = reinvestorList[reinvestorList.length - 1];
        reinvestorList[index] = last;
        reinvestorList.pop();
        delete reinvestorEnabled[reinvestor];
    }

    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 updateReinvestFee(uint256 _newReinvestFee) external onlyFactoryOwner {
        require(_newReinvestFee >= MIN_REINVEST_FEE && _newReinvestFee <= MAX_REINVEST_FEE, "VaultToken: INVLD_REINVEST_FEE");
        REINVEST_FEE = _newReinvestFee;

        emit UpdateReinvestFee(_newReinvestFee);
    }

    function updateWithdrawFee(uint256 _newWithdrawFee) external onlyFactoryOwner {
        require(_newWithdrawFee >= MIN_WITHDRAW_FEE_BPS && _newWithdrawFee <= MAX_WITHDRAW_FEE_BPS, "VaultToken: INVLD_WITHDRAW_FEE");
        WITHDRAW_FEE = _newWithdrawFee;

        emit UpdateWithdrawFee(_newWithdrawFee);
    }

    function updateReinvestFeeTo(address _newReinvestFeeTo) external onlyFactoryOwner {
        reinvestFeeTo = _newReinvestFeeTo;

        emit UpdateReinvestFeeTo(_newReinvestFeeTo);
    }

    /*** PoolToken Overrides ***/

    function _update() internal {
        uint256 _totalBalance = IVeloV2Gauge(gauge).balanceOf(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 = IVeloV2Gauge(gauge).balanceOf(address(this));
        IVeloV2Gauge(gauge).deposit(mintAmount);
        uint256 _totalBalanceAfter = IVeloV2Gauge(gauge).balanceOf(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);
        {
            uint256 redeemFee = redeemAmount.mul(WITHDRAW_FEE).div(MAX_BPS);
            redeemAmount = redeemAmount.sub(redeemFee);
        }
        require(redeemAmount > 0, "VaultToken: REDEEM_AMOUNT_ZERO");
        require(redeemAmount <= totalBalance, "VaultToken: INSUFFICIENT_CASH");
        _burn(address(this), redeemTokens);
        IVeloV2Gauge(gauge).withdraw(redeemAmount);
        _safeTransfer(redeemer, redeemAmount);
        emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);
    }

    /*** Reinvest ***/

    function _optimalDepositA(
        uint256 _amountA,
        uint256 _reserveA
    ) internal view returns (uint256) {
        uint256 swapFee = IVeloV2PoolFactory(pairFactory).getFee(underlying, false);
        uint256 swapFeeFactor = uint256(10000).sub(swapFee);
        uint256 a = uint256(10000).add(swapFeeFactor).mul(_reserveA);
        uint256 b = _amountA.mul(10000).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), router) >= amount) return;
        token.safeApprove(address(router), uint256(-1));
    }

    function swapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint256 amount
    ) internal {
        approveRouter(tokenIn, amount);
        IVeloV2Router.Route[] memory routes = new IVeloV2Router.Route[](1);
        routes[0].from = tokenIn;
        routes[0].to = tokenOut;
        routes[0].stable = false;
        routes[0].factory = IVeloV2Pool(underlying).factory();

        IVeloV2Router(router).swapExactTokensForTokens(amount, 0, routes, address(this), block.timestamp);
    }

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

    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 _getReward() internal returns (uint256 amount) {
        IVeloV2Gauge(gauge).getReward(address(this));

        return rewardsToken.myBalance();
    }

    function getReward() external nonReentrant returns (uint256) {
        require(msg.sender == tx.origin || reinvestorEnabled[msg.sender]);
        return _getReward();
    }

    function reinvest() external nonReentrant update {
        require(msg.sender == tx.origin || reinvestorEnabled[msg.sender]);
        // 1. Withdraw all the rewards.
        uint256 reward = _getReward();
        if (reward == 0) return;
        // 2. Send the reward bounty to the caller.
        uint256 bounty = reward.mul(REINVEST_BOUNTY) / 1e18;
        if (bounty > 0) {
            rewardsToken.safeTransfer(msg.sender, bounty);
        }
        uint256 fee = reward.mul(REINVEST_FEE) / 1e18;
        if (fee > 0) {
            rewardsToken.safeTransfer(reinvestFeeTo, fee);
        }
        // 3. Convert all the remaining rewards to token0 or token1.
        address tokenA;
        address tokenB;
        if (token0 == rewardsToken || token1 == rewardsToken) {
            (tokenA, tokenB) = token0 == rewardsToken ? (token0, token1) : (token1, token0);
        } else {
            if (token1 == WETH) {
                (tokenA, tokenB) = (token1, token0);
            } else {
                (tokenA, tokenB) = (token0, token1);
            }
            optiSwapExactTokensForTokens(rewardsToken, tokenA, reward.sub(bounty.add(fee)));
        }
        // 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);
        swapExactTokensForTokens(tokenA, tokenB, swapAmount);
        uint256 liquidity = addLiquidity(tokenA, tokenB, totalAmountA.sub(swapAmount), tokenB.myBalance());
        // 5. Stake the LP Tokens.
        IVeloV2Gauge(gauge).deposit(liquidity);
        emit Reinvest(msg.sender, reward, bounty, fee);
    }

    function adminClaimRewards() external onlyFactoryOwner nonReentrant {
        IVeloV2Gauge(gauge).getReward(address(this));
    }

    function adminRescueTokens(address _to, address[] calldata _tokens) external onlyFactoryOwner nonReentrant {
        require(_to != address(0), "VaultToken: INVLD_TO");

        for (uint256 i = 0; i < _tokens.length; i++) {
            address token = _tokens[i];
            require(token != underlying, "VaultToken: IS_UNDERLYING");
            require(token != rewardsToken, "VaultToken: IS_REWARDS_TOKEN");
            require(token != token0, "VaultToken: IS_TOKEN_0");
            require(token != token1, "VaultToken: IS_TOKEN_1");

            uint256 tokenBalance = token.myBalance();
            if (tokenBalance > 0) {
                token.safeTransfer(_to, tokenBalance);
            }
        }
    }

    /*** Mirrored From uniswapV2Pair ***/

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        )
    {
        (uint _reserve0, uint _reserve1, uint _blockTimestampLast) = IUniswapV2Pair(underlying).getReserves();
        reserve0 = safe112(_reserve0);
        reserve1 = safe112(_reserve1);
        blockTimestampLast = uint32(_blockTimestampLast % 2**32);
        // 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");
    }

    /*** Mirrored from BaseV1Pair ***/

    function observationLength() external view returns (uint) {
        return IBaseV1Pair(underlying).observationLength();
    }

    function observations(uint index)
        external
        view
        returns (
            uint timestamp,
            uint reserve0Cumulative,
            uint reserve1Cumulative
        )
    {
        return IBaseV1Pair(underlying).observations(index);
    }

    function currentCumulativePrices()
        external
        view
        returns (
            uint reserve0Cumulative,
            uint reserve1Cumulative,
            uint timestamp
        )
    {
        return IBaseV1Pair(underlying).currentCumulativePrices();
    }

    /*** Utilities ***/

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

    function getBlockTimestamp() public view returns (uint32) {
        return uint32(block.timestamp % 2**32);
    }

    /*** Modifiers ***/

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

File 2 of 19 : 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 3 of 19 : 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 4 of 19 : IBaseV1Pair.sol
pragma solidity >=0.5.0;

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

    function stable() external view returns (bool);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
	
    function token0() external view returns (address);
    function token1() external view returns (address);
    function tokens() external view returns (address, address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function observationLength() external view returns (uint);
    function observations(uint) external view returns (
        uint timestamp,
        uint reserve0Cumulative,
        uint reserve1Cumulative
    );
    function currentCumulativePrices() external view returns (
        uint reserve0Cumulative,
        uint reserve1Cumulative,
        uint timestamp
    );

    function metadata() external view returns (uint, uint, uint, uint, bool, address, address);
}

File 5 of 19 : 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 6 of 19 : 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 19 : 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 8 of 19 : 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 9 of 19 : IVeloV2Gauge.sol
pragma solidity >=0.5.0;

interface IVeloV2Gauge {
    function notifyRewardAmount(uint amount) external;
    function getReward(address account) external;
    function left() external view returns (uint);
    function isPool() external view returns (bool);
    function earned(address account) external view returns (uint);
    function balanceOf(address account) external view returns (uint);
    function deposit(uint256 amount) external;
    function withdraw(uint256 amount) external;
}

File 10 of 19 : IVeloV2Pool.sol
pragma solidity >=0.5.0;

interface IVeloV2Pool {
    function factory() external view returns (address);
}

File 11 of 19 : IVeloV2PoolFactory.sol
pragma solidity >=0.5.0;

interface IVeloV2PoolFactory {
    function allPoolsLength() external view returns (uint);
    function isPair(address pair) external view returns (bool);
    function getPair(address tokenA, address tokenB, bool stable) external view returns (address);
    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair);
    function getFee(address pool, bool _stable) external view returns (uint);
}

File 12 of 19 : IVeloV2Router.sol
pragma solidity >=0.5.0;
pragma experimental ABIEncoderV2;

interface IVeloV2Router {
    struct Route {
        address from;
        address to;
        bool stable;
        address factory;
    }

    function weth() external view returns (address);

    /// @notice Add liquidity of two tokens to a Pool
    /// @param tokenA           .
    /// @param tokenB           .
    /// @param stable           True if pool is stable, false if volatile
    /// @param amountADesired   Amount of tokenA desired to deposit
    /// @param amountBDesired   Amount of tokenB desired to deposit
    /// @param amountAMin       Minimum amount of tokenA to deposit
    /// @param amountBMin       Minimum amount of tokenB to deposit
    /// @param to               Recipient of liquidity token
    /// @param deadline         Deadline to receive liquidity
    /// @return amountA         Amount of tokenA to actually deposit
    /// @return amountB         Amount of tokenB to actually deposit
    /// @return liquidity       Amount of liquidity token returned from deposit
    function addLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @notice Swap one token for another
    /// @param amountIn     Amount of token in
    /// @param amountOutMin Minimum amount of desired token received
    /// @param routes       Array of trade routes used in the swap
    /// @param to           Recipient of the tokens received
    /// @param deadline     Deadline to receive tokens
    /// @return amounts     Array of amounts returned per route
    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        Route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
}

File 13 of 19 : IVeloV2VaultToken.sol
pragma solidity >=0.5.0;

interface IVeloV2VaultToken {
    /*** 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, uint256 fee);

    function isVaultToken() external pure returns (bool);

    function stable() external pure returns (bool);

    function optiSwap() external view returns (address);

    function router() external view returns (address);

    function voter() external view returns (address);

    function pairFactory() external view returns (address);

    function rewardsToken() external view returns (address);

    function WETH() external view returns (address);

    function reinvestFeeTo() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function REINVEST_BOUNTY() external view returns (uint256);

    function REINVEST_FEE() external view returns (uint256);

    function WITHDRAW_FEE() external view returns (uint256);

    function reinvestorListLength() external view returns (uint256);

    function reinvestorListItem(uint256 index) external view returns (address);

    function isReinvestorEnabled(address reinvestor) external view returns (bool);

    function addReinvestor(address reinvestor) external;

    function removeReinvestor(address reinvestor) external;

    function updateReinvestBounty(uint256 _newReinvestBounty) external;

    function updateReinvestFee(uint256 _newReinvestFee) external;

    function updateWithdrawFee(uint256 _newWithdrawFee) external;

    function updateReinvestFeeTo(address _newReinvestFeeTo) external;

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

    function observationLength() external view returns (uint);

    function observations(uint index)
        external
        view
        returns (
            uint timestamp,
            uint reserve0Cumulative,
            uint reserve1Cumulative
        );

    function currentCumulativePrices()
        external
        view
        returns (
            uint reserve0Cumulative,
            uint reserve1Cumulative,
            uint timestamp
        );

    function _initialize(
        address _underlying,
        address _optiSwap,
        address _router,
        address _voter,
        address _pairFactory,
        address _rewardsToken,
        address _reinvestFeeTo
    ) external;

    function reinvest() external;

    function getReward() external returns (uint256);

    function getBlockTimestamp() external view returns (uint32);

    function adminClaimRewards() external;

    function adminRescueTokens(address _to, address[] calldata _tokens) external;
}

File 14 of 19 : IVeloVoter.sol
pragma solidity >=0.5.0;

interface IVeloVoter {
    function _ve() external view returns (address);
    function governor() external view returns (address);
    function emergencyCouncil() external view returns (address);
    function attachTokenToGauge(uint _tokenId, address account) external;
    function detachTokenFromGauge(uint _tokenId, address account) external;
    function emitDeposit(uint _tokenId, address account, uint amount) external;
    function emitWithdraw(uint _tokenId, address account, uint amount) external;
    function isWhitelisted(address token) external view returns (bool);
    function notifyRewardAmount(uint amount) external;
    function distribute(address _gauge) external;
    function gauges(address token) external view returns (address);
}

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

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

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

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

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

File 17 of 19 : 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 18 of 19 : 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 19 of 19 : 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);
    }
}

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"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"Reinvest","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newReinvestFee","type":"uint256"}],"name":"UpdateReinvestFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newReinvestFeeTo","type":"address"}],"name":"UpdateReinvestFeeTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newWithdrawFee","type":"uint256"}],"name":"UpdateWithdrawFee","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_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"MAX_REINVEST_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_WITHDRAW_FEE_BPS","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":"MIN_REINVEST_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_WITHDRAW_FEE_BPS","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":"REINVEST_FEE","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":true,"inputs":[],"name":"WITHDRAW_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"address","name":"_optiSwap","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_pairFactory","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_reinvestFeeTo","type":"address"}],"name":"_initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"_setFactory","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"reinvestor","type":"address"}],"name":"addReinvestor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"adminClaimRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"adminRescueTokens","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":"currentCumulativePrices","outputs":[{"internalType":"uint256","name":"reserve0Cumulative","type":"uint256"},{"internalType":"uint256","name":"reserve1Cumulative","type":"uint256"},{"internalType":"uint256","name":"timestamp","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":"gauge","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":false,"inputs":[],"name":"getReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"reinvestor","type":"address"}],"name":"isReinvestorEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isVaultToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"observationLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"observations","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"reserve0Cumulative","type":"uint256"},{"internalType":"uint256","name":"reserve1Cumulative","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":true,"inputs":[],"name":"pairFactory","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":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":"reinvestFeeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"reinvestorListItem","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reinvestorListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"reinvestor","type":"address"}],"name":"removeReinvestor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newReinvestFee","type":"uint256"}],"name":"updateReinvestFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_newReinvestFeeTo","type":"address"}],"name":"updateReinvestFeeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newWithdrawFee","type":"uint256"}],"name":"updateWithdrawFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103d05760003560e01c806395a2251f116101ff578063ca932df01161011a578063e4a1337e116100ad578063f887ea401161007c578063f887ea40146106fb578063fd967f4714610703578063fdb5a03e1461070b578063fff6cae914610713576103d0565b8063e4a1337e146106e3578063e6df6649146106eb578063e6e87e7e146105eb578063ebeb31db146106f3576103d0565b8063daf635de116100e9578063daf635de146106a2578063dd62ed3e146106b5578063e14f870d146106c8578063e15fadfb146106d0576103d0565b8063ca932df01461066c578063d1af0c7d1461067f578063d21220a714610687578063d505accf1461068f576103d0565b8063ad5c464811610192578063c45a015511610161578063c45a015514610649578063c4990f0414610651578063c85f173e14610664578063c8c4ff8c146104f6576103d0565b8063ad5c46481461061e578063ad7a672f14610626578063ba9a7a561461062e578063bc25cf7714610636576103d0565b8063a3e85f01116101ce578063a3e85f01146105eb578063a6f19c84146105fb578063a9059cbb14610603578063abbc065514610616576103d0565b806395a2251f146105d057806395d89b41146105e357806396fa4c11146105eb5780639bff5ddb146105f3576103d0565b806340aa9b71116102ef5780636a6278421161028257806370a082311161025157806370a082311461058d578063796b89b9146105a05780637daeecf0146105b55780637ecebe00146105bd576103d0565b80636a627842146105625780636c2a3bc5146105755780636ee272271461057d5780636f307dc314610585576103d0565b806346c96aac116102be57806346c96aac1461053757806346fb738b1461053f5780634a5d316c1461055257806360c2affa1461055a576103d0565b806340aa9b71146104f6578063439e2740146104fe57806345aca17d146105115780634685338214610524576103d0565b8063252c09d7116103675780633644e515116103365780633644e515146104cb578063378ab9d3146104d35780633ba0b9a9146104e65780633d18b912146104ee576103d0565b8063252c09d71461048657806329a105221461049957806330adf81f146104ae578063313ce567146104b6576103d0565b806318160ddd116103a357806318160ddd1461043f5780631df8c7171461045457806322be3de11461046b57806323b872dd14610473576103d0565b806306fdde03146103d55780630902f1ac146103f3578063095ea7b31461040a5780630dfe16811461042a575b600080fd5b6103dd61071b565b6040516103ea9190614ace565b60405180910390f35b6103fb6107a9565b6040516103ea93929190614c9f565b61041d610418366004613f2a565b6109b3565b6040516103ea919061499f565b6104326109ca565b6040516103ea91906148ba565b6104476109d9565b6040516103ea91906149ad565b61045c6109df565b6040516103ea93929190614d61565b61041d610a75565b61041d610481366004613dfa565b610a7a565b61045c610494366004614020565b610b4a565b6104ac6104a7366004613ed4565b610bdc565b005b610447610e0c565b6104be610e30565b6040516103ea9190614d97565b610447610e39565b61041d6104e1366004613cb8565b610e3f565b610447610e61565b610447610eb1565b610447610f20565b6104ac61050c366004613d5e565b610f2b565b6104ac61051f366004614020565b61128a565b610432610532366004614020565b611393565b6104326113bd565b6104ac61054d366004614020565b6113cc565b6104ac6114ca565b610432611507565b610447610570366004613cb8565b61151b565b6104476117c5565b61041d6117cb565b6104326117d0565b61044761059b366004613cb8565b6117df565b6105a86117f1565b6040516103ea9190614d89565b6104326117fb565b6104476105cb366004613cb8565b61180a565b6104476105de366004613cb8565b61181c565b6103dd6119c1565b610447610a75565b610447611a1b565b610432611a21565b61041d610611366004613f2a565b611a30565b610447611a3d565b610432611a42565b610447611a51565b610447611a57565b6104ac610644366004613cb8565b611a5d565b610432611b37565b6104ac61065f366004613cb8565b611b46565b6104ac611c33565b6104ac61067a366004613cb8565b611d5f565b610432611e0d565b610432611e1c565b6104ac61069d366004613e47565b611e2b565b6104ac6106b0366004614020565b611e66565b6104476106c3366004613cf4565b611f5e565b610432611f7b565b6104ac6106de366004613cb8565b611f8a565b610447612132565b610447612138565b61044761213e565b6104326121c0565b6104476121cf565b6104ac6121d5565b6104ac6125d5565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107a15780601f10610776576101008083540402835291602001916107a1565b820191906000526020600020905b81548152906001019060200180831161078457829003601f168201915b505050505081565b600080600080600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561080057600080fd5b505afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108389190810190613fdd565b63ffffffff1692506001600160701b031692506001600160701b0316925061085f83612609565b955061086a82612609565b9450640100000000810693506003546000141561088a57506109ae915050565b600a54600854604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156108d257600080fd5b505afa1580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061090a919081019061403e565b905061093d6109388261092c856001600160701b038d1663ffffffff61263216565b9063ffffffff61266c16565b612609565b975061095f6109388261092c856001600160701b038c1663ffffffff61263216565b96506064886001600160701b031611801561098357506064876001600160701b0316115b6109a85760405162461bcd60e51b815260040161099f90614c8f565b60405180910390fd5b50505050505b909192565b60006109c03384846126ae565b5060015b92915050565b6013546001600160a01b031681565b60035481565b6000806000600860009054906101000a90046001600160a01b03166001600160a01b0316631df8c7176040518163ffffffff1660e01b815260040160606040518083038186803b158015610a3257600080fd5b505afa158015610a46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a6a919081019061405c565b925092509250909192565b600081565b6001600160a01b038316600090815260056020908152604080832033845290915281205460001914610b3457604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b0387166000908152600582528381203382529091529190912054610b0f91849063ffffffff61271616565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b610b3f848484612742565b5060015b9392505050565b60085460405163252c09d760e01b8152600091829182916001600160a01b03169063252c09d790610b7f9087906004016149ad565b60606040518083038186803b158015610b9757600080fd5b505afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bcf919081019061405c565b9250925092509193909250565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015610c2057600080fd5b505afa158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c589190810190613cd6565b6001600160a01b031614610c7e5760405162461bcd60e51b815260040161099f90614c7f565b600b5460ff16610ca05760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff191690556001600160a01b038316610cd05760405162461bcd60e51b815260040161099f90614c6f565b60005b81811015610df9576000838383818110610ce957fe5b9050602002016020610cfe9190810190613cb8565b6008549091506001600160a01b0380831691161415610d2f5760405162461bcd60e51b815260040161099f90614b3f565b6010546001600160a01b0382811691161415610d5d5760405162461bcd60e51b815260040161099f90614bdf565b6013546001600160a01b0382811691161415610d8b5760405162461bcd60e51b815260040161099f90614b5f565b6014546001600160a01b0382811691161415610db95760405162461bcd60e51b815260040161099f90614c2f565b6000610dcd826001600160a01b031661282a565b90508015610def57610def6001600160a01b038316878363ffffffff6128a916565b5050600101610cd3565b5050600b805460ff191660011790555050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b60065481565b6001600160a01b03811660009081526019602052604090205460ff165b919050565b600354600a5460009190811580610e76575080155b15610e8d57670de0b6b3a764000092505050610eae565b610ea98261092c83670de0b6b3a764000063ffffffff61263216565b925050505b90565b600b5460009060ff16610ed65760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff1916905533321480610efd57503360009081526019602052604090205460ff165b610f0657600080fd5b610f0e612997565b9050600b805460ff1916600117905590565b66b1a2bc2ec5000081565b6009546001600160a01b031615610f545760405162461bcd60e51b815260040161099f90614aef565b600980546001600160a01b0319163317905560408051808201825260118152702a30b937ba102b30bab63a102a37b5b2b760791b602080830191909152825180840190935260068352651d95105493d560d21b90830152610fb491612a10565b600880546001600160a01b03199081166001600160a01b038a81169190911792839055600b8054610100600160a81b0319166101008b841602179055600d8054909216878216179182905560405163b9a09fd560e01b81529181169263b9a09fd5926110279291909116906004016148ba565b60206040518083038186803b15801561103f57600080fd5b505afa158015611053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110779190810190613cd6565b600e80546001600160a01b0319166001600160a01b039283161790819055166110b25760405162461bcd60e51b815260040161099f90614b6f565b600c80546001600160a01b038088166001600160a01b03199283168117909355600f80549187169190921617905560408051633fc8cef360e01b81529051633fc8cef391600480820192602092909190829003018186803b15801561111657600080fd5b505afa15801561112a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061114e9190810190613cd6565b601180546001600160a01b0319166001600160a01b0392831617905560408051634eb1c24560e11b81528151928a1692639d63848a92600480840193919291829003018186803b1580156111a157600080fd5b505afa1580156111b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111d99190810190613d2e565b601480546001600160a01b03199081166001600160a01b03938416179091556013805482169383169390931790925560108054831685831617908190556012805490931684831617909255600c546112379282169116600019612ac4565b600c5460115461125c916001600160a01b03918216911660001963ffffffff612ac416565b600e54600854611281916001600160a01b03918216911660001963ffffffff612ac416565b50505050505050565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b1580156112ce57600080fd5b505afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113069190810190613cd6565b6001600160a01b03161461132c5760405162461bcd60e51b815260040161099f90614c7f565b66b1a2bc2ec500008111156113535760405162461bcd60e51b815260040161099f90614b4f565b60168190556040517f06df23e01946274f699a86923d1f32785f705fa03f19b8f7203367561b6e0b3d906113889083906149ad565b60405180910390a150565b6000601882815481106113a257fe5b6000918252602090912001546001600160a01b031692915050565b600d546001600160a01b031681565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561141057600080fd5b505afa158015611424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114489190810190613cd6565b6001600160a01b03161461146e5760405162461bcd60e51b815260040161099f90614c7f565b66b1a2bc2ec500008111156114955760405162461bcd60e51b815260040161099f90614c1f565b60158190556040517ffa1e13889c5c5294758f01f045a83de15feca61a17e6281f4d11a5110085d932906113889083906149ad565b6009546001600160a01b0316156114f35760405162461bcd60e51b815260040161099f90614bef565b600980546001600160a01b03191633179055565b600b5461010090046001600160a01b031681565b600b5460009060ff166115405760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff19169055600854600090611562906001600160a01b031661282a565b600e546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906115989030906004016148ba565b60206040518083038186803b1580156115b057600080fd5b505afa1580156115c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115e8919081019061403e565b600e5460405163b6b55f2560e01b81529192506001600160a01b03169063b6b55f25906116199085906004016149ad565b600060405180830381600087803b15801561163357600080fd5b505af1158015611647573d6000803e3d6000fd5b5050600e546040516370a0823160e01b8152600093506001600160a01b0390911691506370a082319061167e9030906004016148ba565b60206040518083038186803b15801561169657600080fd5b505afa1580156116aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116ce919081019061403e565b90506117036116db610e61565b61092c670de0b6b3a76400006116f7858763ffffffff612bab16565b9063ffffffff61263216565b93506003546000141561173157611722846103e863ffffffff612bab16565b935061173160006103e8612bed565b600084116117515760405162461bcd60e51b815260040161099f90614b2f565b61175b8585612bed565b846001600160a01b0316336001600160a01b03167f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee85876040516117a0929190614d53565b60405180910390a35050506117b3612c87565b600b805460ff19166001179055919050565b60155481565b600181565b6008546001600160a01b031681565b60046020526000908152604090205481565b63ffffffff421690565b6012546001600160a01b031681565b60076020526000908152604090205481565b600b5460009060ff166118415760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff191690553060009081526004602052604090205461187f670de0b6b3a764000061092c611872610e61565b849063ffffffff61263216565b9150600061189e61271061092c6017548661263290919063ffffffff16565b90506118b0838263ffffffff612bab16565b925050600082116118d35760405162461bcd60e51b815260040161099f90614b1f565b600a548211156118f55760405162461bcd60e51b815260040161099f90614c5f565b6118ff3082612d40565b600e54604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d9061192f9085906004016149ad565b600060405180830381600087803b15801561194957600080fd5b505af115801561195d573d6000803e3d6000fd5b5050505061196b8383612dd6565b826001600160a01b0316336001600160a01b03167f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc84846040516119b0929190614d53565b60405180910390a3506117b3612c87565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107a15780601f10610776576101008083540402835291602001916107a1565b60175481565b600e546001600160a01b031681565b60006109c0338484612742565b606481565b6011546001600160a01b031681565b600a5481565b6103e881565b600b5460ff16611a7f5760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff19169055600a546008546040516370a0823160e01b8152611b27928492611b22926001600160a01b03909116906370a0823190611ac69030906004016148ba565b60206040518083038186803b158015611ade57600080fd5b505afa158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b16919081019061403e565b9063ffffffff612bab16565b612dd6565b50600b805460ff19166001179055565b6009546001600160a01b031681565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611b8a57600080fd5b505afa158015611b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bc29190810190613cd6565b6001600160a01b031614611be85760405162461bcd60e51b815260040161099f90614c7f565b601280546001600160a01b0319166001600160a01b0383161790556040517f7f0cbd49972f62913af26d643526e8da09b67d71da761e4782ce72d4bdc78b73906113889083906148ba565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611c7757600080fd5b505afa158015611c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611caf9190810190613cd6565b6001600160a01b031614611cd55760405162461bcd60e51b815260040161099f90614c7f565b600b5460ff16611cf75760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff19169055600e54604051630c00007b60e41b81526001600160a01b039091169063c00007b090611d319030906004016148ba565b600060405180830381600087803b158015611d4b57600080fd5b505af1158015610df9573d6000803e3d6000fd5b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611da357600080fd5b505afa158015611db7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ddb9190810190613cd6565b6001600160a01b031614611e015760405162461bcd60e51b815260040161099f90614c7f565b611e0a81612f1e565b50565b6010546001600160a01b031681565b6014546001600160a01b031681565b611e5b878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612fbd565b6112818787876126ae565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611eaa57600080fd5b505afa158015611ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ee29190810190613cd6565b6001600160a01b031614611f085760405162461bcd60e51b815260040161099f90614c7f565b6064811115611f295760405162461bcd60e51b815260040161099f90614b9f565b60178190556040517feedc9f23ce4e26f302207ce9f311dcad0a9a027b978f4aad8aa9739a76fcb2f0906113889083906149ad565b600560209081526000928352604080842090915290825290205481565b600f546001600160a01b031681565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611fce57600080fd5b505afa158015611fe2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506120069190810190613cd6565b6001600160a01b03161461202c5760405162461bcd60e51b815260040161099f90614c7f565b6001600160a01b03811660009081526019602052604090205460ff166120645760405162461bcd60e51b815260040161099f90614c3f565b600061206f82613102565b60188054919250600091600019810190811061208757fe5b600091825260209091200154601880546001600160a01b0390921692508291849081106120b057fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060188054806120e957fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b039490941681526019909352505060409020805460ff19169055565b60185490565b60165481565b6008546040805163ebeb31db60e01b815290516000926001600160a01b03169163ebeb31db916004808301926020929190829003018186803b15801561218357600080fd5b505afa158015612197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121bb919081019061403e565b905090565b600c546001600160a01b031681565b61271081565b600b5460ff166121f75760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff191690553332148061221e57503360009081526019602052604090205460ff165b61222757600080fd5b6000612231612997565b90508061223e57506125be565b6000670de0b6b3a764000061225e6015548461263290919063ffffffff16565b8161226557fe5b049050801561228b5760105461228b906001600160a01b0316338363ffffffff6128a916565b6000670de0b6b3a76400006122ab6016548561263290919063ffffffff16565b816122b257fe5b04905080156122de576012546010546122de916001600160a01b0391821691168363ffffffff6128a916565b60105460135460009182916001600160a01b039081169116148061231257506010546014546001600160a01b039081169116145b15612365576010546013546001600160a01b03908116911614612347576014546013546001600160a01b03918216911661235b565b6013546014546001600160a01b0391821691165b90925090506123e6565b6011546014546001600160a01b03908116911614156123985750506014546013546001600160a01b0391821691166123ae565b50506013546014546001600160a01b0391821691165b6010546123e4906001600160a01b0316836123df6123d2888863ffffffff61316e16565b899063ffffffff612bab16565b613193565b505b60006123fa836001600160a01b031661282a565b90506000811161240657fe5b600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561245757600080fd5b505afa15801561246b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061248f9190810190613fdd565b506013546001600160701b039283169450911691506000906001600160a01b038781169116146124bf57816124c1565b825b905060006124cf85836133cf565b90506124dc87878361350c565b600061250a88886124f3898663ffffffff612bab16565b6125058b6001600160a01b031661282a565b6136f8565b600e5460405163b6b55f2560e01b81529192506001600160a01b03169063b6b55f259061253b9084906004016149ad565b600060405180830381600087803b15801561255557600080fd5b505af1158015612569573d6000803e3d6000fd5b50505050336001600160a01b03167f5a1f3c64a894cbcee558ea14f59dd807692703df44b42f0c036588f149c8f7ba8c8c8c6040516125aa93929190614d61565b60405180910390a250505050505050505050505b6125c6612c87565b600b805460ff19166001179055565b600b5460ff166125f75760405162461bcd60e51b815260040161099f90614b8f565b600b805460ff191690556125c6612c87565b6000600160701b821061262e5760405162461bcd60e51b815260040161099f90614b7f565b5090565b600082612641575060006109c4565b8282028284828161264e57fe5b0414610b435760405162461bcd60e51b815260040161099f90614baf565b6000610b4383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506137ac565b6001600160a01b0380841660008181526005602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906127099085906149ad565b60405180910390a3505050565b6000818484111561273a5760405162461bcd60e51b815260040161099f9190614ace565b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b0386166000908152600490915291909120546127a391839063ffffffff61271616565b6001600160a01b0380851660009081526004602052604080822093909355908416815220546127d8908263ffffffff61316e16565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906127099085906149ad565b6040516370a0823160e01b81526000906001600160a01b038316906370a08231906128599030906004016148ba565b60206040518083038186803b15801561287157600080fd5b505afa158015612885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109c4919081019061403e565b60006060846001600160a01b031663a9059cbb85856040516024016128cf929190614984565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506040516129089190614872565b6000604051808303816000865af19150503d8060008114612945576040519150601f19603f3d011682016040523d82523d6000602084013e61294a565b606091505b50915091508180156129745750805115806129745750808060200190516129749190810190613fbf565b6129905760405162461bcd60e51b815260040161099f90614bbf565b5050505050565b600e54604051630c00007b60e41b81526000916001600160a01b03169063c00007b0906129c89030906004016148ba565b600060405180830381600087803b1580156129e257600080fd5b505af11580156129f6573d6000803e3d6000fd5b50506010546121bb92506001600160a01b0316905061282a565b8151612a23906000906020850190613add565b508051612a37906001906020840190613add565b506040514690612a46906148af565b604080519182900382208551602080880191909120848401845260018552603160f81b948201949094529151612aa49391927fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6918691309101614a0a565b60408051601f198184030181529190528051602090910120600655505050565b60006060846001600160a01b031663095ea7b38585604051602401612aea929190614984565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612b239190614872565b6000604051808303816000865af19150503d8060008114612b60576040519150601f19603f3d011682016040523d82523d6000602084013e612b65565b606091505b5091509150818015612b8f575080511580612b8f575080806020019051612b8f9190810190613fbf565b6129905760405162461bcd60e51b815260040161099f90614aff565b6000610b4383836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250612716565b600354612c00908263ffffffff61316e16565b6003556001600160a01b038216600090815260046020526040902054612c2c908263ffffffff61316e16565b6001600160a01b0383166000818152600460205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612c7b9085906149ad565b60405180910390a35050565b600e546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612cb89030906004016148ba565b60206040518083038186803b158015612cd057600080fd5b505afa158015612ce4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612d08919081019061403e565b905080600a819055507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf48160405161138891906149ad565b6001600160a01b038216600090815260046020526040902054612d69908263ffffffff612bab16565b6001600160a01b038316600090815260046020526040902055600354612d95908263ffffffff612bab16565b6003556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612c7b9085906149ad565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602090910152516000916060916001600160a01b03909116907fa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b90612e529087908790602401614984565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612e909190614872565b6000604051808303816000865af19150503d8060008114612ecd576040519150601f19603f3d011682016040523d82523d6000602084013e612ed2565b606091505b5091509150818015612efc575080511580612efc575080806020019051612efc9190810190613fbf565b612f185760405162461bcd60e51b815260040161099f90614c4f565b50505050565b6001600160a01b03811660009081526019602052604090205460ff1615612f575760405162461bcd60e51b815260040161099f90614c3f565b6001600160a01b03166000818152601960205260408120805460ff191660019081179091556018805491820181559091527fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e0180546001600160a01b0319169091179055565b42851015612fdd5760405162461bcd60e51b815260040161099f90614adf565b6006546001600160a01b0389166000908152600760209081526040808320805460018101909155905192939261301e9286928e928e928e92918e91016149bb565b6040516020818303038152906040528051906020012060405160200161304592919061487e565b6040516020818303038152906040528051906020012090506000600182878787604051600081526020016040526040516130829493929190614a56565b6020604051602081039080840390855afa1580156130a4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906130da5750896001600160a01b0316816001600160a01b0316145b6130f65760405162461bcd60e51b815260040161099f90614bff565b50505050505050505050565b601854600090815b8181101561315557836001600160a01b03166018828154811061312957fe5b6000918252602090912001546001600160a01b0316141561314d579150610e5c9050565b60010161310a565b5060405162461bcd60e51b815260040161099f90614c0f565b600082820183811015610b435760405162461bcd60e51b815260040161099f90614b0f565b6000826001600160a01b0316846001600160a01b031614156131b6575080610b43565b600b5460405163711f958560e11b81526101009091046001600160a01b031690600090829063e23f2b0a906131ef9089906004016148ba565b60206040518083038186803b15801561320757600080fd5b505afa15801561321b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061323f9190810190613cd6565b9050846001600160a01b0316816001600160a01b0316141561327057613267828787876137e3565b92505050610b43565b60405163711f958560e11b81526000906001600160a01b0384169063e23f2b0a9061329f9089906004016148ba565b60206040518083038186803b1580156132b757600080fd5b505afa1580156132cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506132ef9190810190613cd6565b9050806001600160a01b0316876001600160a01b0316141561332157613317838888886137e3565b9350505050610b43565b6000876001600160a01b0316836001600160a01b03161461334f57613348848985896137e3565b9050613352565b50845b816001600160a01b0316836001600160a01b0316141561338357613378848489846137e3565b945050505050610b43565b866001600160a01b0316826001600160a01b031614156133a857613378838883613193565b60006133b5848484613193565b90506133c385848a846137e3565b95505050505050610b43565b600f5460085460405163cc56b2c560e01b815260009283926001600160a01b039182169263cc56b2c5926134099216908590600401614969565b60206040518083038186803b15801561342157600080fd5b505afa158015613435573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613459919081019061403e565b9050600061346f6127108363ffffffff612bab16565b90506000613489856116f76127108563ffffffff61316e16565b905060006134a8836116f76004818a818d61271063ffffffff61263216565b905060006134d46134cf836134c3868063ffffffff61263216565b9063ffffffff61316e16565b6139d7565b905060006134e960028663ffffffff61263216565b90506134ff8161092c848763ffffffff612bab16565b9998505050505050505050565b6135168382613a28565b604080516001808252818301909252606091816020015b613535613b57565b81526020019060019003908161352d579050509050838160008151811061355857fe5b6020026020010151600001906001600160a01b031690816001600160a01b031681525050828160008151811061358a57fe5b6020026020010151602001906001600160a01b031690816001600160a01b0316815250506000816000815181106135bd57fe5b602090810291909101810151911515604092830152600854825163c45a015560e01b815292516001600160a01b039091169263c45a0155926004808301939192829003018186803b15801561361157600080fd5b505afa158015613625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506136499190810190613cd6565b8160008151811061365657fe5b60209081029190910101516001600160a01b03918216606090910152600c5460405163cac88ea960e01b815291169063cac88ea9906136a2908590600090869030904290600401614d0a565b600060405180830381600087803b1580156136bc57600080fd5b505af11580156136d0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526129909190810190613f8a565b60006137048584613a28565b61370e8483613a28565b600c54604051635a47ddc360e01b81526001600160a01b0390911690635a47ddc39061374f90889088906000908990899083908190309042906004016148e3565b606060405180830381600087803b15801561376957600080fd5b505af115801561377d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506137a1919081019061405c565b979650505050505050565b600081836137cd5760405162461bcd60e51b815260040161099f9190614ace565b5060008385816137d957fe5b0495945050505050565b6000826001600160a01b0316846001600160a01b031614156138065750806139cf565b604051630820681160e11b81526000906001600160a01b03871690631040d0229061383990869089908990600401614cc7565b604080518083038186803b15801561385057600080fd5b505afa158015613864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138889190810190613f5a565b925090506001600160a01b0381166138b25760405162461bcd60e51b815260040161099f90614bcf565b6138cc6001600160a01b038616828563ffffffff6128a916565b836001600160a01b0316856001600160a01b0316101561395c57604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0383169163022c0d9f9161392591908690309060248101614a94565b600060405180830381600087803b15801561393f57600080fd5b505af1158015613953573d6000803e3d6000fd5b505050506139cd565b604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0383169163022c0d9f9161399a918691309060248101614cef565b600060405180830381600087803b1580156139b457600080fd5b505af11580156139c8573d6000803e3d6000fd5b505050505b505b949350505050565b60006003821115613a1a575080600160028204015b81811015613a1457809150600281828581613a0357fe5b040181613a0c57fe5b0490506139ec565b50610e5c565b8115610e5c57506001919050565b600c54604051636eb1769f60e11b815282916001600160a01b038086169263dd62ed3e92613a5d9230929116906004016148c8565b60206040518083038186803b158015613a7557600080fd5b505afa158015613a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613aad919081019061403e565b10613ab757613ad9565b600c54613ad9906001600160a01b03848116911660001963ffffffff612ac416565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613b1e57805160ff1916838001178555613b4b565b82800160010185558215613b4b579182015b82811115613b4b578251825591602001919060010190613b30565b5061262e929150613b7e565b60408051608081018252600080825260208201819052918101829052606081019190915290565b610eae91905b8082111561262e5760008155600101613b84565b80356109c481614e78565b80516109c481614e78565b60008083601f840112613bc057600080fd5b50813567ffffffffffffffff811115613bd857600080fd5b602083019150836020820283011115613bf057600080fd5b9250929050565b600082601f830112613c0857600080fd5b8151613c1b613c1682614dcc565b614da5565b91508181835260208401935060208101905083856020840282011115613c4057600080fd5b60005b83811015613c6c5781613c568882613c97565b8452506020928301929190910190600101613c43565b5050505092915050565b80516109c481614e8c565b80356109c481614e95565b80516109c481614e9e565b80516109c481614e95565b80516109c481614ea7565b80356109c481614eb0565b600060208284031215613cca57600080fd5b60006139cf8484613b98565b600060208284031215613ce857600080fd5b60006139cf8484613ba3565b60008060408385031215613d0757600080fd5b6000613d138585613b98565b9250506020613d2485828601613b98565b9150509250929050565b60008060408385031215613d4157600080fd5b6000613d4d8585613ba3565b9250506020613d2485828601613ba3565b600080600080600080600060e0888a031215613d7957600080fd5b6000613d858a8a613b98565b9750506020613d968a828b01613b98565b9650506040613da78a828b01613b98565b9550506060613db88a828b01613b98565b9450506080613dc98a828b01613b98565b93505060a0613dda8a828b01613b98565b92505060c0613deb8a828b01613b98565b91505092959891949750929550565b600080600060608486031215613e0f57600080fd5b6000613e1b8686613b98565b9350506020613e2c86828701613b98565b9250506040613e3d86828701613c81565b9150509250925092565b600080600080600080600060e0888a031215613e6257600080fd5b6000613e6e8a8a613b98565b9750506020613e7f8a828b01613b98565b9650506040613e908a828b01613c81565b9550506060613ea18a828b01613c81565b9450506080613eb28a828b01613cad565b93505060a0613ec38a828b01613c81565b92505060c0613deb8a828b01613c81565b600080600060408486031215613ee957600080fd5b6000613ef58686613b98565b935050602084013567ffffffffffffffff811115613f1257600080fd5b613f1e86828701613bae565b92509250509250925092565b60008060408385031215613f3d57600080fd5b6000613f498585613b98565b9250506020613d2485828601613c81565b60008060408385031215613f6d57600080fd5b6000613f798585613ba3565b9250506020613d2485828601613c97565b600060208284031215613f9c57600080fd5b815167ffffffffffffffff811115613fb357600080fd5b6139cf84828501613bf7565b600060208284031215613fd157600080fd5b60006139cf8484613c76565b600080600060608486031215613ff257600080fd5b6000613ffe8686613c8c565b935050602061400f86828701613c8c565b9250506040613e3d86828701613ca2565b60006020828403121561403257600080fd5b60006139cf8484613c81565b60006020828403121561405057600080fd5b60006139cf8484613c97565b60008060006060848603121561407157600080fd5b600061407d8686613c97565b935050602061408e86828701613c97565b9250506040613e3d86828701613c97565b60006140ab838361480d565b505060800190565b6140bc81614e00565b82525050565b60006140cd82614df3565b6140d78185614df7565b93506140e283614ded565b8060005b838110156141105781516140fa888261409f565b975061410583614ded565b9250506001016140e6565b509495945050505050565b6140bc81614e0b565b6140bc81610eae565b6140bc61413982610eae565b610eae565b600061414982614df3565b6141538185610e5c565b9350614163818560208601614e42565b9290920192915050565b600061417882614df3565b6141828185614df7565b9350614192818560208601614e42565b61419b81614e6e565b9093019392505050565b6140bc81614e37565b60006141bb600e83614df7565b6d15185c9bdd0e881156141254915160921b815260200192915050565b60006141e5601f83614df7565b7f5661756c74546f6b656e3a20464143544f52595f414c52454144595f53455400815260200192915050565b600061421e600c83614df7565b6b2173616665417070726f766560a01b815260200192915050565b6000614246600283610e5c565b61190160f01b815260020192915050565b6000614264601b83614df7565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b600061429d601e83614df7565b7f5661756c74546f6b656e3a2052454445454d5f414d4f554e545f5a45524f0000815260200192915050565b60006142d6601c83614df7565b7f5661756c74546f6b656e3a204d494e545f414d4f554e545f5a45524f00000000815260200192915050565b600061430f601983614df7565b7f5661756c74546f6b656e3a2049535f554e4445524c59494e4700000000000000815260200192915050565b6000614348601e83614df7565b7f5661756c74546f6b656e3a20494e564c445f5245494e564553545f4645450000815260200192915050565b6000614381601683614df7565b7505661756c74546f6b656e3a2049535f544f4b454e5f360541b815260200192915050565b60006143b3601483614df7565b735661756c74546f6b656e3a204e4f5f474155474560601b815260200192915050565b60006143e3601383614df7565b722b30bab63a2a37b5b2b71d1029a0a32298989960691b815260200192915050565b6000614412601083614df7565b6f15185c9bdd0e8814915153951154915160821b815260200192915050565b600061443e605283610e5c565b7f454950373132446f6d61696e28737472696e67206e616d652c737472696e672081527f76657273696f6e2c75696e7432353620636861696e49642c6164647265737320602082015271766572696679696e67436f6e74726163742960701b604082015260520192915050565b60006144b8601e83614df7565b7f5661756c74546f6b656e3a20494e564c445f57495448445241575f4645450000815260200192915050565b60006144f1602183614df7565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000614534600d83614df7565b6c10b9b0b332aa3930b739b332b960991b815260200192915050565b600061455d600783614df7565b662727afa820a4a960c91b815260200192915050565b6000614580601c83614df7565b7f5661756c74546f6b656e3a2049535f524557415244535f544f4b454e00000000815260200192915050565b60006145b9601a83614df7565b7f5461726f743a20464143544f52595f414c52454144595f534554000000000000815260200192915050565b60006145f2601883614df7565b7f5461726f743a20494e56414c49445f5349474e41545552450000000000000000815260200192915050565b600061462b602083614df7565b7f5661756c74546f6b656e3a205245494e564553544f525f4e4f545f464f554e44815260200192915050565b6000614664602183614df7565b7f5661756c74546f6b656e3a20494e564c445f5245494e564553545f424f554e548152605960f81b602082015260400192915050565b60006146a7601683614df7565b755661756c74546f6b656e3a2049535f544f4b454e5f3160501b815260200192915050565b60006146d9601e83614df7565b7f5661756c74546f6b656e3a205245494e564553544f525f454e41424c45440000815260200192915050565b6000614712601683614df7565b7515185c9bdd0e881514905394d1915497d1905253115160521b815260200192915050565b6000614744601d83614df7565b7f5661756c74546f6b656e3a20494e53554646494349454e545f43415348000000815260200192915050565b600061477d601483614df7565b735661756c74546f6b656e3a20494e564c445f544f60601b815260200192915050565b60006147ad600e83614df7565b6d1393d517d055551213d49256915160921b815260200192915050565b60006147d7602183614df7565b7f5661756c74546f6b656e3a20494e53554646494349454e545f524553455256458152605360f81b602082015260400192915050565b8051608083019061481e84826140b3565b50602082015161483160208501826140b3565b506040820151614844604085018261411b565b506060820151612f1860608501826140b3565b6140bc81614e10565b6140bc81614e28565b6140bc81614e31565b6000610b43828461413e565b600061488982614239565b9150614895828561412d565b6020820191506148a5828461412d565b5060200192915050565b60006109c482614431565b602081016109c482846140b3565b604081016148d682856140b3565b610b4360208301846140b3565b61012081016148f2828c6140b3565b6148ff602083018b6140b3565b61490c604083018a61411b565b6149196060830189614124565b6149266080830188614124565b61493360a08301876141a5565b61494060c08301866141a5565b61494d60e08301856140b3565b61495b610100830184614124565b9a9950505050505050505050565b6040810161497782856140b3565b610b43602083018461411b565b6040810161499282856140b3565b610b436020830184614124565b602081016109c4828461411b565b602081016109c48284614124565b60c081016149c98289614124565b6149d660208301886140b3565b6149e360408301876140b3565b6149f06060830186614124565b6149fd6080830185614124565b6137a160a0830184614124565b60a08101614a188288614124565b614a256020830187614124565b614a326040830186614124565b614a3f6060830185614124565b614a4c60808301846140b3565b9695505050505050565b60808101614a648287614124565b614a716020830186614869565b614a7e6040830185614124565b614a8b6060830184614124565b95945050505050565b60808101614aa282876141a5565b614aaf6020830186614124565b614abc60408301856140b3565b8181036060830152614a4c818461416d565b60208082528101610b43818461416d565b602080825281016109c4816141ae565b602080825281016109c4816141d8565b602080825281016109c481614211565b602080825281016109c481614257565b602080825281016109c481614290565b602080825281016109c4816142c9565b602080825281016109c481614302565b602080825281016109c48161433b565b602080825281016109c481614374565b602080825281016109c4816143a6565b602080825281016109c4816143d6565b602080825281016109c481614405565b602080825281016109c4816144ab565b602080825281016109c4816144e4565b602080825281016109c481614527565b602080825281016109c481614550565b602080825281016109c481614573565b602080825281016109c4816145ac565b602080825281016109c4816145e5565b602080825281016109c48161461e565b602080825281016109c481614657565b602080825281016109c48161469a565b602080825281016109c4816146cc565b602080825281016109c481614705565b602080825281016109c481614737565b602080825281016109c481614770565b602080825281016109c4816147a0565b602080825281016109c4816147ca565b60608101614cad8286614857565b614cba6020830185614857565b6139cf6040830184614860565b60608101614cd58286614124565b614ce260208301856140b3565b6139cf60408301846140b3565b60808101614cfd8287614124565b614aaf60208301866141a5565b60a08101614d188288614124565b614d2560208301876141a5565b8181036040830152614d3781866140c2565b9050614d4660608301856140b3565b614a4c6080830184614124565b604081016149928285614124565b60608101614d6f8286614124565b614d7c6020830185614124565b6139cf6040830184614124565b602081016109c48284614860565b602081016109c48284614869565b60405181810167ffffffffffffffff81118282101715614dc457600080fd5b604052919050565b600067ffffffffffffffff821115614de357600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b60006109c482614e1c565b151590565b6001600160701b031690565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b60006109c482610eae565b60005b83811015614e5d578181015183820152602001614e45565b83811115612f185750506000910152565b601f01601f191690565b614e8181614e00565b8114611e0a57600080fd5b614e8181614e0b565b614e8181610eae565b614e8181614e10565b614e8181614e28565b614e8181614e3156fea365627a7a723158209c9a339fe4483097d31868a4d93adb969eb46d46e2c7e71f2986c1fdce2d1c9b6c6578706572696d656e74616cf564736f6c63430005100040

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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