ETH Price: $3,476.60 (+2.01%)
Gas: 8 Gwei

Contract

0xb6ecf70F4555627eC8Fc615b17A1ef624140793F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim202114942024-07-01 11:52:595 hrs ago1719834779IN
0xb6ecf70F...24140793F
0 ETH0.000441074.65404128
Claim202114922024-07-01 11:52:355 hrs ago1719834755IN
0xb6ecf70F...24140793F
0 ETH0.000441614.65975581
Claim202114902024-07-01 11:52:115 hrs ago1719834731IN
0xb6ecf70F...24140793F
0 ETH0.000416064.39020901
Claim202114342024-07-01 11:40:595 hrs ago1719834059IN
0xb6ecf70F...24140793F
0 ETH0.000388594.10080905
Claim202114272024-07-01 11:39:356 hrs ago1719833975IN
0xb6ecf70F...24140793F
0 ETH0.000461334.12420826
Claim202109962024-07-01 10:13:237 hrs ago1719828803IN
0xb6ecf70F...24140793F
0 ETH0.00025382.67805989
Claim202109952024-07-01 10:13:117 hrs ago1719828791IN
0xb6ecf70F...24140793F
0 ETH0.000261422.75848246
Claim202094562024-07-01 5:02:5912 hrs ago1719810179IN
0xb6ecf70F...24140793F
0 ETH0.000256052.70176086
Claim202094522024-07-01 5:02:1112 hrs ago1719810131IN
0xb6ecf70F...24140793F
0 ETH0.000294542.63288272
Claim202091842024-07-01 4:08:3513 hrs ago1719806915IN
0xb6ecf70F...24140793F
0 ETH0.000335953.54492659
Claim202091812024-07-01 4:07:5913 hrs ago1719806879IN
0xb6ecf70F...24140793F
0 ETH0.000358263.20246837
Claim202087192024-07-01 2:35:1115 hrs ago1719801311IN
0xb6ecf70F...24140793F
0 ETH0.000409784.32443439
Claim202087172024-07-01 2:34:4715 hrs ago1719801287IN
0xb6ecf70F...24140793F
0 ETH0.000486364.3479782
Claim202087132024-07-01 2:33:5915 hrs ago1719801239IN
0xb6ecf70F...24140793F
0 ETH0.000426494.50022134
Claim202080762024-07-01 0:25:3517 hrs ago1719793535IN
0xb6ecf70F...24140793F
0 ETH0.000260962.75397
Claim202080762024-07-01 0:25:3517 hrs ago1719793535IN
0xb6ecf70F...24140793F
0 ETH0.000308092.75397
Claim202078062024-06-30 23:31:3518 hrs ago1719790295IN
0xb6ecf70F...24140793F
0 ETH0.000288083.03976756
Claim202078052024-06-30 23:31:2318 hrs ago1719790283IN
0xb6ecf70F...24140793F
0 ETH0.000278942.9433648
Claim202075592024-06-30 22:41:4718 hrs ago1719787307IN
0xb6ecf70F...24140793F
0 ETH0.000616555.51182084
Claim202075312024-06-30 22:36:1119 hrs ago1719786971IN
0xb6ecf70F...24140793F
0 ETH0.000366743.87027801
Claim202075292024-06-30 22:35:4719 hrs ago1719786947IN
0xb6ecf70F...24140793F
0 ETH0.000441423.94626665
Claim202075052024-06-30 22:30:5919 hrs ago1719786659IN
0xb6ecf70F...24140793F
0 ETH0.000359993.79854013
Claim202074932024-06-30 22:28:3519 hrs ago1719786515IN
0xb6ecf70F...24140793F
0 ETH0.000378343.38191237
Claim202074172024-06-30 22:13:2319 hrs ago1719785603IN
0xb6ecf70F...24140793F
0 ETH0.000356633.18790803
Claim202074012024-06-30 22:10:1119 hrs ago1719785411IN
0xb6ecf70F...24140793F
0 ETH0.000320333.38008503
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SDAOLaunchpad

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : SDAOLaunchpad.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./WhitelistedPoolVerifier.sol";

contract SDAOLaunchpad is WhitelistedPoolVerifier, Ownable, ReentrancyGuard {
  using SafeERC20 for IERC20;

  struct UserInfo {
    uint256 deposited;
    uint256 claimed;
  }

  struct EmissionPeriod {
    uint256 startOfEmissions;
    uint256 endOfVestingCliff;
    uint256 endOfEmissions;
  }
  
  struct PoolInfo {
    address depositToken;
    uint256 depositedAmount;

    uint256 minDeposit;
    uint256 maxDeposit;
    uint256 startOfDeposits;
    uint256 endOfDeposits;
    
    uint256 price;
    EmissionPeriod emissionPeriod;
    bool collected;

    uint256 cappedTotalDeposits; // maximum total pool deposits
    uint256 instantUnlockRatio; // % of emissions to unlock instantly at start of emission period in 0.01% basis points
    uint256 totalClaimed;
  }

  //==========  Constants  ==========
  uint256 public constant MAX_BASIS_POINTS = 10000; // 100.00% or 10k bps

  /// @dev ERC20 launch token to distribute.   
  address public immutable launchToken;
  /// @dev For precision calculation while computing the vesting.
  uint256 public immutable launchTokenPrecision;

  /** ==========  Storage  ========== */
  /// @dev Info of each launch pool.
  PoolInfo[] public poolInfo;
  
  /// @dev Info of each user that stakes tokens.
  mapping(uint256 => mapping(address => UserInfo)) public userInfo;
  
  uint256 public reservedLaunchTokens;

  // ==========  Events  ==========
  event PoolAdded(uint256 indexed pid, address indexed token);
  event Deposit(address indexed user, uint256 indexed pid, uint256 amount, address token, address indexed to);
  event UpdatedEmissions(uint256 indexed pid, uint256 startOfEmissions, uint256 endOfEmissions);
  event CollectedDeposits(address indexed user, uint256 indexed pid, uint256 amount, address indexed to);
  event Claimed(address indexed user, uint256 indexed pid, uint256 amount);

  // ==========  Constructor  ==========

  /// @dev During the deployment of the contract pass the ERC-20 contract address used for rewards.
  constructor(address _launchToken) {
    launchToken = _launchToken;
    launchTokenPrecision = 10 ** IERC20Metadata(launchToken).decimals();
    _setSigner(msg.sender);
  }

  //*** External functions ***//

  /// @dev Add a new launchpad pool.
  /// Can only be called by the owner
  function createPool(address _token,
                      uint256 _minDeposit,
                      uint256 _maxDeposit,
                      uint256 _startOfDeposits,
                      uint256 _endOfDeposits,
                      uint256 _price,
                      uint256 _cappedTotalDeposits,
                      uint256 _instantUnlockRatio)
           external onlyOwner {
    require(_token != address(0), "ERR_ZERO_ADDRESS");
    require(_maxDeposit > 0, "ERR_MAX_DEPOSIT");
    require(_startOfDeposits < _endOfDeposits, "ERR_START_DEPOSITS");
    require(_endOfDeposits > block.timestamp, "ERR_END_DEPOSITS");
    require(_price > 0, "ERR_PRICE");
    require(_instantUnlockRatio < MAX_BASIS_POINTS, "ERR_INSTANT_UNLOCK_RATIO");

    uint256 pid = poolInfo.length;

    poolInfo.push(PoolInfo({
      depositToken: _token,
      depositedAmount: 0,

      minDeposit: _minDeposit,
      maxDeposit: _maxDeposit,
      startOfDeposits: _startOfDeposits,
      endOfDeposits: _endOfDeposits,

      price: _price,
      emissionPeriod: EmissionPeriod({
                        startOfEmissions: 0,
                        endOfVestingCliff: 0,
                        endOfEmissions: 0
                      }),
      collected: false,
      cappedTotalDeposits: _cappedTotalDeposits,
      instantUnlockRatio: _instantUnlockRatio,
      totalClaimed: 0
    }));

    emit PoolAdded(pid, _token);
  }

  function setEmission(uint256 _pid, uint256 _startOfEmissions, uint256 _endOfVestingCliff, uint256 _endOfEmissions)
    external onlyOwner {
    require(_pid < poolInfo.length, "ERR_POOLID");
    require(poolInfo[_pid].emissionPeriod.startOfEmissions == 0, "ERR_ALREADY_DEFINED");
    require(_startOfEmissions < _endOfEmissions, "ERR_START_EMISSIONS");
    require(_endOfVestingCliff >= _startOfEmissions
            && _endOfVestingCliff <= _endOfEmissions,
            "ERR_END_OF_VESTING_CLIFF");
    require(_endOfEmissions > block.timestamp, "ERR_END_EMISSIONS");

    EmissionPeriod memory emissionPeriod = poolInfo[_pid].emissionPeriod;
    emissionPeriod.startOfEmissions = _startOfEmissions;
    emissionPeriod.endOfVestingCliff = _endOfVestingCliff;
    emissionPeriod.endOfEmissions = _endOfEmissions;
    
    poolInfo[_pid].emissionPeriod = emissionPeriod;
    emit UpdatedEmissions(_pid, _startOfEmissions, _endOfEmissions);
  }

  /// @dev Withdraw tokens from the launchpad contract.
  /// @param _pid The index of the pool. See `poolInfo`.
  /// @param _to Receiver of the tokens.
  function collectDeposits(uint256 _pid, address _to) external nonReentrant onlyOwner {
    require(_pid < poolInfo.length, "ERR_POOLID");
    require(_to != address(0), "ERR_ZERO_ADDRESS");

    PoolInfo memory pool = poolInfo[_pid];
    require(pool.depositedAmount > 0, "ERR_NO_DEPOSITS");
    require(pool.endOfDeposits < block.timestamp, "ERR_OPEN_DEPOSITS");
    require(pool.emissionPeriod.startOfEmissions > 0, "ERR_NO_EMISSIONS");
    require(!pool.collected, "ERR_ALREADY_COLLECTED");

    // Effects
    pool.collected = true;
    poolInfo[_pid] = pool;

    // Interactions
    IERC20(pool.depositToken).safeTransfer(_to, pool.depositedAmount);
    emit CollectedDeposits(msg.sender, _pid, pool.depositedAmount, _to);
  }

  function setSigner(address signer) external onlyOwner{
    require(signer != address(0), "ERR_ZERO_ADDRESS");
    _setSigner(signer);
  }

  // Recover any tokens accidentally sent to the contract excluding properly deposited or bought tokens
  function recoverAnyTokens(address token) external payable onlyOwner {
    require(token != address(0), "ERR_ZERO_ADDRESS");
    
    (bool success, ) = (msg.sender).call{value: address(this).balance}("");
    require(success, "ERR_TRANSFER_ETH");
    
    uint256 reservedTokens = 0;
    uint256 pids = poolInfo.length;
    for (uint256 pid = 0; pid < pids; pid++) {
      PoolInfo memory pool = poolInfo[pid];
      if (token == pool.depositToken && !pool.collected) {
         reservedTokens += pool.depositedAmount;
      } else if (token == launchToken) {
         uint256 totalSold = pool.depositedAmount * launchTokenPrecision / pool.price;
         reservedTokens += totalSold - pool.totalClaimed;
      }
    }
    uint256 currentTokenBalance = IERC20(token).balanceOf(address(this));
    require(currentTokenBalance > reservedTokens, "ERR_NO_EXCESS_TOKENS");
    uint256 excessTokens = currentTokenBalance - reservedTokens;
    IERC20(token).safeTransfer(msg.sender, excessTokens); 
  }

  /// @dev Claim all pools for end user
  function claimAll() external {
    bool claimed;
    uint256 pids = poolInfo.length;
    for (uint256 pid = 0; pid < pids; pid++) {
      if (claimableTokens(pid, msg.sender) > 0) {
         claim(pid, msg.sender);
         claimed = true;
      }
    }
    require(claimed, "ERR_ZERO_CLAIMABLE");
  }

  //*** External view functions ***//

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

  function getPoolDepositToken(uint256 _pid) external view returns (address) {
      return poolInfo[_pid].depositToken;
  }

  //*** Public functions ***//

  /// @dev Deposit tokens to be entitled for launch tokens.
  /// @param _pid The index of the pool. See `poolInfo`.
  /// @param _amount Token amount to deposit.
  function deposit(uint256 _pid,
                   uint256 _amount,
                   string calldata _salt,
                   bytes memory _signature)
           external {
    depositFor(_pid, _amount, msg.sender, _salt, _signature);
  }

  /// @dev Deposit tokens to be entitle for launch tokens.
  /// @param _pid The index of the pool. See `poolInfo`.
  /// @param _amount Token amount to deposit.
  /// @param _to The wallet entitled to claim `_amount` deposit benefit.
  function depositFor(uint256 _pid,
                      uint256 _amount,
                      address _to,
                      string calldata _salt,
                      bytes memory _signature)
           public nonReentrant {
    require(_pid < poolInfo.length, "ERR_POOLID");
    require(_to != address(0), "ERR_ZERO_ADDRESS");

    PoolInfo memory pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_to];

    // check if deposit window is valid 
    require(pool.startOfDeposits < block.timestamp,"ERR_BEFORE_DEPOSITS_START");
    require(pool.endOfDeposits > block.timestamp,"ERR_AFTER_DEPOSITS_END");

    require(user.deposited +_amount >= pool.minDeposit, "ERR_MIN_DEPOSIT");
    require(user.deposited + _amount <= pool.maxDeposit, "ERR_MAX_DEPOSIT");
    
    require(pool.depositedAmount + _amount <= pool.cappedTotalDeposits, "ERR_POOL_SOLD_OUT");
    
    require(IERC20(pool.depositToken).balanceOf(msg.sender) >= _amount, "ERR_DEPOSIT_BALANCE");
    require(IERC20(pool.depositToken).allowance(msg.sender, address(this)) >= _amount, "ERR_DEPOSIT_ALLOWANCE");
    
    uint256 boughtTokens = _amount * launchTokenPrecision / pool.price;
    require(IERC20(launchToken).balanceOf(address(this)) >= boughtTokens + reservedLaunchTokens
           , "ERR_LAUNCHPAD_BALANCE");

    require(isValidSignature(_salt, _pid, _to, _signature), "ERR_WHITELIST");
    
    reservedLaunchTokens += boughtTokens;
    user.deposited += _amount;
    pool.depositedAmount += _amount;
    // Update the pool back
    poolInfo[_pid] = pool;

    // Interactions
    IERC20(pool.depositToken).safeTransferFrom(msg.sender, address(this), _amount);

    emit Deposit(msg.sender, _pid, _amount, pool.depositToken, _to);
  }

  /// @dev Claim proceeds for transaction sender to `_to`.
  /// @param _pid The index of the pool. See `poolInfo`.
  /// @param _to Receiver of rewards.
  function claim(uint256 _pid, address _to) public nonReentrant {
    require(_pid < poolInfo.length, "ERR_POOLID");
    require(_to != address(0), "ERR_ZERO_ADDRESS");

    uint256 claimable = claimableTokens(_pid, _to);
    require(claimable > 0, "ERR_ZERO_CLAIMABLE");
	
    // Interactions
    reservedLaunchTokens -= claimable;
    UserInfo storage user = userInfo[_pid][msg.sender];
    user.claimed += claimable;
    PoolInfo storage pool = poolInfo[_pid];
    pool.totalClaimed += claimable;
    IERC20(launchToken).safeTransfer(_to, claimable);
    emit Claimed(msg.sender, _pid, claimable);
  }

  //*** Public view functions ***//
  
  /// @dev View function to see claimable tokens on frontend.
  /// @param _pid The index of the pool. See `poolInfo`.
  /// @param _user Address of user.
  /// @return claimableAmount tokens for a given user.
  function claimableTokens(uint256 _pid, address _user) public view returns (uint256 claimableAmount) {
    require(_pid < poolInfo.length, "ERR_POOLID");
    PoolInfo memory pool = poolInfo[_pid];
    if (pool.emissionPeriod.startOfEmissions == 0
        || pool.emissionPeriod.startOfEmissions > block.timestamp) {
       return 0;
    }
    UserInfo memory user = userInfo[_pid][_user];
    uint256 boughtAmount = user.deposited * launchTokenPrecision / pool.price;
    uint256 instantUnlockedAmount = boughtAmount * pool.instantUnlockRatio / MAX_BASIS_POINTS;
    uint256 vestedAmount = boughtAmount - instantUnlockedAmount;
    uint256 totalEmissionSeconds = pool.emissionPeriod.endOfEmissions - pool.emissionPeriod.startOfEmissions;
    uint256 emissionPassed = (block.timestamp < pool.emissionPeriod.endOfEmissions)
                             ? block.timestamp - pool.emissionPeriod.startOfEmissions
                             : totalEmissionSeconds;
    uint256 vestedUnlockedAmount = (block.timestamp >= pool.emissionPeriod.endOfVestingCliff)
                                   ? vestedAmount * emissionPassed / totalEmissionSeconds
                                   : 0;
    uint256 unlockedAmount = instantUnlockedAmount + vestedUnlockedAmount;
    claimableAmount = unlockedAmount - user.claimed;    
  }


}

File 2 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

    function _nonReentrantAfter() private {
        // 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 13 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 13 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 7 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.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));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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 8 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://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 functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 10 of 13 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 11 of 13 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

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

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

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

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

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

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

File 12 of 13 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 13 of 13 : WhitelistedPoolVerifier.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

contract WhitelistedPoolVerifier {
    using ECDSA for bytes32;

    address private _signer;

    event SignerUpdated(address newSigner);
    
    function getSigner() external view returns (address) {
        return _signer;
    }

    function isValidSignature(string calldata _salt, uint256 _poolId, address _wallet, bytes memory _signature)
        public view returns(bool) {
        return _hash(_salt, _poolId, _wallet)
               .toEthSignedMessageHash()
               .recover(_signature) == _signer;
    }

    function _setSigner(address _newSigner) internal {
        _signer = _newSigner;
        emit SignerUpdated(_signer);
    }

    // hash payload containing: salt + launchpad address + poolId + whitelisted address
    function _hash(string calldata _salt, uint256 _poolId, address _wallet) internal view returns (bytes32) {
        return keccak256(abi.encode(_salt, address(this), _poolId, _wallet));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_launchToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"CollectedDeposits","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startOfEmissions","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endOfEmissions","type":"uint256"}],"name":"UpdatedEmissions","type":"event"},{"inputs":[],"name":"MAX_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"claimableTokens","outputs":[{"internalType":"uint256","name":"claimableAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"collectDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_minDeposit","type":"uint256"},{"internalType":"uint256","name":"_maxDeposit","type":"uint256"},{"internalType":"uint256","name":"_startOfDeposits","type":"uint256"},{"internalType":"uint256","name":"_endOfDeposits","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_cappedTotalDeposits","type":"uint256"},{"internalType":"uint256","name":"_instantUnlockRatio","type":"uint256"}],"name":"createPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_salt","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"string","name":"_salt","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getPoolDepositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_salt","type":"string"},{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchTokenPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nrOfPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"address","name":"depositToken","type":"address"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"},{"internalType":"uint256","name":"minDeposit","type":"uint256"},{"internalType":"uint256","name":"maxDeposit","type":"uint256"},{"internalType":"uint256","name":"startOfDeposits","type":"uint256"},{"internalType":"uint256","name":"endOfDeposits","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"components":[{"internalType":"uint256","name":"startOfEmissions","type":"uint256"},{"internalType":"uint256","name":"endOfVestingCliff","type":"uint256"},{"internalType":"uint256","name":"endOfEmissions","type":"uint256"}],"internalType":"struct SDAOLaunchpad.EmissionPeriod","name":"emissionPeriod","type":"tuple"},{"internalType":"bool","name":"collected","type":"bool"},{"internalType":"uint256","name":"cappedTotalDeposits","type":"uint256"},{"internalType":"uint256","name":"instantUnlockRatio","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"recoverAnyTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservedLaunchTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_startOfEmissions","type":"uint256"},{"internalType":"uint256","name":"_endOfVestingCliff","type":"uint256"},{"internalType":"uint256","name":"_endOfEmissions","type":"uint256"}],"name":"setEmission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"deposited","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162002fa338038062002fa383398101604081905262000034916200017d565b6200003f33620000d7565b60016002556001600160a01b03811660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa1580156200008f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b59190620001af565b620000c290600a620002e9565b60a052620000d03362000129565b50620002fa565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b6000602082840312156200019057600080fd5b81516001600160a01b0381168114620001a857600080fd5b9392505050565b600060208284031215620001c257600080fd5b815160ff81168114620001a857600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b808511156200022b5781600019048211156200020f576200020f620001d4565b808516156200021d57918102915b93841c9390800290620001ef565b509250929050565b6000826200024457506001620002e3565b816200025357506000620002e3565b81600181146200026c5760028114620002775762000297565b6001915050620002e3565b60ff8411156200028b576200028b620001d4565b50506001821b620002e3565b5060208310610133831016604e8410600b8410161715620002bc575081810a620002e3565b620002c88383620001ea565b8060001904821115620002df57620002df620001d4565b0290505b92915050565b6000620001a860ff84168362000233565b60805160a051612c596200034a6000396000818161046c01528181610a04015281816115530152611df20152600081816103ad01528181610a5801528181611b670152611db20152612c596000f3fe6080604052600436106101405760003560e01c8063984eef56116100b6578063d82cf36e1161006f578063d82cf36e1461043a578063d92a931a1461045a578063ddd5e1b21461048e578063eaa4c446146104ae578063f2fde38b146104c1578063f4ea93d8146104e157600080fd5b8063984eef561461036b578063a28a4d861461039b578063b964b5e5146103cf578063bb2a0916146103ef578063d087d74d14610405578063d1058e591461042557600080fd5b80636c19e783116101085780636c19e78314610272578063715018a61461029257806377355a24146102a75780637ac3c02f146102c75780638da5cb5b146102f957806393f1a40b1461031757600080fd5b80631526fe27146101455780632575dcd1146101f15780635054da7214610213578063568e478e14610233578063640d526414610253575b600080fd5b34801561015157600080fd5b506101656101603660046126b4565b6104f7565b604080516001600160a01b03909d168d526020808e019c909c528c81019a909a5260608c019890985260808b019690965260a08a019490945260c0890192909252805160e08901529586015161010088015294909301516101208601529215156101408501526101608401919091526101808301919091526101a08201526101c0015b60405180910390f35b3480156101fd57600080fd5b5061021161020c3660046127b2565b610599565b005b34801561021f57600080fd5b5061021161022e36600461284b565b6105ae565b34801561023f57600080fd5b5061021161024e3660046128d7565b610cfa565b34801561025f57600080fd5b506003545b6040519081526020016101e8565b34801561027e57600080fd5b5061021161028d366004612903565b6110a2565b34801561029e57600080fd5b506102116110dc565b3480156102b357600080fd5b506102116102c2366004612925565b6110f0565b3480156102d357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101e8565b34801561030557600080fd5b506001546001600160a01b03166102e1565b34801561032357600080fd5b506103566103323660046128d7565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101e8565b34801561037757600080fd5b5061038b610386366004612957565b611324565b60405190151581526020016101e8565b3480156103a757600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b3480156103db57600080fd5b506102e16103ea3660046126b4565b6113b1565b3480156103fb57600080fd5b5061026460055481565b34801561041157600080fd5b506102646104203660046128d7565b6113e6565b34801561043157600080fd5b5061021161165a565b34801561044657600080fd5b506102116104553660046129c4565b6116e0565b34801561046657600080fd5b506102647f000000000000000000000000000000000000000000000000000000000000000081565b34801561049a57600080fd5b506102116104a93660046128d7565b611a2d565b6102116104bc366004612903565b611bd2565b3480156104cd57600080fd5b506102116104dc366004612903565b611f34565b3480156104ed57600080fd5b5061026461271081565b6003818154811061050757600080fd5b6000918252602091829020600e9091020180546001820154600283015460038401546004850154600586015460068701546040805160608101825260078a0154815260088a01549a81019a909a526009890154908a0152600a880154600b890154600c8a0154600d909a01546001600160a01b039099169b50969995989497939692959194919360ff9091169291908c565b6105a78585338686866105ae565b5050505050565b6105b6611faa565b60035486106105e05760405162461bcd60e51b81526004016105d790612a20565b60405180910390fd5b6001600160a01b0384166106065760405162461bcd60e51b81526004016105d790612a44565b60006003878154811061061b5761061b612a6e565b600091825260208083206040805161018081018252600e90940290910180546001600160a01b039081168552600182015485850152600282015485840152600382015460608087019190915260048084015460808801908152600585015460a0890152600685015460c0890152855192830186526007850154835260088501548388015260098501548387015260e0880192909252600a84015460ff161515610100880152600b840154610120880152600c840154610140880152600d909301546101608701528d8752918452828620908b168652909252909220915190925042116107495760405162461bcd60e51b815260206004820152601960248201527f4552525f4245464f52455f4445504f534954535f53544152540000000000000060448201526064016105d7565b428260a00151116107955760405162461bcd60e51b815260206004820152601660248201527511549497d05195115497d1115413d4d25514d7d1539160521b60448201526064016105d7565b604082015181546107a7908990612a9a565b10156107e75760405162461bcd60e51b815260206004820152600f60248201526e11549497d3525397d1115413d4d255608a1b60448201526064016105d7565b606082015181546107f9908990612a9a565b11156108395760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016105d7565b81610120015187836020015161084f9190612a9a565b11156108915760405162461bcd60e51b815260206004820152601160248201527011549497d413d3d317d4d3d31117d3d555607a1b60448201526064016105d7565b81516040516370a0823160e01b815233600482015288916001600160a01b0316906370a0823190602401602060405180830381865afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc9190612aad565b10156109405760405162461bcd60e51b81526020600482015260136024820152724552525f4445504f5349545f42414c414e434560681b60448201526064016105d7565b8151604051636eb1769f60e11b815233600482015230602482015288916001600160a01b03169063dd62ed3e90604401602060405180830381865afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b19190612aad565b10156109f75760405162461bcd60e51b81526020600482015260156024820152744552525f4445504f5349545f414c4c4f57414e434560581b60448201526064016105d7565b60c0820151600090610a297f00000000000000000000000000000000000000000000000000000000000000008a612ac6565b610a339190612add565b905060055481610a439190612a9a565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acb9190612aad565b1015610b115760405162461bcd60e51b81526020600482015260156024820152744552525f4c41554e43485041445f42414c414e434560581b60448201526064016105d7565b610b1e86868b8a88611324565b610b5a5760405162461bcd60e51b815260206004820152600d60248201526c11549497d5d2125511531254d5609a1b60448201526064016105d7565b8060056000828254610b6c9190612a9a565b9091555050815488908390600090610b85908490612a9a565b925050819055508783602001818151610b9e9190612a9a565b905250600380548491908b908110610bb857610bb8612a6e565b60009182526020918290208351600e929092020180546001600160a01b0319166001600160a01b039283161781558383015160018201556040808501516002830155606085015160038301556080850151600483015560a0850151600583015560c0850151600683015560e08501518051600784015593840151600883015592909201516009830155610100830151600a8301805460ff1916911515919091179055610120830151600b830155610140830151600c83015561016090920151600d909101558351610c8c911633308b612001565b82516040516001600160a01b038916918b9133917fc436f473cd90c9b4dd731856a14b80f713d384a1688a506d4230140c5b36d5cd91610cdd918e82526001600160a01b0316602082015260400190565b60405180910390a4505050610cf26001600255565b505050505050565b610d02611faa565b610d0a612072565b6003548210610d2b5760405162461bcd60e51b81526004016105d790612a20565b6001600160a01b038116610d515760405162461bcd60e51b81526004016105d790612a44565b600060038381548110610d6657610d66612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b031683526001810154838501908152600282015484840152600382015460608086019190915260048301546080860152600583015460a0860152600683015460c0860152835190810184526007830154815260088301549581019590955260098201549285019290925260e0830193909352600a83015460ff161515610100830152600b830154610120830152600c830154610140830152600d909201546101608201529051909150610e745760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f5f4445504f5349545360881b60448201526064016105d7565b428160a0015110610ebb5760405162461bcd60e51b81526020600482015260116024820152704552525f4f50454e5f4445504f5349545360781b60448201526064016105d7565b60e081015151610f005760405162461bcd60e51b815260206004820152601060248201526f4552525f4e4f5f454d495353494f4e5360801b60448201526064016105d7565b80610100015115610f4b5760405162461bcd60e51b815260206004820152601560248201527411549497d053149150511657d0d3d3131150d51151605a1b60448201526064016105d7565b60016101008201526003805482919085908110610f6a57610f6a612a6e565b60009182526020918290208351600e929092020180546001600160a01b0319166001600160a01b039283161781558383015160018201556040808501516002830155606085015160038301556080850151600483015560a0850151600583015560c0850151600683015560e08501518051600784015580850151600884015501516009820155610100840151600a8201805460ff1916911515919091179055610120840151600b820155610140840151600c82015561016090930151600d90930192909255820151825161104192169084906120cc565b816001600160a01b031683336001600160a01b03167fbc26696e7e0fabc5eca7f4c50f2eca48ff55ef18d9855423e62c0e142fc5806e846020015160405161108b91815260200190565b60405180910390a45061109e6001600255565b5050565b6110aa612072565b6001600160a01b0381166110d05760405162461bcd60e51b81526004016105d790612a44565b6110d981612101565b50565b6110e4612072565b6110ee6000612155565b565b6110f8612072565b60035484106111195760405162461bcd60e51b81526004016105d790612a20565b6003848154811061112c5761112c612a6e565b90600052602060002090600e0201600701600001546000146111865760405162461bcd60e51b815260206004820152601360248201527211549497d053149150511657d1115192539151606a1b60448201526064016105d7565b8083106111cb5760405162461bcd60e51b81526020600482015260136024820152724552525f53544152545f454d495353494f4e5360681b60448201526064016105d7565b8282101580156111db5750808211155b6112275760405162461bcd60e51b815260206004820152601860248201527f4552525f454e445f4f465f56455354494e475f434c494646000000000000000060448201526064016105d7565b42811161126a5760405162461bcd60e51b81526020600482015260116024820152704552525f454e445f454d495353494f4e5360781b60448201526064016105d7565b60006003858154811061127f5761127f612a6e565b5060005250604080516060810182528481526020810184905290810182905260038054829190879081106112b5576112b5612a6e565b600091825260209182902083516007600e90930290910191820155828201516008820155604092830151600990910155815186815290810184905286917f8f3433165a52619388932e74a94de77af10aac26c523170aefda9e57ac679fb5910160405180910390a25050505050565b600080546001600160a01b031661139d836113976113448a8a8a8a6121a7565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b906121e3565b6001600160a01b0316149695505050505050565b6000600382815481106113c6576113c6612a6e565b60009182526020909120600e90910201546001600160a01b031692915050565b600354600090831061140a5760405162461bcd60e51b81526004016105d790612a20565b60006003848154811061141f5761141f612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b03168352600181015483850152600281015483830152600381015460608085019190915260048201546080850152600582015460a0850152600682015460c0850152825190810183526007820154815260088201549481019490945260098101549184019190915260e08201839052600a81015460ff161515610100830152600b810154610120830152600c810154610140830152600d0154610160820152905190915015806114fa575060e08101515142105b15611509576000915050611654565b60008481526004602090815260408083206001600160a01b03871684528252808320815180830190925280548083526001909101549282019290925260c0840151909291611578907f000000000000000000000000000000000000000000000000000000000000000090612ac6565b6115829190612add565b905060006127108461014001518361159a9190612ac6565b6115a49190612add565b905060006115b28284612aff565b60e086015180516040909101519192506000916115cf9190612aff565b905060008660e001516040015142106115e857816115f8565b60e0870151516115f89042612aff565b905060008760e0015160200151421015611613576000611628565b8261161e8386612ac6565b6116289190612add565b905060006116368287612a9a565b90508760200151816116489190612aff565b99505050505050505050505b92915050565b600354600090815b8181101561169d57600061167682336113e6565b111561168b576116868133611a2d565b600192505b8061169581612b12565b915050611662565b508161109e5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016105d7565b6116e8612072565b6001600160a01b03881661170e5760405162461bcd60e51b81526004016105d790612a44565b600086116117505760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016105d7565b8385106117945760405162461bcd60e51b81526020600482015260126024820152714552525f53544152545f4445504f5349545360701b60448201526064016105d7565b4284116117d65760405162461bcd60e51b815260206004820152601060248201526f4552525f454e445f4445504f5349545360801b60448201526064016105d7565b600083116118125760405162461bcd60e51b81526020600482015260096024820152684552525f505249434560b81b60448201526064016105d7565b61271081106118635760405162461bcd60e51b815260206004820152601860248201527f4552525f494e5354414e545f554e4c4f434b5f524154494f000000000000000060448201526064016105d7565b6000600380549050905060036040518061018001604052808b6001600160a01b03168152602001600081526020018a81526020018981526020018881526020018781526020018681526020016040518060600160405280600081526020016000815260200160008152508152602001600015158152602001858152602001848152602001600081525090806001815401808255809150506001900390600052602060002090600e020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701600082015181600001556020820151816001015560408201518160020155505061010082015181600a0160006101000a81548160ff02191690831515021790555061012082015181600b015561014082015181600c015561016082015181600d01555050886001600160a01b0316817f1f1f6396247a5ba59b7b1e094ec3a8e439d4dace0c5ac4fe3ecfde3e68e03a8a60405160405180910390a3505050505050505050565b611a35611faa565b6003548210611a565760405162461bcd60e51b81526004016105d790612a20565b6001600160a01b038116611a7c5760405162461bcd60e51b81526004016105d790612a44565b6000611a8883836113e6565b905060008111611acf5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016105d7565b8060056000828254611ae19190612aff565b90915550506000838152600460209081526040808320338452909152812060018101805491928492611b14908490612a9a565b92505081905550600060038581548110611b3057611b30612a6e565b90600052602060002090600e020190508281600d016000828254611b549190612a9a565b90915550611b8e90506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001685856120cc565b604051838152859033907f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9060200160405180910390a350505061109e6001600255565b611bda612072565b6001600160a01b038116611c005760405162461bcd60e51b81526004016105d790612a44565b604051600090339047908381818185875af1925050503d8060008114611c42576040519150601f19603f3d011682016040523d82523d6000602084013e611c47565b606091505b5050905080611c8b5760405162461bcd60e51b815260206004820152601060248201526f08aa4a4bea8a4829ca68c8aa4be8aa8960831b60448201526064016105d7565b600354600090815b81811015611e5e57600060038281548110611cb057611cb0612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b039081168452600182015484860152600282015484840152600382015460608086019190915260048301546080860152600583015460a0860152600683015460c0860152835190810184526007830154815260088301549581019590955260098201549285019290925260e0830193909352600a83015460ff161515610100830152600b830154610120830152600c830154610140830152600d9092015461016082015280519092508782169116148015611d955750806101000151155b15611db0576020810151611da99085612a9a565b9350611e4b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031603611e4b5760008160c001517f00000000000000000000000000000000000000000000000000000000000000008360200151611e209190612ac6565b611e2a9190612add565b905081610160015181611e3d9190612aff565b611e479086612a9a565b9450505b5080611e5681612b12565b915050611c93565b506040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eca9190612aad565b9050828111611f125760405162461bcd60e51b81526020600482015260146024820152734552525f4e4f5f4558434553535f544f4b454e5360601b60448201526064016105d7565b6000611f1e8483612aff565b9050610cf26001600160a01b03871633836120cc565b611f3c612072565b6001600160a01b038116611fa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d7565b6110d981612155565b6002805403611ffb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b60028055565b6040516001600160a01b038085166024830152831660448201526064810182905261206c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612207565b50505050565b6001546001600160a01b031633146110ee5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105d7565b6040516001600160a01b0383166024820152604481018290526120fc90849063a9059cbb60e01b90606401612035565b505050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600084843085856040516020016121c2959493929190612b2b565b6040516020818303038152906040528051906020012090505b949350505050565b60008060006121f285856122d9565b915091506121ff8161231e565b509392505050565b600061225c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124689092919063ffffffff16565b8051909150156120fc578080602001905181019061227a9190612b78565b6120fc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105d7565b600080825160410361230f5760208301516040840151606085015160001a61230387828585612477565b94509450505050612317565b506000905060025b9250929050565b600081600481111561233257612332612b9a565b0361233a5750565b600181600481111561234e5761234e612b9a565b0361239b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105d7565b60028160048111156123af576123af612b9a565b036123fc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105d7565b600381600481111561241057612410612b9a565b036110d95760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105d7565b60606121db848460008561253b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124ae5750600090506003612532565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612502573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661252b57600060019250925050612532565b9150600090505b94509492505050565b60608247101561259c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105d7565b600080866001600160a01b031685876040516125b89190612bd4565b60006040518083038185875af1925050503d80600081146125f5576040519150601f19603f3d011682016040523d82523d6000602084013e6125fa565b606091505b509150915061260b87838387612616565b979650505050505050565b6060831561268557825160000361267e576001600160a01b0385163b61267e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105d7565b50816121db565b6121db838381511561269a5781518083602001fd5b8060405162461bcd60e51b81526004016105d79190612bf0565b6000602082840312156126c657600080fd5b5035919050565b60008083601f8401126126df57600080fd5b50813567ffffffffffffffff8111156126f757600080fd5b60208301915083602082850101111561231757600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261273657600080fd5b813567ffffffffffffffff808211156127515761275161270f565b604051601f8301601f19908116603f011681019082821181831017156127795761277961270f565b8160405283815286602085880101111561279257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806000608086880312156127ca57600080fd5b8535945060208601359350604086013567ffffffffffffffff808211156127f057600080fd5b6127fc89838a016126cd565b9095509350606088013591508082111561281557600080fd5b5061282288828901612725565b9150509295509295909350565b80356001600160a01b038116811461284657600080fd5b919050565b60008060008060008060a0878903121561286457600080fd5b863595506020870135945061287b6040880161282f565b9350606087013567ffffffffffffffff8082111561289857600080fd5b6128a48a838b016126cd565b909550935060808901359150808211156128bd57600080fd5b506128ca89828a01612725565b9150509295509295509295565b600080604083850312156128ea57600080fd5b823591506128fa6020840161282f565b90509250929050565b60006020828403121561291557600080fd5b61291e8261282f565b9392505050565b6000806000806080858703121561293b57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060008060006080868803121561296f57600080fd5b853567ffffffffffffffff8082111561298757600080fd5b61299389838a016126cd565b9097509550602088013594508591506129ae6040890161282f565b9350606088013591508082111561281557600080fd5b600080600080600080600080610100898b0312156129e157600080fd5b6129ea8961282f565b9a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e00135945092505050565b6020808252600a908201526911549497d413d3d3125160b21b604082015260600190565b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561165457611654612a84565b600060208284031215612abf57600080fd5b5051919050565b808202811582820484141761165457611654612a84565b600082612afa57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561165457611654612a84565b600060018201612b2457612b24612a84565b5060010190565b60808152846080820152848660a0830137600060a08683018101919091526001600160a01b039485166020830152604082019390935292166060830152601f909201601f19160101919050565b600060208284031215612b8a57600080fd5b8151801515811461291e57600080fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015612bcb578181015183820152602001612bb3565b50506000910152565b60008251612be6818460208701612bb0565b9190910192915050565b6020815260008251806020840152612c0f816040850160208701612bb0565b601f01601f1916919091016040019291505056fea264697066735822122035fbc60928cc4f4758bd40cc5b8cca71e4a6041379b87032c03d7fee642e4fa164736f6c6343000812003300000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab

Deployed Bytecode

0x6080604052600436106101405760003560e01c8063984eef56116100b6578063d82cf36e1161006f578063d82cf36e1461043a578063d92a931a1461045a578063ddd5e1b21461048e578063eaa4c446146104ae578063f2fde38b146104c1578063f4ea93d8146104e157600080fd5b8063984eef561461036b578063a28a4d861461039b578063b964b5e5146103cf578063bb2a0916146103ef578063d087d74d14610405578063d1058e591461042557600080fd5b80636c19e783116101085780636c19e78314610272578063715018a61461029257806377355a24146102a75780637ac3c02f146102c75780638da5cb5b146102f957806393f1a40b1461031757600080fd5b80631526fe27146101455780632575dcd1146101f15780635054da7214610213578063568e478e14610233578063640d526414610253575b600080fd5b34801561015157600080fd5b506101656101603660046126b4565b6104f7565b604080516001600160a01b03909d168d526020808e019c909c528c81019a909a5260608c019890985260808b019690965260a08a019490945260c0890192909252805160e08901529586015161010088015294909301516101208601529215156101408501526101608401919091526101808301919091526101a08201526101c0015b60405180910390f35b3480156101fd57600080fd5b5061021161020c3660046127b2565b610599565b005b34801561021f57600080fd5b5061021161022e36600461284b565b6105ae565b34801561023f57600080fd5b5061021161024e3660046128d7565b610cfa565b34801561025f57600080fd5b506003545b6040519081526020016101e8565b34801561027e57600080fd5b5061021161028d366004612903565b6110a2565b34801561029e57600080fd5b506102116110dc565b3480156102b357600080fd5b506102116102c2366004612925565b6110f0565b3480156102d357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101e8565b34801561030557600080fd5b506001546001600160a01b03166102e1565b34801561032357600080fd5b506103566103323660046128d7565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101e8565b34801561037757600080fd5b5061038b610386366004612957565b611324565b60405190151581526020016101e8565b3480156103a757600080fd5b506102e17f00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab81565b3480156103db57600080fd5b506102e16103ea3660046126b4565b6113b1565b3480156103fb57600080fd5b5061026460055481565b34801561041157600080fd5b506102646104203660046128d7565b6113e6565b34801561043157600080fd5b5061021161165a565b34801561044657600080fd5b506102116104553660046129c4565b6116e0565b34801561046657600080fd5b506102647f00000000000000000000000000000000000000000000000000000000000f424081565b34801561049a57600080fd5b506102116104a93660046128d7565b611a2d565b6102116104bc366004612903565b611bd2565b3480156104cd57600080fd5b506102116104dc366004612903565b611f34565b3480156104ed57600080fd5b5061026461271081565b6003818154811061050757600080fd5b6000918252602091829020600e9091020180546001820154600283015460038401546004850154600586015460068701546040805160608101825260078a0154815260088a01549a81019a909a526009890154908a0152600a880154600b890154600c8a0154600d909a01546001600160a01b039099169b50969995989497939692959194919360ff9091169291908c565b6105a78585338686866105ae565b5050505050565b6105b6611faa565b60035486106105e05760405162461bcd60e51b81526004016105d790612a20565b60405180910390fd5b6001600160a01b0384166106065760405162461bcd60e51b81526004016105d790612a44565b60006003878154811061061b5761061b612a6e565b600091825260208083206040805161018081018252600e90940290910180546001600160a01b039081168552600182015485850152600282015485840152600382015460608087019190915260048084015460808801908152600585015460a0890152600685015460c0890152855192830186526007850154835260088501548388015260098501548387015260e0880192909252600a84015460ff161515610100880152600b840154610120880152600c840154610140880152600d909301546101608701528d8752918452828620908b168652909252909220915190925042116107495760405162461bcd60e51b815260206004820152601960248201527f4552525f4245464f52455f4445504f534954535f53544152540000000000000060448201526064016105d7565b428260a00151116107955760405162461bcd60e51b815260206004820152601660248201527511549497d05195115497d1115413d4d25514d7d1539160521b60448201526064016105d7565b604082015181546107a7908990612a9a565b10156107e75760405162461bcd60e51b815260206004820152600f60248201526e11549497d3525397d1115413d4d255608a1b60448201526064016105d7565b606082015181546107f9908990612a9a565b11156108395760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016105d7565b81610120015187836020015161084f9190612a9a565b11156108915760405162461bcd60e51b815260206004820152601160248201527011549497d413d3d317d4d3d31117d3d555607a1b60448201526064016105d7565b81516040516370a0823160e01b815233600482015288916001600160a01b0316906370a0823190602401602060405180830381865afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc9190612aad565b10156109405760405162461bcd60e51b81526020600482015260136024820152724552525f4445504f5349545f42414c414e434560681b60448201526064016105d7565b8151604051636eb1769f60e11b815233600482015230602482015288916001600160a01b03169063dd62ed3e90604401602060405180830381865afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b19190612aad565b10156109f75760405162461bcd60e51b81526020600482015260156024820152744552525f4445504f5349545f414c4c4f57414e434560581b60448201526064016105d7565b60c0820151600090610a297f00000000000000000000000000000000000000000000000000000000000f42408a612ac6565b610a339190612add565b905060055481610a439190612a9a565b6040516370a0823160e01b81523060048201527f00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab6001600160a01b0316906370a0823190602401602060405180830381865afa158015610aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acb9190612aad565b1015610b115760405162461bcd60e51b81526020600482015260156024820152744552525f4c41554e43485041445f42414c414e434560581b60448201526064016105d7565b610b1e86868b8a88611324565b610b5a5760405162461bcd60e51b815260206004820152600d60248201526c11549497d5d2125511531254d5609a1b60448201526064016105d7565b8060056000828254610b6c9190612a9a565b9091555050815488908390600090610b85908490612a9a565b925050819055508783602001818151610b9e9190612a9a565b905250600380548491908b908110610bb857610bb8612a6e565b60009182526020918290208351600e929092020180546001600160a01b0319166001600160a01b039283161781558383015160018201556040808501516002830155606085015160038301556080850151600483015560a0850151600583015560c0850151600683015560e08501518051600784015593840151600883015592909201516009830155610100830151600a8301805460ff1916911515919091179055610120830151600b830155610140830151600c83015561016090920151600d909101558351610c8c911633308b612001565b82516040516001600160a01b038916918b9133917fc436f473cd90c9b4dd731856a14b80f713d384a1688a506d4230140c5b36d5cd91610cdd918e82526001600160a01b0316602082015260400190565b60405180910390a4505050610cf26001600255565b505050505050565b610d02611faa565b610d0a612072565b6003548210610d2b5760405162461bcd60e51b81526004016105d790612a20565b6001600160a01b038116610d515760405162461bcd60e51b81526004016105d790612a44565b600060038381548110610d6657610d66612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b031683526001810154838501908152600282015484840152600382015460608086019190915260048301546080860152600583015460a0860152600683015460c0860152835190810184526007830154815260088301549581019590955260098201549285019290925260e0830193909352600a83015460ff161515610100830152600b830154610120830152600c830154610140830152600d909201546101608201529051909150610e745760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f5f4445504f5349545360881b60448201526064016105d7565b428160a0015110610ebb5760405162461bcd60e51b81526020600482015260116024820152704552525f4f50454e5f4445504f5349545360781b60448201526064016105d7565b60e081015151610f005760405162461bcd60e51b815260206004820152601060248201526f4552525f4e4f5f454d495353494f4e5360801b60448201526064016105d7565b80610100015115610f4b5760405162461bcd60e51b815260206004820152601560248201527411549497d053149150511657d0d3d3131150d51151605a1b60448201526064016105d7565b60016101008201526003805482919085908110610f6a57610f6a612a6e565b60009182526020918290208351600e929092020180546001600160a01b0319166001600160a01b039283161781558383015160018201556040808501516002830155606085015160038301556080850151600483015560a0850151600583015560c0850151600683015560e08501518051600784015580850151600884015501516009820155610100840151600a8201805460ff1916911515919091179055610120840151600b820155610140840151600c82015561016090930151600d90930192909255820151825161104192169084906120cc565b816001600160a01b031683336001600160a01b03167fbc26696e7e0fabc5eca7f4c50f2eca48ff55ef18d9855423e62c0e142fc5806e846020015160405161108b91815260200190565b60405180910390a45061109e6001600255565b5050565b6110aa612072565b6001600160a01b0381166110d05760405162461bcd60e51b81526004016105d790612a44565b6110d981612101565b50565b6110e4612072565b6110ee6000612155565b565b6110f8612072565b60035484106111195760405162461bcd60e51b81526004016105d790612a20565b6003848154811061112c5761112c612a6e565b90600052602060002090600e0201600701600001546000146111865760405162461bcd60e51b815260206004820152601360248201527211549497d053149150511657d1115192539151606a1b60448201526064016105d7565b8083106111cb5760405162461bcd60e51b81526020600482015260136024820152724552525f53544152545f454d495353494f4e5360681b60448201526064016105d7565b8282101580156111db5750808211155b6112275760405162461bcd60e51b815260206004820152601860248201527f4552525f454e445f4f465f56455354494e475f434c494646000000000000000060448201526064016105d7565b42811161126a5760405162461bcd60e51b81526020600482015260116024820152704552525f454e445f454d495353494f4e5360781b60448201526064016105d7565b60006003858154811061127f5761127f612a6e565b5060005250604080516060810182528481526020810184905290810182905260038054829190879081106112b5576112b5612a6e565b600091825260209182902083516007600e90930290910191820155828201516008820155604092830151600990910155815186815290810184905286917f8f3433165a52619388932e74a94de77af10aac26c523170aefda9e57ac679fb5910160405180910390a25050505050565b600080546001600160a01b031661139d836113976113448a8a8a8a6121a7565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b906121e3565b6001600160a01b0316149695505050505050565b6000600382815481106113c6576113c6612a6e565b60009182526020909120600e90910201546001600160a01b031692915050565b600354600090831061140a5760405162461bcd60e51b81526004016105d790612a20565b60006003848154811061141f5761141f612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b03168352600181015483850152600281015483830152600381015460608085019190915260048201546080850152600582015460a0850152600682015460c0850152825190810183526007820154815260088201549481019490945260098101549184019190915260e08201839052600a81015460ff161515610100830152600b810154610120830152600c810154610140830152600d0154610160820152905190915015806114fa575060e08101515142105b15611509576000915050611654565b60008481526004602090815260408083206001600160a01b03871684528252808320815180830190925280548083526001909101549282019290925260c0840151909291611578907f00000000000000000000000000000000000000000000000000000000000f424090612ac6565b6115829190612add565b905060006127108461014001518361159a9190612ac6565b6115a49190612add565b905060006115b28284612aff565b60e086015180516040909101519192506000916115cf9190612aff565b905060008660e001516040015142106115e857816115f8565b60e0870151516115f89042612aff565b905060008760e0015160200151421015611613576000611628565b8261161e8386612ac6565b6116289190612add565b905060006116368287612a9a565b90508760200151816116489190612aff565b99505050505050505050505b92915050565b600354600090815b8181101561169d57600061167682336113e6565b111561168b576116868133611a2d565b600192505b8061169581612b12565b915050611662565b508161109e5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016105d7565b6116e8612072565b6001600160a01b03881661170e5760405162461bcd60e51b81526004016105d790612a44565b600086116117505760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016105d7565b8385106117945760405162461bcd60e51b81526020600482015260126024820152714552525f53544152545f4445504f5349545360701b60448201526064016105d7565b4284116117d65760405162461bcd60e51b815260206004820152601060248201526f4552525f454e445f4445504f5349545360801b60448201526064016105d7565b600083116118125760405162461bcd60e51b81526020600482015260096024820152684552525f505249434560b81b60448201526064016105d7565b61271081106118635760405162461bcd60e51b815260206004820152601860248201527f4552525f494e5354414e545f554e4c4f434b5f524154494f000000000000000060448201526064016105d7565b6000600380549050905060036040518061018001604052808b6001600160a01b03168152602001600081526020018a81526020018981526020018881526020018781526020018681526020016040518060600160405280600081526020016000815260200160008152508152602001600015158152602001858152602001848152602001600081525090806001815401808255809150506001900390600052602060002090600e020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701600082015181600001556020820151816001015560408201518160020155505061010082015181600a0160006101000a81548160ff02191690831515021790555061012082015181600b015561014082015181600c015561016082015181600d01555050886001600160a01b0316817f1f1f6396247a5ba59b7b1e094ec3a8e439d4dace0c5ac4fe3ecfde3e68e03a8a60405160405180910390a3505050505050505050565b611a35611faa565b6003548210611a565760405162461bcd60e51b81526004016105d790612a20565b6001600160a01b038116611a7c5760405162461bcd60e51b81526004016105d790612a44565b6000611a8883836113e6565b905060008111611acf5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016105d7565b8060056000828254611ae19190612aff565b90915550506000838152600460209081526040808320338452909152812060018101805491928492611b14908490612a9a565b92505081905550600060038581548110611b3057611b30612a6e565b90600052602060002090600e020190508281600d016000828254611b549190612a9a565b90915550611b8e90506001600160a01b037f00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab1685856120cc565b604051838152859033907f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9060200160405180910390a350505061109e6001600255565b611bda612072565b6001600160a01b038116611c005760405162461bcd60e51b81526004016105d790612a44565b604051600090339047908381818185875af1925050503d8060008114611c42576040519150601f19603f3d011682016040523d82523d6000602084013e611c47565b606091505b5050905080611c8b5760405162461bcd60e51b815260206004820152601060248201526f08aa4a4bea8a4829ca68c8aa4be8aa8960831b60448201526064016105d7565b600354600090815b81811015611e5e57600060038281548110611cb057611cb0612a6e565b60009182526020918290206040805161018081018252600e90930290910180546001600160a01b039081168452600182015484860152600282015484840152600382015460608086019190915260048301546080860152600583015460a0860152600683015460c0860152835190810184526007830154815260088301549581019590955260098201549285019290925260e0830193909352600a83015460ff161515610100830152600b830154610120830152600c830154610140830152600d9092015461016082015280519092508782169116148015611d955750806101000151155b15611db0576020810151611da99085612a9a565b9350611e4b565b7f00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab6001600160a01b0316866001600160a01b031603611e4b5760008160c001517f00000000000000000000000000000000000000000000000000000000000f42408360200151611e209190612ac6565b611e2a9190612add565b905081610160015181611e3d9190612aff565b611e479086612a9a565b9450505b5080611e5681612b12565b915050611c93565b506040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eca9190612aad565b9050828111611f125760405162461bcd60e51b81526020600482015260146024820152734552525f4e4f5f4558434553535f544f4b454e5360601b60448201526064016105d7565b6000611f1e8483612aff565b9050610cf26001600160a01b03871633836120cc565b611f3c612072565b6001600160a01b038116611fa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d7565b6110d981612155565b6002805403611ffb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b60028055565b6040516001600160a01b038085166024830152831660448201526064810182905261206c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612207565b50505050565b6001546001600160a01b031633146110ee5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105d7565b6040516001600160a01b0383166024820152604481018290526120fc90849063a9059cbb60e01b90606401612035565b505050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600084843085856040516020016121c2959493929190612b2b565b6040516020818303038152906040528051906020012090505b949350505050565b60008060006121f285856122d9565b915091506121ff8161231e565b509392505050565b600061225c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124689092919063ffffffff16565b8051909150156120fc578080602001905181019061227a9190612b78565b6120fc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105d7565b600080825160410361230f5760208301516040840151606085015160001a61230387828585612477565b94509450505050612317565b506000905060025b9250929050565b600081600481111561233257612332612b9a565b0361233a5750565b600181600481111561234e5761234e612b9a565b0361239b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105d7565b60028160048111156123af576123af612b9a565b036123fc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105d7565b600381600481111561241057612410612b9a565b036110d95760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105d7565b60606121db848460008561253b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124ae5750600090506003612532565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612502573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661252b57600060019250925050612532565b9150600090505b94509492505050565b60608247101561259c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105d7565b600080866001600160a01b031685876040516125b89190612bd4565b60006040518083038185875af1925050503d80600081146125f5576040519150601f19603f3d011682016040523d82523d6000602084013e6125fa565b606091505b509150915061260b87838387612616565b979650505050505050565b6060831561268557825160000361267e576001600160a01b0385163b61267e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105d7565b50816121db565b6121db838381511561269a5781518083602001fd5b8060405162461bcd60e51b81526004016105d79190612bf0565b6000602082840312156126c657600080fd5b5035919050565b60008083601f8401126126df57600080fd5b50813567ffffffffffffffff8111156126f757600080fd5b60208301915083602082850101111561231757600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261273657600080fd5b813567ffffffffffffffff808211156127515761275161270f565b604051601f8301601f19908116603f011681019082821181831017156127795761277961270f565b8160405283815286602085880101111561279257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806000608086880312156127ca57600080fd5b8535945060208601359350604086013567ffffffffffffffff808211156127f057600080fd5b6127fc89838a016126cd565b9095509350606088013591508082111561281557600080fd5b5061282288828901612725565b9150509295509295909350565b80356001600160a01b038116811461284657600080fd5b919050565b60008060008060008060a0878903121561286457600080fd5b863595506020870135945061287b6040880161282f565b9350606087013567ffffffffffffffff8082111561289857600080fd5b6128a48a838b016126cd565b909550935060808901359150808211156128bd57600080fd5b506128ca89828a01612725565b9150509295509295509295565b600080604083850312156128ea57600080fd5b823591506128fa6020840161282f565b90509250929050565b60006020828403121561291557600080fd5b61291e8261282f565b9392505050565b6000806000806080858703121561293b57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060008060006080868803121561296f57600080fd5b853567ffffffffffffffff8082111561298757600080fd5b61299389838a016126cd565b9097509550602088013594508591506129ae6040890161282f565b9350606088013591508082111561281557600080fd5b600080600080600080600080610100898b0312156129e157600080fd5b6129ea8961282f565b9a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e00135945092505050565b6020808252600a908201526911549497d413d3d3125160b21b604082015260600190565b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561165457611654612a84565b600060208284031215612abf57600080fd5b5051919050565b808202811582820484141761165457611654612a84565b600082612afa57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561165457611654612a84565b600060018201612b2457612b24612a84565b5060010190565b60808152846080820152848660a0830137600060a08683018101919091526001600160a01b039485166020830152604082019390935292166060830152601f909201601f19160101919050565b600060208284031215612b8a57600080fd5b8151801515811461291e57600080fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015612bcb578181015183820152602001612bb3565b50506000910152565b60008251612be6818460208701612bb0565b9190910192915050565b6020815260008251806020840152612c0f816040850160208701612bb0565b601f01601f1916919091016040019291505056fea264697066735822122035fbc60928cc4f4758bd40cc5b8cca71e4a6041379b87032c03d7fee642e4fa164736f6c63430008120033

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

00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab

-----Decoded View---------------
Arg [0] : _launchToken (address): 0x02c3296C6eb50249f290AE596F2bE9454bFfadaB

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000002c3296c6eb50249f290ae596f2be9454bffadab


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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