Contract 0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e430

 

Contract Overview

Balance:
0 FTM

FTM Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xb63e7d6b056f5f006d0b78383c44808d9a6f04d3cc67ac52d75f666792e76c1dReinvest451698642022-08-18 13:33:4524 secs ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003660276527
0x2c352c95be97f77697a597b25fa7d4cab7020c679cc72fea9287aa089ec5de5dReinvest451698422022-08-18 13:33:1752 secs ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.004207072259
0x467894fd5ee7e661867e02d848a2beb3b0a93e89a20016fc9aa2bb0e15bdc314Reinvest451698242022-08-18 13:32:491 min ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003983796469
0xecd4b6d3a916a6e46429885acdc752065a6c2d49803fe848e3d081e40ac0a4c1Reinvest451698012022-08-18 13:32:251 min ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003791521502
0x81975d106e014f5d6539a372357d721eafba19f8e6e969688473f39267dd52fbReinvest451697852022-08-18 13:31:592 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.005756958078
0xa0a8a5657fa7a257dea3253c03f79899778ca81aa55d280d1d1ae940aedbc673Reinvest451697822022-08-18 13:31:552 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.005924633
0x40d1a90090e77698985e12596851eb31af7acd98f6c0749c50a0a880d9f6dea0Reinvest451697542022-08-18 13:31:112 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003627499593
0x1a9c7e258a910713f456d9a45def15e54cecabe719cfb9439b34425565c96b46Reinvest451697322022-08-18 13:30:473 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003499866002
0x178b2727108f51754dd975b20ba88c82c6e86d7631493bcfe7375655cccb4ce3Reinvest451697152022-08-18 13:30:263 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.004167582104
0x9737b838e860daef86faa6b106b2f42827436a2f41364647dfde28904557322bReinvest451696912022-08-18 13:29:524 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.008526039497
0x9322a8540194e25b40c925d0558ce5c2e7058e7ad72c98bdfda5af82daf8cdf3Reinvest451696542022-08-18 13:28:355 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.00274059
0x2012f0409731287781a080a84ef835782f6313d9d9490903516b47f701264ad8Reinvest451696272022-08-18 13:27:586 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003413451855
0x697c584539e65f2bc314687dd090f9640e61472ca0a1d909cf5b33479271b7cdReinvest451696082022-08-18 13:27:356 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.00516135208
0xb0ad36ecc5773b0ef94e5b6d1ebf32acfa11d900b70f3af74d12422d08e11568Reinvest451696072022-08-18 13:27:336 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003817226
0x0a45a96f6c73cd62b2e298dbe71eae8d8bc0877033370f1c55d073c1ecb61e39Reinvest451695572022-08-18 13:26:207 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003419606021
0x31496e696d6da0717a9e9317c484a695790edd18dc84da504932354bdaf41bcfReinvest451695382022-08-18 13:25:588 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.00274059
0xd6fd58eed1f8efc05840d7d233860147e52acd3bd5fc2a8118edccf7e807fe22Reinvest451695172022-08-18 13:25:368 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003403269701
0x93cc66a2d091d4ed6f9c64e19dcbc7b5d4eb6c06041f3cc7cff6f0241786d1a4Reinvest451694982022-08-18 13:25:158 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003404902972
0xb1dd8c29ce4641acf9ac7ffb114a9b4972b685a3f95a40ea7ac8752bb7666d63Reinvest451694962022-08-18 13:25:138 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.002693015
0x6950c0afb4d68b543a3ab88bc28e9c62cedb61e8aedb7c90daf5ce6c4913a425Reinvest451694762022-08-18 13:24:519 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003403269701
0xb567a693a9ce32604658cf2274880fc9753ec166cda622540fb19a04fd9b0ef8Reinvest451694562022-08-18 13:24:299 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003347761219
0xcb95e314427a41681c8acaf1d8ba858ef118ed8f46f3c96936a85d76b7435c94Reinvest451694542022-08-18 13:24:279 mins ago0x8f2162cf2ee9c0ac7558017d7f21a50c87f9124a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.00274059
0x89cdb0b8640817520fbddeec0012d31c3a443b7c0389630b32240144437bab02Reinvest451694342022-08-18 13:24:0510 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003421247132
0x63daef5d8fbe9685124e0329d1236931101eb8981cb3455e4c79c3fad6522a96Reinvest451694162022-08-18 13:23:4410 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003404902972
0x889553e337e97cf53a7006a57d137255b686bd7973c812d040bdce1f9ad3f35aReinvest451693982022-08-18 13:23:2110 mins ago0x00000a0135bbcd95a1c594938f02033dedc47a4a IN  0xc6879cc07960d9862d3a3d942ab8c5ee4fc9e4300 FTM0.003421247132
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x4da5a053cf20c5b2775ce29adef377f81dc4e23d5c43a882f815af498a3de485404358292022-06-13 15:42:5865 days 21 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.