Contract 0x2f71345a63f9c32d51b169b32142b18ff8b36558

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x0a48daf8f15d6bad476f3cf60d1590308aa7b81cb587d5e82e51856c0376c364Create Vault Tok...255265202021-12-20 15:49:47199 days 1 hr agoTarot: Deployer IN  0x2f71345a63f9c32d51b169b32142b18ff8b365580 FTM0.365511374502
0x6717dfb82a0dfe692f9303d56447d5f30f6328bf9927ce3d0bd5156f53cd43efCreate Vault Tok...255264932021-12-20 15:49:26199 days 1 hr agoTarot: Deployer IN  0x2f71345a63f9c32d51b169b32142b18ff8b365580 FTM0.364974574011
0x853baae024c282c3d859151894e542247a673eea3bfdb21dffac986e371521070x60806040255263372021-12-20 15:47:09199 days 1 hr agoTarot: Deployer IN  Contract Creation0 FTM0.362674328256
[ Download CSV Export 
Latest 3 internal transactions
Parent Txn Hash Block From To Value
0x0a48daf8f15d6bad476f3cf60d1590308aa7b81cb587d5e82e51856c0376c364255265202021-12-20 15:49:47199 days 1 hr ago 0x2f71345a63f9c32d51b169b32142b18ff8b36558  Contract Creation0 FTM
0x6717dfb82a0dfe692f9303d56447d5f30f6328bf9927ce3d0bd5156f53cd43ef255264932021-12-20 15:49:26199 days 1 hr ago 0x2f71345a63f9c32d51b169b32142b18ff8b36558  Contract Creation0 FTM
0x853baae024c282c3d859151894e542247a673eea3bfdb21dffac986e37152107255263372021-12-20 15:47:09199 days 1 hr ago Tarot: Deployer  Contract Creation0 FTM
[ Download CSV Export 
Loading

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

Contract Name:
VaultTokenFactory

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

import "./VaultToken.sol";
import "./interfaces/IMasterChef.sol";
import "./interfaces/IVaultTokenFactory.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IUniswapV2Router01.sol";

contract VaultTokenFactory is IVaultTokenFactory {
    address public router;
    address public masterChef;
    address public rewardsToken;
    uint256 public swapFeeFactor;

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

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

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

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

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

File 2 of 14 : VaultToken.sol
pragma solidity =0.5.16;

import "./PoolToken.sol";
import "./interfaces/IMasterChef.sol";
import "./interfaces/IVaultToken.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IUniswapV2Router01.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./libraries/SafeToken.sol";
import "./libraries/Math.sol";

contract VaultToken is IVaultToken, IUniswapV2Pair, PoolToken {
    using SafeToken for address;

    bool public constant isVaultToken = true;

    IUniswapV2Router01 public router;
    IMasterChef public masterChef;
    address public rewardsToken;
    address public WETH;
    address public token0;
    address public token1;
    uint256 public swapFeeFactor;
    uint256 public pid;
    uint256 public constant REINVEST_BOUNTY = 0.01e18;

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

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

    /*** 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 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 {
            swapExactTokensForTokens(rewardsToken, WETH, reward.sub(bounty));
            if (token0 == WETH || token1 == WETH) {
                (tokenA, tokenB) = token0 == WETH
                    ? (token0, token1)
                    : (token1, token0);
            } else {
                swapExactTokensForTokens(WETH, token0, WETH.myBalance());
                (tokenA, tokenB) = (token0, token1);
            }
        }
        // 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);
    }

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

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

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

    function router() external view returns (address);

    function masterChef() external view returns (address);

    function rewardsToken() external view returns (address);

    function swapFeeFactor() external view returns (uint256);

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

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

    function allVaultTokensLength() external view returns (uint256);

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

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

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

interface IVaultToken {
    /*** 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(
        IUniswapV2Router01 _router,
        IMasterChef _masterChef,
        address _rewardsToken,
        uint256 _swapFeeFactor,
        uint256 _pid
    ) external;

    function reinvest() external;
}

File 9 of 14 : 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 10 of 14 : 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 11 of 14 : 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 12 of 14 : 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 13 of 14 : 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 14 of 14 : 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",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_masterChef","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"uint256","name":"_swapFeeFactor","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"vaultToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"vaultTokenIndex","type":"uint256"}],"name":"VaultTokenCreated","type":"event"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allVaultTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allVaultTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"createVaultToken","outputs":[{"internalType":"address","name":"vaultToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getVaultToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"masterChef","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"swapFeeFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161333e38038061333e8339818101604052608081101561003357600080fd5b5080516020820151604083015160609093015191929091610384811080159061005e57506103e88111155b6100995760405162461bcd60e51b81526004018080602001828103825260258152602001806133196025913960400191505060405180910390fd5b600080546001600160a01b039586166001600160a01b03199182161790915560018054948616948216949094179093556002805492909416919092161790915560035561322e806100eb6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a9a1e1381161005b578063a9a1e138146100f0578063b3ac2cbf1461010d578063d1af0c7d1461012a578063f887ea401461013257610088565b806308ee8d6a1461008d57806329e15d0b146100c6578063575a86b2146100e057806368f91a44146100e8575b600080fd5b6100aa600480360360208110156100a357600080fd5b503561013a565b604080516001600160a01b039092168252519081900360200190f35b6100ce610155565b60408051918252519081900360200190f35b6100aa61015b565b6100ce61016a565b6100aa6004803603602081101561010657600080fd5b5035610170565b6100aa6004803603602081101561012357600080fd5b5035610197565b6100aa610369565b6100aa610378565b6004602052600090815260409020546001600160a01b031681565b60055490565b6001546001600160a01b031681565b60035481565b6005818154811061017d57fe5b6000918252602090912001546001600160a01b0316905081565b6000818152600460205260408120546001600160a01b031615610201576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e466163746f72793a205049445f455849535453000000604482015290519081900360640190fd5b60606040518060200161021390610387565b6020820181038252601f19601f820116604052509050828151602083016000f56000805460015460025460035460408051630acd36cd60e21b81526001600160a01b039586166004820152938516602485015291841660448401526064830152608482018890525193955090851692632b34db349260a48084019391929182900301818387803b1580156102a657600080fd5b505af11580156102ba573d6000803e3d6000fd5b505050600084815260046020908152604080832080546001600160a01b0388166001600160a01b0319918216811790925560058054600181018255958190527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0909501805490911682179055925481519384529183019190915280518693507f42c2f0d6763288ab9d586235f818373d880de5f012d7a67d672822104747a1349281900390910190a250919050565b6002546001600160a01b031681565b6000546001600160a01b031681565b612e65806103958339019056fe60806040526002805460ff19908116601217909155600b80549091166001179055612e368061002f6000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c80636f307dc311610130578063bc25cf77116100b8578063dd62ed3e1161007c578063dd62ed3e146105cd578063f1068454146105fb578063f887ea4014610603578063fdb5a03e1461060b578063fff6cae91461061357610232565b8063bc25cf771461053e578063c45a015514610564578063d1af0c7d1461056c578063d21220a714610574578063d505accf1461057c57610232565b806395d89b41116100ff57806395d89b41146104f2578063a9059cbb146104fa578063ad5c464814610526578063ad7a672f1461052e578063ba9a7a561461053657610232565b80636f307dc31461047857806370a08231146104805780637ecebe00146104a657806395a2251f146104cc57610232565b80633644e515116101be5780635a3d5493116101825780635a3d54931461043257806368f91a441461043a5780636a627842146104425780636c2a3bc5146104685780636ee272271461047057610232565b80633644e5151461040a5780633ba0b9a9146104125780634a5d316c1461041a578063575a86b2146104225780635909c0d51461042a57610232565b806318160ddd1161020557806318160ddd1461035057806323b872dd1461036a5780632b34db34146103a057806330adf81f146103e4578063313ce567146103ec57610232565b806306fdde03146102375780630902f1ac146102b4578063095ea7b3146102ec5780630dfe16811461032c575b600080fd5b61023f61061b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102bc6106a9565b604080516001600160701b03948516815292909316602083015263ffffffff168183015290519081900360600190f35b6103186004803603604081101561030257600080fd5b506001600160a01b038135169060200135610879565b604080519115158252519081900360200190f35b610334610890565b604080516001600160a01b039092168252519081900360200190f35b61035861089f565b60408051918252519081900360200190f35b6103186004803603606081101561038057600080fd5b506001600160a01b038135811691602081013590911690604001356108a5565b6103e2600480360360a08110156103b657600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135610974565b005b610358610d07565b6103f4610d2b565b6040805160ff9092168252519081900360200190f35b610358610d34565b610358610d3a565b6103e2610d8a565b610334610dfc565b610358610e0b565b610358610e81565b610358610ec6565b6103586004803603602081101561045857600080fd5b50356001600160a01b0316610ecc565b6103586111d7565b6103186111e2565b6103346111e7565b6103586004803603602081101561049657600080fd5b50356001600160a01b03166111f6565b610358600480360360208110156104bc57600080fd5b50356001600160a01b0316611208565b610358600480360360208110156104e257600080fd5b50356001600160a01b031661121a565b61023f611427565b6103186004803603604081101561051057600080fd5b506001600160a01b038135169060200135611481565b61033461148e565b61035861149d565b6103586114a3565b6103e26004803603602081101561055457600080fd5b50356001600160a01b03166114a9565b6103346115a3565b6103346115b2565b6103346115c1565b6103e2600480360360e081101561059257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356115d0565b610358600480360360408110156105e357600080fd5b506001600160a01b0381358116916020013516611614565b610358611631565b610334611637565b6103e261164b565b6103e2611ac8565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106a15780601f10610676576101008083540402835291602001916106a1565b820191906000526020600020905b81548152906001019060200180831161068457829003601f168201915b505050505081565b6000806000600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156106fc57600080fd5b505afa158015610710573d6000803e3d6000fd5b505050506040513d606081101561072657600080fd5b508051602082015160409092015160035491955091935090915061074957610874565b600a54600854604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561079157600080fd5b505afa1580156107a5573d6000803e3d6000fd5b505050506040513d60208110156107bb57600080fd5b505190506107f06107eb826107df856001600160701b038a1663ffffffff611b2416565b9063ffffffff611b8416565b611bc6565b94506108126107eb826107df856001600160701b03891663ffffffff611b2416565b93506064856001600160701b031611801561083657506064846001600160701b0316115b6108715760405162461bcd60e51b8152600401808060200182810382526021815260200180612de16021913960400191505060405180910390fd5b50505b909192565b6000610886338484611c1e565b5060015b92915050565b600f546001600160a01b031681565b60035481565b6001600160a01b03831660009081526005602090815260408083203384529091528120546000191461095f57604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b038716600090815260058252838120338252909152919091205461093a91849063ffffffff611c8016565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b61096a848484611d17565b5060019392505050565b6009546001600160a01b0316156109d2576040805162461bcd60e51b815260206004820152601f60248201527f5661756c74546f6b656e3a20464143544f52595f414c52454144595f53455400604482015290519081900360640190fd5b600980546001600160a01b0319163317905560408051808201825260118152702a30b937ba102b30bab63a102a37b5b2b760791b602080830191909152825180840190935260068352651d95105493d560d21b90830152610a3291611e09565b846001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6b57600080fd5b505afa158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b5051600e80546001600160a01b03199081166001600160a01b0393841617909155600b8054610100600160a81b03191661010089851602179055600c805490911686831617908190556011849055601283905560408051631526fe2760e01b81526004810185905290516000939290921691631526fe2791602480820192608092909190829003018186803b158015610b2d57600080fd5b505afa158015610b41573d6000803e3d6000fd5b505050506040513d6080811015610b5757600080fd5b5051600880546001600160a01b0319166001600160a01b03808416919091179182905560408051630dfe168160e01b81529051939450911691630dfe168191600480820192602092909190829003018186803b158015610bb657600080fd5b505afa158015610bca573d6000803e3d6000fd5b505050506040513d6020811015610be057600080fd5b5051600f80546001600160a01b0319166001600160a01b039283161790556008546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015610c3b57600080fd5b505afa158015610c4f573d6000803e3d6000fd5b505050506040513d6020811015610c6557600080fd5b5051601080546001600160a01b03199081166001600160a01b0393841617909155600d80549091168683161790819055600b54610caf929182169161010090910416600019611ed1565b600b54600e54610cda916001600160a01b03918216916101009091041660001963ffffffff611ed116565b600c54600854610cff916001600160a01b03918216911660001963ffffffff611ed116565b505050505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b60065481565b600354600a5460009190811580610d4f575080155b15610d6657670de0b6b3a764000092505050610d87565b610d82826107df83670de0b6b3a764000063ffffffff611b2416565b925050505b90565b6009546001600160a01b031615610de8576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600c546001600160a01b031681565b60085460408051635909c0d560e01b815290516000926001600160a01b031691635909c0d5916004808301926020929190829003018186803b158015610e5057600080fd5b505afa158015610e64573d6000803e3d6000fd5b505050506040513d6020811015610e7a57600080fd5b5051905090565b60085460408051635a3d549360e01b815290516000926001600160a01b031691635a3d5493916004808301926020929190829003018186803b158015610e5057600080fd5b60115481565b600b5460009060ff16610f19576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854600090610f3b906001600160a01b031661202a565b600c54601254604080516393f1a40b60e01b8152600481019290925230602483015280519394506000936001600160a01b03909316926393f1a40b926044808201939291829003018186803b158015610f9357600080fd5b505afa158015610fa7573d6000803e3d6000fd5b505050506040513d6040811015610fbd57600080fd5b5051600c5460125460408051631c57762b60e31b8152600481019290925260248201869052519293506001600160a01b039091169163e2bbb1589160448082019260009290919082900301818387803b15801561101957600080fd5b505af115801561102d573d6000803e3d6000fd5b5050600c54601254604080516393f1a40b60e01b815260048101929092523060248301528051600095506001600160a01b0390931693506393f1a40b92604480840193829003018186803b15801561108457600080fd5b505afa158015611098573d6000803e3d6000fd5b505050506040513d60408110156110ae57600080fd5b505190506110e56110bd610d3a565b6107df670de0b6b3a76400006110d9858763ffffffff6120a616565b9063ffffffff611b2416565b93506003546000141561111357611104846103e863ffffffff6120a616565b935061111360006103e86120e8565b60008411611168576040805162461bcd60e51b815260206004820152601c60248201527f5661756c74546f6b656e3a204d494e545f414d4f554e545f5a45524f00000000604482015290519081900360640190fd5b61117285856120e8565b604080518481526020810186905281516001600160a01b0388169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a35050506111c561217f565b600b805460ff19166001179055919050565b662386f26fc1000081565b600181565b6008546001600160a01b031681565b60046020526000908152604090205481565b60076020526000908152604090205481565b600b5460009060ff16611267576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055306000908152600460205260409020546112a5670de0b6b3a76400006107df611298610d3a565b849063ffffffff611b2416565b9150600082116112fc576040805162461bcd60e51b815260206004820152601e60248201527f5661756c74546f6b656e3a2052454445454d5f414d4f554e545f5a45524f0000604482015290519081900360640190fd5b600a54821115611353576040805162461bcd60e51b815260206004820152601d60248201527f5661756c74546f6b656e3a20494e53554646494349454e545f43415348000000604482015290519081900360640190fd5b61135d308261223d565b600c5460125460408051630441a3e760e41b8152600481019290925260248201859052516001600160a01b039092169163441a3e709160448082019260009290919082900301818387803b1580156113b457600080fd5b505af11580156113c8573d6000803e3d6000fd5b505050506113d683836122da565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a3506111c561217f565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106a15780601f10610676576101008083540402835291602001916106a1565b6000610886338484611d17565b600e546001600160a01b031681565b600a5481565b6103e881565b600b5460ff166114f3576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b8152306004820152905161159393859361158e9391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561155657600080fd5b505afa15801561156a573d6000803e3d6000fd5b505050506040513d602081101561158057600080fd5b50519063ffffffff6120a616565b6122da565b50600b805460ff19166001179055565b6009546001600160a01b031681565b600d546001600160a01b031681565b6010546001600160a01b031681565b611600878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c961246c565b61160b878787611c1e565b50505050505050565b600560209081526000928352604080842090915290825290205481565b60125481565b600b5461010090046001600160a01b031681565b600b5460ff16611695576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690553332146116ab57600080fd5b600c5460125460408051630441a3e760e41b8152600481019290925260006024830181905290516001600160a01b039093169263441a3e7092604480820193929182900301818387803b15801561170157600080fd5b505af1158015611715573d6000803e3d6000fd5b5050600d546000925061173191506001600160a01b031661202a565b90508061173e5750611ab1565b6000670de0b6b3a764000061176083662386f26fc1000063ffffffff611b2416565b8161176757fe5b600d549190049150611789906001600160a01b0316338363ffffffff61264116565b600d54600f5460009182916001600160a01b03908116911614806117bd5750600d546010546001600160a01b039081169116145b1561181057600d54600f546001600160a01b039081169116146117f257601054600f546001600160a01b039182169116611806565b600f546010546001600160a01b0391821691165b90925090506118d6565b600d54600e5461183c916001600160a01b039081169116611837878763ffffffff6120a616565b612794565b600e54600f546001600160a01b039081169116148061186b5750600e546010546001600160a01b039081169116145b156118a057600e54600f546001600160a01b039081169116146117f257601054600f546001600160a01b039182169116611806565b600e54600f546118c0916001600160a01b0390811691166118378261202a565b5050600f546010546001600160a01b0391821691165b60006118ea836001600160a01b031661202a565b9050600081116118f657fe5b600080600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561194757600080fd5b505afa15801561195b573d6000803e3d6000fd5b505050506040513d606081101561197157600080fd5b508051602090910151600f546001600160701b039283169450911691506000906001600160a01b038781169116146119a957816119ab565b825b905060006119bc858360115461299d565b90506119c9878783612794565b60006119f788886119e0898663ffffffff6120a616565b6119f28b6001600160a01b031661202a565b612a38565b600c5460125460408051631c57762b60e31b8152600481019290925260248201849052519293506001600160a01b039091169163e2bbb1589160448082019260009290919082900301818387803b158015611a5157600080fd5b505af1158015611a65573d6000803e3d6000fd5b5050604080518d8152602081018d905281513394507fc003f45bc224d116b6d079100d4ab57a5b9633244c47a5a92a176c5b79a85f2893509081900390910190a2505050505050505050505b611ab961217f565b600b805460ff19166001179055565b600b5460ff16611b12576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055611ab961217f565b600082611b335750600061088a565b82820282848281611b4057fe5b0414611b7d5760405162461bcd60e51b8152600401808060200182810382526021815260200180612dc06021913960400191505060405180910390fd5b9392505050565b6000611b7d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b0c565b6000600160701b8210611c16576040805162461bcd60e51b81526020600482015260136024820152722b30bab63a2a37b5b2b71d1029a0a32298989960691b604482015290519081900360640190fd5b50805b919050565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60008184841115611d0f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cd4578181015183820152602001611cbc565b50505050905090810190601f168015611d015780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b038616600090815260049091529190912054611d7891839063ffffffff611c8016565b6001600160a01b038085166000908152600460205260408082209390935590841681522054611dad908263ffffffff612b7116565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b8151611e1c906000906020850190612cd5565b508051611e30906001906020840190612cd5565b506040514690806052612d6e8239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b60208310611f4e5780518252601f199092019160209182019101611f2f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611fb0576040519150601f19603f3d011682016040523d82523d6000602084013e611fb5565b606091505b5091509150818015611fe3575080511580611fe35750808060200190516020811015611fe057600080fd5b50515b612023576040805162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b604482015290519081900360640190fd5b5050505050565b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561207457600080fd5b505afa158015612088573d6000803e3d6000fd5b505050506040513d602081101561209e57600080fd5b505192915050565b6000611b7d83836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611c80565b6003546120fb908263ffffffff612b7116565b6003556001600160a01b038216600090815260046020526040902054612127908263ffffffff612b7116565b6001600160a01b03831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600c54601254604080516393f1a40b60e01b8152600481019290925230602483015280516000936001600160a01b0316926393f1a40b926044808301939192829003018186803b1580156121d257600080fd5b505afa1580156121e6573d6000803e3d6000fd5b505050506040513d60408110156121fc57600080fd5b5051600a8190556040805182815290519192507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4919081900360200190a150565b6001600160a01b038216600090815260046020526040902054612266908263ffffffff6120a616565b6001600160a01b038316600090815260046020526040902055600354612292908263ffffffff6120a616565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b602083106123875780518252601f199092019160209182019101612368565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146123e9576040519150601f19603f3d011682016040523d82523d6000602084013e6123ee565b606091505b509150915081801561241c57508051158061241c575080806020019051602081101561241957600080fd5b50515b612466576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b50505050565b428510156124b2576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa1580156125ae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906125e45750896001600160a01b0316816001600160a01b0316145b612635576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106126be5780518252601f19909201916020918201910161269f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612720576040519150601f19603f3d011682016040523d82523d6000602084013e612725565b606091505b5091509150818015612753575080511580612753575080806020019051602081101561275057600080fd5b50515b612023576040805162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b604482015290519081900360640190fd5b604080516002808252606080830184529260208301908038833901905050905083816000815181106127c257fe5b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106127f057fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061281a8483612bcb565b600b546040516338ed173960e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516101009097046001600160a01b0316966338ed1739968a968a9594939092909160c40190602087810191028083838b5b838110156128a457818101518382015260200161288c565b505050509050019650505050505050600060405180830381600087803b1580156128cd57600080fd5b505af11580156128e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561290a57600080fd5b810190808051604051939291908464010000000082111561292a57600080fd5b90830190602082018581111561293f57600080fd5b825186602082028301116401000000008211171561295c57600080fd5b82525081516020918201928201910280838360005b83811015612989578181015183820152602001612971565b505050509050016040525050505050505050565b6000806129b6846110d96103e88663ffffffff612b7116565b905060006129d5846110d960048189818c6103e863ffffffff611b2416565b90506000612a016129fc836129f0868063ffffffff611b2416565b9063ffffffff612b7116565b612c84565b90506000612a1660028763ffffffff611b2416565b9050612a2c816107df848763ffffffff6120a616565b98975050505050505050565b6000612a448584612bcb565b612a4e8483612bcb565b600b546040805162e8e33760e81b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260006084830181905260a483018190523060c48401524260e48401529251610100909404169263e8e337009261010480840193606093929083900390910190829087803b158015612ad457600080fd5b505af1158015612ae8573d6000803e3d6000fd5b505050506040513d6060811015612afe57600080fd5b506040015195945050505050565b60008183612b5b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611cd4578181015183820152602001611cbc565b506000838581612b6757fe5b0495945050505050565b600082820183811015611b7d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600b5460408051636eb1769f60e11b81523060048201526001600160a01b03610100909304831660248201529051839285169163dd62ed3e916044808301926020929190829003018186803b158015612c2357600080fd5b505afa158015612c37573d6000803e3d6000fd5b505050506040513d6020811015612c4d57600080fd5b505110612c5957612c80565b600b54612c80906001600160a01b038481169161010090041660001963ffffffff611ed116565b5050565b60006003821115612cc7575080600160028204015b81811015612cc157809150600281828581612cb057fe5b040181612cb957fe5b049050612c99565b50611c19565b8115611c1957506001919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612d1657805160ff1916838001178555612d43565b82800160010185558215612d43579182015b82811115612d43578251825591602001919060010190612d28565b50612d4f929150612d53565b5090565b610d8791905b80821115612d4f5760008155600101612d5956fe454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775661756c74546f6b656e3a20494e53554646494349454e545f5245534552564553a265627a7a7231582025686d904f21c6b5465190bf9b63d63afdae9a6a6b166c489b5a99f2d64c97f664736f6c63430005100032a265627a7a72315820a265f9c96b169d4d3affb75e35be948bfab9ef532aeb1659f9672af7ba01f1bf64736f6c634300051000325661756c74546f6b656e466163746f72793a20494e56414c49445f4645455f464143544f5200000000000000000000000016327e3fbdaca3bcf7e38f5af2599d2ddc33ae520000000000000000000000009083ea3756bde6ee6f27a6e996806fbd37f6f0930000000000000000000000005cc61a78f164885776aa610fb0fe1257df78e59b00000000000000000000000000000000000000000000000000000000000003e5

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.