ETH Price: $2,470.96 (+7.22%)

Contract

0xb41169Cc124298Be20e2Ca956cC46E266ab5E203
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
New Sale146303892022-04-21 20:17:22881 days ago1650572242IN
0xb41169Cc...66ab5E203
0 ETH0.0162079662.55799111
Buy145931272022-04-16 0:20:17887 days ago1650068417IN
0xb41169Cc...66ab5E203
0 ETH0.0029957532.99613236
Buy145931012022-04-16 0:13:54887 days ago1650068034IN
0xb41169Cc...66ab5E203
0 ETH0.0035566440.1985712
Buy145930942022-04-16 0:11:00887 days ago1650067860IN
0xb41169Cc...66ab5E203
0.00032872 ETH0.003429727.95722818
New Sale145930722022-04-16 0:06:07887 days ago1650067567IN
0xb41169Cc...66ab5E203
0 ETH0.0069392629.01771632
Buy145930512022-04-16 0:01:25887 days ago1650067285IN
0xb41169Cc...66ab5E203
0.00021367 ETH0.0033146934.94339641
Set Start145930482022-04-15 23:59:59887 days ago1650067199IN
0xb41169Cc...66ab5E203
0 ETH0.0008570225.66104443
Set Merkle Root145930382022-04-15 23:57:44887 days ago1650067064IN
0xb41169Cc...66ab5E203
0 ETH0.0015834227.43521662
Set Start145930212022-04-15 23:54:15887 days ago1650066855IN
0xb41169Cc...66ab5E203
0 ETH0.0012595424.94248831
Buy145921832022-04-15 20:44:13887 days ago1650055453IN
0xb41169Cc...66ab5E203
0.0000033 ETH0.0071727464.06585293
Buy145920422022-04-15 20:13:24887 days ago1650053604IN
0xb41169Cc...66ab5E203
0.0002 ETH0.01155486118.67091835
Buy145920392022-04-15 20:11:39887 days ago1650053499IN
0xb41169Cc...66ab5E203
0.0003 ETH0.0103900296.13542346
Buy145920342022-04-15 20:10:22887 days ago1650053422IN
0xb41169Cc...66ab5E203
0.0001 ETH0.0101486677.1357046
Buy145919392022-04-15 19:50:16887 days ago1650052216IN
0xb41169Cc...66ab5E203
0 ETH0.0096471875.23928704
Set Merkle Root145918962022-04-15 19:41:23887 days ago1650051683IN
0xb41169Cc...66ab5E203
0 ETH0.0031033676.40934451
Set Start145918662022-04-15 19:34:06887 days ago1650051246IN
0xb41169Cc...66ab5E203
0 ETH0.0022435267.17557603
New Sale145916492022-04-15 18:42:44887 days ago1650048164IN
0xb41169Cc...66ab5E203
0 ETH0.0083226132.13139778
Buy145797612022-04-13 22:11:09889 days ago1649887869IN
0xb41169Cc...66ab5E203
0.0001 ETH0.0074284753.14517276
New Sale145458602022-04-08 15:05:33895 days ago1649430333IN
0xb41169Cc...66ab5E203
0 ETH0.0114509248.45620213
0x60c06040145411952022-04-07 21:27:48895 days ago1649366868IN
 Create: SaleManager
0 ETH0.1061557539.07897014

Latest 8 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
145931012022-04-16 0:13:54887 days ago1650068034
0xb41169Cc...66ab5E203
0 ETH
145930942022-04-16 0:11:00887 days ago1650067860
0xb41169Cc...66ab5E203
0.00032872 ETH
145930512022-04-16 0:01:25887 days ago1650067285
0xb41169Cc...66ab5E203
0.00021367 ETH
145921832022-04-15 20:44:13887 days ago1650055453
0xb41169Cc...66ab5E203
0.0000033 ETH
145920422022-04-15 20:13:24887 days ago1650053604
0xb41169Cc...66ab5E203
0.0002 ETH
145920392022-04-15 20:11:39887 days ago1650053499
0xb41169Cc...66ab5E203
0.0003 ETH
145920342022-04-15 20:10:22887 days ago1650053422
0xb41169Cc...66ab5E203
0.0001 ETH
145797612022-04-13 22:11:09889 days ago1649887869
0xb41169Cc...66ab5E203
0.0001 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaleManager

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : SaleManager.sol
pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";


contract SaleManager is ReentrancyGuard {
  using SafeERC20 for IERC20;

  AggregatorV3Interface priceOracle;
  IERC20 public immutable paymentToken;
  uint8 public immutable paymentTokenDecimals;

  struct Sale {
    address payable seller; // the address that will receive sale proceeds
    bytes32 merkleRoot; // the merkle root used for proving access
    address claimManager; // address where purchased tokens can be claimed (optional)
    uint256 saleBuyLimit;  // max tokens that can be spent in total
    uint256 userBuyLimit;  // max tokens that can be spent per user
    uint startTime; // the time at which the sale starts
    uint endTime; // the time at which the sale will end, regardless of tokens raised
    string name; // the name of the asset being sold, e.g. "New Crypto Token"
    string symbol; // the symbol of the asset being sold, e.g. "NCT"
    uint256 price; // the price of the asset (eg if 1.0 NCT == $1.23 of USDC: 1230000)
    uint8 decimals; // the number of decimals in the asset being sold, e.g. 18
    uint256 totalSpent; // total purchases denominated in payment token
    mapping(address => uint256) spent;
  }

  mapping (bytes32 => Sale) public sales;

  // global metrics
  uint256 public saleCount = 0;
  uint256 public totalSpent = 0;

  event NewSale(
    bytes32 indexed saleId,
    bytes32 indexed merkleRoot,
    address indexed seller,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint startTime,
    uint endTime,
    string name,
    string symbol,
    uint256 price,
    uint8 decimals
  );

  event UpdateStart(bytes32 indexed saleId, uint startTime);
  event UpdateEnd(bytes32 indexed saleId, uint endTime);
  event UpdateMerkleRoot(bytes32 indexed saleId, bytes32 merkleRoot);
  event Buy(bytes32 indexed saleId, address indexed buyer, uint256 value, bool native, bytes32[] proof);
  event RegisterClaimManager(bytes32 indexed saleId, address indexed claimManager);

  constructor(
    address _paymentToken,
    uint8 _paymentTokenDecimals,
    address _priceOracle
  ) {
    paymentToken = IERC20(_paymentToken);
    paymentTokenDecimals = _paymentTokenDecimals;
    priceOracle = AggregatorV3Interface(_priceOracle);
  }

  modifier validSale (bytes32 saleId) {
    require(
      sales[saleId].seller != address(0),
      "invalid sale id"
    );
    _;
  }

  modifier isSeller(bytes32 saleId) {
    require(
      sales[saleId].seller == msg.sender,
      "must be seller"
    );
    _;
  }

  modifier canAccessSale(bytes32 saleId, bytes32[] calldata proof) {
    // If the merkle root is non-zero this is a private sale and requires a valid proof
    if (sales[saleId].merkleRoot != bytes32(0)) {
      require(
        this._isAllowed(
          sales[saleId].merkleRoot,
          msg.sender,
          proof
        ) == true,
        "invalid access proof for this private sale"
      );
    }
    _;
  }

  modifier requireOpen(bytes32 saleId) {
    require(block.timestamp > sales[saleId].startTime, "sale not started yet");
    require(block.timestamp < sales[saleId].endTime, "sale ended");
    require(sales[saleId].totalSpent < sales[saleId].saleBuyLimit, "sale over");
    _;
  }

  // Get current price from chainlink oracle
  function getLatestPrice() public view returns (uint) {
    (
        uint80 roundID,
        int price,
        uint startedAt,
        uint timeStamp,
        uint80 answeredInRound
    ) = priceOracle.latestRoundData();

    require(price > 0, "negative price");
    return uint(price);
  }

  // Accessor functions
  function getSeller(bytes32 saleId) public validSale(saleId) view returns(address) {
    return(sales[saleId].seller);
  }

  function getMerkleRoot(bytes32 saleId) public validSale(saleId) view returns(bytes32) {
    return(sales[saleId].merkleRoot);
  }

  function getPriceOracle() public view returns (address) {
    return address(priceOracle);
  }

  function getClaimManager(bytes32 saleId) public validSale(saleId) view returns(address) {
    return (sales[saleId].claimManager);
  }


  function getSaleBuyLimit(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return(sales[saleId].saleBuyLimit);
  }

  function getUserBuyLimit(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return(sales[saleId].userBuyLimit);
  }

  function getStartTime(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].startTime);
  }

  function getEndTime(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].endTime);
  }

  function getName(bytes32 saleId) public validSale(saleId) view returns(string memory) {
    return(sales[saleId].name);
  }

  function getSymbol(bytes32 saleId) public validSale(saleId) view returns(string memory) {
    return(sales[saleId].symbol);
  }

  function getPrice(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].price);
  }

  function getDecimals(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return (sales[saleId].decimals);
  }

  function getTotalSpent(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return (sales[saleId].totalSpent);
  }

  function spentToBought(bytes32 saleId, uint256 spent) public view returns (uint256) {
    // Convert tokens spent (e.g. 10,000,000 USDC = $10) to tokens bought (e.g. 8.13e18) at a price of $1.23/NCT
    // convert an integer value of tokens spent to an integer value of tokens bought
    return (spent * 10 ** sales[saleId].decimals ) / (sales[saleId].price);
  }

  function nativeToPaymentToken(uint256 nativeValue) public view returns (uint256) {
    // convert a payment in the native token (eg ETH) to an integer value of the payment token
    return (nativeValue * getLatestPrice() * 10 ** paymentTokenDecimals) / (10 ** (priceOracle.decimals() + 18));
  }

  function getSpent(
      bytes32 saleId,
      address userAddress
    ) public validSale(saleId) view returns(uint256) {
    // returns the amount spent by this user in paymentToken
    return(sales[saleId].spent[userAddress]);
  }

  function getBought(
      bytes32 saleId,
      address userAddress
    ) public validSale(saleId) view returns(uint256) {
    // returns the amount bought by this user in the new token being sold
    return(spentToBought(saleId, sales[saleId].spent[userAddress]));
  }

  function isOpen(bytes32 saleId) public validSale(saleId) view returns(bool) {
    // is the sale currently open?
    return(
      block.timestamp > sales[saleId].startTime
      && block.timestamp < sales[saleId].endTime
      && sales[saleId].totalSpent < sales[saleId].saleBuyLimit
    );
  }

  function isOver(bytes32 saleId) public validSale(saleId) view returns(bool) {
    // is the sale permanently over?
    return(
      block.timestamp > sales[saleId].endTime || sales[saleId].totalSpent >= sales[saleId].saleBuyLimit
    );
  }

  /**
  sale setup and config
  - the address calling this method is the seller: all payments are sent to this address
  - only the seller can change the sale start and end time
  */
  function newSale(
    bytes32 merkleRoot,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint startTime,
    uint endTime,
    string calldata name,
    string calldata symbol,
    uint256 price,
    uint8 decimals
  ) public returns(bytes32) {
    require(startTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(endTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(endTime > block.timestamp, "sale must end in future");

    // Generate a reorg-resistant sale ID
    bytes32 saleId = keccak256(abi.encodePacked(
      merkleRoot,
      msg.sender,
      saleBuyLimit,
      userBuyLimit,
      startTime,
      endTime,
      name,
      symbol,
      price,
      decimals
    ));

    // This ensures the Sale struct wasn't already created (msg.sender will never be the zero address)
    require(sales[saleId].seller == address(0), "a sale with these parameters already exists");

    Sale storage s = sales[saleId];

    s.merkleRoot = merkleRoot;
    s.seller = payable(msg.sender);
    s.saleBuyLimit = saleBuyLimit;
    s.userBuyLimit = userBuyLimit;
    s.startTime = startTime;
    s.endTime = endTime;
    s.name = name;
    s.symbol = symbol;
    s.price = price;
    s.decimals = decimals;

    saleCount++;

    emit NewSale(saleId,
      s.merkleRoot,
      s.seller,
      s.saleBuyLimit,
      s.userBuyLimit,
      s.startTime,
      s.endTime,
      s.name,
      s.symbol,
      s.price,
      s.decimals
    );

    return saleId;
  }

  function setStart(bytes32 saleId, uint startTime) public validSale(saleId) isSeller(saleId) {
    // seller can update start time until the sale starts
    require(block.timestamp < sales[saleId].endTime, "disabled after sale closes");
    require(startTime < sales[saleId].endTime, "sale start must precede end");
    sales[saleId].startTime = startTime;
    emit UpdateStart(saleId, startTime);
  }

  function setEnd(bytes32 saleId, uint endTime) public validSale(saleId) isSeller(saleId){
    // seller can update end time until the sale ends
    require(block.timestamp < sales[saleId].endTime, "disabled after sale closes");
    sales[saleId].endTime = endTime;
    emit UpdateEnd(saleId, endTime);
  }

  function setMerkleRoot(bytes32 saleId, bytes32 merkleRoot) public validSale(saleId) isSeller(saleId){
    require(!isOpen(saleId) && !isOver(saleId), "cannot set merkle root once sale opens");
    sales[saleId].merkleRoot = merkleRoot;
    emit UpdateMerkleRoot(saleId, merkleRoot);
  }

  function _isAllowed(
      bytes32 root,
      address account,
      bytes32[] calldata proof
  ) external pure returns (bool) {
    // check if the account is in the merkle tree
    bytes32 leaf = keccak256(abi.encodePacked(account));
    if (MerkleProof.verify(proof, root, leaf)) {
      return true;
    }

    return false;
  }

  // pay with the payment token (eg USDC)
  function buy(
    bytes32 saleId,
    uint256 tokenQuantity,
    bytes32[] calldata proof
  ) public validSale(saleId) requireOpen(saleId) canAccessSale(saleId, proof) nonReentrant {
    // make sure the purchase would not break any sale limits
    require(
      tokenQuantity + sales[saleId].spent[msg.sender] <= sales[saleId].userBuyLimit,
      "purchase exceeds your limit"
    );

    require(
      tokenQuantity + sales[saleId].totalSpent <= sales[saleId].saleBuyLimit,
      "purchase exceeds sale limit"
    );

    require(paymentToken.allowance(msg.sender, address(this)) >= tokenQuantity, "allowance too low");

    // move the funds
    paymentToken.safeTransferFrom(msg.sender, sales[saleId].seller, tokenQuantity);

    // effects after interaction: we need a reentrancy guard
    sales[saleId].spent[msg.sender] += tokenQuantity;
    sales[saleId].totalSpent += tokenQuantity;
    totalSpent += tokenQuantity;

    emit Buy(saleId, msg.sender, tokenQuantity, false, proof);
  }

  // pay with the native token
  function buy(
    bytes32 saleId,
    bytes32[] calldata proof
  ) public payable validSale(saleId) requireOpen(saleId) canAccessSale(saleId, proof) nonReentrant {
    // convert to the equivalent payment token value from wei
    uint256 tokenQuantity = nativeToPaymentToken(msg.value);

    // make sure the purchase would not break any sale limits
    require(
      tokenQuantity + sales[saleId].spent[msg.sender] <= sales[saleId].userBuyLimit,
      "purchase exceeds your limit"
    );

    require(
      tokenQuantity + sales[saleId].totalSpent <= sales[saleId].saleBuyLimit,
      "purchase exceeds sale limit"
    );

    // forward the eth to the seller
    sales[saleId].seller.transfer(msg.value);

    // account for the purchase in equivalent payment token value
    sales[saleId].spent[msg.sender] += tokenQuantity;
    sales[saleId].totalSpent += tokenQuantity;
    totalSpent += tokenQuantity;

    // flag this payment as using the native token
    emit Buy(saleId, msg.sender, tokenQuantity, true, proof);
  }

  // Tell users where they can claim tokens
  function registerClaimManager(bytes32 saleId, address claimManager) public validSale(saleId) isSeller(saleId) {
    sales[saleId].claimManager = claimManager;
    emit RegisterClaimManager(saleId, claimManager);
  }

  // Make it public LOL
  function recoverERC20(address tokenAddress, uint256 tokenAmount) public {
    IERC20(tokenAddress).transfer(msg.sender, tokenAmount);
  }
}

File 2 of 7 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

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

  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 3 of 7 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 6 of 7 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 7 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint8","name":"_paymentTokenDecimals","type":"uint8"},{"internalType":"address","name":"_priceOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bool","name":"native","type":"bool"},{"indexed":false,"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"saleBuyLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userBuyLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"NewSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"claimManager","type":"address"}],"name":"RegisterClaimManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"UpdateEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"UpdateMerkleRoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"saleId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"UpdateStart","type":"event"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"_isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"uint256","name":"tokenQuantity","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"address","name":"userAddress","type":"address"}],"name":"getBought","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getClaimManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getSaleBuyLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getSeller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"address","name":"userAddress","type":"address"}],"name":"getSpent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getSymbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getTotalSpent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"getUserBuyLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"isOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"}],"name":"isOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nativeValue","type":"uint256"}],"name":"nativeToPaymentToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"saleBuyLimit","type":"uint256"},{"internalType":"uint256","name":"userBuyLimit","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"newSale","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentTokenDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"address","name":"claimManager","type":"address"}],"name":"registerClaimManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"sales","outputs":[{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"address","name":"claimManager","type":"address"},{"internalType":"uint256","name":"saleBuyLimit","type":"uint256"},{"internalType":"uint256","name":"userBuyLimit","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"totalSpent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"setEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"setStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"saleId","type":"bytes32"},{"internalType":"uint256","name":"spent","type":"uint256"}],"name":"spentToBought","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSpent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c0604052600060035560006004553480156200001b57600080fd5b506040516200308c3803806200308c8339810160408190526200003e91620000c0565b6001600081905560609390931b6001600160601b03191660805260f89190911b7fff000000000000000000000000000000000000000000000000000000000000001660a05281546001600160a01b0319166001600160a01b039091161790556200010f565b80516001600160a01b0381168114620000bb57600080fd5b919050565b600080600060608486031215620000d5578283fd5b620000e084620000a3565b9250602084015160ff81168114620000f6578283fd5b91506200010660408501620000a3565b90509250925092565b60805160601c60a05160f81c612f3c620001506000396000818161034901526114c60152600081816102f501528181611d220152611e030152612f3c6000f3fe6080604052600436106101f95760003560e01c80638e15f4731161010d578063bac4dd88116100a0578063eb28322e1161006f578063eb28322e14610618578063ef8148b214610638578063f1a085f814610658578063fb346eab14610678578063fca513a81461068e57600080fd5b8063bac4dd88146105a5578063bc8bf093146105c5578063c83b55f3146105d8578063dee5ab43146105f857600080fd5b8063a7206cd6116100dc578063a7206cd614610525578063ad9a686514610545578063b8211d9014610565578063b94c69aa1461058557600080fd5b80638e15f473146104ba578063939d6065146104cf578063976b2050146104ef578063a1e89aec1461050f57600080fd5b80634f8b50b0116101905780635f0fe4461161015f5780635f0fe4461461041a57806375edcbe01461043a5780637c35be7a1461045a5780637e44e5041461047a5780638980f11f1461049a57600080fd5b80634f8b50b01461037d57806350fa4ff2146103ad57806354b8d5e3146103cd5780635cfac837146103fa57600080fd5b806327e54230116101cc57806327e54230146102c15780633013ce29146102e357806331d98b3f14610317578063325cd7961461033757600080fd5b8063089ed435146101fe5780630c2afd721461023157806312105fea14610269578063231bedc714610289575b600080fd5b34801561020a57600080fd5b5061021e6102193660046126f6565b6106ac565b6040519081526020015b60405180910390f35b34801561023d57600080fd5b5061025161024c3660046126f6565b610706565b6040516102289c9b9a99989796959493929190612b0b565b34801561027557600080fd5b5061021e6102843660046126f6565b610888565b34801561029557600080fd5b506102a96102a43660046126f6565b6108d8565b6040516001600160a01b039091168152602001610228565b3480156102cd57600080fd5b506102e16102dc3660046127db565b61092f565b005b3480156102ef57600080fd5b506102a97f000000000000000000000000000000000000000000000000000000000000000081565b34801561032357600080fd5b5061021e6103323660046126f6565b610ab3565b34801561034357600080fd5b5061036b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610228565b34801561038957600080fd5b5061039d6103983660046126f6565b610b00565b6040519015158152602001610228565b3480156103b957600080fd5b506102e16103c83660046127db565b610b73565b3480156103d957600080fd5b506103ed6103e83660046126f6565b610c89565b6040516102289190612bc9565b34801561040657600080fd5b506103ed6104153660046126f6565b610d64565b34801561042657600080fd5b5061021e6104353660046127db565b610db9565b34801561044657600080fd5b506102e16104553660046127db565b610dfe565b34801561046657600080fd5b5061039d6104753660046126f6565b610f2b565b34801561048657600080fd5b506102a96104953660046126f6565b610fb7565b3480156104a657600080fd5b506102e16104b53660046126ad565b61100a565b3480156104c657600080fd5b5061021e61108f565b3480156104db57600080fd5b5061021e6104ea3660046126f6565b611173565b3480156104fb57600080fd5b5061021e61050a36600461270e565b6111c0565b34801561051b57600080fd5b5061021e60035481565b34801561053157600080fd5b5061021e6105403660046126f6565b61122f565b34801561055157600080fd5b5061039d610560366004612739565b61127c565b34801561057157600080fd5b5061021e6105803660046126f6565b611313565b34801561059157600080fd5b506102e16105a036600461270e565b611360565b3480156105b157600080fd5b5061021e6105c03660046126f6565b61142e565b6102e16105d3366004612791565b611512565b3480156105e457600080fd5b5061021e6105f336600461270e565b611967565b34801561060457600080fd5b506102e16106133660046127fc565b6119cb565b34801561062457600080fd5b5061021e6106333660046126f6565b611ed9565b34801561064457600080fd5b5061021e6106533660046126f6565b611f26565b34801561066457600080fd5b5061021e610673366004612835565b611f73565b34801561068457600080fd5b5061021e60045481565b34801561069a57600080fd5b506001546001600160a01b03166102a9565b60008181526002602052604081205482906001600160a01b03166106eb5760405162461bcd60e51b81526004016106e290612c4e565b60405180910390fd5b60008381526002602052604090206004015491505b50919050565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870180546001600160a01b0397881699989690971696949593949293919261075f90612e8e565b80601f016020809104026020016040519081016040528092919081815260200182805461078b90612e8e565b80156107d85780601f106107ad576101008083540402835291602001916107d8565b820191906000526020600020905b8154815290600101906020018083116107bb57829003601f168201915b5050505050908060080180546107ed90612e8e565b80601f016020809104026020016040519081016040528092919081815260200182805461081990612e8e565b80156108665780601f1061083b57610100808354040283529160200191610866565b820191906000526020600020905b81548152906001019060200180831161084957829003601f168201915b505050506009830154600a840154600b909401549293909260ff90911691508c565b60008181526002602052604081205482906001600160a01b03166108be5760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081205482906001600160a01b031661090e5760405162461bcd60e51b81526004016106e290612c4e565b5050600090815260026020819052604090912001546001600160a01b031690565b60008281526002602052604090205482906001600160a01b03166109655760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b0316331461099d5760405162461bcd60e51b81526004016106e290612c26565b60008481526002602052604090206006015442106109fd5760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016106e2565b6000848152600260205260409020600601548310610a5d5760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016106e2565b600084815260026020526040908190206005018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d01190610aa59086815260200190565b60405180910390a250505050565b60008181526002602052604081205482906001600160a01b0316610ae95760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206009015490565b60008181526002602052604081205482906001600160a01b0316610b365760405162461bcd60e51b81526004016106e290612c4e565b600083815260026020526040902060060154421180610b6c575060008381526002602052604090206003810154600b9091015410155b9392505050565b60008281526002602052604090205482906001600160a01b0316610ba95760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b03163314610be15760405162461bcd60e51b81526004016106e290612c26565b6000848152600260205260409020600601544210610c415760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016106e2565b600084815260026020526040908190206006018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a690610aa59086815260200190565b60008181526002602052604090205460609082906001600160a01b0316610cc25760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206007018054610cde90612e8e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0a90612e8e565b8015610d575780601f10610d2c57610100808354040283529160200191610d57565b820191906000526020600020905b815481529060010190602001808311610d3a57829003601f168201915b5050505050915050919050565b60008181526002602052604090205460609082906001600160a01b0316610d9d5760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206008018054610cde90612e8e565b60008281526002602052604081206009810154600a918201549091610de19160ff1690612d98565b610deb9084612e43565b610df59190612d35565b90505b92915050565b60008281526002602052604090205482906001600160a01b0316610e345760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b03163314610e6c5760405162461bcd60e51b81526004016106e290612c26565b610e7584610f2b565b158015610e885750610e8684610b00565b155b610ee35760405162461bcd60e51b815260206004820152602660248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c65604482015265206f70656e7360d01b60648201526084016106e2565b600084815260026020526040908190206001018490555184907f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a90610aa59086815260200190565b60008181526002602052604081205482906001600160a01b0316610f615760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206005015442118015610f91575060008381526002602052604090206006015442105b8015610b6c5750505060009081526002602052604090206003810154600b909101541090565b60008181526002602052604081205482906001600160a01b0316610fed5760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020546001600160a01b031690565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0383169063a9059cbb90604401602060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108a91906126d6565b505050565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061290c565b94509450945094509450600084136111695760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016106e2565b5091949350505050565b60008181526002602052604081205482906001600160a01b03166111a95760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206005015490565b60008281526002602052604081205483906001600160a01b03166111f65760405162461bcd60e51b81526004016106e290612c4e565b60008481526002602090815260408083206001600160a01b0387168452600c01909152902054611227908590610db9565b949350505050565b60008181526002602052604081205482906001600160a01b03166112655760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206001015490565b6040516bffffffffffffffffffffffff19606085901b16602082015260009081906034016040516020818303038152906040528051906020012090506112f88484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a92508591506122479050565b15611307576001915050611227565b50600095945050505050565b60008181526002602052604081205482906001600160a01b03166113495760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020600b015490565b60008281526002602052604090205482906001600160a01b03166113965760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b031633146113ce5760405162461bcd60e51b81526004016106e290612c26565b600084815260026020819052604080832090910180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561147357600080fd5b505afa158015611487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ab919061295b565b6114b6906012612d10565b6114c190600a612d98565b6114ec7f0000000000000000000000000000000000000000000000000000000000000000600a612d98565b6114f461108f565b6114fe9085612e43565b6115089190612e43565b610df89190612d35565b60008381526002602052604090205483906001600160a01b03166115485760405162461bcd60e51b81526004016106e290612c4e565b600084815260026020526040902060050154849042116115a15760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016106e2565b60008181526002602052604090206006015442106115ee5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016106e2565b60008181526002602052604090206003810154600b90910154106116405760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016106e2565b60008581526002602052604090206001015485908590859015611709576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a6865916116989190339087908790600401612b94565b60206040518083038186803b1580156116b057600080fd5b505afa1580156116c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e891906126d6565b15156001146117095760405162461bcd60e51b81526004016106e290612bdc565b6002600054141561175c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106e2565b6002600090815561176c3461142e565b60008a81526002602090815260408083206004810154338552600c909101909252909120549192509061179f9083612cf8565b11156117ed5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016106e2565b60008981526002602052604090206003810154600b909101546118109083612cf8565b111561185e5760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016106e2565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156118a3573d6000803e3d6000fd5b506000898152600260209081526040808320338452600c01909152812080548392906118d0908490612cf8565b90915550506000898152600260205260408120600b0180548392906118f6908490612cf8565b92505081905550806004600082825461190f9190612cf8565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061194f9085906001908e908e90612c77565b60405180910390a35050600160005550505050505050565b60008281526002602052604081205483906001600160a01b031661199d5760405162461bcd60e51b81526004016106e290612c4e565b505060009182526002602090815260408084206001600160a01b03939093168452600c909201905290205490565b60008481526002602052604090205484906001600160a01b0316611a015760405162461bcd60e51b81526004016106e290612c4e565b60008581526002602052604090206005015485904211611a5a5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016106e2565b6000818152600260205260409020600601544210611aa75760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016106e2565b60008181526002602052604090206003810154600b9091015410611af95760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016106e2565b60008681526002602052604090206001015486908590859015611bc2576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591611b519190339087908790600401612b94565b60206040518083038186803b158015611b6957600080fd5b505afa158015611b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba191906126d6565b1515600114611bc25760405162461bcd60e51b81526004016106e290612bdc565b60026000541415611c155760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106e2565b600260008181558a8152602091825260408082206004810154338452600c909101909352902054611c46908a612cf8565b1115611c945760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016106e2565b60008981526002602052604090206003810154600b90910154611cb7908a612cf8565b1115611d055760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016106e2565b604051636eb1769f60e11b815233600482015230602482015288907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611d6c57600080fd5b505afa158015611d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da491906128f4565b1015611de65760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016106e2565b600089815260026020526040902054611e2e906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116913391168b61225d565b6000898152600260209081526040808320338452600c01909152812080548a9290611e5a908490612cf8565b90915550506000898152600260205260408120600b0180548a9290611e80908490612cf8565b925050819055508760046000828254611e999190612cf8565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061194f908c906000908d908d90612c77565b60008181526002602052604081205482906001600160a01b0316611f0f5760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206006015490565b60008181526002602052604081205482906001600160a01b0316611f5c5760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206003015490565b600063f4865700891115611fc95760405162461bcd60e51b815260206004820152601c60248201527f6d61783a203431303234343438303020284a616e20312032313030290000000060448201526064016106e2565b63f486570088111561201d5760405162461bcd60e51b815260206004820152601c60248201527f6d61783a203431303234343438303020284a616e20312032313030290000000060448201526064016106e2565b42881161206c5760405162461bcd60e51b815260206004820152601760248201527f73616c65206d75737420656e6420696e2066757475726500000000000000000060448201526064016106e2565b60008c338d8d8d8d8d8d8d8d8d8d6040516020016120959c9b9a99989796959493929190612a75565b60408051601f198184030181529181528151602092830120600081815260029093529120549091506001600160a01b0316156121275760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016106e2565b6000818152600260205260409020600181018e905580546001600160a01b03191633178155600381018d9055600481018c9055600581018b9055600681018a9055612176600782018a8a612554565b50612185600882018888612554565b5060098101859055600a8101805460ff191660ff8616179055600380549060006121ae83612ec3565b90915550508054600182015460038301546004840154600585015460068601546009870154600a8801546040516001600160a01b03909816978a967fe70e6c9913a7090e71fb50ae7e4659534ab6971c423f0ba019ebf844081afcef9661222e96919590949193909260078d019260088e0192909160ff90911690612c99565b60405180910390a4509c9b505050505050505050505050565b60008261225485846122bd565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526122b7908590612377565b50505050565b600081815b845181101561236f5760008582815181106122ed57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161232f57604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061235c565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061236781612ec3565b9150506122c2565b509392505050565b60006123cc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124499092919063ffffffff16565b80519091501561108a57808060200190518101906123ea91906126d6565b61108a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e2565b6060611227848460008585843b6124a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e2565b600080866001600160a01b031685876040516124be9190612aef565b60006040518083038185875af1925050503d80600081146124fb576040519150601f19603f3d011682016040523d82523d6000602084013e612500565b606091505b509150915061251082828661251b565b979650505050505050565b6060831561252a575081610b6c565b82511561253a5782518084602001fd5b8160405162461bcd60e51b81526004016106e29190612bc9565b82805461256090612e8e565b90600052602060002090601f01602090048101928261258257600085556125c8565b82601f1061259b5782800160ff198235161785556125c8565b828001600101855582156125c8579182015b828111156125c85782358255916020019190600101906125ad565b506125d49291506125d8565b5090565b5b808211156125d457600081556001016125d9565b80356001600160a01b038116811461260457600080fd5b919050565b60008083601f84011261261a578182fd5b50813567ffffffffffffffff811115612631578182fd5b6020830191508360208260051b850101111561264c57600080fd5b9250929050565b60008083601f840112612664578182fd5b50813567ffffffffffffffff81111561267b578182fd5b60208301915083602082850101111561264c57600080fd5b805169ffffffffffffffffffff8116811461260457600080fd5b600080604083850312156126bf578182fd5b6126c8836125ed565b946020939093013593505050565b6000602082840312156126e7578081fd5b81518015158114610b6c578182fd5b600060208284031215612707578081fd5b5035919050565b60008060408385031215612720578182fd5b82359150612730602084016125ed565b90509250929050565b6000806000806060858703121561274e578182fd5b8435935061275e602086016125ed565b9250604085013567ffffffffffffffff811115612779578283fd5b61278587828801612609565b95989497509550505050565b6000806000604084860312156127a5578283fd5b83359250602084013567ffffffffffffffff8111156127c2578283fd5b6127ce86828701612609565b9497909650939450505050565b600080604083850312156127ed578182fd5b50508035926020909101359150565b60008060008060608587031215612811578384fd5b8435935060208501359250604085013567ffffffffffffffff811115612779578283fd5b60008060008060008060008060008060006101208c8e031215612856578687fd5b8b359a5060208c0135995060408c0135985060608c0135975060808c0135965067ffffffffffffffff8060a08e0135111561288f578687fd5b61289f8e60a08f01358f01612653565b909750955060c08d01358110156128b4578485fd5b506128c58d60c08e01358e01612653565b909450925060e08c013591506101008c01356128e081612ef4565b809150509295989b509295989b9093969950565b600060208284031215612905578081fd5b5051919050565b600080600080600060a08688031215612923578283fd5b61292c86612693565b945060208601519350604086015192506060860151915061294f60808701612693565b90509295509295909350565b60006020828403121561296c578081fd5b8151610b6c81612ef4565b81835260006001600160fb1b0383111561298f578081fd5b8260051b80836020870137939093016020019283525090919050565b600081518084526129c3816020860160208601612e62565b601f01601f19169290920160200192915050565b8054600090600181811c90808316806129f157607f831692505b6020808410821415612a1157634e487b7160e01b86526022600452602486fd5b83885260208801828015612a2c5760018114612a3d57612a68565b60ff19871682528282019750612a68565b60008981526020902060005b87811015612a6257815484820152908601908401612a49565b83019850505b5050505050505092915050565b8c81526bffffffffffffffffffffffff198c60601b1660208201528a6034820152896054820152886074820152876094820152858760b4830137600086820160b48101828152868882375060b49501948501939093525060f81b6001600160f81b03191660d48301525060d5019998505050505050505050565b60008251612b01818460208701612e62565b9190910192915050565b600060018060a01b03808f1683528d6020840152808d166040840152508a60608301528960808301528860a08301528760c083015261018060e0830152612b566101808301886129ab565b828103610100840152612b6981886129ab565b610120840196909652505060ff92909216610140830152610160909101529998505050505050505050565b8481526001600160a01b0384166020820152606060408201819052600090612bbf9083018486612977565b9695505050505050565b602081526000610df560208301846129ab565b6020808252602a908201527f696e76616c6964206163636573732070726f6f6620666f72207468697320707260408201526969766174652073616c6560b01b606082015260800190565b6020808252600e908201526d36bab9ba1031329039b2b63632b960911b604082015260600190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b8481528315156020820152606060408201526000612bbf606083018486612977565b60006101008a8352896020840152886040840152876060840152806080840152612cc5818401886129d7565b905082810360a0840152612cd981876129d7565b9150508360c083015260ff831660e08301529998505050505050505050565b60008219821115612d0b57612d0b612ede565b500190565b600060ff821660ff84168060ff03821115612d2d57612d2d612ede565b019392505050565b600082612d5057634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115612d90578160001904821115612d7657612d76612ede565b80851615612d8357918102915b93841c9390800290612d5a565b509250929050565b6000610df560ff841683600082612db157506001610df8565b81612dbe57506000610df8565b8160018114612dd45760028114612dde57612dfa565b6001915050610df8565b60ff841115612def57612def612ede565b50506001821b610df8565b5060208310610133831016604e8410600b8410161715612e1d575081810a610df8565b612e278383612d55565b8060001904821115612e3b57612e3b612ede565b029392505050565b6000816000190483118215151615612e5d57612e5d612ede565b500290565b60005b83811015612e7d578181015183820152602001612e65565b838111156122b75750506000910152565b600181811c90821680612ea257607f821691505b6020821081141561070057634e487b7160e01b600052602260045260246000fd5b6000600019821415612ed757612ed7612ede565b5060010190565b634e487b7160e01b600052601160045260246000fd5b60ff81168114612f0357600080fd5b5056fea2646970667358221220b883b14e9222551d2488a062fade977e7da59b30af0b93d3efd8e1e60761854864736f6c63430008040033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x6080604052600436106101f95760003560e01c80638e15f4731161010d578063bac4dd88116100a0578063eb28322e1161006f578063eb28322e14610618578063ef8148b214610638578063f1a085f814610658578063fb346eab14610678578063fca513a81461068e57600080fd5b8063bac4dd88146105a5578063bc8bf093146105c5578063c83b55f3146105d8578063dee5ab43146105f857600080fd5b8063a7206cd6116100dc578063a7206cd614610525578063ad9a686514610545578063b8211d9014610565578063b94c69aa1461058557600080fd5b80638e15f473146104ba578063939d6065146104cf578063976b2050146104ef578063a1e89aec1461050f57600080fd5b80634f8b50b0116101905780635f0fe4461161015f5780635f0fe4461461041a57806375edcbe01461043a5780637c35be7a1461045a5780637e44e5041461047a5780638980f11f1461049a57600080fd5b80634f8b50b01461037d57806350fa4ff2146103ad57806354b8d5e3146103cd5780635cfac837146103fa57600080fd5b806327e54230116101cc57806327e54230146102c15780633013ce29146102e357806331d98b3f14610317578063325cd7961461033757600080fd5b8063089ed435146101fe5780630c2afd721461023157806312105fea14610269578063231bedc714610289575b600080fd5b34801561020a57600080fd5b5061021e6102193660046126f6565b6106ac565b6040519081526020015b60405180910390f35b34801561023d57600080fd5b5061025161024c3660046126f6565b610706565b6040516102289c9b9a99989796959493929190612b0b565b34801561027557600080fd5b5061021e6102843660046126f6565b610888565b34801561029557600080fd5b506102a96102a43660046126f6565b6108d8565b6040516001600160a01b039091168152602001610228565b3480156102cd57600080fd5b506102e16102dc3660046127db565b61092f565b005b3480156102ef57600080fd5b506102a97f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561032357600080fd5b5061021e6103323660046126f6565b610ab3565b34801561034357600080fd5b5061036b7f000000000000000000000000000000000000000000000000000000000000000681565b60405160ff9091168152602001610228565b34801561038957600080fd5b5061039d6103983660046126f6565b610b00565b6040519015158152602001610228565b3480156103b957600080fd5b506102e16103c83660046127db565b610b73565b3480156103d957600080fd5b506103ed6103e83660046126f6565b610c89565b6040516102289190612bc9565b34801561040657600080fd5b506103ed6104153660046126f6565b610d64565b34801561042657600080fd5b5061021e6104353660046127db565b610db9565b34801561044657600080fd5b506102e16104553660046127db565b610dfe565b34801561046657600080fd5b5061039d6104753660046126f6565b610f2b565b34801561048657600080fd5b506102a96104953660046126f6565b610fb7565b3480156104a657600080fd5b506102e16104b53660046126ad565b61100a565b3480156104c657600080fd5b5061021e61108f565b3480156104db57600080fd5b5061021e6104ea3660046126f6565b611173565b3480156104fb57600080fd5b5061021e61050a36600461270e565b6111c0565b34801561051b57600080fd5b5061021e60035481565b34801561053157600080fd5b5061021e6105403660046126f6565b61122f565b34801561055157600080fd5b5061039d610560366004612739565b61127c565b34801561057157600080fd5b5061021e6105803660046126f6565b611313565b34801561059157600080fd5b506102e16105a036600461270e565b611360565b3480156105b157600080fd5b5061021e6105c03660046126f6565b61142e565b6102e16105d3366004612791565b611512565b3480156105e457600080fd5b5061021e6105f336600461270e565b611967565b34801561060457600080fd5b506102e16106133660046127fc565b6119cb565b34801561062457600080fd5b5061021e6106333660046126f6565b611ed9565b34801561064457600080fd5b5061021e6106533660046126f6565b611f26565b34801561066457600080fd5b5061021e610673366004612835565b611f73565b34801561068457600080fd5b5061021e60045481565b34801561069a57600080fd5b506001546001600160a01b03166102a9565b60008181526002602052604081205482906001600160a01b03166106eb5760405162461bcd60e51b81526004016106e290612c4e565b60405180910390fd5b60008381526002602052604090206004015491505b50919050565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870180546001600160a01b0397881699989690971696949593949293919261075f90612e8e565b80601f016020809104026020016040519081016040528092919081815260200182805461078b90612e8e565b80156107d85780601f106107ad576101008083540402835291602001916107d8565b820191906000526020600020905b8154815290600101906020018083116107bb57829003601f168201915b5050505050908060080180546107ed90612e8e565b80601f016020809104026020016040519081016040528092919081815260200182805461081990612e8e565b80156108665780601f1061083b57610100808354040283529160200191610866565b820191906000526020600020905b81548152906001019060200180831161084957829003601f168201915b505050506009830154600a840154600b909401549293909260ff90911691508c565b60008181526002602052604081205482906001600160a01b03166108be5760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081205482906001600160a01b031661090e5760405162461bcd60e51b81526004016106e290612c4e565b5050600090815260026020819052604090912001546001600160a01b031690565b60008281526002602052604090205482906001600160a01b03166109655760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b0316331461099d5760405162461bcd60e51b81526004016106e290612c26565b60008481526002602052604090206006015442106109fd5760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016106e2565b6000848152600260205260409020600601548310610a5d5760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016106e2565b600084815260026020526040908190206005018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d01190610aa59086815260200190565b60405180910390a250505050565b60008181526002602052604081205482906001600160a01b0316610ae95760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206009015490565b60008181526002602052604081205482906001600160a01b0316610b365760405162461bcd60e51b81526004016106e290612c4e565b600083815260026020526040902060060154421180610b6c575060008381526002602052604090206003810154600b9091015410155b9392505050565b60008281526002602052604090205482906001600160a01b0316610ba95760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b03163314610be15760405162461bcd60e51b81526004016106e290612c26565b6000848152600260205260409020600601544210610c415760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016106e2565b600084815260026020526040908190206006018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a690610aa59086815260200190565b60008181526002602052604090205460609082906001600160a01b0316610cc25760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206007018054610cde90612e8e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0a90612e8e565b8015610d575780601f10610d2c57610100808354040283529160200191610d57565b820191906000526020600020905b815481529060010190602001808311610d3a57829003601f168201915b5050505050915050919050565b60008181526002602052604090205460609082906001600160a01b0316610d9d5760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206008018054610cde90612e8e565b60008281526002602052604081206009810154600a918201549091610de19160ff1690612d98565b610deb9084612e43565b610df59190612d35565b90505b92915050565b60008281526002602052604090205482906001600160a01b0316610e345760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b03163314610e6c5760405162461bcd60e51b81526004016106e290612c26565b610e7584610f2b565b158015610e885750610e8684610b00565b155b610ee35760405162461bcd60e51b815260206004820152602660248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c65604482015265206f70656e7360d01b60648201526084016106e2565b600084815260026020526040908190206001018490555184907f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a90610aa59086815260200190565b60008181526002602052604081205482906001600160a01b0316610f615760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090206005015442118015610f91575060008381526002602052604090206006015442105b8015610b6c5750505060009081526002602052604090206003810154600b909101541090565b60008181526002602052604081205482906001600160a01b0316610fed5760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020546001600160a01b031690565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0383169063a9059cbb90604401602060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108a91906126d6565b505050565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061290c565b94509450945094509450600084136111695760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016106e2565b5091949350505050565b60008181526002602052604081205482906001600160a01b03166111a95760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206005015490565b60008281526002602052604081205483906001600160a01b03166111f65760405162461bcd60e51b81526004016106e290612c4e565b60008481526002602090815260408083206001600160a01b0387168452600c01909152902054611227908590610db9565b949350505050565b60008181526002602052604081205482906001600160a01b03166112655760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206001015490565b6040516bffffffffffffffffffffffff19606085901b16602082015260009081906034016040516020818303038152906040528051906020012090506112f88484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a92508591506122479050565b15611307576001915050611227565b50600095945050505050565b60008181526002602052604081205482906001600160a01b03166113495760405162461bcd60e51b81526004016106e290612c4e565b50506000908152600260205260409020600b015490565b60008281526002602052604090205482906001600160a01b03166113965760405162461bcd60e51b81526004016106e290612c4e565b60008381526002602052604090205483906001600160a01b031633146113ce5760405162461bcd60e51b81526004016106e290612c26565b600084815260026020819052604080832090910180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561147357600080fd5b505afa158015611487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ab919061295b565b6114b6906012612d10565b6114c190600a612d98565b6114ec7f0000000000000000000000000000000000000000000000000000000000000006600a612d98565b6114f461108f565b6114fe9085612e43565b6115089190612e43565b610df89190612d35565b60008381526002602052604090205483906001600160a01b03166115485760405162461bcd60e51b81526004016106e290612c4e565b600084815260026020526040902060050154849042116115a15760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016106e2565b60008181526002602052604090206006015442106115ee5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016106e2565b60008181526002602052604090206003810154600b90910154106116405760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016106e2565b60008581526002602052604090206001015485908590859015611709576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a6865916116989190339087908790600401612b94565b60206040518083038186803b1580156116b057600080fd5b505afa1580156116c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e891906126d6565b15156001146117095760405162461bcd60e51b81526004016106e290612bdc565b6002600054141561175c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106e2565b6002600090815561176c3461142e565b60008a81526002602090815260408083206004810154338552600c909101909252909120549192509061179f9083612cf8565b11156117ed5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016106e2565b60008981526002602052604090206003810154600b909101546118109083612cf8565b111561185e5760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016106e2565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156118a3573d6000803e3d6000fd5b506000898152600260209081526040808320338452600c01909152812080548392906118d0908490612cf8565b90915550506000898152600260205260408120600b0180548392906118f6908490612cf8565b92505081905550806004600082825461190f9190612cf8565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061194f9085906001908e908e90612c77565b60405180910390a35050600160005550505050505050565b60008281526002602052604081205483906001600160a01b031661199d5760405162461bcd60e51b81526004016106e290612c4e565b505060009182526002602090815260408084206001600160a01b03939093168452600c909201905290205490565b60008481526002602052604090205484906001600160a01b0316611a015760405162461bcd60e51b81526004016106e290612c4e565b60008581526002602052604090206005015485904211611a5a5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016106e2565b6000818152600260205260409020600601544210611aa75760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016106e2565b60008181526002602052604090206003810154600b9091015410611af95760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016106e2565b60008681526002602052604090206001015486908590859015611bc2576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591611b519190339087908790600401612b94565b60206040518083038186803b158015611b6957600080fd5b505afa158015611b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba191906126d6565b1515600114611bc25760405162461bcd60e51b81526004016106e290612bdc565b60026000541415611c155760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106e2565b600260008181558a8152602091825260408082206004810154338452600c909101909352902054611c46908a612cf8565b1115611c945760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016106e2565b60008981526002602052604090206003810154600b90910154611cb7908a612cf8565b1115611d055760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016106e2565b604051636eb1769f60e11b815233600482015230602482015288907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611d6c57600080fd5b505afa158015611d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da491906128f4565b1015611de65760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016106e2565b600089815260026020526040902054611e2e906001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488116913391168b61225d565b6000898152600260209081526040808320338452600c01909152812080548a9290611e5a908490612cf8565b90915550506000898152600260205260408120600b0180548a9290611e80908490612cf8565b925050819055508760046000828254611e999190612cf8565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061194f908c906000908d908d90612c77565b60008181526002602052604081205482906001600160a01b0316611f0f5760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206006015490565b60008181526002602052604081205482906001600160a01b0316611f5c5760405162461bcd60e51b81526004016106e290612c4e565b505060009081526002602052604090206003015490565b600063f4865700891115611fc95760405162461bcd60e51b815260206004820152601c60248201527f6d61783a203431303234343438303020284a616e20312032313030290000000060448201526064016106e2565b63f486570088111561201d5760405162461bcd60e51b815260206004820152601c60248201527f6d61783a203431303234343438303020284a616e20312032313030290000000060448201526064016106e2565b42881161206c5760405162461bcd60e51b815260206004820152601760248201527f73616c65206d75737420656e6420696e2066757475726500000000000000000060448201526064016106e2565b60008c338d8d8d8d8d8d8d8d8d8d6040516020016120959c9b9a99989796959493929190612a75565b60408051601f198184030181529181528151602092830120600081815260029093529120549091506001600160a01b0316156121275760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016106e2565b6000818152600260205260409020600181018e905580546001600160a01b03191633178155600381018d9055600481018c9055600581018b9055600681018a9055612176600782018a8a612554565b50612185600882018888612554565b5060098101859055600a8101805460ff191660ff8616179055600380549060006121ae83612ec3565b90915550508054600182015460038301546004840154600585015460068601546009870154600a8801546040516001600160a01b03909816978a967fe70e6c9913a7090e71fb50ae7e4659534ab6971c423f0ba019ebf844081afcef9661222e96919590949193909260078d019260088e0192909160ff90911690612c99565b60405180910390a4509c9b505050505050505050505050565b60008261225485846122bd565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526122b7908590612377565b50505050565b600081815b845181101561236f5760008582815181106122ed57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161232f57604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061235c565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061236781612ec3565b9150506122c2565b509392505050565b60006123cc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124499092919063ffffffff16565b80519091501561108a57808060200190518101906123ea91906126d6565b61108a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e2565b6060611227848460008585843b6124a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e2565b600080866001600160a01b031685876040516124be9190612aef565b60006040518083038185875af1925050503d80600081146124fb576040519150601f19603f3d011682016040523d82523d6000602084013e612500565b606091505b509150915061251082828661251b565b979650505050505050565b6060831561252a575081610b6c565b82511561253a5782518084602001fd5b8160405162461bcd60e51b81526004016106e29190612bc9565b82805461256090612e8e565b90600052602060002090601f01602090048101928261258257600085556125c8565b82601f1061259b5782800160ff198235161785556125c8565b828001600101855582156125c8579182015b828111156125c85782358255916020019190600101906125ad565b506125d49291506125d8565b5090565b5b808211156125d457600081556001016125d9565b80356001600160a01b038116811461260457600080fd5b919050565b60008083601f84011261261a578182fd5b50813567ffffffffffffffff811115612631578182fd5b6020830191508360208260051b850101111561264c57600080fd5b9250929050565b60008083601f840112612664578182fd5b50813567ffffffffffffffff81111561267b578182fd5b60208301915083602082850101111561264c57600080fd5b805169ffffffffffffffffffff8116811461260457600080fd5b600080604083850312156126bf578182fd5b6126c8836125ed565b946020939093013593505050565b6000602082840312156126e7578081fd5b81518015158114610b6c578182fd5b600060208284031215612707578081fd5b5035919050565b60008060408385031215612720578182fd5b82359150612730602084016125ed565b90509250929050565b6000806000806060858703121561274e578182fd5b8435935061275e602086016125ed565b9250604085013567ffffffffffffffff811115612779578283fd5b61278587828801612609565b95989497509550505050565b6000806000604084860312156127a5578283fd5b83359250602084013567ffffffffffffffff8111156127c2578283fd5b6127ce86828701612609565b9497909650939450505050565b600080604083850312156127ed578182fd5b50508035926020909101359150565b60008060008060608587031215612811578384fd5b8435935060208501359250604085013567ffffffffffffffff811115612779578283fd5b60008060008060008060008060008060006101208c8e031215612856578687fd5b8b359a5060208c0135995060408c0135985060608c0135975060808c0135965067ffffffffffffffff8060a08e0135111561288f578687fd5b61289f8e60a08f01358f01612653565b909750955060c08d01358110156128b4578485fd5b506128c58d60c08e01358e01612653565b909450925060e08c013591506101008c01356128e081612ef4565b809150509295989b509295989b9093969950565b600060208284031215612905578081fd5b5051919050565b600080600080600060a08688031215612923578283fd5b61292c86612693565b945060208601519350604086015192506060860151915061294f60808701612693565b90509295509295909350565b60006020828403121561296c578081fd5b8151610b6c81612ef4565b81835260006001600160fb1b0383111561298f578081fd5b8260051b80836020870137939093016020019283525090919050565b600081518084526129c3816020860160208601612e62565b601f01601f19169290920160200192915050565b8054600090600181811c90808316806129f157607f831692505b6020808410821415612a1157634e487b7160e01b86526022600452602486fd5b83885260208801828015612a2c5760018114612a3d57612a68565b60ff19871682528282019750612a68565b60008981526020902060005b87811015612a6257815484820152908601908401612a49565b83019850505b5050505050505092915050565b8c81526bffffffffffffffffffffffff198c60601b1660208201528a6034820152896054820152886074820152876094820152858760b4830137600086820160b48101828152868882375060b49501948501939093525060f81b6001600160f81b03191660d48301525060d5019998505050505050505050565b60008251612b01818460208701612e62565b9190910192915050565b600060018060a01b03808f1683528d6020840152808d166040840152508a60608301528960808301528860a08301528760c083015261018060e0830152612b566101808301886129ab565b828103610100840152612b6981886129ab565b610120840196909652505060ff92909216610140830152610160909101529998505050505050505050565b8481526001600160a01b0384166020820152606060408201819052600090612bbf9083018486612977565b9695505050505050565b602081526000610df560208301846129ab565b6020808252602a908201527f696e76616c6964206163636573732070726f6f6620666f72207468697320707260408201526969766174652073616c6560b01b606082015260800190565b6020808252600e908201526d36bab9ba1031329039b2b63632b960911b604082015260600190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b8481528315156020820152606060408201526000612bbf606083018486612977565b60006101008a8352896020840152886040840152876060840152806080840152612cc5818401886129d7565b905082810360a0840152612cd981876129d7565b9150508360c083015260ff831660e08301529998505050505050505050565b60008219821115612d0b57612d0b612ede565b500190565b600060ff821660ff84168060ff03821115612d2d57612d2d612ede565b019392505050565b600082612d5057634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115612d90578160001904821115612d7657612d76612ede565b80851615612d8357918102915b93841c9390800290612d5a565b509250929050565b6000610df560ff841683600082612db157506001610df8565b81612dbe57506000610df8565b8160018114612dd45760028114612dde57612dfa565b6001915050610df8565b60ff841115612def57612def612ede565b50506001821b610df8565b5060208310610133831016604e8410600b8410161715612e1d575081810a610df8565b612e278383612d55565b8060001904821115612e3b57612e3b612ede565b029392505050565b6000816000190483118215151615612e5d57612e5d612ede565b500290565b60005b83811015612e7d578181015183820152602001612e65565b838111156122b75750506000910152565b600181811c90821680612ea257607f821691505b6020821081141561070057634e487b7160e01b600052602260045260246000fd5b6000600019821415612ed757612ed7612ede565b5060010190565b634e487b7160e01b600052601160045260246000fd5b60ff81168114612f0357600080fd5b5056fea2646970667358221220b883b14e9222551d2488a062fade977e7da59b30af0b93d3efd8e1e60761854864736f6c63430008040033

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

000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : _paymentToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : _paymentTokenDecimals (uint8): 6
Arg [2] : _priceOracle (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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