ETH Price: $3,308.39 (+1.12%)
Gas: 3 Gwei

Contract

0x5b2013B35C15e9e98bC70858BE9A453b4e45A33e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040146634422022-04-27 1:03:07824 days ago1651021387IN
 Create: MAXRStaking
0 ETH0.0903069445

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MAXRStaking

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : MAXRStaking.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.6;

import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import './interface/IUniswapV2Pair.sol';
import './interface/IUniswapV2Factory.sol';
import './interface/IUniswapV2Router.sol';

contract MAXRStaking is OwnableUpgradeable {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  struct UserInfo {
    uint256 amount;
    uint256 collateralAmount;
    uint256 rewardDebt;
    uint256 pendingRewards;
    uint256 lastAction;
  }

  struct PoolInfo {
    IERC20 stakeToken;
    IERC20 rewardToken;
    uint256 conversionRate;
    uint256 fee;
    uint256 rewardPerBlock;
    uint256 lockupDuration;
    uint256 lastRewardBlock;
    uint256 accTokenPerShare;
    uint256 depositedAmount;
    uint256 depositedCollateralAmount;
  }

  IERC20 public maxrToken;
  PoolInfo[] public poolInfo;
  mapping(uint256 => mapping(address => UserInfo)) public userInfo;

  IUniswapV2Router02 public uniswapV2Router;
  uint256 private constant CONST_MULTIPLIER = 1e20;

  address public teamAddress;
  address public devAddress;
  uint256 public devFee;

  mapping(uint256 => bool) public keepPoolToken;

  event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
  event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
  event EmergencyWithdraw(
    address indexed user,
    uint256 indexed pid,
    uint256 amount
  );
  event Claim(address indexed user, uint256 indexed pid, uint256 amount);

  function initialize(address _maxrToken, address _routerAddr)
    public
    initializer
  {
    uniswapV2Router = IUniswapV2Router02(_routerAddr);
    maxrToken = IERC20(_maxrToken);
    teamAddress = address(0x2D84589F1aF76B75a86858866ad959d4A9a2B8A6);
    devAddress = address(0xEBdC249284a90B5A30e7b1c5DE2466aa79408F18);
    devFee = 20;

    __Ownable_init();
  }

  //to recieve ETH from uniswapV2Router when swaping
  receive() external payable {}

  function setMaxrToken(address _addr) external onlyOwner {
    require(_addr != address(0), 'Address cannot be zero');
    maxrToken = IERC20(_addr);
  }

  function setTeamAddress(address _addr) external onlyOwner {
    require(_addr != address(0), 'Address cannot be zero');
    teamAddress = _addr;
  }

  function setDevAddress(address _addr) external onlyOwner {
    require(_addr != address(0), 'Address cannot be zero');
    devAddress = _addr;
  }

  function setDevFee(uint256 _fee) external onlyOwner {
    devFee = _fee;
  }

  function addPool(
    IERC20 _stakeToken,
    IERC20 _rewardToken,
    uint256 _conversionRate,
    uint256 _fee,
    uint256 _rewardPerBlock,
    uint256 _lockupDuration,
    bool _keepPookToken
  ) external onlyOwner {
    uint256 pid = poolInfo.length;
    poolInfo.push(
      PoolInfo({
        stakeToken: _stakeToken,
        rewardToken: _rewardToken,
        conversionRate: _conversionRate,
        fee: _fee,
        rewardPerBlock: _rewardPerBlock,
        lockupDuration: _lockupDuration,
        lastRewardBlock: block.number,
        accTokenPerShare: 0,
        depositedAmount: 0,
        depositedCollateralAmount: 0
      })
    );
    keepPoolToken[pid] = _keepPookToken;
  }

  function updatePool(
    uint256 pid,
    IERC20 _rewardToken,
    uint256 _conversionRate,
    uint256 _fee,
    uint256 _lockupDuration,
    bool _keepPookToken
  ) external onlyOwner {
    require(pid < poolInfo.length, 'Invalid pool id');

    PoolInfo storage pool = poolInfo[pid];
    pool.rewardToken = _rewardToken;
    pool.conversionRate = _conversionRate;
    pool.fee = _fee;
    pool.lockupDuration = _lockupDuration;

    keepPoolToken[pid] = _keepPookToken;
  }

  function pendingRewards(uint256 pid, address _user)
    external
    view
    returns (uint256)
  {
    PoolInfo storage pool = poolInfo[pid];
    UserInfo storage user = userInfo[pid][_user];
    uint256 accTokenPerShare = pool.accTokenPerShare;
    uint256 depositedAmount = pool.depositedAmount;
    if (block.number > pool.lastRewardBlock && depositedAmount != 0) {
      uint256 multiplier = block.number.sub(pool.lastRewardBlock);
      uint256 tokenReward = multiplier.mul(pool.rewardPerBlock);
      accTokenPerShare = accTokenPerShare.add(
        tokenReward.mul(CONST_MULTIPLIER).div(depositedAmount)
      );
    }
    return
      user
        .amount
        .mul(accTokenPerShare)
        .div(CONST_MULTIPLIER)
        .sub(user.rewardDebt)
        .add(user.pendingRewards);
  }

  function _updatePool(uint256 pid) internal {
    require(pid < poolInfo.length, 'Invalid pool id');

    PoolInfo storage pool = poolInfo[pid];
    uint256 depositedAmount = pool.depositedAmount;
    if (pool.depositedAmount == 0) {
      pool.lastRewardBlock = block.number;
      return;
    }

    uint256 multiplier = block.number.sub(pool.lastRewardBlock);
    uint256 tokenReward = multiplier.mul(pool.rewardPerBlock);
    pool.accTokenPerShare = pool.accTokenPerShare.add(
      tokenReward.mul(CONST_MULTIPLIER).div(depositedAmount)
    );
    pool.lastRewardBlock = block.number;
  }

  function deposit(uint256 pid, uint256 amount) external {
    PoolInfo storage pool = poolInfo[pid];
    UserInfo storage user = userInfo[pid][msg.sender];

    _updatePool(pid);

    if (user.amount > 0) {
      uint256 pending = user
        .amount
        .mul(pool.accTokenPerShare)
        .div(CONST_MULTIPLIER)
        .sub(user.rewardDebt);

      if (pending > 0) {
        user.pendingRewards = user.pendingRewards.add(pending);
      }
    }

    if (amount > 0) {
      pool.stakeToken.safeTransferFrom(
        address(msg.sender),
        address(this),
        amount
      );

      uint256 collateralAmount = amount.mul(pool.conversionRate).div(
        CONST_MULTIPLIER
      );

      if (collateralAmount > 0) {
        maxrToken.safeTransferFrom(
          address(msg.sender),
          address(this),
          collateralAmount
        );

        uint256 feeAmount = collateralAmount.mul(pool.fee).div(100);
        collateralAmount = collateralAmount.sub(feeAmount);
        swapAndDistribute(maxrToken, feeAmount);
      } else {
        uint256 feeAmount = amount.mul(pool.fee).div(100);
        amount = amount.sub(feeAmount);
        swapAndDistribute(pool.stakeToken, feeAmount);
      }

      user.amount = user.amount.add(amount);
      user.collateralAmount = user.collateralAmount.add(collateralAmount);
      pool.depositedAmount = pool.depositedAmount.add(amount);
      pool.depositedCollateralAmount = pool.depositedCollateralAmount.add(
        collateralAmount
      );
    }

    user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(
      CONST_MULTIPLIER
    );

    user.lastAction = block.timestamp;

    emit Deposit(msg.sender, pid, amount);
  }

  function withdraw(uint256 pid) external {
    PoolInfo storage pool = poolInfo[pid];
    UserInfo storage user = userInfo[pid][msg.sender];

    require(
      user.lastAction.add(pool.lockupDuration) <= block.timestamp,
      'You cannot withdraw yet!'
    );

    _updatePool(pid);

    uint256 pending = user
      .amount
      .mul(pool.accTokenPerShare)
      .div(CONST_MULTIPLIER)
      .sub(user.rewardDebt);

    if (pending > 0) {
      user.pendingRewards = user.pendingRewards.add(pending);
    }

    if (user.amount > 0) {
      if (!keepPoolToken[pid]) {
        pool.stakeToken.safeTransfer(address(msg.sender), user.amount);
      }
      pool.depositedAmount = pool.depositedAmount.sub(user.amount);
    }

    if (user.collateralAmount > 0) {
      maxrToken.safeTransfer(address(msg.sender), user.collateralAmount);
      pool.depositedCollateralAmount = pool.depositedCollateralAmount.sub(
        user.collateralAmount
      );
    }

    user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(
      CONST_MULTIPLIER
    );

    emit Withdraw(msg.sender, pid, user.amount);

    user.rewardDebt = 0;
    user.amount = 0;
    user.collateralAmount = 0;
    user.lastAction = block.timestamp;
  }

  function claim(uint256 pid) external {
    PoolInfo storage pool = poolInfo[pid];
    UserInfo storage user = userInfo[pid][msg.sender];

    _updatePool(pid);

    uint256 pending = user
      .amount
      .mul(pool.accTokenPerShare)
      .div(CONST_MULTIPLIER)
      .sub(user.rewardDebt);

    if (pending > 0 || user.pendingRewards > 0) {
      user.pendingRewards = user.pendingRewards.add(pending);
      uint256 claimedAmount = safeRewardTransfer(
        pool.rewardToken,
        msg.sender,
        user.pendingRewards
      );
      user.pendingRewards = user.pendingRewards.sub(claimedAmount);
      emit Claim(msg.sender, pid, claimedAmount);
    }

    user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(
      CONST_MULTIPLIER
    );
  }

  function swapAndDistribute(IERC20 token, uint256 tokenAmount) private {
    if (tokenAmount == 0) {
      return;
    }

    swapTokensForEth(token, tokenAmount);

    uint256 devAmount = address(this).balance.mul(devFee).div(100);
    uint256 teamAmount = address(this).balance.sub(devAmount);

    payable(teamAddress).call{value: teamAmount}('');
    payable(devAddress).call{value: devAmount}('');
  }

  function swapTokensForEth(IERC20 token, uint256 tokenAmount) private {
    // generate the uniswap pair path of token -> weth
    address[] memory path = new address[](2);
    path[0] = address(token);
    path[1] = uniswapV2Router.WETH();

    token.approve(address(uniswapV2Router), tokenAmount);

    // make the swap
    uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
      tokenAmount,
      0, // accept any amount of ETH
      path,
      address(this),
      block.timestamp
    );
  }

  function safeRewardTransfer(
    IERC20 token,
    address to,
    uint256 amount
  ) internal returns (uint256) {
    uint256 _rewardBalance = token.balanceOf(address(this));
    if (amount > _rewardBalance) amount = _rewardBalance;
    token.safeTransfer(to, amount);
    return amount;
  }

  function getPoolCount() external view returns (uint256) {
    return poolInfo.length;
  }
}

File 2 of 12 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * 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.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the 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 virtual 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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}

File 3 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @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 subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 5 of 12 : IUniswapV2Pair.sol
interface IUniswapV2Pair {
  event Approval(address indexed owner, address indexed spender, uint256 value);
  event Transfer(address indexed from, address indexed to, 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;

  event Mint(address indexed sender, uint256 amount0, uint256 amount1);
  event Burn(
    address indexed sender,
    uint256 amount0,
    uint256 amount1,
    address indexed to
  );
  event Swap(
    address indexed sender,
    uint256 amount0In,
    uint256 amount1In,
    uint256 amount0Out,
    uint256 amount1Out,
    address indexed to
  );
  event Sync(uint112 reserve0, uint112 reserve1);

  function MINIMUM_LIQUIDITY() external pure returns (uint256);

  function factory() external view returns (address);

  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);

  function kLast() external view returns (uint256);

  function mint(address to) external returns (uint256 liquidity);

  function burn(address to) external returns (uint256 amount0, uint256 amount1);

  function swap(
    uint256 amount0Out,
    uint256 amount1Out,
    address to,
    bytes calldata data
  ) external;

  function skim(address to) external;

  function sync() external;

  function initialize(address, address) external;
}

File 6 of 12 : IUniswapV2Factory.sol
interface IUniswapV2Factory {
  event PairCreated(
    address indexed token0,
    address indexed token1,
    address pair,
    uint256
  );

  function feeTo() external view returns (address);

  function feeToSetter() external view returns (address);

  function getPair(address tokenA, address tokenB)
    external
    view
    returns (address pair);

  function allPairs(uint256) external view returns (address pair);

  function allPairsLength() external view returns (uint256);

  function createPair(address tokenA, address tokenB)
    external
    returns (address pair);

  function setFeeTo(address) external;

  function setFeeToSetter(address) external;
}

File 7 of 12 : IUniswapV2Router.sol
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);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
  function removeLiquidityETHSupportingFeeOnTransferTokens(
    address token,
    uint256 liquidity,
    uint256 amountTokenMin,
    uint256 amountETHMin,
    address to,
    uint256 deadline
  ) external returns (uint256 amountETH);

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

  function swapExactTokensForTokensSupportingFeeOnTransferTokens(
    uint256 amountIn,
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external;

  function swapExactETHForTokensSupportingFeeOnTransferTokens(
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external payable;

  function swapExactTokensForETHSupportingFeeOnTransferTokens(
    uint256 amountIn,
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external;
}

File 8 of 12 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @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.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

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

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

File 9 of 12 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 10 of 12 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 12 of 12 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"contract IERC20","name":"_stakeToken","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_conversionRate","type":"uint256"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_lockupDuration","type":"uint256"},{"internalType":"bool","name":"_keepPookToken","type":"bool"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_maxrToken","type":"address"},{"internalType":"address","name":"_routerAddr","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"keepPoolToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxrToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"internalType":"contract IERC20","name":"rewardToken","type":"address"},{"internalType":"uint256","name":"conversionRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"lockupDuration","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"},{"internalType":"uint256","name":"depositedCollateralAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setDevAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setDevFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setMaxrToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setTeamAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"teamAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_conversionRate","type":"uint256"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_lockupDuration","type":"uint256"},{"internalType":"bool","name":"_keepPookToken","type":"bool"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"pendingRewards","type":"uint256"},{"internalType":"uint256","name":"lastAction","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50612358806100206000396000f3fe6080604052600436106101445760003560e01c80636d2e13c2116100b6578063a312aa6b1161006f578063a312aa6b146104cc578063d0d41fe1146104e1578063d18df53c14610514578063e2bbb1581461054d578063f2fde38b1461057d578063f450fa0d146105b05761014b565b80636d2e13c214610399578063715018a6146103f6578063805ed1c21461040b5780638da5cb5b1461043e5780638eec5d701461045357806393f1a40b146104685761014b565b8063379607f511610108578063379607f514610272578063380552741461029c5780633ad10ef6146102ef578063485cc955146103045780636690864e1461033f5780636827e764146103725761014b565b80631526fe27146101505780631694505e146101d65780631c75b6b2146102075780631c75f085146102335780632e1a7d4d146102485761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b5061017a6004803603602081101561017357600080fd5b50356105ee565b604080516001600160a01b039b8c16815299909a1660208a0152888a01979097526060880195909552608087019390935260a086019190915260c085015260e08401526101008301526101208201529051908190036101400190f35b3480156101e257600080fd5b506101eb61065f565b604080516001600160a01b039092168252519081900360200190f35b34801561021357600080fd5b506102316004803603602081101561022a57600080fd5b503561066e565b005b34801561023f57600080fd5b506101eb6106d5565b34801561025457600080fd5b506102316004803603602081101561026b57600080fd5b50356106e4565b34801561027e57600080fd5b506102316004803603602081101561029557600080fd5b50356108f2565b3480156102a857600080fd5b50610231600480360360c08110156102bf57600080fd5b508035906001600160a01b036020820135169060408101359060608101359060808101359060a001351515610a2e565b3480156102fb57600080fd5b506101eb610b51565b34801561031057600080fd5b506102316004803603604081101561032757600080fd5b506001600160a01b0381358116916020013516610b60565b34801561034b57600080fd5b506102316004803603602081101561036257600080fd5b50356001600160a01b0316610c7e565b34801561037e57600080fd5b50610387610d56565b60408051918252519081900360200190f35b3480156103a557600080fd5b50610231600480360360e08110156103bc57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c001351515610d5c565b34801561040257600080fd5b50610231610f31565b34801561041757600080fd5b506102316004803603602081101561042e57600080fd5b50356001600160a01b0316610fdd565b34801561044a57600080fd5b506101eb6110b5565b34801561045f57600080fd5b506103876110c4565b34801561047457600080fd5b506104a16004803603604081101561048b57600080fd5b50803590602001356001600160a01b03166110ca565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b3480156104d857600080fd5b506101eb611104565b3480156104ed57600080fd5b506102316004803603602081101561050457600080fd5b50356001600160a01b0316611113565b34801561052057600080fd5b506103876004803603604081101561053757600080fd5b50803590602001356001600160a01b03166111eb565b34801561055957600080fd5b506102316004803603604081101561057057600080fd5b50803590602001356112f4565b34801561058957600080fd5b50610231600480360360208110156105a057600080fd5b50356001600160a01b031661152f565b3480156105bc57600080fd5b506105da600480360360208110156105d357600080fd5b5035611632565b604080519115158252519081900360200190f35b606681815481106105fe57600080fd5b60009182526020909120600a909102018054600182015460028301546003840154600485015460058601546006870154600788015460088901546009909901546001600160a01b039889169a5097909616979496939592949193909291908a565b6068546001600160a01b031681565b610676611647565b6001600160a01b03166106876110b5565b6001600160a01b0316146106d0576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b606b55565b6069546001600160a01b031681565b6000606682815481106106f357fe5b6000918252602080832085845260678252604080852033865290925292206005600a90920290920190810154600483015491935042916107329161164b565b1115610785576040805162461bcd60e51b815260206004820152601860248201527f596f752063616e6e6f7420776974686472617720796574210000000000000000604482015290519081900360640190fd5b61078e836116ac565b60006107cc82600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b906117f7565b9061185e565b905080156107e95760038201546107e3908261164b565b60038301555b815415610837576000848152606c602052604090205460ff166108215781548354610821916001600160a01b039091169033906118bb565b815460088401546108319161185e565b60088401555b600182015415610879576001820154606554610860916001600160a01b039091169033906118bb565b600182015460098401546108739161185e565b60098401555b600783015482546108989168056bc75e2d63100000916107c09161179e565b600283015581546040805191825251859133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3506000600282018190558082556001820155426004909101555050565b60006066828154811061090157fe5b600091825260208083208584526067825260408085203386529092529220600a9091029091019150610932836116ac565b600061096482600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b90506000811180610979575060008260030154115b15610a0157600382015461098d908261164b565b6003830181905560018401546000916109b1916001600160a01b031690339061190d565b60038401549091506109c3908261185e565b6003840155604080518281529051869133917f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf79181900360200190a3505b60078301548254610a209168056bc75e2d63100000916107c09161179e565b826002018190555050505050565b610a36611647565b6001600160a01b0316610a476110b5565b6001600160a01b031614610a90576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6066548610610ad8576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c1bdbdb081a59608a1b604482015290519081900360640190fd5b600060668781548110610ae757fe5b60009182526020808320600a929092029091016001810180546001600160a01b0319166001600160a01b039a909a16999099179098556002880196909655600387019490945550600590940155928352606c90526040909120805460ff1916911515919091179055565b606a546001600160a01b031681565b600054610100900460ff1680610b795750610b796119b4565b80610b87575060005460ff16155b610bc25760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015610bed576000805460ff1961ff0019909116610100171660011790555b606880546001600160a01b038085166001600160a01b0319928316179092556065805492861692821692909217909155606980548216732d84589f1af76b75a86858866ad959d4a9a2b8a6179055606a805490911673ebdc249284a90b5a30e7b1c5de2466aa79408f181790556014606b55610c676119c5565b8015610c79576000805461ff00191690555b505050565b610c86611647565b6001600160a01b0316610c976110b5565b6001600160a01b031614610ce0576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b038116610d34576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606980546001600160a01b0319166001600160a01b0392909216919091179055565b606b5481565b610d64611647565b6001600160a01b0316610d756110b5565b6001600160a01b031614610dbe576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6000606680549050905060666040518061014001604052808a6001600160a01b03168152602001896001600160a01b031681526020018881526020018781526020018681526020018581526020014381526020016000815260200160008152602001600081525090806001815401808255809150506001900390600052602060002090600a020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090155505081606c600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505050505050505050565b610f39611647565b6001600160a01b0316610f4a6110b5565b6001600160a01b031614610f93576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b610fe5611647565b6001600160a01b0316610ff66110b5565b6001600160a01b03161461103f576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b038116611093576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031690565b60665490565b6067602090815260009283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b6065546001600160a01b031681565b61111b611647565b6001600160a01b031661112c6110b5565b6001600160a01b031614611175576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b0381166111c9576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606a80546001600160a01b0319166001600160a01b0392909216919091179055565b600080606684815481106111fb57fe5b600091825260208083208784526067825260408085206001600160a01b038916865290925292206007600a909202909201908101546008820154600683015492945090914311801561124c57508015155b156112ad57600061126a85600601544361185e90919063ffffffff16565b9050600061128586600401548361179e90919063ffffffff16565b90506112a86112a1846107c08468056bc75e2d6310000061179e565b859061164b565b935050505b6112e783600301546112e185600201546107c668056bc75e2d631000006107c0888a6000015461179e90919063ffffffff16565b9061164b565b9450505050505b92915050565b60006066838154811061130357fe5b600091825260208083208684526067825260408085203386529092529220600a9091029091019150611334846116ac565b80541561138c57600061136d82600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b9050801561138a576003820154611384908261164b565b60038301555b505b82156114c85781546113a9906001600160a01b0316333086611a76565b60006113cf68056bc75e2d631000006107c085600201548761179e90919063ffffffff16565b90508015611438576065546113ef906001600160a01b0316333084611a76565b600061140d60646107c086600301548561179e90919063ffffffff16565b9050611419828261185e565b606554909250611432906001600160a01b031682611ad6565b5061147c565b600061145660646107c086600301548861179e90919063ffffffff16565b9050611462858261185e565b845490955061147a906001600160a01b031682611ad6565b505b8154611488908561164b565b82556001820154611499908261164b565b600183015560088301546114ad908561164b565b600884015560098301546114c1908261164b565b6009840155505b600782015481546114e79168056bc75e2d63100000916107c09161179e565b6002820155426004820155604080518481529051859133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050565b611537611647565b6001600160a01b03166115486110b5565b6001600160a01b031614611591576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b0381166115d65760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b606c6020526000908152604090205460ff1681565b3390565b6000828201838110156116a5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60665481106116f4576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c1bdbdb081a59608a1b604482015290519081900360640190fd5b60006066828154811061170357fe5b60009182526020909120600a9091020160088101549091508061172d57504360069091015561179b565b600061174683600601544361185e90919063ffffffff16565b9050600061176184600401548361179e90919063ffffffff16565b905061178861177d846107c08468056bc75e2d6310000061179e565b60078601549061164b565b6007850155505043600690920191909155505b50565b6000826117ad575060006112ee565b828202828482816117ba57fe5b04146116a55760405162461bcd60e51b81526004018080602001828103825260218152602001806122b86021913960400191505060405180910390fd5b600080821161184d576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161185657fe5b049392505050565b6000828211156118b5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c79908490611bc6565b600080846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561195d57600080fd5b505afa158015611971573d6000803e3d6000fd5b505050506040513d602081101561198757600080fd5b5051905080831115611997578092505b6119ab6001600160a01b03861685856118bb565b50909392505050565b60006119bf30611c77565b15905090565b600054610100900460ff16806119de57506119de6119b4565b806119ec575060005460ff16155b611a275760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611a52576000805460ff1961ff0019909116610100171660011790555b611a5a611c7d565b611a62611d1d565b801561179b576000805461ff001916905550565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ad0908590611bc6565b50505050565b80611ae057611bc2565b611aea8282611e16565b6000611b0660646107c0606b544761179e90919063ffffffff16565b90506000611b14478361185e565b6069546040519192506001600160a01b0316908290600081818185875af1925050503d8060008114611b62576040519150601f19603f3d011682016040523d82523d6000602084013e611b67565b606091505b5050606a546040516001600160a01b0390911691508390600081818185875af1925050503d8060008114611bb7576040519150601f19603f3d011682016040523d82523d6000602084013e611bbc565b606091505b50505050505b5050565b6000611c1b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120279092919063ffffffff16565b805190915015610c7957808060200190516020811015611c3a57600080fd5b5051610c795760405162461bcd60e51b815260040180806020018281038252602a8152602001806122f9602a913960400191505060405180910390fd5b3b151590565b600054610100900460ff1680611c965750611c966119b4565b80611ca4575060005460ff16155b611cdf5760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611a62576000805460ff1961ff001990911661010017166001179055801561179b576000805461ff001916905550565b600054610100900460ff1680611d365750611d366119b4565b80611d44575060005460ff16155b611d7f5760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611daa576000805460ff1961ff0019909116610100171660011790555b6000611db4611647565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350801561179b576000805461ff001916905550565b6040805160028082526060820183526000926020830190803683370190505090508281600081518110611e4557fe5b6001600160a01b03928316602091820292909201810191909152606854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611e9957600080fd5b505afa158015611ead573d6000803e3d6000fd5b505050506040513d6020811015611ec357600080fd5b5051815182906001908110611ed457fe5b6001600160a01b039283166020918202929092018101919091526068546040805163095ea7b360e01b8152918416600483015260248201869052519286169263095ea7b3926044808401939192918290030181600087803b158015611f3857600080fd5b505af1158015611f4c573d6000803e3d6000fd5b505050506040513d6020811015611f6257600080fd5b505060685460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602087810191028083838b5b83811015611fea578181015183820152602001611fd2565b505050509050019650505050505050600060405180830381600087803b15801561201357600080fd5b505af1158015611bbc573d6000803e3d6000fd5b6060612036848460008561203e565b949350505050565b60608247101561207f5760405162461bcd60e51b81526004018080602001828103825260268152602001806122646026913960400191505060405180910390fd5b61208885611c77565b6120d9576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106121175780518252601f1990920191602091820191016120f8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612179576040519150601f19603f3d011682016040523d82523d6000602084013e61217e565b606091505b509150915061218e828286612199565b979650505050505050565b606083156121a85750816116a5565b8251156121b85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122025781810151838201526020016121ea565b50505050905090810190601f16801561222f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212206baf71aa99a149c84ce89ffa14be8973dd238112709cd180c8f3d659422179e064736f6c63430007060033

Deployed Bytecode

0x6080604052600436106101445760003560e01c80636d2e13c2116100b6578063a312aa6b1161006f578063a312aa6b146104cc578063d0d41fe1146104e1578063d18df53c14610514578063e2bbb1581461054d578063f2fde38b1461057d578063f450fa0d146105b05761014b565b80636d2e13c214610399578063715018a6146103f6578063805ed1c21461040b5780638da5cb5b1461043e5780638eec5d701461045357806393f1a40b146104685761014b565b8063379607f511610108578063379607f514610272578063380552741461029c5780633ad10ef6146102ef578063485cc955146103045780636690864e1461033f5780636827e764146103725761014b565b80631526fe27146101505780631694505e146101d65780631c75b6b2146102075780631c75f085146102335780632e1a7d4d146102485761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b5061017a6004803603602081101561017357600080fd5b50356105ee565b604080516001600160a01b039b8c16815299909a1660208a0152888a01979097526060880195909552608087019390935260a086019190915260c085015260e08401526101008301526101208201529051908190036101400190f35b3480156101e257600080fd5b506101eb61065f565b604080516001600160a01b039092168252519081900360200190f35b34801561021357600080fd5b506102316004803603602081101561022a57600080fd5b503561066e565b005b34801561023f57600080fd5b506101eb6106d5565b34801561025457600080fd5b506102316004803603602081101561026b57600080fd5b50356106e4565b34801561027e57600080fd5b506102316004803603602081101561029557600080fd5b50356108f2565b3480156102a857600080fd5b50610231600480360360c08110156102bf57600080fd5b508035906001600160a01b036020820135169060408101359060608101359060808101359060a001351515610a2e565b3480156102fb57600080fd5b506101eb610b51565b34801561031057600080fd5b506102316004803603604081101561032757600080fd5b506001600160a01b0381358116916020013516610b60565b34801561034b57600080fd5b506102316004803603602081101561036257600080fd5b50356001600160a01b0316610c7e565b34801561037e57600080fd5b50610387610d56565b60408051918252519081900360200190f35b3480156103a557600080fd5b50610231600480360360e08110156103bc57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c001351515610d5c565b34801561040257600080fd5b50610231610f31565b34801561041757600080fd5b506102316004803603602081101561042e57600080fd5b50356001600160a01b0316610fdd565b34801561044a57600080fd5b506101eb6110b5565b34801561045f57600080fd5b506103876110c4565b34801561047457600080fd5b506104a16004803603604081101561048b57600080fd5b50803590602001356001600160a01b03166110ca565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b3480156104d857600080fd5b506101eb611104565b3480156104ed57600080fd5b506102316004803603602081101561050457600080fd5b50356001600160a01b0316611113565b34801561052057600080fd5b506103876004803603604081101561053757600080fd5b50803590602001356001600160a01b03166111eb565b34801561055957600080fd5b506102316004803603604081101561057057600080fd5b50803590602001356112f4565b34801561058957600080fd5b50610231600480360360208110156105a057600080fd5b50356001600160a01b031661152f565b3480156105bc57600080fd5b506105da600480360360208110156105d357600080fd5b5035611632565b604080519115158252519081900360200190f35b606681815481106105fe57600080fd5b60009182526020909120600a909102018054600182015460028301546003840154600485015460058601546006870154600788015460088901546009909901546001600160a01b039889169a5097909616979496939592949193909291908a565b6068546001600160a01b031681565b610676611647565b6001600160a01b03166106876110b5565b6001600160a01b0316146106d0576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b606b55565b6069546001600160a01b031681565b6000606682815481106106f357fe5b6000918252602080832085845260678252604080852033865290925292206005600a90920290920190810154600483015491935042916107329161164b565b1115610785576040805162461bcd60e51b815260206004820152601860248201527f596f752063616e6e6f7420776974686472617720796574210000000000000000604482015290519081900360640190fd5b61078e836116ac565b60006107cc82600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b906117f7565b9061185e565b905080156107e95760038201546107e3908261164b565b60038301555b815415610837576000848152606c602052604090205460ff166108215781548354610821916001600160a01b039091169033906118bb565b815460088401546108319161185e565b60088401555b600182015415610879576001820154606554610860916001600160a01b039091169033906118bb565b600182015460098401546108739161185e565b60098401555b600783015482546108989168056bc75e2d63100000916107c09161179e565b600283015581546040805191825251859133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3506000600282018190558082556001820155426004909101555050565b60006066828154811061090157fe5b600091825260208083208584526067825260408085203386529092529220600a9091029091019150610932836116ac565b600061096482600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b90506000811180610979575060008260030154115b15610a0157600382015461098d908261164b565b6003830181905560018401546000916109b1916001600160a01b031690339061190d565b60038401549091506109c3908261185e565b6003840155604080518281529051869133917f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf79181900360200190a3505b60078301548254610a209168056bc75e2d63100000916107c09161179e565b826002018190555050505050565b610a36611647565b6001600160a01b0316610a476110b5565b6001600160a01b031614610a90576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6066548610610ad8576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c1bdbdb081a59608a1b604482015290519081900360640190fd5b600060668781548110610ae757fe5b60009182526020808320600a929092029091016001810180546001600160a01b0319166001600160a01b039a909a16999099179098556002880196909655600387019490945550600590940155928352606c90526040909120805460ff1916911515919091179055565b606a546001600160a01b031681565b600054610100900460ff1680610b795750610b796119b4565b80610b87575060005460ff16155b610bc25760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015610bed576000805460ff1961ff0019909116610100171660011790555b606880546001600160a01b038085166001600160a01b0319928316179092556065805492861692821692909217909155606980548216732d84589f1af76b75a86858866ad959d4a9a2b8a6179055606a805490911673ebdc249284a90b5a30e7b1c5de2466aa79408f181790556014606b55610c676119c5565b8015610c79576000805461ff00191690555b505050565b610c86611647565b6001600160a01b0316610c976110b5565b6001600160a01b031614610ce0576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b038116610d34576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606980546001600160a01b0319166001600160a01b0392909216919091179055565b606b5481565b610d64611647565b6001600160a01b0316610d756110b5565b6001600160a01b031614610dbe576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6000606680549050905060666040518061014001604052808a6001600160a01b03168152602001896001600160a01b031681526020018881526020018781526020018681526020018581526020014381526020016000815260200160008152602001600081525090806001815401808255809150506001900390600052602060002090600a020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090155505081606c600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505050505050505050565b610f39611647565b6001600160a01b0316610f4a6110b5565b6001600160a01b031614610f93576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b610fe5611647565b6001600160a01b0316610ff66110b5565b6001600160a01b03161461103f576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b038116611093576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031690565b60665490565b6067602090815260009283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b6065546001600160a01b031681565b61111b611647565b6001600160a01b031661112c6110b5565b6001600160a01b031614611175576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b0381166111c9576040805162461bcd60e51b8152602060048201526016602482015275416464726573732063616e6e6f74206265207a65726f60501b604482015290519081900360640190fd5b606a80546001600160a01b0319166001600160a01b0392909216919091179055565b600080606684815481106111fb57fe5b600091825260208083208784526067825260408085206001600160a01b038916865290925292206007600a909202909201908101546008820154600683015492945090914311801561124c57508015155b156112ad57600061126a85600601544361185e90919063ffffffff16565b9050600061128586600401548361179e90919063ffffffff16565b90506112a86112a1846107c08468056bc75e2d6310000061179e565b859061164b565b935050505b6112e783600301546112e185600201546107c668056bc75e2d631000006107c0888a6000015461179e90919063ffffffff16565b9061164b565b9450505050505b92915050565b60006066838154811061130357fe5b600091825260208083208684526067825260408085203386529092529220600a9091029091019150611334846116ac565b80541561138c57600061136d82600201546107c668056bc75e2d631000006107c08760070154876000015461179e90919063ffffffff16565b9050801561138a576003820154611384908261164b565b60038301555b505b82156114c85781546113a9906001600160a01b0316333086611a76565b60006113cf68056bc75e2d631000006107c085600201548761179e90919063ffffffff16565b90508015611438576065546113ef906001600160a01b0316333084611a76565b600061140d60646107c086600301548561179e90919063ffffffff16565b9050611419828261185e565b606554909250611432906001600160a01b031682611ad6565b5061147c565b600061145660646107c086600301548861179e90919063ffffffff16565b9050611462858261185e565b845490955061147a906001600160a01b031682611ad6565b505b8154611488908561164b565b82556001820154611499908261164b565b600183015560088301546114ad908561164b565b600884015560098301546114c1908261164b565b6009840155505b600782015481546114e79168056bc75e2d63100000916107c09161179e565b6002820155426004820155604080518481529051859133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050565b611537611647565b6001600160a01b03166115486110b5565b6001600160a01b031614611591576040805162461bcd60e51b815260206004820181905260248201526000805160206122d9833981519152604482015290519081900360640190fd5b6001600160a01b0381166115d65760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b606c6020526000908152604090205460ff1681565b3390565b6000828201838110156116a5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60665481106116f4576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c1bdbdb081a59608a1b604482015290519081900360640190fd5b60006066828154811061170357fe5b60009182526020909120600a9091020160088101549091508061172d57504360069091015561179b565b600061174683600601544361185e90919063ffffffff16565b9050600061176184600401548361179e90919063ffffffff16565b905061178861177d846107c08468056bc75e2d6310000061179e565b60078601549061164b565b6007850155505043600690920191909155505b50565b6000826117ad575060006112ee565b828202828482816117ba57fe5b04146116a55760405162461bcd60e51b81526004018080602001828103825260218152602001806122b86021913960400191505060405180910390fd5b600080821161184d576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161185657fe5b049392505050565b6000828211156118b5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c79908490611bc6565b600080846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561195d57600080fd5b505afa158015611971573d6000803e3d6000fd5b505050506040513d602081101561198757600080fd5b5051905080831115611997578092505b6119ab6001600160a01b03861685856118bb565b50909392505050565b60006119bf30611c77565b15905090565b600054610100900460ff16806119de57506119de6119b4565b806119ec575060005460ff16155b611a275760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611a52576000805460ff1961ff0019909116610100171660011790555b611a5a611c7d565b611a62611d1d565b801561179b576000805461ff001916905550565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ad0908590611bc6565b50505050565b80611ae057611bc2565b611aea8282611e16565b6000611b0660646107c0606b544761179e90919063ffffffff16565b90506000611b14478361185e565b6069546040519192506001600160a01b0316908290600081818185875af1925050503d8060008114611b62576040519150601f19603f3d011682016040523d82523d6000602084013e611b67565b606091505b5050606a546040516001600160a01b0390911691508390600081818185875af1925050503d8060008114611bb7576040519150601f19603f3d011682016040523d82523d6000602084013e611bbc565b606091505b50505050505b5050565b6000611c1b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120279092919063ffffffff16565b805190915015610c7957808060200190516020811015611c3a57600080fd5b5051610c795760405162461bcd60e51b815260040180806020018281038252602a8152602001806122f9602a913960400191505060405180910390fd5b3b151590565b600054610100900460ff1680611c965750611c966119b4565b80611ca4575060005460ff16155b611cdf5760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611a62576000805460ff1961ff001990911661010017166001179055801561179b576000805461ff001916905550565b600054610100900460ff1680611d365750611d366119b4565b80611d44575060005460ff16155b611d7f5760405162461bcd60e51b815260040180806020018281038252602e81526020018061228a602e913960400191505060405180910390fd5b600054610100900460ff16158015611daa576000805460ff1961ff0019909116610100171660011790555b6000611db4611647565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350801561179b576000805461ff001916905550565b6040805160028082526060820183526000926020830190803683370190505090508281600081518110611e4557fe5b6001600160a01b03928316602091820292909201810191909152606854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611e9957600080fd5b505afa158015611ead573d6000803e3d6000fd5b505050506040513d6020811015611ec357600080fd5b5051815182906001908110611ed457fe5b6001600160a01b039283166020918202929092018101919091526068546040805163095ea7b360e01b8152918416600483015260248201869052519286169263095ea7b3926044808401939192918290030181600087803b158015611f3857600080fd5b505af1158015611f4c573d6000803e3d6000fd5b505050506040513d6020811015611f6257600080fd5b505060685460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602087810191028083838b5b83811015611fea578181015183820152602001611fd2565b505050509050019650505050505050600060405180830381600087803b15801561201357600080fd5b505af1158015611bbc573d6000803e3d6000fd5b6060612036848460008561203e565b949350505050565b60608247101561207f5760405162461bcd60e51b81526004018080602001828103825260268152602001806122646026913960400191505060405180910390fd5b61208885611c77565b6120d9576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106121175780518252601f1990920191602091820191016120f8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612179576040519150601f19603f3d011682016040523d82523d6000602084013e61217e565b606091505b509150915061218e828286612199565b979650505050505050565b606083156121a85750816116a5565b8251156121b85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122025781810151838201526020016121ea565b50505050905090810190601f16801561222f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212206baf71aa99a149c84ce89ffa14be8973dd238112709cd180c8f3d659422179e064736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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