ETH Price: $3,209.12 (+1.46%)

Token

Infinity-NFT (INFT)
 

Overview

Max Total Supply

411 INFT

Holders

312

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 INFT
0x703E50af7E055C6C9ac83d72255CAAcD62400BCA
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DexfaiINFT

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 19 : DexfaiINFT.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;

import "DexfaiPool.sol";
import "ERC721Enumerable.sol";

import "IDexfaiINFT.sol";
import "IERC20.sol";
import "IDexfaiFactory.sol";
import "IWETH.sol";

/**
 * @title Xfai's Infinity NFT contract
 * @author Xfai
 * @notice DexfaiINFT is responsible for minting, boosting, and harvesting INFTs
 */
contract DexfaiINFT is IDexfaiINFT, ERC721Enumerable {
  /**
   * @notice The WETH address.
   * @dev In the case of a chain ID other than Ethereum, the wrapped ERC20 token address of the chain's native coin
   */
  address private WETH;

  /**
   * @notice The ERC20 token used as the underlying token for the INFT
   */
  address private underlyingToken;

  /**
   * @notice The Factory address of the DEX
   */
  address private dexfaiFactory;

  string private baseURI;

  uint private counter;

  /**
   * @notice The reserve of underlyingToken within the INFT contract
   */
  uint public override reserve;

  /**
   * @notice Total amount of issued shares
   */
  uint public override totalSharesIssued;

  /**
   * @notice Initial reserve set at during deployment. Does count as part of INFT reserve
   */
  uint public override initialReserve;

  uint private constant NOT_ENTERED = 1;
  uint private constant ENTERED = 2;
  uint private status;
  uint private expectedMints;

  /**
   * @notice Mapping from token address to harvested amounts. harvestedBalance shows how much of a token has been harvested so far from the contract.
   */
  mapping(address => uint) public override harvestedBalance;

  /**
   * @notice Mapping from token ID to share
   */
  mapping(uint => uint) public override INFTShares;

  /**
   * @notice Mapping from token address to token ID to token share
   */
  mapping(address => mapping(uint => uint)) public override sharesHarvestedByPool;

  /**
   * @notice Mapping from token address to total share for a token
   */
  mapping(address => uint) public override totalSharesHarvestedByPool;

  /**
   * @notice Functions with the onlyOwner modifier can be called only by the factory owner
   */
  modifier onlyOwner() {
    require(msg.sender == IDexfaiFactory(dexfaiFactory).getOwner(), 'DexfaiINFT: NOT_OWNER');
    _;
  }

  /**
   * @notice Functions with the lock modifier can be called only once within a transaction
   */
  modifier lock() {
    require(status != ENTERED, 'DexfaiINFT: REENTRANT_CALL');
    status = ENTERED;
    _;
    status = NOT_ENTERED;
  }

  /**
   * @notice Construct Xfai's DEX Factory
   * @param _dexfaiFactory The address of the DexfaiFactory contract
   * @param _underlyingToken The address of the ERC20 token used as the underlying token for the INFT
   * @param _initialReserve The initial reserve used during deployment
   * @param _expectedMints The number of pre-mints before minting is available
   */
  constructor(
    address _dexfaiFactory,
    address _WETH,
    address _underlyingToken,
    uint _initialReserve,
    uint _expectedMints
  ) ERC721('Infinity-NFT', 'INFT') {
    status = NOT_ENTERED;
    dexfaiFactory = _dexfaiFactory;
    WETH = _WETH;
    underlyingToken = _underlyingToken;
    initialReserve = _initialReserve;
    expectedMints = _expectedMints;
    totalSharesIssued = 1; // permanently lock one share to prevent zero divisions
  }

  receive() external payable {
    assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
  }

  /**
   * @notice preMint is used to mint the legacy NFTs before minting is enabled
   * @dev Can only be called by the owner
   * @param _legacyLNFTHolders the address array of the legacy nft holders
   * @param _initialShares the share array of the legacy nft holders
   */
  function premint(
    address[] memory _legacyLNFTHolders,
    uint[] memory _initialShares
  ) external override onlyOwner {
    require(counter < expectedMints, 'DexfaiINFT: PREMINTS_ENDED');
    require(_initialShares.length == _legacyLNFTHolders.length, 'DexfaiINFT: INVALID_VALUES');
    for (uint i = 0; i < _initialShares.length; i++) {
      counter += 1;
      _safeMint(_legacyLNFTHolders[i], counter);
      INFTShares[counter] = _initialShares[i];
      totalSharesIssued += _initialShares[i];
    }
  }

  /**
   * @notice Function used to set the baseURI of the NFT
   * @dev setBaseURI can be called only by the contract owner
   * @param _newBaseURI the new baseURI string for the NFT
   */
  function setBaseURI(string memory _newBaseURI) external override onlyOwner {
    baseURI = _newBaseURI;
  }

  function _baseURI() internal view override returns (string memory) {
    return baseURI;
  }

  /**
   * @notice Function used to fetch contract states
   * @return The reserve used during contract initialization, the reserve of the underlying token, and the total number of shares issued
   */
  function getStates() external view override returns (uint, uint, uint) {
    return (initialReserve, reserve, totalSharesIssued);
  }

  /**
   * @notice Computes the amount of _token fees collected for a given _tokenID
   * @param _tokenID The token ID of an INFT
   * @param _token the address of an ERC20 token
   * @return share2amount The total amount of _token that a given _tokenID can harvest
   * @return inftShare The share of an INFT
   * @return harvestedShares The amount of shares harvested for a given pool
   */
  function shareToTokenAmount(
    uint _tokenID,
    address _token
  ) external view override returns (uint share2amount, uint inftShare, uint harvestedShares) {
    inftShare = INFTShares[_tokenID];
    harvestedShares = sharesHarvestedByPool[_token][_tokenID];
    uint tokenBalance = IERC20(_token).balanceOf(address(this));
    uint share = inftShare - harvestedShares;
    uint totalShare = totalSharesIssued - totalSharesHarvestedByPool[_token];
    share2amount = (tokenBalance * share) / totalShare; // zero divisions not possible
  }

  /**
   * @notice Creates a new INFT, the share of which is determined by the amount of the underlying token sent to the DexfaiFactory
   * @dev This low-level function should be called from a contract which performs important safety checks
   * @param _to The address to which the newly minted INFT should be sent to
   * @return tokenID The id of the newly minted INFT
   * @return share The share value of the INFT
   */
  function mint(address _to) external override lock returns (uint tokenID, uint share) {
    require(counter >= expectedMints, 'DexfaiINFT: PREMINTS_ONGOING');
    uint amount = IERC20(underlyingToken).balanceOf(dexfaiFactory) - reserve;
    require(amount != 0, 'DexfaiINFT: INSUFICIENT_AMOUNT');
    counter += 1;
    tokenID = counter;
    reserve += amount;
    share = (1e18 * amount) / (reserve + initialReserve);
    INFTShares[tokenID] = share;
    totalSharesIssued += share;
    _safeMint(_to, tokenID);
    emit Mint(msg.sender, _to, share, tokenID);
  }

  /**
   * @notice Boosts the share value of an INFT, the share of which is determined by the amount of the underlying token sent to the DexfaiFactory
   * @dev This low-level function should be called from a contract which performs important safety checks
   * @param _tokenID The token ID of an INFT
   * @return share The share value added to an INFT
   */
  function boost(uint _tokenID) external override lock returns (uint share) {
    require(_tokenID <= counter, 'DexfaiINFT: Inexistent_ID');
    uint amount = IERC20(underlyingToken).balanceOf(dexfaiFactory) - reserve;
    require(amount != 0, 'DexfaiINFT: INSUFICIENT_AMOUNT');
    reserve += amount;
    share = (1e18 * amount) / (reserve + initialReserve);
    INFTShares[_tokenID] += share;
    totalSharesIssued += share;
    emit Boost(msg.sender, share, _tokenID);
  }

  /**
   * @notice Harvests the fees (in terms of a given ERC20 token) for a given INFT.
   * @param _token An ERC20 token address
   * @param _tokenID The token ID of an INFT
   * @param _amount The amount of _token to harvest
   */
  function _harvest(
    address _token,
    uint _tokenID,
    uint _amount
  ) private returns (uint harvestedTokenShare) {
    require(ownerOf(_tokenID) == msg.sender, 'DexfaiINFT: NOT_INFT_OWNER');
    uint tokenBalance = IERC20(_token).balanceOf(address(this));
    uint share = INFTShares[_tokenID] - sharesHarvestedByPool[_token][_tokenID];
    uint totalShare = totalSharesIssued - totalSharesHarvestedByPool[_token];
    uint share2amount = (tokenBalance * share) / totalShare; // zero divisions not possible
    require(_amount <= share2amount, 'DexfaiINFT: AMOUNT_EXCEEDS_SHARE');
    harvestedTokenShare = (share * _amount) / share2amount;
    sharesHarvestedByPool[_token][_tokenID] += harvestedTokenShare;
    totalSharesHarvestedByPool[_token] += harvestedTokenShare;
    harvestedBalance[_token] += _amount;
  }

  /**
   * @notice Harvests INFT fees from the INFT contract
   * @param _token The address of an ERC20 token
   * @param _tokenID The ID of the INFT
   * @param _amount The amount to harvest
   */
  function harvestToken(
    address _token,
    uint _tokenID,
    uint _amount
  ) external override lock returns (uint) {
    uint harvestedTokenShare = _harvest(_token, _tokenID, _amount);
    _safeTransfer(_token, ownerOf(_tokenID), _amount);
    emit HarvestToken(_token, _amount, harvestedTokenShare, _tokenID);
    return _amount;
  }

  /**
   * @notice Harvests INFT fees from the INFT contract
   * @param _tokenID The ID of the INFT
   * @param _amount The amount to harvest
   */
  function harvestETH(uint _tokenID, uint _amount) external override lock returns (uint) {
    uint harvestedTokenShare = _harvest(WETH, _tokenID, _amount);
    IWETH(WETH).withdraw(_amount);
    _safeTransferETH(ownerOf(_tokenID), _amount);
    emit HarvestETH(_amount, harvestedTokenShare, _tokenID);
    return _amount;
  }

  function _safeTransfer(address _token, address _to, uint256 _value) internal {
    require(_token.code.length > 0, 'DexfaiINFT: TRANSFER_FAILED');
    (bool success, bytes memory data) = _token.call(
      abi.encodeWithSelector(IERC20.transfer.selector, _to, _value)
    );
    require(
      success && (data.length == 0 || abi.decode(data, (bool))),
      'DexfaiINFT: TRANSFER_FAILED'
    );
  }

  function _safeTransferETH(address _to, uint _value) internal {
    (bool success, ) = _to.call{value: _value}(new bytes(0));
    require(success, 'DexfaiINFT: ETH_TRANSFER_FAILED');
  }
}

File 2 of 19 : DexfaiPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;

import "IDexfaiPool.sol";
import "IERC20.sol";
import "IDexfaiFactory.sol";

/**
 * @title Xfai's Dexfai Pools
 * @author Xfai
 * @notice DexfaiPool are contracts that get generated by the DexfaiFactory. Every hosted token has one unique pool that holds the state (i.e. pool reserve, balance, weights) for the given token.
 */
contract DexfaiPool is IDexfaiPool {
  /**
   * @notice The ERC20 token name for the LP token
   */
  string public override name;

  /**
   * @notice The ERC20 token symbol for the LP token
   */
  string public override symbol;

  /**
   * @notice The ERC20 token decimals for the LP token
   */
  uint8 public constant override decimals = 18;

  /**
   * @notice Structure to capture time period obervations every 15 minutes, used for local oracles
   */
  struct Observation {
    uint rCumulative;
    uint wCumulative;
    uint timestamp;
  }

  /**
   * @notice The amount of time within a period.
   * @dev Used to capture oracle reading every 15 minutes
   */
  uint private constant PERIOD_SIZE = 900;

  /**
   * @notice The total size of the ring buffer
   * @dev Stores every PERIOD_SIZE a new record. The buffer can store up to 1 week of data
   */
  uint private constant RING_SIZE = 672;

  /**
   * @notice The ring buffer counter
   * @dev Used to determine the latest index within the ring buffer
   */
  uint public ringBufferNonce = 0;

  /**
   * @notice The ring buffer array
   */
  Observation[RING_SIZE] public override observations;

  /**
   * @notice The pool reserve
   */
  uint private r;

  /**
   * @notice Pool weight
   * @dev w is used to compute the exchange value of a token
   */
  uint private w;

  /**
   * @notice The last block timestamp
   */
  uint private blockTimestampLast;

  /**
   * @notice The cumulative reserve value
   * @dev used to compute TWAPs
   */
  uint private rCumulativeLast;

  /**
   * @notice The cumulative w value
   * @dev used to compute TWAPs
   */
  uint private wCumulativeLast;

  /**
   * @notice The total supply of LP tokens
   */
  uint public override totalSupply = 0;

  uint private seeded = 1;
  IDexfaiFactory private dexfaiFactory;

  /**
   * @notice The ERC20 token address for which the pool was created. Not the same with the LP token address
   */
  address public override poolToken;

  /**
   * @notice the domain seperator. Used for permits
   */
  bytes32 public override DOMAIN_SEPARATOR;

  /**
   * @notice the permit typehash. Used for permits
   * @dev keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
   */
  bytes32 public constant override PERMIT_TYPEHASH =
    0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

  /**
   * @notice mapping used to determine the nonce of an address. Used for permits
   */
  mapping(address => uint) public override nonces;

  /**
   * @notice mapping used to determine the allowance of an address for another address
   */
  mapping(address => mapping(address => uint)) public override allowance;

  /**
   * @notice mapping used to determine the LP token balance of an address
   */
  mapping(address => uint) public override balanceOf;

  modifier linked() {
    address core = getDexfaiCore();
    require(msg.sender == core, 'DexfaiPool: NOT_CORE');
    _;
  }

  /**
   * @notice Construct the DexfaiPool
   * @dev The parameters of the pool are omitted in the construct and are instead specified via the initialize function
   */
  constructor() {
    write(0, 0, block.timestamp);

    DOMAIN_SEPARATOR = keccak256(
      abi.encode(
        keccak256(
          'EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'
        ),
        keccak256(bytes(name)),
        keccak256('1'),
        block.chainid,
        address(this)
      )
    );
  }

  // **** Oracle Functions ****

  /**
   * @notice Computes the latest index within the ring buffer
   * @dev The returned index will point at the latest 'empty' position within the ring buffer, i.e. the index for which the time period has not yet been reached
   * @return index The current index within the price oracle ring bufffer
   */
  function getCurrentIndex() public view override returns (uint16 index) {
    index = uint16(ringBufferNonce % RING_SIZE);
  }

  function write(uint _r, uint _w, uint _blockTimestamp) private returns (uint16 index) {
    index = getCurrentIndex();
    observations[index] = Observation(_r, _w, _blockTimestamp);
    ringBufferNonce += 1;
    emit Write(_r, _w, _blockTimestamp);
  }

  /**
   * @notice Fetches the N-th latest stored observation from the ring buffer
   * @dev E.g. If _n = 1, getNthObservation returns the lastest observation. If _n = 2, getNthObservation returns the previous (2nd lastest) observation
   * @param _n The N-th observation that one wants to fetch
   * @return rCumulative The rCumulative of the N-th observation
   * @return wCumulative The wCumulative of the N-th observation
   * @return timestamp The timestamp of the N-th observation
   */
  function getNthObservation(
    uint _n
  ) public view override returns (uint rCumulative, uint wCumulative, uint timestamp) {
    require(ringBufferNonce >= _n, 'DexfaiPool: INEXISTENT_HISTORY');
    require(_n < RING_SIZE, 'DexfaiPool: OVERRIDDEN_HISTORY');
    uint16 index = uint16((ringBufferNonce - _n) % RING_SIZE);
    Observation memory point = observations[index];
    rCumulative = point.rCumulative;
    wCumulative = point.wCumulative;
    timestamp = point.timestamp;
  }

  /**
   * @notice Fetches the latest cummulativeLast values of the pool
   * @return rCumulativeLast The cummulative r of the pool
   * @return wCumulativeLast The cummulative w of the pool
   * @return blockTimestampLast The cummulative timestamp of the pool
   */
  function getCumulativeLast() public view override returns (uint, uint, uint) {
    return (rCumulativeLast, wCumulativeLast, blockTimestampLast);
  }

  // **** Pool Functions ****

  /**
   * @notice Called once by the factory at time of deployment
   * @param _token The ERC20 token address of the pool
   * @param _dexfaiFactory The Dexfai Factory of the pool
   */
  function initialize(address _token, address _dexfaiFactory) external override {
    require(seeded == 1, 'DexfaiPool: DEX_SEEDED');
    poolToken = _token;
    dexfaiFactory = IDexfaiFactory(_dexfaiFactory);
    name = string(abi.encodePacked(IERC20(_token).name(), '-Xfai'));
    symbol = string(abi.encodePacked(IERC20(_token).symbol(), '-Xfai'));
    seeded = 2;
  }

  /**
   * @notice Get the current Dexfai Core that is allowed to modify the pool state
   */
  function getDexfaiCore() public view override returns (address) {
    return dexfaiFactory.getDexfaiCore();
  }

  /**
   * @notice Get the current reserve, weight, and last block timestamp of the pool
   */
  function getStates() external view override returns (uint, uint, uint) {
    return (r, w, blockTimestampLast);
  }

  /**
   * @notice Updates the reserve and weight. On the first call per block updates cumulative states.
   * @dev This function is linked. Only the latest Dexfai core can call it
   * @param _balance The latest balance of the pool
   * @param _r The latest reserve of the pool
   * @param _w The latest w weight of the pool
   */
  function update(uint _balance, uint _r, uint _w) external override linked {
    uint blockTimestamp = block.timestamp;
    uint timeElapsed = blockTimestamp - blockTimestampLast;
    if (timeElapsed > 0 && _r != 0) {
      unchecked {
        rCumulativeLast += _r * timeElapsed;
        wCumulativeLast += _w * timeElapsed;
      }
    }
    (, , uint timestamp) = getNthObservation(1);
    timeElapsed = blockTimestamp - timestamp; // compare the last observation with current timestamp, if greater than 15 minutes, record a new event
    if (timeElapsed > PERIOD_SIZE && _r != 0) {
      write(rCumulativeLast, wCumulativeLast, blockTimestamp);
    }
    r = _balance;
    w = _w;
    blockTimestampLast = blockTimestamp;
    emit Sync(_balance, _w);
  }

  /**
   * @notice transfer the pool's ERC20 token (not LP token)
   * @dev This function is linked. Only the latest Dexfai core can call it
   * @param _token The pool's ERC20 token address
   * @param _to The recipient of the tokens
   * @param _value The amount of tokens
   */
  function safeTransfer(address _token, address _to, uint256 _value) external override linked {
    require(_token.code.length > 0, 'DexfaiPool: TRANSFER_FAILED');
    (bool success, bytes memory data) = _token.call(
      abi.encodeWithSelector(IERC20.transfer.selector, _to, _value)
    );
    require(
      success && (data.length == 0 || abi.decode(data, (bool))),
      'DexfaiPool: TRANSFER_FAILED'
    );
  }

  // **** ERC20 Functions ****

  /**
   * @notice This function mints new ERC20 LP tokens
   * @dev This function is linked. Only the latest Dexfai core can call it
   * @param _to The recipient of the tokens
   * @param _amount The amount of tokens
   */
  function mint(address _to, uint _amount) public override linked {
    _mint(_to, _amount);
  }

  /**
   * @notice This function burns existing ERC20 LP tokens
   * @dev This function is linked. Only the latest Dexfai core can call it
   * @param _to The recipient whose tokens get burned
   * @param _amount The amount of tokens burned
   */
  function burn(address _to, uint _amount) public override linked {
    _burn(_to, _amount);
  }

  function _mint(address _dst, uint _amount) internal {
    totalSupply += _amount;
    balanceOf[_dst] += _amount;
    emit Transfer(address(0), _dst, _amount);
  }

  function _burn(address _dst, uint _amount) internal {
    totalSupply -= _amount;
    balanceOf[_dst] -= _amount;
    emit Transfer(_dst, address(0), _amount);
  }

  /**
   * @notice The ERC20 standard approve function
   */
  function approve(address _spender, uint _amount) external override returns (bool) {
    allowance[msg.sender][_spender] = _amount;

    emit Approval(msg.sender, _spender, _amount);
    return true;
  }

  /**
   * @notice The ERC20 standard permit function
   */
  function permit(
    address _owner,
    address _spender,
    uint _value,
    uint _deadline,
    uint8 _v,
    bytes32 _r,
    bytes32 _s
  ) external override {
    require(_deadline >= block.timestamp, 'DexfaiPool: EXPIRED');
    bytes32 digest = keccak256(
      abi.encodePacked(
        '\x19\x01',
        DOMAIN_SEPARATOR,
        keccak256(
          abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonces[_owner]++, _deadline)
        )
      )
    );
    address recoveredAddress = ecrecover(digest, _v, _r, _s);
    require(recoveredAddress != address(0), 'DexfaiPool: INVALID_SIGNATURE');
    require(recoveredAddress == _owner, 'DexfaiPool: INVALID_SIGNATURE');
    allowance[_owner][_spender] = _value;

    emit Approval(_owner, _spender, _value);
  }

  /**
   * @notice The ERC20 standard transfer function
   */
  function transfer(address _dst, uint _amount) external override returns (bool) {
    _transferTokens(msg.sender, _dst, _amount);
    return true;
  }

  /**
   * @notice The ERC20 standard transferFrom function
   */
  function transferFrom(address _src, address _dst, uint _amount) external override returns (bool) {
    address spender = msg.sender;
    uint spenderAllowance = allowance[_src][spender];

    if (spender != _src && spenderAllowance != type(uint).max) {
      uint newAllowance = spenderAllowance - _amount;
      allowance[_src][spender] = newAllowance;

      emit Approval(_src, spender, newAllowance);
    }

    _transferTokens(_src, _dst, _amount);
    return true;
  }

  function _transferTokens(address _src, address _dst, uint _amount) internal {
    balanceOf[_src] -= _amount;
    balanceOf[_dst] += _amount;

    emit Transfer(_src, _dst, _amount);
  }
}

File 3 of 19 : IDexfaiPool.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.19;

interface IDexfaiPool {
  function getCurrentIndex() external view returns (uint16 index);

  function getNthObservation(
    uint _n
  ) external view returns (uint timestamp, uint rCumulative, uint wCumulative);

  function getCumulativeLast()
    external
    view
    returns (uint timestamp, uint rCumulative, uint wCumulative);

  function ringBufferNonce() external view returns (uint);

  function observations(uint observation) external view returns (uint, uint, uint);

  function getDexfaiCore() external view returns (address);

  function poolToken() external view returns (address);

  function initialize(address _token, address _dexfaiFactory) external;

  function getStates() external view returns (uint, uint, uint);

  function update(uint _balance, uint _r, uint _w) external;

  function mint(address _to, uint _amount) external;

  function burn(address _to, uint _amount) external;

  function safeTransfer(address _token, address _to, uint256 _value) external;

  function totalSupply() external view returns (uint);

  function transfer(address _recipient, uint _amount) external returns (bool);

  function decimals() external view returns (uint8);

  function balanceOf(address) external view returns (uint);

  function transferFrom(address _sender, address _recipient, uint _amount) external returns (bool);

  function approve(address _spender, uint _value) external returns (bool);

  function allowance(address _owner, address _spender) external view returns (uint256);

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

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

  function permit(
    address _owner,
    address _spender,
    uint _value,
    uint _deadline,
    uint8 _v,
    bytes32 _re,
    bytes32 _s
  ) external;

  function nonces(address _owner) external view returns (uint);

  function PERMIT_TYPEHASH() external view returns (bytes32);

  function DOMAIN_SEPARATOR() external view returns (bytes32);

  event Sync(uint _reserve, uint _w);
  event Transfer(address indexed _from, address indexed _to, uint _amount);
  event Approval(address indexed _owner, address indexed _spender, uint _amount);
  event Write(uint _r, uint _w, uint _blockTimestamp);
}

File 4 of 19 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;

interface IERC20 {
  function totalSupply() external view returns (uint);

  function transfer(address recipient, uint amount) external returns (bool);

  function decimals() external view returns (uint8);

  function balanceOf(address) external view returns (uint);

  function transferFrom(address sender, address recipient, uint amount) external returns (bool);

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

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

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

  function name() external view returns (string memory);
}

File 5 of 19 : IDexfaiFactory.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.19;

interface IDexfaiFactory {
  function getPool(address _token) external view returns (address pool);

  function allPools(uint256) external view returns (address pool);

  function poolCodeHash() external pure returns (bytes32);

  function allPoolsLength() external view returns (uint);

  function createPool(address _token) external returns (address pool);

  function setDexfaiCore(address _core) external;

  function getDexfaiCore() external view returns (address);

  function setOwner(address _owner) external;

  function setWhitelistingPhase(bool _state) external;

  function getOwner() external view returns (address);

  event ChangedOwner(address indexed owner);
  event ChangedCore(address indexed core);
  event Whitelisting(bool state);
  event PoolCreated(address indexed token, address indexed pool, uint allPoolsSize);
}

File 6 of 19 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "ERC721.sol";
import "IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
  // Mapping from owner to list of owned token IDs
  mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

  // Mapping from token ID to index of the owner tokens list
  mapping(uint256 => uint256) private _ownedTokensIndex;

  // Array with all token ids, used for enumeration
  uint256[] private _allTokens;

  // Mapping from token id to position in the allTokens array
  mapping(uint256 => uint256) private _allTokensIndex;

  /**
   * @dev See {IERC165-supportsInterface}.
   */
  function supportsInterface(
    bytes4 interfaceId
  ) public view virtual override(IERC165, ERC721) returns (bool) {
    return
      interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
  }

  /**
   * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
   */
  function tokenOfOwnerByIndex(
    address owner,
    uint256 index
  ) public view virtual override returns (uint256) {
    require(index < ERC721.balanceOf(owner), 'ERC721Enumerable: owner index out of bounds');
    return _ownedTokens[owner][index];
  }

  /**
   * @dev See {IERC721Enumerable-totalSupply}.
   */
  function totalSupply() public view virtual override returns (uint256) {
    return _allTokens.length;
  }

  /**
   * @dev See {IERC721Enumerable-tokenByIndex}.
   */
  function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
    require(index < ERC721Enumerable.totalSupply(), 'ERC721Enumerable: global index out of bounds');
    return _allTokens[index];
  }

  /**
   * @dev See {ERC721-_beforeTokenTransfer}.
   */
  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 firstTokenId,
    uint256 batchSize
  ) internal virtual override {
    super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

    if (batchSize > 1) {
      // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
      revert('ERC721Enumerable: consecutive transfers not supported');
    }

    uint256 tokenId = firstTokenId;

    if (from == address(0)) {
      _addTokenToAllTokensEnumeration(tokenId);
    } else if (from != to) {
      _removeTokenFromOwnerEnumeration(from, tokenId);
    }
    if (to == address(0)) {
      _removeTokenFromAllTokensEnumeration(tokenId);
    } else if (to != from) {
      _addTokenToOwnerEnumeration(to, tokenId);
    }
  }

  /**
   * @dev Private function to add a token to this extension's ownership-tracking data structures.
   * @param to address representing the new owner of the given token ID
   * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
    uint256 length = ERC721.balanceOf(to);
    _ownedTokens[to][length] = tokenId;
    _ownedTokensIndex[tokenId] = length;
  }

  /**
   * @dev Private function to add a token to this extension's token tracking data structures.
   * @param tokenId uint256 ID of the token to be added to the tokens list
   */
  function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
    _allTokensIndex[tokenId] = _allTokens.length;
    _allTokens.push(tokenId);
  }

  /**
   * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
   * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
   * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
   * This has O(1) time complexity, but alters the order of the _ownedTokens array.
   * @param from address representing the previous owner of the given token ID
   * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
    // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
    // then delete the last slot (swap and pop).

    uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
    uint256 tokenIndex = _ownedTokensIndex[tokenId];

    // When the token to delete is the last token, the swap operation is unnecessary
    if (tokenIndex != lastTokenIndex) {
      uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

      _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
      _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
    }

    // This also deletes the contents at the last position of the array
    delete _ownedTokensIndex[tokenId];
    delete _ownedTokens[from][lastTokenIndex];
  }

  /**
   * @dev Private function to remove a token from this extension's token tracking data structures.
   * This has O(1) time complexity, but alters the order of the _allTokens array.
   * @param tokenId uint256 ID of the token to be removed from the tokens list
   */
  function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
    // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
    // then delete the last slot (swap and pop).

    uint256 lastTokenIndex = _allTokens.length - 1;
    uint256 tokenIndex = _allTokensIndex[tokenId];

    // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
    // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
    // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
    uint256 lastTokenId = _allTokens[lastTokenIndex];

    _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
    _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

    // This also deletes the contents at the last position of the array
    delete _allTokensIndex[tokenId];
    _allTokens.pop();
  }
}

File 7 of 19 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "IERC721.sol";
import "IERC721Receiver.sol";
import "IERC721Metadata.sol";
import "Address.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
  using Address for address;
  using Strings for uint256;

  // Token name
  string private _name;

  // Token symbol
  string private _symbol;

  // Mapping from token ID to owner address
  mapping(uint256 => address) private _owners;

  // Mapping owner address to token count
  mapping(address => uint256) private _balances;

  // Mapping from token ID to approved address
  mapping(uint256 => address) private _tokenApprovals;

  // Mapping from owner to operator approvals
  mapping(address => mapping(address => bool)) private _operatorApprovals;

  /**
   * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
   */
  constructor(string memory name_, string memory symbol_) {
    _name = name_;
    _symbol = symbol_;
  }

  /**
   * @dev See {IERC165-supportsInterface}.
   */
  function supportsInterface(
    bytes4 interfaceId
  ) public view virtual override(ERC165, IERC165) returns (bool) {
    return
      interfaceId == type(IERC721).interfaceId ||
      interfaceId == type(IERC721Metadata).interfaceId ||
      super.supportsInterface(interfaceId);
  }

  /**
   * @dev See {IERC721-balanceOf}.
   */
  function balanceOf(address owner) public view virtual override returns (uint256) {
    require(owner != address(0), 'ERC721: address zero is not a valid owner');
    return _balances[owner];
  }

  /**
   * @dev See {IERC721-ownerOf}.
   */
  function ownerOf(uint256 tokenId) public view virtual override returns (address) {
    address owner = _ownerOf(tokenId);
    require(owner != address(0), 'ERC721: invalid token ID');
    return owner;
  }

  /**
   * @dev See {IERC721Metadata-name}.
   */
  function name() public view virtual override returns (string memory) {
    return _name;
  }

  /**
   * @dev See {IERC721Metadata-symbol}.
   */
  function symbol() public view virtual override returns (string memory) {
    return _symbol;
  }

  /**
   * @dev See {IERC721Metadata-tokenURI}.
   */
  function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    _requireMinted(tokenId);

    string memory baseURI = _baseURI();
    return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
  }

  /**
   * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
   * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
   * by default, can be overridden in child contracts.
   */
  function _baseURI() internal view virtual returns (string memory) {
    return '';
  }

  /**
   * @dev See {IERC721-approve}.
   */
  function approve(address to, uint256 tokenId) public virtual override {
    address owner = ERC721.ownerOf(tokenId);
    require(to != owner, 'ERC721: approval to current owner');

    require(
      _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
      'ERC721: approve caller is not token owner or approved for all'
    );

    _approve(to, tokenId);
  }

  /**
   * @dev See {IERC721-getApproved}.
   */
  function getApproved(uint256 tokenId) public view virtual override returns (address) {
    _requireMinted(tokenId);

    return _tokenApprovals[tokenId];
  }

  /**
   * @dev See {IERC721-setApprovalForAll}.
   */
  function setApprovalForAll(address operator, bool approved) public virtual override {
    _setApprovalForAll(_msgSender(), operator, approved);
  }

  /**
   * @dev See {IERC721-isApprovedForAll}.
   */
  function isApprovedForAll(
    address owner,
    address operator
  ) public view virtual override returns (bool) {
    return _operatorApprovals[owner][operator];
  }

  /**
   * @dev See {IERC721-transferFrom}.
   */
  function transferFrom(address from, address to, uint256 tokenId) public virtual override {
    //solhint-disable-next-line max-line-length
    require(
      _isApprovedOrOwner(_msgSender(), tokenId),
      'ERC721: caller is not token owner or approved'
    );

    _transfer(from, to, tokenId);
  }

  /**
   * @dev See {IERC721-safeTransferFrom}.
   */
  function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
    safeTransferFrom(from, to, tokenId, '');
  }

  /**
   * @dev See {IERC721-safeTransferFrom}.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes memory data
  ) public virtual override {
    require(
      _isApprovedOrOwner(_msgSender(), tokenId),
      'ERC721: caller is not token owner or approved'
    );
    _safeTransfer(from, to, tokenId, data);
  }

  /**
   * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
   * are aware of the ERC721 protocol to prevent tokens from being forever locked.
   *
   * `data` is additional data, it has no specified format and it is sent in call to `to`.
   *
   * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
   * implement alternative mechanisms to perform token transfer, such as signature-based.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must exist and be owned by `from`.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function _safeTransfer(
    address from,
    address to,
    uint256 tokenId,
    bytes memory data
  ) internal virtual {
    _transfer(from, to, tokenId);
    require(
      _checkOnERC721Received(from, to, tokenId, data),
      'ERC721: transfer to non ERC721Receiver implementer'
    );
  }

  /**
   * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
   */
  function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
    return _owners[tokenId];
  }

  /**
   * @dev Returns whether `tokenId` exists.
   *
   * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
   *
   * Tokens start existing when they are minted (`_mint`),
   * and stop existing when they are burned (`_burn`).
   */
  function _exists(uint256 tokenId) internal view virtual returns (bool) {
    return _ownerOf(tokenId) != address(0);
  }

  /**
   * @dev Returns whether `spender` is allowed to manage `tokenId`.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function _isApprovedOrOwner(
    address spender,
    uint256 tokenId
  ) internal view virtual returns (bool) {
    address owner = ERC721.ownerOf(tokenId);
    return (spender == owner ||
      isApprovedForAll(owner, spender) ||
      getApproved(tokenId) == spender);
  }

  /**
   * @dev Safely mints `tokenId` and transfers it to `to`.
   *
   * Requirements:
   *
   * - `tokenId` must not exist.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function _safeMint(address to, uint256 tokenId) internal virtual {
    _safeMint(to, tokenId, '');
  }

  /**
   * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
   * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
   */
  function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
    _mint(to, tokenId);
    require(
      _checkOnERC721Received(address(0), to, tokenId, data),
      'ERC721: transfer to non ERC721Receiver implementer'
    );
  }

  /**
   * @dev Mints `tokenId` and transfers it to `to`.
   *
   * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
   *
   * Requirements:
   *
   * - `tokenId` must not exist.
   * - `to` cannot be the zero address.
   *
   * Emits a {Transfer} event.
   */
  function _mint(address to, uint256 tokenId) internal virtual {
    require(to != address(0), 'ERC721: mint to the zero address');
    require(!_exists(tokenId), 'ERC721: token already minted');

    _beforeTokenTransfer(address(0), to, tokenId, 1);

    // Check that tokenId was not minted by `_beforeTokenTransfer` hook
    require(!_exists(tokenId), 'ERC721: token already minted');

    unchecked {
      // Will not overflow unless all 2**256 token ids are minted to the same owner.
      // Given that tokens are minted one by one, it is impossible in practice that
      // this ever happens. Might change if we allow batch minting.
      // The ERC fails to describe this case.
      _balances[to] += 1;
    }

    _owners[tokenId] = to;

    emit Transfer(address(0), to, tokenId);

    _afterTokenTransfer(address(0), to, tokenId, 1);
  }

  /**
   * @dev Destroys `tokenId`.
   * The approval is cleared when the token is burned.
   * This is an internal function that does not check if the sender is authorized to operate on the token.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   *
   * Emits a {Transfer} event.
   */
  function _burn(uint256 tokenId) internal virtual {
    address owner = ERC721.ownerOf(tokenId);

    _beforeTokenTransfer(owner, address(0), tokenId, 1);

    // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
    owner = ERC721.ownerOf(tokenId);

    // Clear approvals
    delete _tokenApprovals[tokenId];

    unchecked {
      // Cannot overflow, as that would require more tokens to be burned/transferred
      // out than the owner initially received through minting and transferring in.
      _balances[owner] -= 1;
    }
    delete _owners[tokenId];

    emit Transfer(owner, address(0), tokenId);

    _afterTokenTransfer(owner, address(0), tokenId, 1);
  }

  /**
   * @dev Transfers `tokenId` from `from` to `to`.
   *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
   *
   * Requirements:
   *
   * - `to` cannot be the zero address.
   * - `tokenId` token must be owned by `from`.
   *
   * Emits a {Transfer} event.
   */
  function _transfer(address from, address to, uint256 tokenId) internal virtual {
    require(ERC721.ownerOf(tokenId) == from, 'ERC721: transfer from incorrect owner');
    require(to != address(0), 'ERC721: transfer to the zero address');

    _beforeTokenTransfer(from, to, tokenId, 1);

    // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
    require(ERC721.ownerOf(tokenId) == from, 'ERC721: transfer from incorrect owner');

    // Clear approvals from the previous owner
    delete _tokenApprovals[tokenId];

    unchecked {
      // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
      // `from`'s balance is the number of token held, which is at least one before the current
      // transfer.
      // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
      // all 2**256 token ids to be minted, which in practice is impossible.
      _balances[from] -= 1;
      _balances[to] += 1;
    }
    _owners[tokenId] = to;

    emit Transfer(from, to, tokenId);

    _afterTokenTransfer(from, to, tokenId, 1);
  }

  /**
   * @dev Approve `to` to operate on `tokenId`
   *
   * Emits an {Approval} event.
   */
  function _approve(address to, uint256 tokenId) internal virtual {
    _tokenApprovals[tokenId] = to;
    emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
  }

  /**
   * @dev Approve `operator` to operate on all of `owner` tokens
   *
   * Emits an {ApprovalForAll} event.
   */
  function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
    require(owner != operator, 'ERC721: approve to caller');
    _operatorApprovals[owner][operator] = approved;
    emit ApprovalForAll(owner, operator, approved);
  }

  /**
   * @dev Reverts if the `tokenId` has not been minted yet.
   */
  function _requireMinted(uint256 tokenId) internal view virtual {
    require(_exists(tokenId), 'ERC721: invalid token ID');
  }

  /**
   * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
   * The call is not executed if the target address is not a contract.
   *
   * @param from address representing the previous owner of the given token ID
   * @param to target address that will receive the tokens
   * @param tokenId uint256 ID of the token to be transferred
   * @param data bytes optional data to send along with the call
   * @return bool whether the call correctly returned the expected magic value
   */
  function _checkOnERC721Received(
    address from,
    address to,
    uint256 tokenId,
    bytes memory data
  ) private returns (bool) {
    if (to.isContract()) {
      try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (
        bytes4 retval
      ) {
        return retval == IERC721Receiver.onERC721Received.selector;
      } catch (bytes memory reason) {
        if (reason.length == 0) {
          revert('ERC721: transfer to non ERC721Receiver implementer');
        } else {
          /// @solidity memory-safe-assembly
          assembly {
            revert(add(32, reason), mload(reason))
          }
        }
      }
    } else {
      return true;
    }
  }

  /**
   * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
   * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
   *
   * Calling conditions:
   *
   * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
   * - When `from` is zero, the tokens will be minted for `to`.
   * - When `to` is zero, ``from``'s tokens will be burned.
   * - `from` and `to` are never both zero.
   * - `batchSize` is non-zero.
   *
   * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
   */
  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 /* firstTokenId */,
    uint256 batchSize
  ) internal virtual {
    if (batchSize > 1) {
      if (from != address(0)) {
        _balances[from] -= batchSize;
      }
      if (to != address(0)) {
        _balances[to] += batchSize;
      }
    }
  }

  /**
   * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
   * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
   *
   * Calling conditions:
   *
   * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
   * - When `from` is zero, the tokens were minted for `to`.
   * - When `to` is zero, ``from``'s tokens were burned.
   * - `from` and `to` are never both zero.
   * - `batchSize` is non-zero.
   *
   * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
   */
  function _afterTokenTransfer(
    address from,
    address to,
    uint256 firstTokenId,
    uint256 batchSize
  ) internal virtual {}
}

File 8 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.19;

import "IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
  /**
   * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
   */
  event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

  /**
   * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
   */
  event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

  /**
   * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
   */
  event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

  /**
   * @dev Returns the number of tokens in ``owner``'s account.
   */
  function balanceOf(address owner) external view returns (uint256 balance);

  /**
   * @dev Returns the owner of the `tokenId` token.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function ownerOf(uint256 tokenId) external view returns (address owner);

  /**
   * @dev Safely transfers `tokenId` token from `from` to `to`.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must exist and be owned by `from`.
   * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes calldata data
  ) external;

  /**
   * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
   * are aware of the ERC721 protocol to prevent tokens from being forever locked.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must exist and be owned by `from`.
   * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function safeTransferFrom(address from, address to, uint256 tokenId) external;

  /**
   * @dev Transfers `tokenId` token from `from` to `to`.
   *
   * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
   * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
   * understand this adds an external call which potentially creates a reentrancy vulnerability.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must be owned by `from`.
   * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
   *
   * Emits a {Transfer} event.
   */
  function transferFrom(address from, address to, uint256 tokenId) external;

  /**
   * @dev Gives permission to `to` to transfer `tokenId` token to another account.
   * The approval is cleared when the token is transferred.
   *
   * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
   *
   * Requirements:
   *
   * - The caller must own the token or be an approved operator.
   * - `tokenId` must exist.
   *
   * Emits an {Approval} event.
   */
  function approve(address to, uint256 tokenId) external;

  /**
   * @dev Approve or remove `operator` as an operator for the caller.
   * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
   *
   * Requirements:
   *
   * - The `operator` cannot be the caller.
   *
   * Emits an {ApprovalForAll} event.
   */
  function setApprovalForAll(address operator, bool _approved) external;

  /**
   * @dev Returns the account approved for `tokenId` token.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function getApproved(uint256 tokenId) external view returns (address operator);

  /**
   * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
   *
   * See {setApprovalForAll}
   */
  function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 9 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.19;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
  /**
   * @dev Returns true if this contract implements the interface defined by
   * `interfaceId`. See the corresponding
   * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
   * to learn more about how these ids are created.
   *
   * This function call must use less than 30 000 gas.
   */
  function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 10 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.19;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
  /**
   * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
   * by `operator` from `from`, this function is called.
   *
   * It must return its Solidity selector to confirm the token transfer.
   * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
   *
   * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
   */
  function onERC721Received(
    address operator,
    address from,
    uint256 tokenId,
    bytes calldata data
  ) external returns (bytes4);
}

File 11 of 19 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.19;

import "IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
  /**
   * @dev Returns the token collection name.
   */
  function name() external view returns (string memory);

  /**
   * @dev Returns the token collection symbol.
   */
  function symbol() external view returns (string memory);

  /**
   * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
   */
  function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 12 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
   * ====
   *
   * [IMPORTANT]
   * ====
   * You shouldn't rely on `isContract` to protect against flash loan attacks!
   *
   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
   * constructor.
   * ====
   */
  function isContract(address account) internal view returns (bool) {
    // This method relies on extcodesize/address.code.length, which returns 0
    // for contracts in construction, since the code is only stored at the end
    // of the constructor execution.

    return account.code.length > 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://consensys.net/diligence/blog/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');

    (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 functionCallWithValue(target, data, 0, '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');
    (bool success, bytes memory returndata) = target.call{value: value}(data);
    return verifyCallResultFromTarget(target, 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) {
    (bool success, bytes memory returndata) = target.staticcall(data);
    return verifyCallResultFromTarget(target, 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) {
    (bool success, bytes memory returndata) = target.delegatecall(data);
    return verifyCallResultFromTarget(target, success, returndata, errorMessage);
  }

  /**
   * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
   * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
   *
   * _Available since v4.8._
   */
  function verifyCallResultFromTarget(
    address target,
    bool success,
    bytes memory returndata,
    string memory errorMessage
  ) internal view returns (bytes memory) {
    if (success) {
      if (returndata.length == 0) {
        // only check isContract if the call was successful and the return data is empty
        // otherwise we already know that it was a contract
        require(isContract(target), 'Address: call to non-contract');
      }
      return returndata;
    } else {
      _revert(returndata, errorMessage);
    }
  }

  /**
   * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
   * revert reason or using the provided one.
   *
   * _Available since v4.3._
   */
  function verifyCallResult(
    bool success,
    bytes memory returndata,
    string memory errorMessage
  ) internal pure returns (bytes memory) {
    if (success) {
      return returndata;
    } else {
      _revert(returndata, errorMessage);
    }
  }

  function _revert(bytes memory returndata, string memory errorMessage) private pure {
    // 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
      /// @solidity memory-safe-assembly
      assembly {
        let returndata_size := mload(returndata)
        revert(add(32, returndata), returndata_size)
      }
    } else {
      revert(errorMessage);
    }
  }
}

File 13 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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 Context {
  function _msgSender() internal view virtual returns (address) {
    return msg.sender;
  }

  function _msgData() internal view virtual returns (bytes calldata) {
    return msg.data;
  }
}

File 14 of 19 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "OZMath.sol";

/**
 * @dev String operations.
 */
library Strings {
  bytes16 private constant _SYMBOLS = '0123456789abcdef';
  uint8 private constant _ADDRESS_LENGTH = 20;

  /**
   * @dev Converts a `uint256` to its ASCII `string` decimal representation.
   */
  function toString(uint256 value) internal pure returns (string memory) {
    unchecked {
      uint256 length = OZMath.log10(value) + 1;
      string memory buffer = new string(length);
      uint256 ptr;
      /// @solidity memory-safe-assembly
      assembly {
        ptr := add(buffer, add(32, length))
      }
      while (true) {
        ptr--;
        /// @solidity memory-safe-assembly
        assembly {
          mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
        }
        value /= 10;
        if (value == 0) break;
      }
      return buffer;
    }
  }

  /**
   * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
   */
  function toHexString(uint256 value) internal pure returns (string memory) {
    unchecked {
      return toHexString(value, OZMath.log256(value) + 1);
    }
  }

  /**
   * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
   */
  function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
    bytes memory buffer = new bytes(2 * length + 2);
    buffer[0] = '0';
    buffer[1] = 'x';
    for (uint256 i = 2 * length + 1; i > 1; --i) {
      buffer[i] = _SYMBOLS[value & 0xf];
      value >>= 4;
    }
    require(value == 0, 'Strings: hex length insufficient');
    return string(buffer);
  }

  /**
   * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
   */
  function toHexString(address addr) internal pure returns (string memory) {
    return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
  }
}

File 15 of 19 : OZMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library OZMath {
  enum Rounding {
    Down, // Toward negative infinity
    Up, // Toward infinity
    Zero // Toward zero
  }

  /**
   * @dev Return the log in base 10, rounded down, of a positive value.
   * Returns 0 if given 0.
   */
  function log10(uint256 value) internal pure returns (uint256) {
    uint256 result = 0;
    unchecked {
      if (value >= 10 ** 64) {
        value /= 10 ** 64;
        result += 64;
      }
      if (value >= 10 ** 32) {
        value /= 10 ** 32;
        result += 32;
      }
      if (value >= 10 ** 16) {
        value /= 10 ** 16;
        result += 16;
      }
      if (value >= 10 ** 8) {
        value /= 10 ** 8;
        result += 8;
      }
      if (value >= 10 ** 4) {
        value /= 10 ** 4;
        result += 4;
      }
      if (value >= 10 ** 2) {
        value /= 10 ** 2;
        result += 2;
      }
      if (value >= 10 ** 1) {
        result += 1;
      }
    }
    return result;
  }

  /**
   * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
   * Returns 0 if given 0.
   */
  function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
    unchecked {
      uint256 result = log10(value);
      return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
    }
  }

  /**
   * @dev Return the log in base 256, rounded down, of a positive value.
   * Returns 0 if given 0.
   *
   * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
   */
  function log256(uint256 value) internal pure returns (uint256) {
    uint256 result = 0;
    unchecked {
      if (value >> 128 > 0) {
        value >>= 128;
        result += 16;
      }
      if (value >> 64 > 0) {
        value >>= 64;
        result += 8;
      }
      if (value >> 32 > 0) {
        value >>= 32;
        result += 4;
      }
      if (value >> 16 > 0) {
        value >>= 16;
        result += 2;
      }
      if (value >> 8 > 0) {
        result += 1;
      }
    }
    return result;
  }

  /**
   * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
   * Returns 0 if given 0.
   */
  function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
    unchecked {
      uint256 result = log256(value);
      return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
    }
  }
}

File 16 of 19 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
  /**
   * @dev See {IERC165-supportsInterface}.
   */
  function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
    return interfaceId == type(IERC165).interfaceId;
  }
}

File 17 of 19 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.19;

import "IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
  /**
   * @dev Returns the total amount of tokens stored by the contract.
   */
  function totalSupply() external view returns (uint256);

  /**
   * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
   * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
   */
  function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

  /**
   * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
   * Use along with {totalSupply} to enumerate all tokens.
   */
  function tokenByIndex(uint256 index) external view returns (uint256);
}

File 18 of 19 : IDexfaiINFT.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.19;

interface IDexfaiINFT {
  function reserve() external view returns (uint);

  function totalSharesIssued() external view returns (uint);

  function initialReserve() external view returns (uint);

  function harvestedBalance(address _token) external view returns (uint);

  function INFTShares(uint _id) external view returns (uint);

  function sharesHarvestedByPool(address _token, uint _id) external view returns (uint);

  function totalSharesHarvestedByPool(address _token) external view returns (uint);

  function setBaseURI(string memory _baseURI) external;

  function getStates() external view returns (uint, uint, uint);

  function shareToTokenAmount(
    uint _tokenID,
    address _token
  ) external view returns (uint share2amount, uint inftShare, uint harvestedShares);

  function premint(address[] memory _legacyLNFTHolders, uint[] memory _initialShares) external;

  function mint(address _to) external returns (uint tokenID, uint share);

  function boost(uint _tokenID) external returns (uint share);

  function harvestToken(address _token, uint _tokenID, uint _amount) external returns (uint);

  function harvestETH(uint _tokenID, uint _amount) external returns (uint);

  event Mint(address indexed from, address indexed to, uint share, uint id);
  event Boost(address indexed from, uint share, uint id);
  event HarvestToken(address token, uint harvestedAmount, uint harvestedShare, uint id);
  event HarvestETH(uint harvestedAmount, uint harvestedShare, uint id);
}

File 19 of 19 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.19;

interface IWETH {
  function deposit() external payable;

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

  function withdraw(uint) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_dexfaiFactory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_underlyingToken","type":"address"},{"internalType":"uint256","name":"_initialReserve","type":"uint256"},{"internalType":"uint256","name":"_expectedMints","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Boost","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"HarvestETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"HarvestToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"INFTShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"}],"name":"boost","outputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"harvestETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_tokenID","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"harvestToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"harvestedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_legacyLNFTHolders","type":"address[]"},{"internalType":"uint256[]","name":"_initialShares","type":"uint256[]"}],"name":"premint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"shareToTokenAmount","outputs":[{"internalType":"uint256","name":"share2amount","type":"uint256"},{"internalType":"uint256","name":"inftShare","type":"uint256"},{"internalType":"uint256","name":"harvestedShares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"sharesHarvestedByPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalSharesHarvestedByPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSharesIssued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b50604051620032243803806200322483398101604081905262000034916200010d565b6040518060400160405280600c81526020016b125b999a5b9a5d1e4b53919560a21b815250604051806040016040528060048152602001631253919560e21b81525081600090816200008791906200020f565b5060016200009682826200020f565b505060016012819055600c80546001600160a01b03199081166001600160a01b03998a1617909155600a8054821697891697909717909655600b8054909616949096169390931790935560115550601355601055620002db565b80516001600160a01b03811681146200010857600080fd5b919050565b600080600080600060a086880312156200012657600080fd5b6200013186620000f0565b94506200014160208701620000f0565b93506200015160408701620000f0565b6060870151608090970151959894975095949392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200019557607f821691505b602082108103620001b657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200020a57600081815260208120601f850160051c81016020861015620001e55750805b601f850160051c820191505b818110156200020657828155600101620001f1565b5050505b505050565b81516001600160401b038111156200022b576200022b6200016a565b62000243816200023c845462000180565b84620001bc565b602080601f8311600181146200027b5760008415620002625750858301515b600019600386901b1c1916600185901b17855562000206565b600085815260208120601f198616915b82811015620002ac578886015182559484019460019091019084016200028b565b5085821015620002cb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612f3980620002eb6000396000f3fe6080604052600436106101dc5760003560e01c806360f4867411610102578063b88d4fde11610095578063d8ab827411610064578063d8ab8274146105ee578063e6fd298214610609578063e985e9c51461061f578063fab2cb361461066857600080fd5b8063b88d4fde1461056b578063bdba15611461058b578063c87b56dd146105b8578063cd3293de146105d857600080fd5b8063871f1940116100d1578063871f1940146104e957806395d89b4114610509578063a22cb4651461051e578063a8b9d9d51461053e57600080fd5b806360f48674146104395780636352211e146104745780636a6278421461049457806370a08231146104c957600080fd5b80631b55d19e1161017a5780632f745c59116101495780632f745c59146103b957806342842e0e146103d95780634f6ccce7146103f957806355f804b31461041957600080fd5b80631b55d19e1461033957806323b872dd146103595780632dd5a938146103795780632e27e3a71461039957600080fd5b8063095ea7b3116101b6578063095ea7b31461029157806311865c43146102b157806318160ddd146102f75780631ac9afdb1461030c57600080fd5b806301ffc9a71461020257806306fdde0314610237578063081812fc1461025957600080fd5b366101fd57600a546001600160a01b031633146101fb576101fb6125e0565b005b600080fd5b34801561020e57600080fd5b5061022261021d36600461260c565b61067e565b60405190151581526020015b60405180910390f35b34801561024357600080fd5b5061024c6106a9565b60405161022e9190612679565b34801561026557600080fd5b5061027961027436600461268c565b61073b565b6040516001600160a01b03909116815260200161022e565b34801561029d57600080fd5b506101fb6102ac3660046126ba565b610762565b3480156102bd57600080fd5b506102e96102cc3660046126ba565b601660209081526000928352604080842090915290825290205481565b60405190815260200161022e565b34801561030357600080fd5b506008546102e9565b34801561031857600080fd5b506102e96103273660046126e6565b60146020526000908152604090205481565b34801561034557600080fd5b506102e961035436600461268c565b61087c565b34801561036557600080fd5b506101fb610374366004612703565b610a98565b34801561038557600080fd5b506102e9610394366004612744565b610ac9565b3480156103a557600080fd5b506101fb6103b436600461283c565b610bca565b3480156103c557600080fd5b506102e96103d43660046126ba565b610dfe565b3480156103e557600080fd5b506101fb6103f4366004612703565b610e94565b34801561040557600080fd5b506102e961041436600461268c565b610eaf565b34801561042557600080fd5b506101fb610434366004612956565b610f42565b34801561044557600080fd5b5061045961045436600461299f565b611021565b6040805193845260208401929092529082015260600161022e565b34801561048057600080fd5b5061027961048f36600461268c565b61110d565b3480156104a057600080fd5b506104b46104af3660046126e6565b61116d565b6040805192835260208301919091520161022e565b3480156104d557600080fd5b506102e96104e43660046126e6565b6113ad565b3480156104f557600080fd5b506102e96105043660046129cf565b611433565b34801561051557600080fd5b5061024c6114dc565b34801561052a57600080fd5b506101fb610539366004612a12565b6114eb565b34801561054a57600080fd5b506102e96105593660046126e6565b60176020526000908152604090205481565b34801561057757600080fd5b506101fb610586366004612a40565b6114f6565b34801561059757600080fd5b506102e96105a636600461268c565b60156020526000908152604090205481565b3480156105c457600080fd5b5061024c6105d336600461268c565b61152e565b3480156105e457600080fd5b506102e9600f5481565b3480156105fa57600080fd5b50601154600f54601054610459565b34801561061557600080fd5b506102e960115481565b34801561062b57600080fd5b5061022261063a366004612ac0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561067457600080fd5b506102e960105481565b60006001600160e01b0319821663780e9d6360e01b14806106a357506106a382611595565b92915050565b6060600080546106b890612aee565b80601f01602080910402602001604051908101604052809291908181526020018280546106e490612aee565b80156107315780601f1061070657610100808354040283529160200191610731565b820191906000526020600020905b81548152906001019060200180831161071457829003601f168201915b5050505050905090565b6000610746826115e5565b506000908152600460205260409020546001600160a01b031690565b600061076d8261110d565b9050806001600160a01b0316836001600160a01b0316036107df5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107fb57506107fb813361063a565b61086d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016107d6565b6108778383611647565b505050565b60006002601254036108a05760405162461bcd60e51b81526004016107d690612b28565b6002601255600e548211156108f75760405162461bcd60e51b815260206004820152601960248201527f446578666169494e46543a20496e6578697374656e745f49440000000000000060448201526064016107d6565b600f54600b54600c546040516370a0823160e01b81526001600160a01b0391821660048201526000939291909116906370a0823190602401602060405180830381865afa15801561094c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109709190612b5f565b61097a9190612b8e565b9050806000036109cc5760405162461bcd60e51b815260206004820152601e60248201527f446578666169494e46543a20494e535546494349454e545f414d4f554e54000060448201526064016107d6565b80600f60008282546109de9190612ba1565b9091555050601154600f546109f39190612ba1565b610a0582670de0b6b3a7640000612bb4565b610a0f9190612bcb565b915081601560008581526020019081526020016000206000828254610a349190612ba1565b925050819055508160106000828254610a4d9190612ba1565b9091555050604080518381526020810185905233917faadc628cb4fd3bb7a62795eb460290459458bdc6f387ffde727c740f42c18337910160405180910390a2506001601255919050565b610aa233826116b5565b610abe5760405162461bcd60e51b81526004016107d690612bed565b610877838383611734565b6000600260125403610aed5760405162461bcd60e51b81526004016107d690612b28565b6002601255600a54600090610b0c906001600160a01b031685856118a5565b600a54604051632e1a7d4d60e01b8152600481018690529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610b5357600080fd5b505af1158015610b67573d6000803e3d6000fd5b50505050610b7d610b778561110d565b84611afb565b60408051848152602081018390529081018590527ffd1a3a6d5498bdf58109d329c7c185fa6652cb8ae241a662e3772c559c8c86a69060600160405180910390a150506001601255919050565b600c60009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190612c3a565b6001600160a01b0316336001600160a01b031614610c995760405162461bcd60e51b81526020600482015260156024820152742232bc3330b4a4a7232a1d102727aa2fa7aba722a960591b60448201526064016107d6565b601354600e5410610cec5760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a205052454d494e54535f454e44454400000000000060448201526064016107d6565b8151815114610d3d5760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a20494e56414c49445f56414c55455300000000000060448201526064016107d6565b60005b8151811015610877576001600e6000828254610d5c9190612ba1565b92505081905550610d88838281518110610d7857610d78612c57565b6020026020010151600e54611bb8565b818181518110610d9a57610d9a612c57565b602002602001015160156000600e54815260200190815260200160002081905550818181518110610dcd57610dcd612c57565b602002602001015160106000828254610de69190612ba1565b90915550819050610df681612c6d565b915050610d40565b6000610e09836113ad565b8210610e6b5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107d6565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610877838383604051806020016040528060008152506114f6565b6000610eba60085490565b8210610f1d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107d6565b60088281548110610f3057610f30612c57565b90600052602060002001549050919050565b600c60009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb99190612c3a565b6001600160a01b0316336001600160a01b0316146110115760405162461bcd60e51b81526020600482015260156024820152742232bc3330b4a4a7232a1d102727aa2fa7aba722a960591b60448201526064016107d6565b600d61101d8282612cd4565b5050565b6000828152601560209081526040808320546001600160a01b038516808552601684528285208786529093528184205491516370a0823160e01b8152306004820152909284916370a0823190602401602060405180830381865afa15801561108d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b19190612b5f565b905060006110bf8385612b8e565b6001600160a01b03871660009081526017602052604081205460105492935090916110ea9190612b8e565b9050806110f78385612bb4565b6111019190612bcb565b95505050509250925092565b6000818152600260205260408120546001600160a01b0316806106a35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107d6565b6000806002601254036111925760405162461bcd60e51b81526004016107d690612b28565b6002601255601354600e5410156111eb5760405162461bcd60e51b815260206004820152601c60248201527f446578666169494e46543a205052454d494e54535f4f4e474f494e470000000060448201526064016107d6565b600f54600b54600c546040516370a0823160e01b81526001600160a01b0391821660048201526000939291909116906370a0823190602401602060405180830381865afa158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612b5f565b61126e9190612b8e565b9050806000036112c05760405162461bcd60e51b815260206004820152601e60248201527f446578666169494e46543a20494e535546494349454e545f414d4f554e54000060448201526064016107d6565b6001600e60008282546112d39190612ba1565b92505081905550600e54925080600f60008282546112f19190612ba1565b9091555050601154600f546113069190612ba1565b61131882670de0b6b3a7640000612bb4565b6113229190612bcb565b600084815260156020526040812082905560108054929450849290919061134a908490612ba1565b9091555061135a90508484611bb8565b60408051838152602081018590526001600160a01b0386169133917f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee910160405180910390a35060016012559092909150565b60006001600160a01b0382166114175760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107d6565b506001600160a01b031660009081526003602052604090205490565b60006002601254036114575760405162461bcd60e51b81526004016107d690612b28565b600260125560006114698585856118a5565b905061147e856114788661110d565b85611bd2565b604080516001600160a01b038716815260208101859052908101829052606081018590527fe611dbd9386c5163f399f1a4548786381fad79b3b33a9c512654c98e2446d85c9060800160405180910390a15050600160125592915050565b6060600180546106b890612aee565b61101d338383611d47565b61150033836116b5565b61151c5760405162461bcd60e51b81526004016107d690612bed565b61152884848484611e15565b50505050565b6060611539826115e5565b6000611543611e48565b90506000815111611563576040518060200160405280600081525061158e565b8061156d84611e57565b60405160200161157e929190612d94565b6040516020818303038152906040525b9392505050565b60006001600160e01b031982166380ac58cd60e01b14806115c657506001600160e01b03198216635b5e139f60e01b145b806106a357506301ffc9a760e01b6001600160e01b03198316146106a3565b6000818152600260205260409020546001600160a01b03166116445760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107d6565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061167c8261110d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806116c18361110d565b9050806001600160a01b0316846001600160a01b0316148061170857506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061172c5750836001600160a01b03166117218461073b565b6001600160a01b0316145b949350505050565b826001600160a01b03166117478261110d565b6001600160a01b03161461176d5760405162461bcd60e51b81526004016107d690612dc3565b6001600160a01b0382166117cf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107d6565b6117dc8383836001611eea565b826001600160a01b03166117ef8261110d565b6001600160a01b0316146118155760405162461bcd60e51b81526004016107d690612dc3565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000336118b18461110d565b6001600160a01b0316146119075760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a204e4f545f494e46545f4f574e455200000000000060448201526064016107d6565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561194e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119729190612b5f565b6001600160a01b0386166000908152601660209081526040808320888452825280832054601590925282205492935090916119ad9190612b8e565b6001600160a01b03871660009081526017602052604081205460105492935090916119d89190612b8e565b90506000816119e78486612bb4565b6119f19190612bcb565b905080861115611a435760405162461bcd60e51b815260206004820181905260248201527f446578666169494e46543a20414d4f554e545f455843454544535f534841524560448201526064016107d6565b80611a4e8785612bb4565b611a589190612bcb565b6001600160a01b03891660009081526016602090815260408083208b8452909152812080549297508792909190611a90908490612ba1565b90915550506001600160a01b03881660009081526017602052604081208054879290611abd908490612ba1565b90915550506001600160a01b03881660009081526014602052604081208054889290611aea908490612ba1565b909155509498975050505050505050565b604080516000808252602082019092526001600160a01b038416908390604051611b259190612e08565b60006040518083038185875af1925050503d8060008114611b62576040519150601f19603f3d011682016040523d82523d6000602084013e611b67565b606091505b50509050806108775760405162461bcd60e51b815260206004820152601f60248201527f446578666169494e46543a204554485f5452414e534645525f4641494c45440060448201526064016107d6565b61101d828260405180602001604052806000815250612023565b6000836001600160a01b03163b11611c2c5760405162461bcd60e51b815260206004820152601b60248201527f446578666169494e46543a205452414e534645525f4641494c4544000000000060448201526064016107d6565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611c889190612e08565b6000604051808303816000865af19150503d8060008114611cc5576040519150601f19603f3d011682016040523d82523d6000602084013e611cca565b606091505b5091509150818015611cf4575080511580611cf4575080806020019051810190611cf49190612e24565b611d405760405162461bcd60e51b815260206004820152601b60248201527f446578666169494e46543a205452414e534645525f4641494c4544000000000060448201526064016107d6565b5050505050565b816001600160a01b0316836001600160a01b031603611da85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107d6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611e20848484611734565b611e2c84848484612056565b6115285760405162461bcd60e51b81526004016107d690612e41565b6060600d80546106b890612aee565b60606000611e6483612157565b600101905060008167ffffffffffffffff811115611e8457611e84612766565b6040519080825280601f01601f191660200182016040528015611eae576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611eb857509392505050565b611ef68484848461222f565b6001811115611f655760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b60648201526084016107d6565b816001600160a01b038516611fc157611fbc81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611fe4565b836001600160a01b0316856001600160a01b031614611fe457611fe485826122b7565b6001600160a01b03841661200057611ffb81612354565b611d40565b846001600160a01b0316846001600160a01b031614611d4057611d408482612403565b61202d8383612447565b61203a6000848484612056565b6108775760405162461bcd60e51b81526004016107d690612e41565b60006001600160a01b0384163b1561214c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061209a903390899088908890600401612e93565b6020604051808303816000875af19250505080156120d5575060408051601f3d908101601f191682019092526120d291810190612ed0565b60015b612132573d808015612103576040519150601f19603f3d011682016040523d82523d6000602084013e612108565b606091505b50805160000361212a5760405162461bcd60e51b81526004016107d690612e41565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061172c565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106121965772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106121c2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106121e057662386f26fc10000830492506010015b6305f5e10083106121f8576305f5e100830492506008015b612710831061220c57612710830492506004015b6064831061221e576064830492506002015b600a83106106a35760010192915050565b6001811115611528576001600160a01b03841615612275576001600160a01b0384166000908152600360205260408120805483929061226f908490612b8e565b90915550505b6001600160a01b03831615611528576001600160a01b038316600090815260036020526040812080548392906122ac908490612ba1565b909155505050505050565b600060016122c4846113ad565b6122ce9190612b8e565b600083815260076020526040902054909150808214612321576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061236690600190612b8e565b6000838152600960205260408120546008805493945090928490811061238e5761238e612c57565b9060005260206000200154905080600883815481106123af576123af612c57565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806123e7576123e7612eed565b6001900381819060005260206000200160009055905550505050565b600061240e836113ad565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661249d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107d6565b6000818152600260205260409020546001600160a01b0316156125025760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107d6565b612510600083836001611eea565b6000818152600260205260409020546001600160a01b0316156125755760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107d6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b634e487b7160e01b600052600160045260246000fd5b6001600160e01b03198116811461164457600080fd5b60006020828403121561261e57600080fd5b813561158e816125f6565b60005b8381101561264457818101518382015260200161262c565b50506000910152565b60008151808452612665816020860160208601612629565b601f01601f19169290920160200192915050565b60208152600061158e602083018461264d565b60006020828403121561269e57600080fd5b5035919050565b6001600160a01b038116811461164457600080fd5b600080604083850312156126cd57600080fd5b82356126d8816126a5565b946020939093013593505050565b6000602082840312156126f857600080fd5b813561158e816126a5565b60008060006060848603121561271857600080fd5b8335612723816126a5565b92506020840135612733816126a5565b929592945050506040919091013590565b6000806040838503121561275757600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156127a5576127a5612766565b604052919050565b600067ffffffffffffffff8211156127c7576127c7612766565b5060051b60200190565b600082601f8301126127e257600080fd5b813560206127f76127f2836127ad565b61277c565b82815260059290921b8401810191818101908684111561281657600080fd5b8286015b84811015612831578035835291830191830161281a565b509695505050505050565b6000806040838503121561284f57600080fd5b823567ffffffffffffffff8082111561286757600080fd5b818501915085601f83011261287b57600080fd5b8135602061288b6127f2836127ad565b82815260059290921b840181019181810190898411156128aa57600080fd5b948201945b838610156128d15785356128c2816126a5565b825294820194908201906128af565b965050860135925050808211156128e757600080fd5b506128f4858286016127d1565b9150509250929050565b600067ffffffffffffffff83111561291857612918612766565b61292b601f8401601f191660200161277c565b905082815283838301111561293f57600080fd5b828260208301376000602084830101529392505050565b60006020828403121561296857600080fd5b813567ffffffffffffffff81111561297f57600080fd5b8201601f8101841361299057600080fd5b61172c848235602084016128fe565b600080604083850312156129b257600080fd5b8235915060208301356129c4816126a5565b809150509250929050565b6000806000606084860312156129e457600080fd5b83356129ef816126a5565b95602085013595506040909401359392505050565b801515811461164457600080fd5b60008060408385031215612a2557600080fd5b8235612a30816126a5565b915060208301356129c481612a04565b60008060008060808587031215612a5657600080fd5b8435612a61816126a5565b93506020850135612a71816126a5565b925060408501359150606085013567ffffffffffffffff811115612a9457600080fd5b8501601f81018713612aa557600080fd5b612ab4878235602084016128fe565b91505092959194509250565b60008060408385031215612ad357600080fd5b8235612ade816126a5565b915060208301356129c4816126a5565b600181811c90821680612b0257607f821691505b602082108103612b2257634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601a908201527f446578666169494e46543a205245454e5452414e545f43414c4c000000000000604082015260600190565b600060208284031215612b7157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106a3576106a3612b78565b808201808211156106a3576106a3612b78565b80820281158282048414176106a3576106a3612b78565b600082612be857634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b600060208284031215612c4c57600080fd5b815161158e816126a5565b634e487b7160e01b600052603260045260246000fd5b600060018201612c7f57612c7f612b78565b5060010190565b601f82111561087757600081815260208120601f850160051c81016020861015612cad5750805b601f850160051c820191505b81811015612ccc57828155600101612cb9565b505050505050565b815167ffffffffffffffff811115612cee57612cee612766565b612d0281612cfc8454612aee565b84612c86565b602080601f831160018114612d375760008415612d1f5750858301515b600019600386901b1c1916600185901b178555612ccc565b600085815260208120601f198616915b82811015612d6657888601518255948401946001909101908401612d47565b5085821015612d845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351612da6818460208801612629565b835190830190612dba818360208801612629565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60008251612e1a818460208701612629565b9190910192915050565b600060208284031215612e3657600080fd5b815161158e81612a04565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec69083018461264d565b9695505050505050565b600060208284031215612ee257600080fd5b815161158e816125f6565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220e30ace093128599aea4faf025a32332c19193d017c8e418bd34933e06371f88764736f6c63430008130033000000000000000000000000ee9c77cc985dcc4fd81e7804ce4c2f380430c333000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004aa41bc1649c9c3177ed16caaa11482295fc744100000000000000000000000000000000000000000031a17e847807b1bc0000000000000000000000000000000000000000000000000000000000000000000194

Deployed Bytecode

0x6080604052600436106101dc5760003560e01c806360f4867411610102578063b88d4fde11610095578063d8ab827411610064578063d8ab8274146105ee578063e6fd298214610609578063e985e9c51461061f578063fab2cb361461066857600080fd5b8063b88d4fde1461056b578063bdba15611461058b578063c87b56dd146105b8578063cd3293de146105d857600080fd5b8063871f1940116100d1578063871f1940146104e957806395d89b4114610509578063a22cb4651461051e578063a8b9d9d51461053e57600080fd5b806360f48674146104395780636352211e146104745780636a6278421461049457806370a08231146104c957600080fd5b80631b55d19e1161017a5780632f745c59116101495780632f745c59146103b957806342842e0e146103d95780634f6ccce7146103f957806355f804b31461041957600080fd5b80631b55d19e1461033957806323b872dd146103595780632dd5a938146103795780632e27e3a71461039957600080fd5b8063095ea7b3116101b6578063095ea7b31461029157806311865c43146102b157806318160ddd146102f75780631ac9afdb1461030c57600080fd5b806301ffc9a71461020257806306fdde0314610237578063081812fc1461025957600080fd5b366101fd57600a546001600160a01b031633146101fb576101fb6125e0565b005b600080fd5b34801561020e57600080fd5b5061022261021d36600461260c565b61067e565b60405190151581526020015b60405180910390f35b34801561024357600080fd5b5061024c6106a9565b60405161022e9190612679565b34801561026557600080fd5b5061027961027436600461268c565b61073b565b6040516001600160a01b03909116815260200161022e565b34801561029d57600080fd5b506101fb6102ac3660046126ba565b610762565b3480156102bd57600080fd5b506102e96102cc3660046126ba565b601660209081526000928352604080842090915290825290205481565b60405190815260200161022e565b34801561030357600080fd5b506008546102e9565b34801561031857600080fd5b506102e96103273660046126e6565b60146020526000908152604090205481565b34801561034557600080fd5b506102e961035436600461268c565b61087c565b34801561036557600080fd5b506101fb610374366004612703565b610a98565b34801561038557600080fd5b506102e9610394366004612744565b610ac9565b3480156103a557600080fd5b506101fb6103b436600461283c565b610bca565b3480156103c557600080fd5b506102e96103d43660046126ba565b610dfe565b3480156103e557600080fd5b506101fb6103f4366004612703565b610e94565b34801561040557600080fd5b506102e961041436600461268c565b610eaf565b34801561042557600080fd5b506101fb610434366004612956565b610f42565b34801561044557600080fd5b5061045961045436600461299f565b611021565b6040805193845260208401929092529082015260600161022e565b34801561048057600080fd5b5061027961048f36600461268c565b61110d565b3480156104a057600080fd5b506104b46104af3660046126e6565b61116d565b6040805192835260208301919091520161022e565b3480156104d557600080fd5b506102e96104e43660046126e6565b6113ad565b3480156104f557600080fd5b506102e96105043660046129cf565b611433565b34801561051557600080fd5b5061024c6114dc565b34801561052a57600080fd5b506101fb610539366004612a12565b6114eb565b34801561054a57600080fd5b506102e96105593660046126e6565b60176020526000908152604090205481565b34801561057757600080fd5b506101fb610586366004612a40565b6114f6565b34801561059757600080fd5b506102e96105a636600461268c565b60156020526000908152604090205481565b3480156105c457600080fd5b5061024c6105d336600461268c565b61152e565b3480156105e457600080fd5b506102e9600f5481565b3480156105fa57600080fd5b50601154600f54601054610459565b34801561061557600080fd5b506102e960115481565b34801561062b57600080fd5b5061022261063a366004612ac0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561067457600080fd5b506102e960105481565b60006001600160e01b0319821663780e9d6360e01b14806106a357506106a382611595565b92915050565b6060600080546106b890612aee565b80601f01602080910402602001604051908101604052809291908181526020018280546106e490612aee565b80156107315780601f1061070657610100808354040283529160200191610731565b820191906000526020600020905b81548152906001019060200180831161071457829003601f168201915b5050505050905090565b6000610746826115e5565b506000908152600460205260409020546001600160a01b031690565b600061076d8261110d565b9050806001600160a01b0316836001600160a01b0316036107df5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107fb57506107fb813361063a565b61086d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016107d6565b6108778383611647565b505050565b60006002601254036108a05760405162461bcd60e51b81526004016107d690612b28565b6002601255600e548211156108f75760405162461bcd60e51b815260206004820152601960248201527f446578666169494e46543a20496e6578697374656e745f49440000000000000060448201526064016107d6565b600f54600b54600c546040516370a0823160e01b81526001600160a01b0391821660048201526000939291909116906370a0823190602401602060405180830381865afa15801561094c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109709190612b5f565b61097a9190612b8e565b9050806000036109cc5760405162461bcd60e51b815260206004820152601e60248201527f446578666169494e46543a20494e535546494349454e545f414d4f554e54000060448201526064016107d6565b80600f60008282546109de9190612ba1565b9091555050601154600f546109f39190612ba1565b610a0582670de0b6b3a7640000612bb4565b610a0f9190612bcb565b915081601560008581526020019081526020016000206000828254610a349190612ba1565b925050819055508160106000828254610a4d9190612ba1565b9091555050604080518381526020810185905233917faadc628cb4fd3bb7a62795eb460290459458bdc6f387ffde727c740f42c18337910160405180910390a2506001601255919050565b610aa233826116b5565b610abe5760405162461bcd60e51b81526004016107d690612bed565b610877838383611734565b6000600260125403610aed5760405162461bcd60e51b81526004016107d690612b28565b6002601255600a54600090610b0c906001600160a01b031685856118a5565b600a54604051632e1a7d4d60e01b8152600481018690529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610b5357600080fd5b505af1158015610b67573d6000803e3d6000fd5b50505050610b7d610b778561110d565b84611afb565b60408051848152602081018390529081018590527ffd1a3a6d5498bdf58109d329c7c185fa6652cb8ae241a662e3772c559c8c86a69060600160405180910390a150506001601255919050565b600c60009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190612c3a565b6001600160a01b0316336001600160a01b031614610c995760405162461bcd60e51b81526020600482015260156024820152742232bc3330b4a4a7232a1d102727aa2fa7aba722a960591b60448201526064016107d6565b601354600e5410610cec5760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a205052454d494e54535f454e44454400000000000060448201526064016107d6565b8151815114610d3d5760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a20494e56414c49445f56414c55455300000000000060448201526064016107d6565b60005b8151811015610877576001600e6000828254610d5c9190612ba1565b92505081905550610d88838281518110610d7857610d78612c57565b6020026020010151600e54611bb8565b818181518110610d9a57610d9a612c57565b602002602001015160156000600e54815260200190815260200160002081905550818181518110610dcd57610dcd612c57565b602002602001015160106000828254610de69190612ba1565b90915550819050610df681612c6d565b915050610d40565b6000610e09836113ad565b8210610e6b5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107d6565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610877838383604051806020016040528060008152506114f6565b6000610eba60085490565b8210610f1d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107d6565b60088281548110610f3057610f30612c57565b90600052602060002001549050919050565b600c60009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb99190612c3a565b6001600160a01b0316336001600160a01b0316146110115760405162461bcd60e51b81526020600482015260156024820152742232bc3330b4a4a7232a1d102727aa2fa7aba722a960591b60448201526064016107d6565b600d61101d8282612cd4565b5050565b6000828152601560209081526040808320546001600160a01b038516808552601684528285208786529093528184205491516370a0823160e01b8152306004820152909284916370a0823190602401602060405180830381865afa15801561108d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b19190612b5f565b905060006110bf8385612b8e565b6001600160a01b03871660009081526017602052604081205460105492935090916110ea9190612b8e565b9050806110f78385612bb4565b6111019190612bcb565b95505050509250925092565b6000818152600260205260408120546001600160a01b0316806106a35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107d6565b6000806002601254036111925760405162461bcd60e51b81526004016107d690612b28565b6002601255601354600e5410156111eb5760405162461bcd60e51b815260206004820152601c60248201527f446578666169494e46543a205052454d494e54535f4f4e474f494e470000000060448201526064016107d6565b600f54600b54600c546040516370a0823160e01b81526001600160a01b0391821660048201526000939291909116906370a0823190602401602060405180830381865afa158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612b5f565b61126e9190612b8e565b9050806000036112c05760405162461bcd60e51b815260206004820152601e60248201527f446578666169494e46543a20494e535546494349454e545f414d4f554e54000060448201526064016107d6565b6001600e60008282546112d39190612ba1565b92505081905550600e54925080600f60008282546112f19190612ba1565b9091555050601154600f546113069190612ba1565b61131882670de0b6b3a7640000612bb4565b6113229190612bcb565b600084815260156020526040812082905560108054929450849290919061134a908490612ba1565b9091555061135a90508484611bb8565b60408051838152602081018590526001600160a01b0386169133917f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee910160405180910390a35060016012559092909150565b60006001600160a01b0382166114175760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107d6565b506001600160a01b031660009081526003602052604090205490565b60006002601254036114575760405162461bcd60e51b81526004016107d690612b28565b600260125560006114698585856118a5565b905061147e856114788661110d565b85611bd2565b604080516001600160a01b038716815260208101859052908101829052606081018590527fe611dbd9386c5163f399f1a4548786381fad79b3b33a9c512654c98e2446d85c9060800160405180910390a15050600160125592915050565b6060600180546106b890612aee565b61101d338383611d47565b61150033836116b5565b61151c5760405162461bcd60e51b81526004016107d690612bed565b61152884848484611e15565b50505050565b6060611539826115e5565b6000611543611e48565b90506000815111611563576040518060200160405280600081525061158e565b8061156d84611e57565b60405160200161157e929190612d94565b6040516020818303038152906040525b9392505050565b60006001600160e01b031982166380ac58cd60e01b14806115c657506001600160e01b03198216635b5e139f60e01b145b806106a357506301ffc9a760e01b6001600160e01b03198316146106a3565b6000818152600260205260409020546001600160a01b03166116445760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107d6565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061167c8261110d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806116c18361110d565b9050806001600160a01b0316846001600160a01b0316148061170857506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061172c5750836001600160a01b03166117218461073b565b6001600160a01b0316145b949350505050565b826001600160a01b03166117478261110d565b6001600160a01b03161461176d5760405162461bcd60e51b81526004016107d690612dc3565b6001600160a01b0382166117cf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107d6565b6117dc8383836001611eea565b826001600160a01b03166117ef8261110d565b6001600160a01b0316146118155760405162461bcd60e51b81526004016107d690612dc3565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000336118b18461110d565b6001600160a01b0316146119075760405162461bcd60e51b815260206004820152601a60248201527f446578666169494e46543a204e4f545f494e46545f4f574e455200000000000060448201526064016107d6565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561194e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119729190612b5f565b6001600160a01b0386166000908152601660209081526040808320888452825280832054601590925282205492935090916119ad9190612b8e565b6001600160a01b03871660009081526017602052604081205460105492935090916119d89190612b8e565b90506000816119e78486612bb4565b6119f19190612bcb565b905080861115611a435760405162461bcd60e51b815260206004820181905260248201527f446578666169494e46543a20414d4f554e545f455843454544535f534841524560448201526064016107d6565b80611a4e8785612bb4565b611a589190612bcb565b6001600160a01b03891660009081526016602090815260408083208b8452909152812080549297508792909190611a90908490612ba1565b90915550506001600160a01b03881660009081526017602052604081208054879290611abd908490612ba1565b90915550506001600160a01b03881660009081526014602052604081208054889290611aea908490612ba1565b909155509498975050505050505050565b604080516000808252602082019092526001600160a01b038416908390604051611b259190612e08565b60006040518083038185875af1925050503d8060008114611b62576040519150601f19603f3d011682016040523d82523d6000602084013e611b67565b606091505b50509050806108775760405162461bcd60e51b815260206004820152601f60248201527f446578666169494e46543a204554485f5452414e534645525f4641494c45440060448201526064016107d6565b61101d828260405180602001604052806000815250612023565b6000836001600160a01b03163b11611c2c5760405162461bcd60e51b815260206004820152601b60248201527f446578666169494e46543a205452414e534645525f4641494c4544000000000060448201526064016107d6565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611c889190612e08565b6000604051808303816000865af19150503d8060008114611cc5576040519150601f19603f3d011682016040523d82523d6000602084013e611cca565b606091505b5091509150818015611cf4575080511580611cf4575080806020019051810190611cf49190612e24565b611d405760405162461bcd60e51b815260206004820152601b60248201527f446578666169494e46543a205452414e534645525f4641494c4544000000000060448201526064016107d6565b5050505050565b816001600160a01b0316836001600160a01b031603611da85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107d6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611e20848484611734565b611e2c84848484612056565b6115285760405162461bcd60e51b81526004016107d690612e41565b6060600d80546106b890612aee565b60606000611e6483612157565b600101905060008167ffffffffffffffff811115611e8457611e84612766565b6040519080825280601f01601f191660200182016040528015611eae576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611eb857509392505050565b611ef68484848461222f565b6001811115611f655760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b60648201526084016107d6565b816001600160a01b038516611fc157611fbc81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611fe4565b836001600160a01b0316856001600160a01b031614611fe457611fe485826122b7565b6001600160a01b03841661200057611ffb81612354565b611d40565b846001600160a01b0316846001600160a01b031614611d4057611d408482612403565b61202d8383612447565b61203a6000848484612056565b6108775760405162461bcd60e51b81526004016107d690612e41565b60006001600160a01b0384163b1561214c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061209a903390899088908890600401612e93565b6020604051808303816000875af19250505080156120d5575060408051601f3d908101601f191682019092526120d291810190612ed0565b60015b612132573d808015612103576040519150601f19603f3d011682016040523d82523d6000602084013e612108565b606091505b50805160000361212a5760405162461bcd60e51b81526004016107d690612e41565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061172c565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106121965772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106121c2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106121e057662386f26fc10000830492506010015b6305f5e10083106121f8576305f5e100830492506008015b612710831061220c57612710830492506004015b6064831061221e576064830492506002015b600a83106106a35760010192915050565b6001811115611528576001600160a01b03841615612275576001600160a01b0384166000908152600360205260408120805483929061226f908490612b8e565b90915550505b6001600160a01b03831615611528576001600160a01b038316600090815260036020526040812080548392906122ac908490612ba1565b909155505050505050565b600060016122c4846113ad565b6122ce9190612b8e565b600083815260076020526040902054909150808214612321576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061236690600190612b8e565b6000838152600960205260408120546008805493945090928490811061238e5761238e612c57565b9060005260206000200154905080600883815481106123af576123af612c57565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806123e7576123e7612eed565b6001900381819060005260206000200160009055905550505050565b600061240e836113ad565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661249d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107d6565b6000818152600260205260409020546001600160a01b0316156125025760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107d6565b612510600083836001611eea565b6000818152600260205260409020546001600160a01b0316156125755760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107d6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b634e487b7160e01b600052600160045260246000fd5b6001600160e01b03198116811461164457600080fd5b60006020828403121561261e57600080fd5b813561158e816125f6565b60005b8381101561264457818101518382015260200161262c565b50506000910152565b60008151808452612665816020860160208601612629565b601f01601f19169290920160200192915050565b60208152600061158e602083018461264d565b60006020828403121561269e57600080fd5b5035919050565b6001600160a01b038116811461164457600080fd5b600080604083850312156126cd57600080fd5b82356126d8816126a5565b946020939093013593505050565b6000602082840312156126f857600080fd5b813561158e816126a5565b60008060006060848603121561271857600080fd5b8335612723816126a5565b92506020840135612733816126a5565b929592945050506040919091013590565b6000806040838503121561275757600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156127a5576127a5612766565b604052919050565b600067ffffffffffffffff8211156127c7576127c7612766565b5060051b60200190565b600082601f8301126127e257600080fd5b813560206127f76127f2836127ad565b61277c565b82815260059290921b8401810191818101908684111561281657600080fd5b8286015b84811015612831578035835291830191830161281a565b509695505050505050565b6000806040838503121561284f57600080fd5b823567ffffffffffffffff8082111561286757600080fd5b818501915085601f83011261287b57600080fd5b8135602061288b6127f2836127ad565b82815260059290921b840181019181810190898411156128aa57600080fd5b948201945b838610156128d15785356128c2816126a5565b825294820194908201906128af565b965050860135925050808211156128e757600080fd5b506128f4858286016127d1565b9150509250929050565b600067ffffffffffffffff83111561291857612918612766565b61292b601f8401601f191660200161277c565b905082815283838301111561293f57600080fd5b828260208301376000602084830101529392505050565b60006020828403121561296857600080fd5b813567ffffffffffffffff81111561297f57600080fd5b8201601f8101841361299057600080fd5b61172c848235602084016128fe565b600080604083850312156129b257600080fd5b8235915060208301356129c4816126a5565b809150509250929050565b6000806000606084860312156129e457600080fd5b83356129ef816126a5565b95602085013595506040909401359392505050565b801515811461164457600080fd5b60008060408385031215612a2557600080fd5b8235612a30816126a5565b915060208301356129c481612a04565b60008060008060808587031215612a5657600080fd5b8435612a61816126a5565b93506020850135612a71816126a5565b925060408501359150606085013567ffffffffffffffff811115612a9457600080fd5b8501601f81018713612aa557600080fd5b612ab4878235602084016128fe565b91505092959194509250565b60008060408385031215612ad357600080fd5b8235612ade816126a5565b915060208301356129c4816126a5565b600181811c90821680612b0257607f821691505b602082108103612b2257634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601a908201527f446578666169494e46543a205245454e5452414e545f43414c4c000000000000604082015260600190565b600060208284031215612b7157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106a3576106a3612b78565b808201808211156106a3576106a3612b78565b80820281158282048414176106a3576106a3612b78565b600082612be857634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b600060208284031215612c4c57600080fd5b815161158e816126a5565b634e487b7160e01b600052603260045260246000fd5b600060018201612c7f57612c7f612b78565b5060010190565b601f82111561087757600081815260208120601f850160051c81016020861015612cad5750805b601f850160051c820191505b81811015612ccc57828155600101612cb9565b505050505050565b815167ffffffffffffffff811115612cee57612cee612766565b612d0281612cfc8454612aee565b84612c86565b602080601f831160018114612d375760008415612d1f5750858301515b600019600386901b1c1916600185901b178555612ccc565b600085815260208120601f198616915b82811015612d6657888601518255948401946001909101908401612d47565b5085821015612d845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351612da6818460208801612629565b835190830190612dba818360208801612629565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60008251612e1a818460208701612629565b9190910192915050565b600060208284031215612e3657600080fd5b815161158e81612a04565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec69083018461264d565b9695505050505050565b600060208284031215612ee257600080fd5b815161158e816125f6565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220e30ace093128599aea4faf025a32332c19193d017c8e418bd34933e06371f88764736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ee9c77cc985dcc4fd81e7804ce4c2f380430c333000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004aa41bc1649c9c3177ed16caaa11482295fc744100000000000000000000000000000000000000000031a17e847807b1bc0000000000000000000000000000000000000000000000000000000000000000000194

-----Decoded View---------------
Arg [0] : _dexfaiFactory (address): 0xEe9c77Cc985dcC4fd81e7804ce4C2f380430C333
Arg [1] : _WETH (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _underlyingToken (address): 0x4aa41bC1649C9C3177eD16CaaA11482295fC7441
Arg [3] : _initialReserve (uint256): 60000000000000000000000000
Arg [4] : _expectedMints (uint256): 404

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000ee9c77cc985dcc4fd81e7804ce4c2f380430c333
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000004aa41bc1649c9c3177ed16caaa11482295fc7441
Arg [3] : 00000000000000000000000000000000000000000031a17e847807b1bc000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000194


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.