Contract 0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e430

 

Contract Overview

Balance:
0 FTM

FTM Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6402beba84c97c9f1df83f1a661757406ae4ebd0960ee3ceaeb8751b974ad7a5Reinvest540254602023-01-19 6:48:0719 days 20 hrs ago0x28c974c18c6553b445c4b77f35d83f3499acf58f IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.021931190499
0x09f03b661bd854ea95e6c491ad6a01311a555f04459f5126d59848d5dd277c28Reinvest527156152022-12-22 22:33:1047 days 5 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003393234726
0x5a40c26b32e78243a213e1b0a8d71506f49d49cdabb239afa6e1a039246b472eReinvest527146682022-12-22 22:15:4547 days 5 hrs ago0x2df95ea6e42643bc357b0e0c01a942797e1c2010 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.005958356026
0x887aa1896052f5eae92e39226102a635a8d5255f5ccb07e376448ad773639eafReinvest527142982022-12-22 22:09:3547 days 5 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.018438071564
0x0d08d102601cb8c1648acc7f3b9d45fd6631eed6a7232e8e6c01bc921fb000b6Reinvest527133562022-12-22 21:51:5447 days 5 hrs ago0xf38d3ac9a6b994239c57dd7996a2ba4217c90661 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.019865836064
0x14ef247e488e48162e144766db8f1d35abb69ec74284e6849d22762b71b61651Reinvest527133532022-12-22 21:51:5147 days 5 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.018684176044
0x918a67c80ebbefceef43755da593aa353383918e514cfda7e41fb535c2d4ffc3Reinvest527123872022-12-22 21:31:4947 days 6 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.018619677837
0xaeeef7196c2067a0a1a0ab2b88d0a4f619fe5a205a1f9a44c72d508fee972c92Reinvest527116242022-12-22 21:13:2947 days 6 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.019493866042
0xdbf4fd93e605498fde1fe9d90e504b92e33363a3d6b019609291a86aab8d4276Reinvest527116232022-12-22 21:13:2847 days 6 hrs ago0x14c07a5f107a9d15a6c2d0c131dcb3933386503e IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.01885534
0x34e5b82f7d3aa8ce7ddf9b669f11954c8b40cff1c21f909ef8565b206e1bff02Reinvest527116222022-12-22 21:13:2747 days 6 hrs ago0x6bbaf582db70c5819f84ea4822113ef598cc2906 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.020488622326
0x39e174bbf908ec99ea4857c1a8628486233b1adbefe7000da863ea93e0ab18e5Reinvest527105932022-12-22 20:54:2447 days 6 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.019222898959
0xa9f21eab9b6771ce3f2b52daf339a33f81f5c279582b37ea45c19522e0d95df0Reinvest527095962022-12-22 20:35:1747 days 6 hrs ago0x6bbaf582db70c5819f84ea4822113ef598cc2906 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.020506262174
0x6937737fdd6ba44f879177e13b596c94f4bd248b132738c886343691a18b873bReinvest527091182022-12-22 20:14:3947 days 7 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.018526464
0xde9626c38a78be9d8bc8702fc430f41dfd8a46386f5f22ffdd958604ed3b6a03Reinvest527084882022-12-22 19:56:1947 days 7 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.020008203965
0xa54fdc95f28b34e79c9e966f5aef762e060669b2345b7867e7a5528a168769f1Reinvest527078102022-12-22 19:36:3647 days 7 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.022227193565
0x14a703c8ee13438df2b37da12b376acf6e3a790a64764e2b9581db2973643c8eReinvest527078092022-12-22 19:36:3547 days 7 hrs ago0x6bbaf582db70c5819f84ea4822113ef598cc2906 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.022101979101
0x404685573a40586a3e6e68ab9565505290d771484dc115cedc6f92b501ad6816Reinvest527065192022-12-22 19:14:4947 days 8 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.0241760712
0xcd1984faa8b2561b5d414c794eb7f34f7ae531cec53fc4035c983057a524bf22Reinvest527052432022-12-22 18:51:1747 days 8 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.025864519374
0x2faf7ed9f1765ca73e644a06599a1a3eed3c82822c84524ca4af8b321cb20038Reinvest527040702022-12-22 18:26:0647 days 9 hrs ago0x28c974c18c6553b445c4b77f35d83f3499acf58f IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.027308489718
0x96dfcae441b5468001cac61b7859197bfec418018303e752bf8c12a747a9d65cReinvest527036582022-12-22 18:17:4347 days 9 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.028053313054
0xd95ef3dc02dec2c502a5fc9631cf90ec3d20dd7cc2ce9009ca9fc78e78831958Reinvest527022332022-12-22 17:49:3547 days 9 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.029818939019
0x079898043f9be0b13a735cd25d0c1045ee5fb1c3bc8d3b1cce669293cb75b22bReinvest527006652022-12-22 17:19:4547 days 10 hrs ago0x28c974c18c6553b445c4b77f35d83f3499acf58f IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.044075191479
0xdd76868db345d494cc4d83ba54286a6ff3e5851dd6b601e0a465ca9e43fb0ec3Reinvest526994202022-12-22 16:58:0847 days 10 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.036126415636
0xdaadb5c0ffa8970b7b893e357449f0f9fd31ede6d9dd7b260dbc489d213f87d4Reinvest526977572022-12-22 16:21:5347 days 11 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.038228467692
0x5ecbbeb88e378981962dc8cededce936ceabf1b0be6bddd1abf56ae10ca3cc0fReinvest526958352022-12-22 15:44:0747 days 11 hrs ago0x0000000000e9e96d2ee2ee91775848aed8813be3 IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.043811562502
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x4da5a053cf20c5b2775ce29adef377f81dc4e23d5c43a882f815af498a3de485404358292022-06-13 15:42:58239 days 11 hrs ago 0x2dc3be114ec36ae0e8dc70f3090b8f2bcb7c18e7  Contract Creation0 FTM
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x22B20D4C5ea37f9227915E57CDEEBF75e40EEbf4

Contract Name:
TombSwapVaultToken

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 16 : TombSwapVaultToken.sol
pragma solidity =0.5.16;

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

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

contract TombSwapVaultToken is ITombSwapVaultToken, IUniswapV2Pair, PoolToken {
    using SafeToken for address;

    bool public constant isVaultToken = true;

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

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

    function _initialize(
        address _optiSwap,
        IUniswapV2Router01 _router,
        IMasterChef _masterChef,
        address _rewardsToken,
        uint256 _pid
    ) external {
        require(factory == address(0), "VaultToken: FACTORY_ALREADY_SET"); // sufficient check
        optiSwap = _optiSwap;
        factory = msg.sender;
        _setName("Tarot Vault Token", "vTAROT");
        WETH = _router.WETH();
        router = _router;
        tombSwapFactory = ITombSwapUniswapV2Factory(router.factory());
        masterChef = _masterChef;
        pid = _pid;
        (IERC20 _underlying, , , ) = masterChef.poolInfo(_pid);
        underlying = address(_underlying);
        token0 = IUniswapV2Pair(underlying).token0();
        token1 = IUniswapV2Pair(underlying).token1();
        require(tombSwapFactory.getPair(token0, token1) == underlying, "VaultToken: INVLD_PAIR");
        rewardsToken = _rewardsToken;
        rewardsToken.safeApprove(address(router), uint256(-1));
        WETH.safeApprove(address(router), uint256(-1));
        underlying.safeApprove(address(masterChef), uint256(-1));
    }

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

        emit UpdateReinvestBounty(_newReinvestBounty);
    }

    /*** PoolToken Overrides ***/

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

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

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

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

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

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

    /*** Reinvest ***/

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

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

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

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

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

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

    function reinvest() external nonReentrant update {
        require(msg.sender == tx.origin);
        // 1. Withdraw all the rewards.
        masterChef.withdraw(pid, 0);
        uint256 reward = rewardsToken.myBalance();
        if (reward == 0) return;
        // 2. Send the reward bounty to the caller.
        uint256 bounty = reward.mul(REINVEST_BOUNTY) / 1e18;
        rewardsToken.safeTransfer(msg.sender, bounty);
        // 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));
        }
        // 4. Convert tokenA to LP Token underlyings.
        uint256 totalAmountA = tokenA.myBalance();
        assert(totalAmountA > 0);
        (uint256 r0, uint256 r1, ) = IUniswapV2Pair(underlying).getReserves();
        uint256 reserveA = tokenA == token0 ? r0 : r1;
        uint256 swapAmount = _optimalDepositA(
            totalAmountA,
            reserveA,
            swapFeeFactor()
        );
        swapExactTokensForTokens(tokenA, tokenB, swapAmount);
        uint256 liquidity = addLiquidity(
            tokenA,
            tokenB,
            totalAmountA.sub(swapAmount),
            tokenB.myBalance()
        );
        // 5. Stake the LP Tokens.
        masterChef.deposit(pid, liquidity);
        emit Reinvest(msg.sender, reward, bounty);
    }

    function swapFeeFactor() public view returns (uint256) {
        return uint256(1000).sub(tombSwapFactory.swapFee());
    }

    /*** Mirrored From uniswapV2Pair ***/

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

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

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

    /*** Utilities ***/

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

    /*** Modifiers ***/

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

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

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

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

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

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

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

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

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

File 3 of 16 : PoolToken.sol
pragma solidity =0.5.16;

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

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

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

    /*** Initialize ***/

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

    /*** PoolToken ***/

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

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

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

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

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

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

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

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

    /*** Utilities ***/

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

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

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

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

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

import "./IERC20.sol";

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

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

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

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

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

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

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

interface ITombSwapVaultToken {
    /*** Tarot ERC20 ***/

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

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

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

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

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

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

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

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

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

    /*** Pool Token ***/

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

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external view returns (uint256);

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

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

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;

    /*** VaultToken ***/

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

    function isVaultToken() external pure returns (bool);

    function router() external view returns (IUniswapV2Router01);

    function masterChef() external view returns (IMasterChef);

    function rewardsToken() external view returns (address);

    function WETH() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function swapFeeFactor() external view returns (uint256);

    function pid() external view returns (uint256);

    function REINVEST_BOUNTY() external pure returns (uint256);

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

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function _initialize(
        address optiSwap,
        IUniswapV2Router01 _router,
        IMasterChef _masterChef,
        address _rewardsToken,
        uint256 _pid
    ) external;

    function reinvest() external;
}

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

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

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

    function bridgeFromTokensLength() external view returns (uint256);

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

    function addBridgeToken(address _token, address _bridgeToken) external;

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

    function dexListLength() external view returns (uint256);

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

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

    function addDex(address _dex, address _handler) external;

    function removeDex(address _dex) external;

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

File 7 of 16 : 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 8 of 16 : IUniswapV2Router01.sol
pragma solidity >=0.5.0;

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

    function WETH() external pure returns (address);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 16 : ITombSwapUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface ITombSwapUniswapV2Factory {
    function swapFee() external view returns (uint);
    
    function getPair(address tokenA, address tokenB) external view returns (address pair);
}

File 10 of 16 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

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

    function totalSupply() external view returns (uint256);

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

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

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

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

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

    function token0() external view returns (address);

    function token1() external view returns (address);

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

    function price0CumulativeLast() external view returns (uint256);

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

File 11 of 16 : SafeToken.sol
pragma solidity 0.5.16;

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

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

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

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

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

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

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

File 12 of 16 : Math.sol
pragma solidity =0.5.16;

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

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

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

File 13 of 16 : Context.sol
pragma solidity ^0.5.0;

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

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

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

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

import "./libraries/SafeMath.sol";

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

contract TarotERC20 {
    using SafeMath for uint256;

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

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

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

    constructor() public {}

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

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

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

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

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

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

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

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

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

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

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

File 15 of 16 : IPoolToken.sol
pragma solidity >=0.5.0;

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

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

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

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

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

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

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

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

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

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

    /*** Pool Token ***/

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

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external view returns (uint256);

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

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

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;
}

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

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

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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

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

Contract Security Audit

Contract ABI

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

60806040526002805460ff19908116601217909155600b80549091166001179055662386f26fc100006014556137168061003a6000396000f3fe608060405234801561001057600080fd5b50600436106102695760003560e01c80636f307dc311610151578063c45a0155116100c3578063dd62ed3e11610087578063dd62ed3e1461063d578063ddf98f511461066b578063f106845414610673578063f887ea401461067b578063fdb5a03e14610683578063fff6cae91461068b57610269565b8063c45a0155146105cc578063c8c4ff8c146105d4578063d1af0c7d146105dc578063d21220a7146105e4578063d505accf146105ec57610269565b806396fa4c111161011557806396fa4c111461055a578063a9059cbb14610562578063ad5c46481461058e578063ad7a672f14610596578063ba9a7a561461059e578063bc25cf77146105a657610269565b80636f307dc3146104d857806370a08231146104e05780637ecebe001461050657806395a2251f1461052c57806395d89b411461055257610269565b80633ba0b9a9116101ea5780635a3d5493116101ae5780635a3d54931461048a57806360c2affa1461049257806368f91a441461049a5780636a627842146104a25780636c2a3bc5146104c85780636ee27227146104d057610269565b80633ba0b9a91461044d57806346fb738b146104555780634a5d316c14610472578063575a86b21461047a5780635909c0d51461048257610269565b806323b872dd1161023157806323b872dd146103a157806330adf81f146103d7578063313ce567146103df5780633591f073146103fd5780633644e5151461044557610269565b806306fdde031461026e5780630902f1ac146102eb578063095ea7b3146103235780630dfe16811461036357806318160ddd14610387575b600080fd5b610276610693565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102b0578181015183820152602001610298565b50505050905090810190601f1680156102dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102f3610721565b604080516001600160701b03948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034f6004803603604081101561033957600080fd5b506001600160a01b0381351690602001356108f1565b604080519115158252519081900360200190f35b61036b610908565b604080516001600160a01b039092168252519081900360200190f35b61038f610917565b60408051918252519081900360200190f35b61034f600480360360608110156103b757600080fd5b506001600160a01b0381358116916020810135909116906040013561091d565b61038f6109ed565b6103e7610a11565b6040805160ff9092168252519081900360200190f35b610443600480360360a081101561041357600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135610a1a565b005b61038f610f1d565b61038f610f23565b6104436004803603602081101561046b57600080fd5b5035610f73565b6104436110c3565b61036b611135565b61038f611144565b61038f6111ba565b61036b6111ff565b61038f611213565b61038f600480360360208110156104b857600080fd5b50356001600160a01b03166112a6565b61038f6115b1565b61034f6115b7565b61036b6115bc565b61038f600480360360208110156104f657600080fd5b50356001600160a01b03166115cb565b61038f6004803603602081101561051c57600080fd5b50356001600160a01b03166115dd565b61038f6004803603602081101561054257600080fd5b50356001600160a01b03166115ef565b6102766117fc565b61038f611856565b61034f6004803603604081101561057857600080fd5b506001600160a01b038135169060200135611861565b61036b61186e565b61038f61187d565b61038f611883565b610443600480360360208110156105bc57600080fd5b50356001600160a01b0316611889565b61036b611983565b61038f611992565b61036b61199d565b61036b6119ac565b610443600480360360e081101561060257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356119bb565b61038f6004803603604081101561065357600080fd5b506001600160a01b03813581169160200135166119ff565b61036b611a1c565b61038f611a2b565b61036b611a31565b610443611a40565b610443611e6b565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107195780601f106106ee57610100808354040283529160200191610719565b820191906000526020600020905b8154815290600101906020018083116106fc57829003601f168201915b505050505081565b6000806000600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561077457600080fd5b505afa158015610788573d6000803e3d6000fd5b505050506040513d606081101561079e57600080fd5b50805160208201516040909201516003549195509193509091506107c1576108ec565b600a54600854604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561080957600080fd5b505afa15801561081d573d6000803e3d6000fd5b505050506040513d602081101561083357600080fd5b5051905061086861086382610857856001600160701b038a1663ffffffff611ec716565b9063ffffffff611f2016565b611f62565b945061088a61086382610857856001600160701b03891663ffffffff611ec716565b93506064856001600160701b03161180156108ae57506064846001600160701b0316115b6108e95760405162461bcd60e51b81526004018080602001828103825260218152602001806136c16021913960400191505060405180910390fd5b50505b909192565b60006108fe338484611fba565b5060015b92915050565b6011546001600160a01b031681565b60035481565b6001600160a01b0383166000908152600560209081526040808320338452909152812054600019146109d757604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b03871660009081526005825283812033825290915291909120546109b291849063ffffffff61201c16565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b6109e28484846120b3565b5060015b9392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b6009546001600160a01b031615610a78576040805162461bcd60e51b815260206004820152601f60248201527f5661756c74546f6b656e3a20464143544f52595f414c52454144595f53455400604482015290519081900360640190fd5b600b80546001600160a01b03871661010002610100600160a81b0319909116179055600980546001600160a01b0319163317905560408051808201825260118152702a30b937ba102b30bab63a102a37b5b2b760791b602080830191909152825180840190935260068352651d95105493d560d21b90830152610afa916121a5565b836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3357600080fd5b505afa158015610b47573d6000803e3d6000fd5b505050506040513d6020811015610b5d57600080fd5b5051601080546001600160a01b03199081166001600160a01b0393841617909155600c805490911686831617908190556040805163c45a015560e01b81529051919092169163c45a0155916004828101926020929190829003018186803b158015610bc757600080fd5b505afa158015610bdb573d6000803e3d6000fd5b505050506040513d6020811015610bf157600080fd5b5051600d80546001600160a01b03199081166001600160a01b0393841617909155600e80549091168583161790819055601383905560408051631526fe2760e01b81526004810185905290516000939290921691631526fe2791602480820192608092909190829003018186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d6080811015610c9557600080fd5b5051600880546001600160a01b0319166001600160a01b03808416919091179182905560408051630dfe168160e01b81529051939450911691630dfe168191600480820192602092909190829003018186803b158015610cf457600080fd5b505afa158015610d08573d6000803e3d6000fd5b505050506040513d6020811015610d1e57600080fd5b5051601180546001600160a01b0319166001600160a01b039283161790556008546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015610d7957600080fd5b505afa158015610d8d573d6000803e3d6000fd5b505050506040513d6020811015610da357600080fd5b5051601280546001600160a01b0319166001600160a01b039283161790819055600854600d546011546040805163e6a4390560e01b815291861660048301529385166024820152925191841693169163e6a43905916044808301926020929190829003018186803b158015610e1757600080fd5b505afa158015610e2b573d6000803e3d6000fd5b505050506040513d6020811015610e4157600080fd5b50516001600160a01b031614610e97576040805162461bcd60e51b81526020600482015260166024820152752b30bab63a2a37b5b2b71d1024a72b26222fa820a4a960511b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b038581169190911791829055600c54610ecb928216911660001961226d565b600c54601054610ef0916001600160a01b03918216911660001963ffffffff61226d16565b600e54600854610f15916001600160a01b03918216911660001963ffffffff61226d16565b505050505050565b60065481565b600354600a5460009190811580610f38575080155b15610f4f57670de0b6b3a764000092505050610f70565b610f6b8261085783670de0b6b3a764000063ffffffff611ec716565b925050505b90565b60095460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015610fb757600080fd5b505afa158015610fcb573d6000803e3d6000fd5b505050506040513d6020811015610fe157600080fd5b50516001600160a01b03161461102f576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b604482015290519081900360640190fd5b66038d7ea4c68000811015801561104d5750662386f26fc100008111155b6110885760405162461bcd60e51b81526004018080602001828103825260218152602001806136a06021913960400191505060405180910390fd5b60148190556040805182815290517ffa1e13889c5c5294758f01f045a83de15feca61a17e6281f4d11a5110085d9329181900360200190a150565b6009546001600160a01b031615611121576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600e546001600160a01b031681565b60085460408051635909c0d560e01b815290516000926001600160a01b031691635909c0d5916004808301926020929190829003018186803b15801561118957600080fd5b505afa15801561119d573d6000803e3d6000fd5b505050506040513d60208110156111b357600080fd5b5051905090565b60085460408051635a3d549360e01b815290516000926001600160a01b031691635a3d5493916004808301926020929190829003018186803b15801561118957600080fd5b600b5461010090046001600160a01b031681565b60006112a1600d60009054906101000a90046001600160a01b03166001600160a01b03166354cf2aeb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561126657600080fd5b505afa15801561127a573d6000803e3d6000fd5b505050506040513d602081101561129057600080fd5b50516103e89063ffffffff6123c616565b905090565b600b5460009060ff166112f3576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854600090611315906001600160a01b0316612408565b600e54601354604080516393f1a40b60e01b8152600481019290925230602483015280519394506000936001600160a01b03909316926393f1a40b926044808201939291829003018186803b15801561136d57600080fd5b505afa158015611381573d6000803e3d6000fd5b505050506040513d604081101561139757600080fd5b5051600e5460135460408051631c57762b60e31b8152600481019290925260248201869052519293506001600160a01b039091169163e2bbb1589160448082019260009290919082900301818387803b1580156113f357600080fd5b505af1158015611407573d6000803e3d6000fd5b5050600e54601354604080516393f1a40b60e01b815260048101929092523060248301528051600095506001600160a01b0390931693506393f1a40b92604480840193829003018186803b15801561145e57600080fd5b505afa158015611472573d6000803e3d6000fd5b505050506040513d604081101561148857600080fd5b505190506114bf611497610f23565b610857670de0b6b3a76400006114b3858763ffffffff6123c616565b9063ffffffff611ec716565b9350600354600014156114ed576114de846103e863ffffffff6123c616565b93506114ed60006103e8612484565b60008411611542576040805162461bcd60e51b815260206004820152601c60248201527f5661756c74546f6b656e3a204d494e545f414d4f554e545f5a45524f00000000604482015290519081900360640190fd5b61154c8585612484565b604080518481526020810186905281516001600160a01b0388169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a350505061159f61251b565b600b805460ff19166001179055919050565b60145481565b600181565b6008546001600160a01b031681565b60046020526000908152604090205481565b60076020526000908152604090205481565b600b5460009060ff1661163c576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690553060009081526004602052604090205461167a670de0b6b3a764000061085761166d610f23565b849063ffffffff611ec716565b9150600082116116d1576040805162461bcd60e51b815260206004820152601e60248201527f5661756c74546f6b656e3a2052454445454d5f414d4f554e545f5a45524f0000604482015290519081900360640190fd5b600a54821115611728576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e3a20494e53554646494349454e545f43415348000000604482015290519081900360640190fd5b61173230826125d9565b600e5460135460408051630441a3e760e41b8152600481019290925260248201859052516001600160a01b039092169163441a3e709160448082019260009290919082900301818387803b15801561178957600080fd5b505af115801561179d573d6000803e3d6000fd5b505050506117ab8383612676565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a35061159f61251b565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107195780601f106106ee57610100808354040283529160200191610719565b66038d7ea4c6800081565b60006108fe3384846120b3565b6010546001600160a01b031681565b600a5481565b6103e881565b600b5460ff166118d3576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b8152306004820152905161197393859361196e9391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561193657600080fd5b505afa15801561194a573d6000803e3d6000fd5b505050506040513d602081101561196057600080fd5b50519063ffffffff6123c616565b612676565b50600b805460ff19166001179055565b6009546001600160a01b031681565b662386f26fc1000081565b600f546001600160a01b031681565b6012546001600160a01b031681565b6119eb878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612808565b6119f6878787611fba565b50505050505050565b600560209081526000928352604080842090915290825290205481565b600d546001600160a01b031681565b60135481565b600c546001600160a01b031681565b600b5460ff16611a8a576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055333214611aa057600080fd5b600e5460135460408051630441a3e760e41b8152600481019290925260006024830181905290516001600160a01b039093169263441a3e7092604480820193929182900301818387803b158015611af657600080fd5b505af1158015611b0a573d6000803e3d6000fd5b5050600f5460009250611b2691506001600160a01b0316612408565b905080611b335750611e54565b6000670de0b6b3a7640000611b5360145484611ec790919063ffffffff16565b81611b5a57fe5b600f549190049150611b7c906001600160a01b0316338363ffffffff6129dd16565b600f5460115460009182916001600160a01b0390811691161480611bb05750600f546012546001600160a01b039081169116145b15611c0357600f546011546001600160a01b03908116911614611be5576012546011546001600160a01b039182169116611bf9565b6011546012546001600160a01b0391821691165b9092509050611c74565b6010546012546001600160a01b0390811691161415611c365750506012546011546001600160a01b039182169116611c4c565b50506011546012546001600160a01b0391821691165b600f54611c72906001600160a01b031683611c6d878763ffffffff6123c616565b612b30565b505b6000611c88836001600160a01b0316612408565b905060008111611c9457fe5b600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611ce557600080fd5b505afa158015611cf9573d6000803e3d6000fd5b505050506040513d6060811015611d0f57600080fd5b5080516020909101516011546001600160701b039283169450911691506000906001600160a01b03878116911614611d475781611d49565b825b90506000611d5f8583611d5a611213565b612d60565b9050611d6c878783612dfb565b6000611d9a8888611d83898663ffffffff6123c616565b611d958b6001600160a01b0316612408565b613000565b600e5460135460408051631c57762b60e31b8152600481019290925260248201849052519293506001600160a01b039091169163e2bbb1589160448082019260009290919082900301818387803b158015611df457600080fd5b505af1158015611e08573d6000803e3d6000fd5b5050604080518d8152602081018d905281513394507fc003f45bc224d116b6d079100d4ab57a5b9633244c47a5a92a176c5b79a85f2893509081900390910190a2505050505050505050505b611e5c61251b565b600b805460ff19166001179055565b600b5460ff16611eb5576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055611e5c61251b565b600082611ed657506000610902565b82820282848281611ee357fe5b04146109e65760405162461bcd60e51b815260040180806020018281038252602181526020018061367f6021913960400191505060405180910390fd5b60006109e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506130cf565b6000600160701b8210611fb2576040805162461bcd60e51b81526020600482015260136024820152722b30bab63a2a37b5b2b71d1029a0a32298989960691b604482015290519081900360640190fd5b50805b919050565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600081848411156120ab5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612070578181015183820152602001612058565b50505050905090810190601f16801561209d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b03861660009081526004909152919091205461211491839063ffffffff61201c16565b6001600160a01b038085166000908152600460205260408082209390935590841681522054612149908263ffffffff61313416565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b81516121b8906000906020850190613594565b5080516121cc906001906020840190613594565b50604051469080605261362d8239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106122ea5780518252601f1990920191602091820191016122cb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461234c576040519150601f19603f3d011682016040523d82523d6000602084013e612351565b606091505b509150915081801561237f57508051158061237f575080806020019051602081101561237c57600080fd5b50515b6123bf576040805162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b604482015290519081900360640190fd5b5050505050565b60006109e683836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061201c565b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561245257600080fd5b505afa158015612466573d6000803e3d6000fd5b505050506040513d602081101561247c57600080fd5b505192915050565b600354612497908263ffffffff61313416565b6003556001600160a01b0382166000908152600460205260409020546124c3908263ffffffff61313416565b6001600160a01b03831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600e54601354604080516393f1a40b60e01b8152600481019290925230602483015280516000936001600160a01b0316926393f1a40b926044808301939192829003018186803b15801561256e57600080fd5b505afa158015612582573d6000803e3d6000fd5b505050506040513d604081101561259857600080fd5b5051600a8190556040805182815290519192507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4919081900360200190a150565b6001600160a01b038216600090815260046020526040902054612602908263ffffffff6123c616565b6001600160a01b03831660009081526004602052604090205560035461262e908263ffffffff6123c616565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b602083106127235780518252601f199092019160209182019101612704565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612785576040519150601f19603f3d011682016040523d82523d6000602084013e61278a565b606091505b50915091508180156127b85750805115806127b857508080602001905160208110156127b557600080fd5b50515b612802576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b50505050565b4285101561284e576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa15801561294a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906129805750896001600160a01b0316816001600160a01b0316145b6129d1576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b60208310612a5a5780518252601f199092019160209182019101612a3b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612abc576040519150601f19603f3d011682016040523d82523d6000602084013e612ac1565b606091505b5091509150818015612aef575080511580612aef5750808060200190516020811015612aec57600080fd5b50515b6123bf576040805162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b604482015290519081900360640190fd5b6000826001600160a01b0316846001600160a01b03161415612b535750806109e6565b600b546040805163711f958560e11b81526001600160a01b038781166004830152915161010090930490911691600091839163e23f2b0a91602480820192602092909190829003018186803b158015612bab57600080fd5b505afa158015612bbf573d6000803e3d6000fd5b505050506040513d6020811015612bd557600080fd5b505190506001600160a01b038082169086161415612c0257612bf98287878761318e565b925050506109e6565b6000826001600160a01b031663e23f2b0a876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015612c5a57600080fd5b505afa158015612c6e573d6000803e3d6000fd5b505050506040513d6020811015612c8457600080fd5b505190506001600160a01b038781169082161415612cb257612ca88388888861318e565b93505050506109e6565b6000876001600160a01b0316836001600160a01b031614612ce057612cd98489858961318e565b9050612ce3565b50845b816001600160a01b0316836001600160a01b03161415612d1457612d098484898461318e565b9450505050506109e6565b866001600160a01b0316826001600160a01b03161415612d3957612d09838883612b30565b6000612d46848484612b30565b9050612d5485848a8461318e565b955050505050506109e6565b600080612d79846114b36103e88663ffffffff61313416565b90506000612d98846114b360048189818c6103e863ffffffff611ec716565b90506000612dc4612dbf83612db3868063ffffffff611ec716565b9063ffffffff61313416565b613494565b90506000612dd960028763ffffffff611ec716565b9050612def81610857848763ffffffff6123c616565b98975050505050505050565b60408051600280825260608083018452926020830190803883390190505090508381600081518110612e2957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110612e5757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050612e8184836134e5565b600c546040516338ed173960e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b03909716966338ed1739968a968a9594939092909160c40190602080880191028083838b5b83811015612f07578181015183820152602001612eef565b505050509050019650505050505050600060405180830381600087803b158015612f3057600080fd5b505af1158015612f44573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612f6d57600080fd5b8101908080516040519392919084640100000000821115612f8d57600080fd5b908301906020820185811115612fa257600080fd5b8251866020820283011164010000000082111715612fbf57600080fd5b82525081516020918201928201910280838360005b83811015612fec578181015183820152602001612fd4565b505050509050016040525050505050505050565b600061300c85846134e5565b61301684836134e5565b600c546040805162e8e33760e81b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260006084830181905260a483018190523060c48401524260e4840152925193169263e8e337009261010480840193606093929083900390910190829087803b15801561309757600080fd5b505af11580156130ab573d6000803e3d6000fd5b505050506040513d60608110156130c157600080fd5b506040015195945050505050565b6000818361311e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612070578181015183820152602001612058565b50600083858161312a57fe5b0495945050505050565b6000828201838110156109e6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826001600160a01b0316846001600160a01b031614156131b157508061348c565b60408051630820681160e11b8152600481018490526001600160a01b0386811660248301528581166044830152825160009391891692631040d022926064808301939192829003018186803b15801561320957600080fd5b505afa15801561321d573d6000803e3d6000fd5b505050506040513d604081101561323357600080fd5b508051602090910151925090506001600160a01b038116613285576040805162461bcd60e51b81526020600482015260076024820152662727afa820a4a960c91b604482015290519081900360640190fd5b61329f6001600160a01b038616828563ffffffff6129dd16565b836001600160a01b0316856001600160a01b031610156133a357604080516000808252602082019283905263022c0d9f60e01b835260248201818152604483018690523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a9590939092909160c48501918083838b5b8381101561333757818101518382015260200161331f565b50505050905090810190601f1680156133645780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561338657600080fd5b505af115801561339a573d6000803e3d6000fd5b5050505061348a565b604080516000808252602082019283905263022c0d9f60e01b835260248201858152604483018290523060648401819052608060848501908152845160a486018190526001600160a01b0388169663022c0d9f968a969590939092909160c48501918083838a5b8381101561342257818101518382015260200161340a565b50505050905090810190601f16801561344f5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561347157600080fd5b505af1158015613485573d6000803e3d6000fd5b505050505b505b949350505050565b600060038211156134d7575080600160028204015b818110156134d1578091506002818285816134c057fe5b0401816134c957fe5b0490506134a9565b50611fb5565b8115611fb557506001919050565b600c5460408051636eb1769f60e11b81523060048201526001600160a01b0392831660248201529051839285169163dd62ed3e916044808301926020929190829003018186803b15801561353857600080fd5b505afa15801561354c573d6000803e3d6000fd5b505050506040513d602081101561356257600080fd5b50511061356e57613590565b600c54613590906001600160a01b03848116911660001963ffffffff61226d16565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106135d557805160ff1916838001178555613602565b82800160010185558215613602579182015b828111156136025782518255916020019190600101906135e7565b5061360e929150613612565b5090565b610f7091905b8082111561360e576000815560010161361856fe454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775661756c74546f6b656e3a20494e564c445f5245494e564553545f424f554e54595661756c74546f6b656e3a20494e53554646494349454e545f5245534552564553a265627a7a7231582014f6d6e5d60f86f85e08ace7190a65e855bc7bfe73e9afb79b4e5ca9caa7abcd64736f6c63430005100032

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

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

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