Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 8,349 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 21302054 | 5 hrs ago | IN | 0 ETH | 0.00179353 | ||||
Claim | 21301208 | 8 hrs ago | IN | 0 ETH | 0.00108776 | ||||
Claim | 21301204 | 8 hrs ago | IN | 0 ETH | 0.00128631 | ||||
Claim | 21301200 | 8 hrs ago | IN | 0 ETH | 0.00112668 | ||||
Claim | 21301198 | 8 hrs ago | IN | 0 ETH | 0.00135656 | ||||
Claim | 21299347 | 14 hrs ago | IN | 0 ETH | 0.00076466 | ||||
Claim | 21297421 | 21 hrs ago | IN | 0 ETH | 0.00074846 | ||||
Claim | 21297225 | 21 hrs ago | IN | 0 ETH | 0.00075558 | ||||
Claim | 21297222 | 21 hrs ago | IN | 0 ETH | 0.00084643 | ||||
Claim | 21296732 | 23 hrs ago | IN | 0 ETH | 0.00081219 | ||||
Claim | 21296204 | 25 hrs ago | IN | 0 ETH | 0.00104498 | ||||
Claim | 21295251 | 28 hrs ago | IN | 0 ETH | 0.00114422 | ||||
Claim | 21293576 | 34 hrs ago | IN | 0 ETH | 0.00162552 | ||||
Claim | 21292894 | 36 hrs ago | IN | 0 ETH | 0.00098769 | ||||
Claim | 21291286 | 41 hrs ago | IN | 0 ETH | 0.00070994 | ||||
Claim | 21290349 | 45 hrs ago | IN | 0 ETH | 0.00054054 | ||||
Claim | 21289706 | 47 hrs ago | IN | 0 ETH | 0.00078332 | ||||
Claim | 21288990 | 2 days ago | IN | 0 ETH | 0.00081613 | ||||
Claim | 21288671 | 2 days ago | IN | 0 ETH | 0.00100048 | ||||
Claim | 21287616 | 2 days ago | IN | 0 ETH | 0.00109466 | ||||
Claim | 21287523 | 2 days ago | IN | 0 ETH | 0.00134557 | ||||
Claim | 21286494 | 2 days ago | IN | 0 ETH | 0.00110967 | ||||
Claim | 21286442 | 2 days ago | IN | 0 ETH | 0.00122383 | ||||
Claim | 21285966 | 2 days ago | IN | 0 ETH | 0.00069205 | ||||
Claim | 21285963 | 2 days ago | IN | 0 ETH | 0.00075813 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
SDAOLaunchpad
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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; bool vestingCliffAccrues; } 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 MAX Pools allowed in the contract to avoid Block gas limits uint256 public constant MAX_POOLS_ALLOWED = 50; /// @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) { // Check the input parameter require(_launchToken != address(0), "Invalid launch token"); 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 && _maxDeposit > _minDeposit, "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; // To restrict the number of pools per contract instance require(pid <= MAX_POOLS_ALLOWED, "Pool size exceeded"); 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, vestingCliffAccrues: false }), collected: false, cappedTotalDeposits: _cappedTotalDeposits, instantUnlockRatio: _instantUnlockRatio, totalClaimed: 0 })); emit PoolAdded(pid, _token); } function setEmission(uint256 _pid, uint256 _startOfEmissions, uint256 _endOfVestingCliff, uint256 _endOfEmissions, bool _vestingCliffAccrues) 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; emissionPeriod.vestingCliffAccrues = _vestingCliffAccrues; 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 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 { require(_pid < poolInfo.length, "ERR_POOLID"); require(_to != address(0), "ERR_ZERO_ADDRESS"); uint256 claimable = claimableTokens(_pid, msg.sender); 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 startOfEmissions = pool.emissionPeriod.vestingCliffAccrues ? pool.emissionPeriod.startOfEmissions : pool.emissionPeriod.endOfVestingCliff; uint256 totalEmissionSeconds = pool.emissionPeriod.endOfEmissions - startOfEmissions; uint256 emissionPassed = (block.timestamp < pool.emissionPeriod.endOfEmissions) ? (block.timestamp > startOfEmissions ? block.timestamp - startOfEmissions : 0) : totalEmissionSeconds; uint256 vestedUnlockedAmount = (block.timestamp >= pool.emissionPeriod.endOfVestingCliff) ? vestedAmount * emissionPassed / totalEmissionSeconds : 0; uint256 unlockedAmount = instantUnlockedAmount + vestedUnlockedAmount; claimableAmount = unlockedAmount - user.claimed; } }
// 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); } }
// 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; } }
// 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); }
// 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); }
// 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); }
// 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"); } } }
// 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); } } }
// 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; } }
// 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)); } }
// 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); } } }
// 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); } }
//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)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":[],"name":"MAX_POOLS_ALLOWED","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":"bool","name":"vestingCliffAccrues","type":"bool"}],"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":"nonpayable","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"},{"internalType":"bool","name":"_vestingCliffAccrues","type":"bool"}],"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"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162003067380380620030678339810160408190526200003491620001d8565b6200003f3362000132565b60016002556001600160a01b0381166200009f5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206c61756e636820746f6b656e000000000000000000000000604482015260640160405180910390fd5b6001600160a01b03811660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015620000ea573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011091906200020a565b6200011d90600a62000344565b60a0526200012b3362000184565b5062000355565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b600060208284031215620001eb57600080fd5b81516001600160a01b03811681146200020357600080fd5b9392505050565b6000602082840312156200021d57600080fd5b815160ff811681146200020357600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620002865781600019048211156200026a576200026a6200022f565b808516156200027857918102915b93841c93908002906200024a565b509250929050565b6000826200029f575060016200033e565b81620002ae575060006200033e565b8160018114620002c75760028114620002d257620002f2565b60019150506200033e565b60ff841115620002e657620002e66200022f565b50506001821b6200033e565b5060208310610133831016604e8410600b841016171562000317575081810a6200033e565b62000323838362000245565b80600019048211156200033a576200033a6200022f565b0290505b92915050565b60006200020360ff8416836200028e565b60805160a051612cc2620003a56000396000818161039c01528181610b83015281816114f40152611e3701526000818161032301528181610bd701528181611b9d0152611df70152612cc26000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063a28a4d86116100c3578063d82cf36e1161007c578063d82cf36e14610384578063d92a931a14610397578063ddd5e1b2146103be578063eaa4c446146103d1578063f2fde38b146103e4578063f4ea93d8146103f757600080fd5b8063a28a4d861461031e578063b62a772f14610345578063b964b5e51461034d578063bb2a091614610360578063d087d74d14610369578063d1058e591461037c57600080fd5b80636c19e783116101155780636c19e78314610263578063715018a6146102765780637ac3c02f1461027e5780638da5cb5b146102a357806393f1a40b146102b4578063984eef56146102fb57600080fd5b80631526fe271461015d5780632575dcd11461020357806339bc1c35146102185780635054da721461022b578063568e478e1461023e578063640d526414610251575b600080fd5b61017061016b3660046126f9565b610400565b604080516001600160a01b03909d168d526020808e019c909c528c81019a909a526060808d019990995260808c019790975260a08b019590955260c08a0193909352815160e08a01529681015161010089015294850151610120880152929093015115156101408601529215156101608501526101808401526101a08301526101c08201526101e0015b60405180910390f35b6102166102113660046127f7565b6104b0565b005b610216610226366004612882565b6104c5565b6102166102393660046128eb565b610725565b61021661024c366004612977565b610e8e565b6003545b6040519081526020016101fa565b6102166102713660046129a3565b611260565b61021661129a565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101fa565b6001546001600160a01b031661028b565b6102e66102c2366004612977565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101fa565b61030e6103093660046129c5565b6112ae565b60405190151581526020016101fa565b61028b7f000000000000000000000000000000000000000000000000000000000000000081565b610255603281565b61028b61035b3660046126f9565b61133b565b61025560055481565b610255610377366004612977565b611370565b610216611625565b610216610392366004612a32565b6116ab565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b6102166103cc366004612977565b611a6b565b6102166103df3660046129a3565b611c02565b6102166103f23660046129a3565b611f79565b61025561271081565b6003818154811061041057600080fd5b6000918252602091829020600f9091020180546001820154600283015460038401546004850154600586015460068701546040805160808101825260078a0154815260088a01549a81019a909a526009890154908a0152600a88015460ff908116151560608b0152600b890154600c8a0154600d8b0154600e909b01546001600160a01b03909a169c50979a96999598949793969295929491169291908c565b6104be858533868686610725565b5050505050565b6104cd611fef565b60035485106104f75760405162461bcd60e51b81526004016104ee90612a8e565b60405180910390fd5b6003858154811061050a5761050a612ab2565b90600052602060002090600f0201600701600001546000146105645760405162461bcd60e51b815260206004820152601360248201527211549497d053149150511657d1115192539151606a1b60448201526064016104ee565b8184106105a95760405162461bcd60e51b81526020600482015260136024820152724552525f53544152545f454d495353494f4e5360681b60448201526064016104ee565b8383101580156105b95750818311155b6106055760405162461bcd60e51b815260206004820152601860248201527f4552525f454e445f4f465f56455354494e475f434c494646000000000000000060448201526064016104ee565b4282116106485760405162461bcd60e51b81526020600482015260116024820152704552525f454e445f454d495353494f4e5360781b60448201526064016104ee565b60006003868154811061065d5761065d612ab2565b506000525060408051608081018252858152602081018590529081018390528115156060820152600380548291908890811061069b5761069b612ab2565b60009182526020918290208351600f929092020160078101919091558282015160088201556040808401516009830155606090930151600a909101805460ff1916911515919091179055815187815290810185905287917f8f3433165a52619388932e74a94de77af10aac26c523170aefda9e57ac679fb5910160405180910390a2505050505050565b61072d612049565b600354861061074e5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b0384166107745760405162461bcd60e51b81526004016104ee90612ac8565b60006003878154811061078957610789612ab2565b600091825260208083206040805161018081018252600f90940290910180546001600160a01b03908116855260018201548585015260028201548584015260038201546060808701919091526004808401546080808901918252600586015460a08a0152600686015460c08a01528651908101875260078601548152600886015481890152600986015481880152600a86015460ff90811615159482019490945260e0890152600b8501549092161515610100880152600c840154610120880152600d840154610140880152600e909301546101608701528d8752918452828620908b168652909252909220915190925042116108c85760405162461bcd60e51b815260206004820152601960248201527f4552525f4245464f52455f4445504f534954535f53544152540000000000000060448201526064016104ee565b428260a00151116109145760405162461bcd60e51b815260206004820152601660248201527511549497d05195115497d1115413d4d25514d7d1539160521b60448201526064016104ee565b60408201518154610926908990612b08565b10156109665760405162461bcd60e51b815260206004820152600f60248201526e11549497d3525397d1115413d4d255608a1b60448201526064016104ee565b60608201518154610978908990612b08565b11156109b85760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016104ee565b8161012001518783602001516109ce9190612b08565b1115610a105760405162461bcd60e51b815260206004820152601160248201527011549497d413d3d317d4d3d31117d3d555607a1b60448201526064016104ee565b81516040516370a0823160e01b815233600482015288916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b9190612b1b565b1015610abf5760405162461bcd60e51b81526020600482015260136024820152724552525f4445504f5349545f42414c414e434560681b60448201526064016104ee565b8151604051636eb1769f60e11b815233600482015230602482015288916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190612b1b565b1015610b765760405162461bcd60e51b81526020600482015260156024820152744552525f4445504f5349545f414c4c4f57414e434560581b60448201526064016104ee565b60c0820151600090610ba87f00000000000000000000000000000000000000000000000000000000000000008a612b34565b610bb29190612b4b565b905060055481610bc29190612b08565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190612b1b565b1015610c905760405162461bcd60e51b81526020600482015260156024820152744552525f4c41554e43485041445f42414c414e434560581b60448201526064016104ee565b610c9d86868b8a886112ae565b610cd95760405162461bcd60e51b815260206004820152600d60248201526c11549497d5d2125511531254d5609a1b60448201526064016104ee565b8060056000828254610ceb9190612b08565b9091555050815488908390600090610d04908490612b08565b925050819055508783602001818151610d1d9190612b08565b905250600380548491908b908110610d3757610d37612ab2565b60009182526020918290208351600f9092020180546001600160a01b039283166001600160a01b0319909116178155838301516001820155604080850151600283015560608086015160038401556080860151600484015560a0860151600584015560c0860151600684015560e0860151805160078501559485015160088401559084015160098301559290920151600a8301805491151560ff19928316179055610100840151600b8401805491151591909216179055610120830151600c830155610140830151600d83015561016090920151600e909101558351610e20911633308b6120a0565b82516040516001600160a01b038916918b9133917fc436f473cd90c9b4dd731856a14b80f713d384a1688a506d4230140c5b36d5cd91610e71918e82526001600160a01b0316602082015260400190565b60405180910390a4505050610e866001600255565b505050505050565b610e96612049565b610e9e611fef565b6003548210610ebf5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b038116610ee55760405162461bcd60e51b81526004016104ee90612ac8565b600060038381548110610efa57610efa612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b03168352600181015483850190815260028201548484015260038201546060808601919091526004830154608080870191909152600584015460a0870152600684015460c08701528451908101855260078401548152600884015496810196909652600983015493860193909352600a82015460ff90811615159386019390935260e0840194909452600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e0154610160820152905190915061101d5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f5f4445504f5349545360881b60448201526064016104ee565b428160a00151106110645760405162461bcd60e51b81526020600482015260116024820152704552525f4f50454e5f4445504f5349545360781b60448201526064016104ee565b60e0810151516110a95760405162461bcd60e51b815260206004820152601060248201526f4552525f4e4f5f454d495353494f4e5360801b60448201526064016104ee565b806101000151156110f45760405162461bcd60e51b815260206004820152601560248201527411549497d053149150511657d0d3d3131150d51151605a1b60448201526064016104ee565b6001610100820152600380548291908590811061111357611113612ab2565b60009182526020918290208351600f9092020180546001600160a01b039283166001600160a01b0319909116178155838301516001820155604080850151600283015560608086015160038401556080860151600484015560a0860151600584015560c0860151600684015560e0860151805160078501558086015160088501559182015160098401550151600a8201805491151560ff19928316179055610100850151600b8301805491151591909216179055610120840151600c820155610140840151600d82015561016090930151600e9093019290925582015182516111ff9216908490612111565b816001600160a01b031683336001600160a01b03167fbc26696e7e0fabc5eca7f4c50f2eca48ff55ef18d9855423e62c0e142fc5806e846020015160405161124991815260200190565b60405180910390a45061125c6001600255565b5050565b611268611fef565b6001600160a01b03811661128e5760405162461bcd60e51b81526004016104ee90612ac8565b61129781612146565b50565b6112a2611fef565b6112ac600061219a565b565b600080546001600160a01b0316611327836113216112ce8a8a8a8a6121ec565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612228565b6001600160a01b0316149695505050505050565b60006003828154811061135057611350612ab2565b60009182526020909120600f90910201546001600160a01b031692915050565b60035460009083106113945760405162461bcd60e51b81526004016104ee90612a8e565b6000600384815481106113a9576113a9612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b0316835260018101548385015260028101548383015260038101546060808501919091526004820154608080860191909152600583015460a0860152600683015460c08601528351908101845260078301548152600883015495810195909552600982015492850192909252600a81015460ff90811615159285019290925260e08301849052600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e01546101608201529051909150158061149b575060e08101515142105b156114aa57600091505061161f565b60008481526004602090815260408083206001600160a01b03871684528252808320815180830190925280548083526001909101549282019290925260c0840151909291611519907f000000000000000000000000000000000000000000000000000000000000000090612b34565b6115239190612b4b565b905060006127108461014001518361153b9190612b34565b6115459190612b4b565b905060006115538284612b6d565b905060008560e0015160600151611572578560e0015160200151611579565b60e0860151515b90506000818760e00151604001516115919190612b6d565b905060008760e001516040015142106115aa57816115c2565b8242116115b85760006115c2565b6115c28342612b6d565b905060008860e00151602001514210156115dd5760006115f2565b826115e88387612b34565b6115f29190612b4b565b905060006116008288612b08565b90508860200151816116129190612b6d565b9a50505050505050505050505b92915050565b600354600090815b818110156116685760006116418233611370565b1115611656576116518133611a6b565b600192505b8061166081612b80565b91505061162d565b508161125c5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016104ee565b6116b3611fef565b6001600160a01b0388166116d95760405162461bcd60e51b81526004016104ee90612ac8565b6000861180156116e857508686115b6117265760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016104ee565b83851061176a5760405162461bcd60e51b81526020600482015260126024820152714552525f53544152545f4445504f5349545360701b60448201526064016104ee565b4284116117ac5760405162461bcd60e51b815260206004820152601060248201526f4552525f454e445f4445504f5349545360801b60448201526064016104ee565b600083116117e85760405162461bcd60e51b81526020600482015260096024820152684552525f505249434560b81b60448201526064016104ee565b61271081106118395760405162461bcd60e51b815260206004820152601860248201527f4552525f494e5354414e545f554e4c4f434b5f524154494f000000000000000060448201526064016104ee565b60035460328111156118825760405162461bcd60e51b8152602060048201526012602482015271141bdbdb081cda5e9948195e18d95959195960721b60448201526064016104ee565b60036040518061018001604052808b6001600160a01b03168152602001600081526020018a81526020018981526020018881526020018781526020018681526020016040518060800160405280600081526020016000815260200160008152602001600015158152508152602001600015158152602001858152602001848152602001600081525090806001815401808255809150506001900390600052602060002090600f020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908315150217905550505061010082015181600b0160006101000a81548160ff02191690831515021790555061012082015181600c015561014082015181600d015561016082015181600e01555050886001600160a01b0316817f1f1f6396247a5ba59b7b1e094ec3a8e439d4dace0c5ac4fe3ecfde3e68e03a8a60405160405180910390a3505050505050505050565b6003548210611a8c5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b038116611ab25760405162461bcd60e51b81526004016104ee90612ac8565b6000611abe8333611370565b905060008111611b055760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016104ee565b8060056000828254611b179190612b6d565b90915550506000838152600460209081526040808320338452909152812060018101805491928492611b4a908490612b08565b92505081905550600060038581548110611b6657611b66612ab2565b90600052602060002090600f020190508281600e016000828254611b8a9190612b08565b90915550611bc490506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585612111565b604051838152859033907f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9060200160405180910390a35050505050565b611c0a611fef565b6001600160a01b038116611c305760405162461bcd60e51b81526004016104ee90612ac8565b604051600090339047908381818185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5050905080611cbb5760405162461bcd60e51b815260206004820152601060248201526f08aa4a4bea8a4829ca68c8aa4be8aa8960831b60448201526064016104ee565b600354600090815b81811015611ea357600060038281548110611ce057611ce0612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b03908116845260018201548486015260028201548484015260038201546060808601919091526004830154608080870191909152600584015460a0870152600684015460c08701528451908101855260078401548152600884015496810196909652600983015493860193909352600a82015460ff90811615159386019390935260e0840194909452600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e015461016082015280519092508782169116148015611dda5750806101000151155b15611df5576020810151611dee9085612b08565b9350611e90565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031603611e905760008160c001517f00000000000000000000000000000000000000000000000000000000000000008360200151611e659190612b34565b611e6f9190612b4b565b905081610160015181611e829190612b6d565b611e8c9086612b08565b9450505b5080611e9b81612b80565b915050611cc3565b506040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190612b1b565b9050828111611f575760405162461bcd60e51b81526020600482015260146024820152734552525f4e4f5f4558434553535f544f4b454e5360601b60448201526064016104ee565b6000611f638483612b6d565b9050610e866001600160a01b0387163383612111565b611f81611fef565b6001600160a01b038116611fe65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ee565b6112978161219a565b6001546001600160a01b031633146112ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104ee565b600280540361209a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104ee565b60028055565b6040516001600160a01b038085166024830152831660448201526064810182905261210b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261224c565b50505050565b6040516001600160a01b03831660248201526044810182905261214190849063a9059cbb60e01b906064016120d4565b505050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008484308585604051602001612207959493929190612b99565b6040516020818303038152906040528051906020012090505b949350505050565b6000806000612237858561231e565b9150915061224481612363565b509392505050565b60006122a1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124ad9092919063ffffffff16565b80519091501561214157808060200190518101906122bf9190612be6565b6121415760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104ee565b60008082516041036123545760208301516040840151606085015160001a612348878285856124bc565b9450945050505061235c565b506000905060025b9250929050565b600081600481111561237757612377612c03565b0361237f5750565b600181600481111561239357612393612c03565b036123e05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016104ee565b60028160048111156123f4576123f4612c03565b036124415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016104ee565b600381600481111561245557612455612c03565b036112975760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016104ee565b60606122208484600085612580565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124f35750600090506003612577565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612547573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661257057600060019250925050612577565b9150600090505b94509492505050565b6060824710156125e15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104ee565b600080866001600160a01b031685876040516125fd9190612c3d565b60006040518083038185875af1925050503d806000811461263a576040519150601f19603f3d011682016040523d82523d6000602084013e61263f565b606091505b50915091506126508783838761265b565b979650505050505050565b606083156126ca5782516000036126c3576001600160a01b0385163b6126c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104ee565b5081612220565b61222083838151156126df5781518083602001fd5b8060405162461bcd60e51b81526004016104ee9190612c59565b60006020828403121561270b57600080fd5b5035919050565b60008083601f84011261272457600080fd5b50813567ffffffffffffffff81111561273c57600080fd5b60208301915083602082850101111561235c57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261277b57600080fd5b813567ffffffffffffffff8082111561279657612796612754565b604051601f8301601f19908116603f011681019082821181831017156127be576127be612754565b816040528381528660208588010111156127d757600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060006080868803121561280f57600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561283557600080fd5b61284189838a01612712565b9095509350606088013591508082111561285a57600080fd5b506128678882890161276a565b9150509295509295909350565b801515811461129757600080fd5b600080600080600060a0868803121561289a57600080fd5b8535945060208601359350604086013592506060860135915060808601356128c181612874565b809150509295509295909350565b80356001600160a01b03811681146128e657600080fd5b919050565b60008060008060008060a0878903121561290457600080fd5b863595506020870135945061291b604088016128cf565b9350606087013567ffffffffffffffff8082111561293857600080fd5b6129448a838b01612712565b9095509350608089013591508082111561295d57600080fd5b5061296a89828a0161276a565b9150509295509295509295565b6000806040838503121561298a57600080fd5b8235915061299a602084016128cf565b90509250929050565b6000602082840312156129b557600080fd5b6129be826128cf565b9392505050565b6000806000806000608086880312156129dd57600080fd5b853567ffffffffffffffff808211156129f557600080fd5b612a0189838a01612712565b909750955060208801359450859150612a1c604089016128cf565b9350606088013591508082111561285a57600080fd5b600080600080600080600080610100898b031215612a4f57600080fd5b612a58896128cf565b9a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e00135945092505050565b6020808252600a908201526911549497d413d3d3125160b21b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561161f5761161f612af2565b600060208284031215612b2d57600080fd5b5051919050565b808202811582820484141761161f5761161f612af2565b600082612b6857634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561161f5761161f612af2565b600060018201612b9257612b92612af2565b5060010190565b60808152846080820152848660a0830137600060a08683018101919091526001600160a01b039485166020830152604082019390935292166060830152601f909201601f19160101919050565b600060208284031215612bf857600080fd5b81516129be81612874565b634e487b7160e01b600052602160045260246000fd5b60005b83811015612c34578181015183820152602001612c1c565b50506000910152565b60008251612c4f818460208701612c19565b9190910192915050565b6020815260008251806020840152612c78816040850160208701612c19565b601f01601f1916919091016040019291505056fea2646970667358221220807191c85b18c1244dc3765ee9ae23f6088463f2b02e57135e4b30682848163164736f6c6343000812003300000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d380
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063a28a4d86116100c3578063d82cf36e1161007c578063d82cf36e14610384578063d92a931a14610397578063ddd5e1b2146103be578063eaa4c446146103d1578063f2fde38b146103e4578063f4ea93d8146103f757600080fd5b8063a28a4d861461031e578063b62a772f14610345578063b964b5e51461034d578063bb2a091614610360578063d087d74d14610369578063d1058e591461037c57600080fd5b80636c19e783116101155780636c19e78314610263578063715018a6146102765780637ac3c02f1461027e5780638da5cb5b146102a357806393f1a40b146102b4578063984eef56146102fb57600080fd5b80631526fe271461015d5780632575dcd11461020357806339bc1c35146102185780635054da721461022b578063568e478e1461023e578063640d526414610251575b600080fd5b61017061016b3660046126f9565b610400565b604080516001600160a01b03909d168d526020808e019c909c528c81019a909a526060808d019990995260808c019790975260a08b019590955260c08a0193909352815160e08a01529681015161010089015294850151610120880152929093015115156101408601529215156101608501526101808401526101a08301526101c08201526101e0015b60405180910390f35b6102166102113660046127f7565b6104b0565b005b610216610226366004612882565b6104c5565b6102166102393660046128eb565b610725565b61021661024c366004612977565b610e8e565b6003545b6040519081526020016101fa565b6102166102713660046129a3565b611260565b61021661129a565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101fa565b6001546001600160a01b031661028b565b6102e66102c2366004612977565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101fa565b61030e6103093660046129c5565b6112ae565b60405190151581526020016101fa565b61028b7f00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d38081565b610255603281565b61028b61035b3660046126f9565b61133b565b61025560055481565b610255610377366004612977565b611370565b610216611625565b610216610392366004612a32565b6116ab565b6102557f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6102166103cc366004612977565b611a6b565b6102166103df3660046129a3565b611c02565b6102166103f23660046129a3565b611f79565b61025561271081565b6003818154811061041057600080fd5b6000918252602091829020600f9091020180546001820154600283015460038401546004850154600586015460068701546040805160808101825260078a0154815260088a01549a81019a909a526009890154908a0152600a88015460ff908116151560608b0152600b890154600c8a0154600d8b0154600e909b01546001600160a01b03909a169c50979a96999598949793969295929491169291908c565b6104be858533868686610725565b5050505050565b6104cd611fef565b60035485106104f75760405162461bcd60e51b81526004016104ee90612a8e565b60405180910390fd5b6003858154811061050a5761050a612ab2565b90600052602060002090600f0201600701600001546000146105645760405162461bcd60e51b815260206004820152601360248201527211549497d053149150511657d1115192539151606a1b60448201526064016104ee565b8184106105a95760405162461bcd60e51b81526020600482015260136024820152724552525f53544152545f454d495353494f4e5360681b60448201526064016104ee565b8383101580156105b95750818311155b6106055760405162461bcd60e51b815260206004820152601860248201527f4552525f454e445f4f465f56455354494e475f434c494646000000000000000060448201526064016104ee565b4282116106485760405162461bcd60e51b81526020600482015260116024820152704552525f454e445f454d495353494f4e5360781b60448201526064016104ee565b60006003868154811061065d5761065d612ab2565b506000525060408051608081018252858152602081018590529081018390528115156060820152600380548291908890811061069b5761069b612ab2565b60009182526020918290208351600f929092020160078101919091558282015160088201556040808401516009830155606090930151600a909101805460ff1916911515919091179055815187815290810185905287917f8f3433165a52619388932e74a94de77af10aac26c523170aefda9e57ac679fb5910160405180910390a2505050505050565b61072d612049565b600354861061074e5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b0384166107745760405162461bcd60e51b81526004016104ee90612ac8565b60006003878154811061078957610789612ab2565b600091825260208083206040805161018081018252600f90940290910180546001600160a01b03908116855260018201548585015260028201548584015260038201546060808701919091526004808401546080808901918252600586015460a08a0152600686015460c08a01528651908101875260078601548152600886015481890152600986015481880152600a86015460ff90811615159482019490945260e0890152600b8501549092161515610100880152600c840154610120880152600d840154610140880152600e909301546101608701528d8752918452828620908b168652909252909220915190925042116108c85760405162461bcd60e51b815260206004820152601960248201527f4552525f4245464f52455f4445504f534954535f53544152540000000000000060448201526064016104ee565b428260a00151116109145760405162461bcd60e51b815260206004820152601660248201527511549497d05195115497d1115413d4d25514d7d1539160521b60448201526064016104ee565b60408201518154610926908990612b08565b10156109665760405162461bcd60e51b815260206004820152600f60248201526e11549497d3525397d1115413d4d255608a1b60448201526064016104ee565b60608201518154610978908990612b08565b11156109b85760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016104ee565b8161012001518783602001516109ce9190612b08565b1115610a105760405162461bcd60e51b815260206004820152601160248201527011549497d413d3d317d4d3d31117d3d555607a1b60448201526064016104ee565b81516040516370a0823160e01b815233600482015288916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b9190612b1b565b1015610abf5760405162461bcd60e51b81526020600482015260136024820152724552525f4445504f5349545f42414c414e434560681b60448201526064016104ee565b8151604051636eb1769f60e11b815233600482015230602482015288916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190612b1b565b1015610b765760405162461bcd60e51b81526020600482015260156024820152744552525f4445504f5349545f414c4c4f57414e434560581b60448201526064016104ee565b60c0820151600090610ba87f0000000000000000000000000000000000000000000000000de0b6b3a76400008a612b34565b610bb29190612b4b565b905060055481610bc29190612b08565b6040516370a0823160e01b81523060048201527f00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d3806001600160a01b0316906370a0823190602401602060405180830381865afa158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190612b1b565b1015610c905760405162461bcd60e51b81526020600482015260156024820152744552525f4c41554e43485041445f42414c414e434560581b60448201526064016104ee565b610c9d86868b8a886112ae565b610cd95760405162461bcd60e51b815260206004820152600d60248201526c11549497d5d2125511531254d5609a1b60448201526064016104ee565b8060056000828254610ceb9190612b08565b9091555050815488908390600090610d04908490612b08565b925050819055508783602001818151610d1d9190612b08565b905250600380548491908b908110610d3757610d37612ab2565b60009182526020918290208351600f9092020180546001600160a01b039283166001600160a01b0319909116178155838301516001820155604080850151600283015560608086015160038401556080860151600484015560a0860151600584015560c0860151600684015560e0860151805160078501559485015160088401559084015160098301559290920151600a8301805491151560ff19928316179055610100840151600b8401805491151591909216179055610120830151600c830155610140830151600d83015561016090920151600e909101558351610e20911633308b6120a0565b82516040516001600160a01b038916918b9133917fc436f473cd90c9b4dd731856a14b80f713d384a1688a506d4230140c5b36d5cd91610e71918e82526001600160a01b0316602082015260400190565b60405180910390a4505050610e866001600255565b505050505050565b610e96612049565b610e9e611fef565b6003548210610ebf5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b038116610ee55760405162461bcd60e51b81526004016104ee90612ac8565b600060038381548110610efa57610efa612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b03168352600181015483850190815260028201548484015260038201546060808601919091526004830154608080870191909152600584015460a0870152600684015460c08701528451908101855260078401548152600884015496810196909652600983015493860193909352600a82015460ff90811615159386019390935260e0840194909452600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e0154610160820152905190915061101d5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f5f4445504f5349545360881b60448201526064016104ee565b428160a00151106110645760405162461bcd60e51b81526020600482015260116024820152704552525f4f50454e5f4445504f5349545360781b60448201526064016104ee565b60e0810151516110a95760405162461bcd60e51b815260206004820152601060248201526f4552525f4e4f5f454d495353494f4e5360801b60448201526064016104ee565b806101000151156110f45760405162461bcd60e51b815260206004820152601560248201527411549497d053149150511657d0d3d3131150d51151605a1b60448201526064016104ee565b6001610100820152600380548291908590811061111357611113612ab2565b60009182526020918290208351600f9092020180546001600160a01b039283166001600160a01b0319909116178155838301516001820155604080850151600283015560608086015160038401556080860151600484015560a0860151600584015560c0860151600684015560e0860151805160078501558086015160088501559182015160098401550151600a8201805491151560ff19928316179055610100850151600b8301805491151591909216179055610120840151600c820155610140840151600d82015561016090930151600e9093019290925582015182516111ff9216908490612111565b816001600160a01b031683336001600160a01b03167fbc26696e7e0fabc5eca7f4c50f2eca48ff55ef18d9855423e62c0e142fc5806e846020015160405161124991815260200190565b60405180910390a45061125c6001600255565b5050565b611268611fef565b6001600160a01b03811661128e5760405162461bcd60e51b81526004016104ee90612ac8565b61129781612146565b50565b6112a2611fef565b6112ac600061219a565b565b600080546001600160a01b0316611327836113216112ce8a8a8a8a6121ec565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612228565b6001600160a01b0316149695505050505050565b60006003828154811061135057611350612ab2565b60009182526020909120600f90910201546001600160a01b031692915050565b60035460009083106113945760405162461bcd60e51b81526004016104ee90612a8e565b6000600384815481106113a9576113a9612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b0316835260018101548385015260028101548383015260038101546060808501919091526004820154608080860191909152600583015460a0860152600683015460c08601528351908101845260078301548152600883015495810195909552600982015492850192909252600a81015460ff90811615159285019290925260e08301849052600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e01546101608201529051909150158061149b575060e08101515142105b156114aa57600091505061161f565b60008481526004602090815260408083206001600160a01b03871684528252808320815180830190925280548083526001909101549282019290925260c0840151909291611519907f0000000000000000000000000000000000000000000000000de0b6b3a764000090612b34565b6115239190612b4b565b905060006127108461014001518361153b9190612b34565b6115459190612b4b565b905060006115538284612b6d565b905060008560e0015160600151611572578560e0015160200151611579565b60e0860151515b90506000818760e00151604001516115919190612b6d565b905060008760e001516040015142106115aa57816115c2565b8242116115b85760006115c2565b6115c28342612b6d565b905060008860e00151602001514210156115dd5760006115f2565b826115e88387612b34565b6115f29190612b4b565b905060006116008288612b08565b90508860200151816116129190612b6d565b9a50505050505050505050505b92915050565b600354600090815b818110156116685760006116418233611370565b1115611656576116518133611a6b565b600192505b8061166081612b80565b91505061162d565b508161125c5760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016104ee565b6116b3611fef565b6001600160a01b0388166116d95760405162461bcd60e51b81526004016104ee90612ac8565b6000861180156116e857508686115b6117265760405162461bcd60e51b815260206004820152600f60248201526e11549497d3505617d1115413d4d255608a1b60448201526064016104ee565b83851061176a5760405162461bcd60e51b81526020600482015260126024820152714552525f53544152545f4445504f5349545360701b60448201526064016104ee565b4284116117ac5760405162461bcd60e51b815260206004820152601060248201526f4552525f454e445f4445504f5349545360801b60448201526064016104ee565b600083116117e85760405162461bcd60e51b81526020600482015260096024820152684552525f505249434560b81b60448201526064016104ee565b61271081106118395760405162461bcd60e51b815260206004820152601860248201527f4552525f494e5354414e545f554e4c4f434b5f524154494f000000000000000060448201526064016104ee565b60035460328111156118825760405162461bcd60e51b8152602060048201526012602482015271141bdbdb081cda5e9948195e18d95959195960721b60448201526064016104ee565b60036040518061018001604052808b6001600160a01b03168152602001600081526020018a81526020018981526020018881526020018781526020018681526020016040518060800160405280600081526020016000815260200160008152602001600015158152508152602001600015158152602001858152602001848152602001600081525090806001815401808255809150506001900390600052602060002090600f020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908315150217905550505061010082015181600b0160006101000a81548160ff02191690831515021790555061012082015181600c015561014082015181600d015561016082015181600e01555050886001600160a01b0316817f1f1f6396247a5ba59b7b1e094ec3a8e439d4dace0c5ac4fe3ecfde3e68e03a8a60405160405180910390a3505050505050505050565b6003548210611a8c5760405162461bcd60e51b81526004016104ee90612a8e565b6001600160a01b038116611ab25760405162461bcd60e51b81526004016104ee90612ac8565b6000611abe8333611370565b905060008111611b055760405162461bcd60e51b81526020600482015260126024820152714552525f5a45524f5f434c41494d41424c4560701b60448201526064016104ee565b8060056000828254611b179190612b6d565b90915550506000838152600460209081526040808320338452909152812060018101805491928492611b4a908490612b08565b92505081905550600060038581548110611b6657611b66612ab2565b90600052602060002090600f020190508281600e016000828254611b8a9190612b08565b90915550611bc490506001600160a01b037f00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d380168585612111565b604051838152859033907f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9060200160405180910390a35050505050565b611c0a611fef565b6001600160a01b038116611c305760405162461bcd60e51b81526004016104ee90612ac8565b604051600090339047908381818185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5050905080611cbb5760405162461bcd60e51b815260206004820152601060248201526f08aa4a4bea8a4829ca68c8aa4be8aa8960831b60448201526064016104ee565b600354600090815b81811015611ea357600060038281548110611ce057611ce0612ab2565b60009182526020918290206040805161018081018252600f90930290910180546001600160a01b03908116845260018201548486015260028201548484015260038201546060808601919091526004830154608080870191909152600584015460a0870152600684015460c08701528451908101855260078401548152600884015496810196909652600983015493860193909352600a82015460ff90811615159386019390935260e0840194909452600b8101549091161515610100830152600c810154610120830152600d810154610140830152600e015461016082015280519092508782169116148015611dda5750806101000151155b15611df5576020810151611dee9085612b08565b9350611e90565b7f00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d3806001600160a01b0316866001600160a01b031603611e905760008160c001517f0000000000000000000000000000000000000000000000000de0b6b3a76400008360200151611e659190612b34565b611e6f9190612b4b565b905081610160015181611e829190612b6d565b611e8c9086612b08565b9450505b5080611e9b81612b80565b915050611cc3565b506040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190612b1b565b9050828111611f575760405162461bcd60e51b81526020600482015260146024820152734552525f4e4f5f4558434553535f544f4b454e5360601b60448201526064016104ee565b6000611f638483612b6d565b9050610e866001600160a01b0387163383612111565b611f81611fef565b6001600160a01b038116611fe65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ee565b6112978161219a565b6001546001600160a01b031633146112ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104ee565b600280540361209a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104ee565b60028055565b6040516001600160a01b038085166024830152831660448201526064810182905261210b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261224c565b50505050565b6040516001600160a01b03831660248201526044810182905261214190849063a9059cbb60e01b906064016120d4565b505050565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c739060200160405180910390a150565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008484308585604051602001612207959493929190612b99565b6040516020818303038152906040528051906020012090505b949350505050565b6000806000612237858561231e565b9150915061224481612363565b509392505050565b60006122a1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124ad9092919063ffffffff16565b80519091501561214157808060200190518101906122bf9190612be6565b6121415760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104ee565b60008082516041036123545760208301516040840151606085015160001a612348878285856124bc565b9450945050505061235c565b506000905060025b9250929050565b600081600481111561237757612377612c03565b0361237f5750565b600181600481111561239357612393612c03565b036123e05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016104ee565b60028160048111156123f4576123f4612c03565b036124415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016104ee565b600381600481111561245557612455612c03565b036112975760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016104ee565b60606122208484600085612580565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124f35750600090506003612577565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612547573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661257057600060019250925050612577565b9150600090505b94509492505050565b6060824710156125e15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104ee565b600080866001600160a01b031685876040516125fd9190612c3d565b60006040518083038185875af1925050503d806000811461263a576040519150601f19603f3d011682016040523d82523d6000602084013e61263f565b606091505b50915091506126508783838761265b565b979650505050505050565b606083156126ca5782516000036126c3576001600160a01b0385163b6126c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104ee565b5081612220565b61222083838151156126df5781518083602001fd5b8060405162461bcd60e51b81526004016104ee9190612c59565b60006020828403121561270b57600080fd5b5035919050565b60008083601f84011261272457600080fd5b50813567ffffffffffffffff81111561273c57600080fd5b60208301915083602082850101111561235c57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261277b57600080fd5b813567ffffffffffffffff8082111561279657612796612754565b604051601f8301601f19908116603f011681019082821181831017156127be576127be612754565b816040528381528660208588010111156127d757600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060006080868803121561280f57600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561283557600080fd5b61284189838a01612712565b9095509350606088013591508082111561285a57600080fd5b506128678882890161276a565b9150509295509295909350565b801515811461129757600080fd5b600080600080600060a0868803121561289a57600080fd5b8535945060208601359350604086013592506060860135915060808601356128c181612874565b809150509295509295909350565b80356001600160a01b03811681146128e657600080fd5b919050565b60008060008060008060a0878903121561290457600080fd5b863595506020870135945061291b604088016128cf565b9350606087013567ffffffffffffffff8082111561293857600080fd5b6129448a838b01612712565b9095509350608089013591508082111561295d57600080fd5b5061296a89828a0161276a565b9150509295509295509295565b6000806040838503121561298a57600080fd5b8235915061299a602084016128cf565b90509250929050565b6000602082840312156129b557600080fd5b6129be826128cf565b9392505050565b6000806000806000608086880312156129dd57600080fd5b853567ffffffffffffffff808211156129f557600080fd5b612a0189838a01612712565b909750955060208801359450859150612a1c604089016128cf565b9350606088013591508082111561285a57600080fd5b600080600080600080600080610100898b031215612a4f57600080fd5b612a58896128cf565b9a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e00135945092505050565b6020808252600a908201526911549497d413d3d3125160b21b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561161f5761161f612af2565b600060208284031215612b2d57600080fd5b5051919050565b808202811582820484141761161f5761161f612af2565b600082612b6857634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561161f5761161f612af2565b600060018201612b9257612b92612af2565b5060010190565b60808152846080820152848660a0830137600060a08683018101919091526001600160a01b039485166020830152604082019390935292166060830152601f909201601f19160101919050565b600060208284031215612bf857600080fd5b81516129be81612874565b634e487b7160e01b600052602160045260246000fd5b60005b83811015612c34578181015183820152602001612c1c565b50506000910152565b60008251612c4f818460208701612c19565b9190910192915050565b6020815260008251806020840152612c78816040850160208701612c19565b601f01601f1916919091016040019291505056fea2646970667358221220807191c85b18c1244dc3765ee9ae23f6088463f2b02e57135e4b30682848163164736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d380
-----Decoded View---------------
Arg [0] : _launchToken (address): 0x73fBD93bFDa83B111DdC092aa3a4ca77fD30d380
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000073fbd93bfda83b111ddc092aa3a4ca77fd30d380
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.017694 | 18,241,330.4914 | $322,766.66 |
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.