Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PreSaleETH
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "../interfaces/ITreasuryXOX.sol"; contract OwnerWithdrawable is OwnableUpgradeable { using SafeMathUpgradeable for uint256; using SafeERC20Upgradeable for IERC20Upgradeable; function withdraw(address token, uint256 amt) public onlyOwner { IERC20Upgradeable(token).safeTransfer(msg.sender, amt); } function withdrawAll(address token) public onlyOwner { uint256 amt = IERC20Upgradeable(token).balanceOf(address(this)); withdraw(token, amt); } function withdrawCurrency(uint256 amt) public onlyOwner { payable(msg.sender).transfer(amt); } } contract PreSaleETH is Initializable, OwnerWithdrawable, PausableUpgradeable { using SafeMathUpgradeable for uint256; using SafeERC20Upgradeable for IERC20Upgradeable; // Exchange rate uint256 public constant BASE_DENOMINATOR = 10_000; // 10_000 uint256 public constant _ONE_DAY = 86400; // 86400 seconds = 1 day uint256 public _ONE_WEEK; // 604800 uint256 public _ONE_HOUR; // 3600 uint256 public _ONE_MONTH; // 2592000 seconds = 30 days uint256[10] public TOKEN_PRICE; uint256[10] public BONUS_PERCENTAGE; uint256[10] public DISTRIBUTION_TOKEN; uint256[10] public XOXS_BONUS; // Buy boundary uint256 public constant MINIMUM_BUY = 50_000_000; uint256 public constant MINIMUM_BUY_NEW = 10_000_000; uint256 public constant MAXIMUM_BUY_WL = 5_000_000_000; uint256 public constant MAXIMUM_BUY = 10_000_000_000; uint256 public constant TOTAL_ROUND = 10; // Chainlink price feed AggregatorV3Interface internal priceFeed; // Treasury contract address for user receive a bonus of XOXS token address treasuryContractAddress; // Whitelist of tokens to buy from mapping(address => bool) public tokenWL; // Root of merkle tree, used to whitelist address on pre sale bytes32 public merkleRoot; IERC20Upgradeable public xoxToken; // Time launch DAPP uint256 public launchTime; uint256 public startTime; uint256 public endTime; // Amount each user has invested mapping(address => uint256) public userInvestedAmount; // Amount each user has invested USD mapping(address => uint256) private userInvestedUSDAmount; // Amount each user has invested USD in Whitelist round mapping(address => uint256) private whitelistInvestedUSDAmount; // Amount invested token (XOX) each user has claimed mapping(address => uint256) public userClaimedAmount; // Total amount of XOX that users has invested in each round mapping(uint256 => uint256) public totalRoundInvested; // operator is wallet can call next round address private operator; // force next round uint256 public forceRound; uint256 public forceTime; uint256 public startTimeNew; uint256 public startTimeNextRound; event PreSaleTokenInvested( address _sender, uint256 _valueUSD, uint256 _amountXOX, uint256 _amountXOXS, uint256 _round ); event UserClaimedToken(address _sender, uint256 _amount); // Receive native token function receive() external payable {} fallback() external payable {} /* ========== CONSTRUCTOR ========== */ /** * @dev constructor the contract * @param _xoxTokenAddress Address XOX * @param _whitelistTokens List of tokens accepted for payment * @param _treasuryContractAddress Treasury Address process logic XOXS * @param _priceFeedAddress Chainlink price feed * @param _operator Wallet can call nextRound * @notice Each parameters should be set carefully since it's not modifiable for each round */ function initialize( address _xoxTokenAddress, address[2] memory _whitelistTokens, address _treasuryContractAddress, address _priceFeedAddress, address _operator, uint256 _startTime ) public initializer { __Ownable_init_unchained(); xoxToken = IERC20Upgradeable(_xoxTokenAddress); treasuryContractAddress = _treasuryContractAddress; priceFeed = AggregatorV3Interface(_priceFeedAddress); tokenWL[_whitelistTokens[0]] = true; tokenWL[_whitelistTokens[1]] = true; TOKEN_PRICE = [500, 540, 580, 620, 660, 700, 740, 780, 820, 860]; BONUS_PERCENTAGE = [12, 11, 10, 9, 8, 7, 6, 5, 4, 3]; DISTRIBUTION_TOKEN = [ 5_000_000 ether, 6_000_000 ether, 6_000_000 ether, 7_000_000 ether, 7_000_000 ether, 8_000_000 ether, 8_000_000 ether, 8_000_000 ether, 8_000_000 ether, 9_000_000 ether ]; XOXS_BONUS = [ 120000, 110000, 100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000 ]; startTime = _startTime; _ONE_WEEK = 604800; // 604800 _ONE_HOUR = 3600; // 3600 _ONE_MONTH = 2592000; // 2592000 seconds = 30 days endTime = _ONE_WEEK.mul(10).add(_startTime); operator = _operator; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOperator() { _checkOperator(); _; } /** * @dev This function is designed to pause invest activity on this contract in case emergency happen */ function pause() public onlyOperator { _pause(); } /** * @dev Unpause the contract & let everything be normal */ function unpause() public onlyOperator { _unpause(); } /** * @dev Update list of addresses that are whitelisted to buy token */ function updateMerkleRoot(bytes32 _merkleRoot) public onlyOperator { merkleRoot = _merkleRoot; // emit MerkleRootUpdated(_merkleRoot); } /** * @dev Update address of treasury contract */ function updateTreasuryContractAddress( address _newContractAddress ) public onlyOwner { treasuryContractAddress = _newContractAddress; } /** * @dev Update list of tokens that are whitelisted to use for investing */ function updateWhiteListToken( address _tokenAddress, bool _status ) public onlyOwner { tokenWL[_tokenAddress] = _status; } /** * @dev setup time for launch DAPP */ function setupLaunchTime(uint256 _time) external onlyOwner { launchTime = _time; } /** * @dev If full raised of this round, call next round */ function stopCurrentRound() external onlyOperator { require(block.timestamp > startTimeNextRound, "ready to stop"); uint256 currentRound = getCurrentRound(); startTimeNextRound = _ONE_DAY.mul(currentRound - 1).add( startTimeNextRound ); } /** * @dev setup startTime */ function setupStartTime(uint256 _time) external onlyOperator { startTimeNew = _time; startTimeNextRound = _time; endTime = _ONE_DAY.mul(9).add(_time); } /** * @dev setup operator: can call some function */ function setupOperator(address _operator) external onlyOwner { operator = _operator; } /** * @dev Call this function to send whitelisted token to contract and get back XOX token * @notice Numbers of XOX token that user has invested will be locked in this contract to unlock through time (10% per month) * User will receive a bonus XOXS from their investment for farming & an additional bonus of XOXS on referral * Users can claim back their invested XOX token after unlocking time */ function whiteListedInvest( address _tokenAddress, uint256 _amount, address _referralAddress, bytes32[] calldata _merkleProof ) public payable whenNotPaused { require(tokenWL[_tokenAddress], "PreSale: Token not in whitelist"); require( msg.sender != _referralAddress, "PreSale: cannot referral yourself" ); uint256 timestampCurrent = block.timestamp; require( timestampCurrent >= startTime, "PreSale: Not the time for Whitelist" ); require( timestampCurrent <= startTime.add(_ONE_HOUR), "PreSale: Whitelist finished" ); bytes32 leaf = keccak256(abi.encodePacked(_msgSender())); require( MerkleProofUpgradeable.verify(_merkleProof, merkleRoot, leaf), "PreSale: Invalid proof!" ); uint256 cash = _amount; if (_tokenAddress == address(0)) { cash = msg.value.mul(uint256(getLatestPrice())).div(1e20); // div(1e18).div(1e8).mul(1e6) => convert ETH,`, converDecimalPrice, converDecimalUSDT } require(cash >= MINIMUM_BUY, "PreSale: Minimum investment is required"); require( whitelistInvestedUSDAmount[msg.sender].add(cash) <= MAXIMUM_BUY_WL, "PreSale: Exchange amount exceed limit!" ); uint256 amounXOXToInvest = cash.mul(1e12).mul(BASE_DENOMINATOR).div( TOKEN_PRICE[0] // price of round1 ); require( totalRoundInvested[1].add(amounXOXToInvest) <= DISTRIBUTION_TOKEN[0], "PreSale: Invested amount has exceed total distribution of this round" ); if (_tokenAddress != address(0)) { IERC20Upgradeable(_tokenAddress).safeTransferFrom( msg.sender, address(this), cash ); } whitelistInvestedUSDAmount[msg.sender] = whitelistInvestedUSDAmount[ msg.sender ].add(cash); userInvestedUSDAmount[msg.sender] = userInvestedUSDAmount[msg.sender] .add(cash); userInvestedAmount[msg.sender] = userInvestedAmount[msg.sender].add( amounXOXToInvest ); totalRoundInvested[1] = totalRoundInvested[1].add(amounXOXToInvest); uint256 amountXOXS = ITreasuryXOX(treasuryContractAddress).preSaleXOX( msg.sender, _referralAddress, cash, BONUS_PERCENTAGE[0], 1 ); emit PreSaleTokenInvested( msg.sender, cash, amounXOXToInvest, amountXOXS, 1 ); } /** * @dev Call this function to send whitelisted token to contract and get back XOX token * @notice Numbers of XOX token that user has invested will be locked in this contract to unlock through time (10% per month) * User will receive a bonus XOXS from their investment for farming & an additional bonus of XOXS on referral * Users can claim back their invested XOX token after unlocking time */ function invest( address _tokenAddress, uint256 _amount, address _referralAddress ) public payable whenNotPaused { require(tokenWL[_tokenAddress], "PreSale: Token not in whitelist"); require( msg.sender != _referralAddress, "PreSale: cannot referral yourself" ); uint256 currentRound = getCurrentRound(); uint256 timestampCurrent = block.timestamp; require( timestampCurrent >= startTimeNextRound, "PreSale: Not time to sale yet" ); require(timestampCurrent <= endTime, "PreSale: Sale finished"); uint256 cash = _amount; if (_tokenAddress == address(0)) { cash = msg.value.mul(uint256(getLatestPrice())).div(1e20); // div(1e18).div(1e8).mul(1e6) => convert ETH,`, converDecimalPrice, converDecimalUSDT } require(cash > 0, "PreSale: Minimum investment is required"); require(cash <= MAXIMUM_BUY, "PreSale: Maximum investment is required"); uint256 amounXOXToInvest = cash.mul(1e12).mul(BASE_DENOMINATOR).div( TOKEN_PRICE[currentRound - 1] ); require( totalRoundInvested[currentRound].add(amounXOXToInvest) <= DISTRIBUTION_TOKEN[currentRound - 1], "PreSale: Invested amount has exceed total distribution of this round" ); if (_tokenAddress != address(0)) { IERC20Upgradeable(_tokenAddress).safeTransferFrom( msg.sender, address(this), cash ); } userInvestedUSDAmount[msg.sender] = userInvestedUSDAmount[msg.sender] .add(cash); userInvestedAmount[msg.sender] = userInvestedAmount[msg.sender].add( amounXOXToInvest ); totalRoundInvested[currentRound] = totalRoundInvested[currentRound].add( amounXOXToInvest ); uint256 amountXOXS = ITreasuryXOX(treasuryContractAddress).preSaleXOX( msg.sender, _referralAddress, cash, BONUS_PERCENTAGE[currentRound - 1], currentRound ); emit PreSaleTokenInvested( msg.sender, cash, amounXOXToInvest, amountXOXS, currentRound ); } /** * @dev Function for user to claim XOX token that they have invested */ function claim() public whenNotPaused { uint256 releaseableAmount = pendingXOXInvest(msg.sender); require(releaseableAmount > 0, "PreSale: No tokens to claim yet"); require( releaseableAmount <= xoxToken.balanceOf(address(this)), "PreSale: INSUFFICIENT_LIQUIDITY" ); userClaimedAmount[msg.sender] = userClaimedAmount[msg.sender].add( releaseableAmount ); xoxToken.safeTransfer(msg.sender, releaseableAmount); emit UserClaimedToken(msg.sender, releaseableAmount); } /** * @dev Function for user to view XOX token avaiable claim */ function pendingXOXInvest(address account) public view returns (uint256) { if (block.timestamp <= launchTime) return 0; if (launchTime == 0) return 0; uint256 userInvestedBalance = userInvestedAmount[account]; uint256 unlockedPercent = _caculateUnlockedPercent(); uint256 unlockedAmount = userInvestedBalance.mul(unlockedPercent).div( 100 ); return unlockedAmount.sub(userClaimedAmount[account]); } /** * @dev Get the current Round: * 0: not start * 1-10: processing * >10: finished */ function getCurrentRound() public view returns (uint256) { if (block.timestamp < startTime) return 0; if (startTimeNew == 0 || block.timestamp < startTimeNew) return 1; uint256 weeksPass = (block.timestamp.sub(startTimeNew)) .div(_ONE_DAY) .add(2); if (weeksPass > 10) return 10; return weeksPass; } /** * @dev Get the lastest price of token from price feed */ function getLatestPrice() public view returns (int256) { ( , /* uint80 roundID */ int256 price /*uint startedAt*/ /*uint timeStamp*/ /*uint80 answeredInRound*/, , , ) = priceFeed.latestRoundData(); return price; } /** * @dev Pre function to caculate how long has pass since round unlocked * @notice Current set is 10% each week, unlock all after 10 week pass */ function _caculateUnlockedPercent() private view returns (uint256) { if (block.timestamp < launchTime) return 0; uint256 weekPass = (block.timestamp.sub(launchTime)) .div(_ONE_WEEK) .add(10); if (weekPass > 20) return 100; return weekPass.mul(5); } /** * @dev Throws if the sender is not the operator. */ function _checkOperator() internal view virtual { require( owner() == _msgSender() || operator == _msgSender(), "Ownable: caller is not the owner" ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _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; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// 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 IERC20PermitUpgradeable { /** * @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 (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 IERC20Upgradeable { /** * @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 "../IERC20Upgradeable.sol"; import "../extensions/draft-IERC20PermitUpgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20PermitUpgradeable 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(IERC20Upgradeable 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 AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [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 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; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; interface ITreasuryXOX { function preSaleXOX(address from, address ref, uint256 amount, uint256 rewardPercent, uint256 round) external returns (uint256); function seedSale(uint256 amount) external; }
{ "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
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_valueUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountXOX","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountXOXS","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_round","type":"uint256"}],"name":"PreSaleTokenInvested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"UserClaimedToken","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BASE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"BONUS_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"DISTRIBUTION_TOKEN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_BUY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_BUY_WL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_BUY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_BUY_NEW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"TOKEN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_ROUND","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"XOXS_BONUS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_ONE_DAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_ONE_HOUR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_ONE_MONTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_ONE_WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestPrice","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_xoxTokenAddress","type":"address"},{"internalType":"address[2]","name":"_whitelistTokens","type":"address[2]"},{"internalType":"address","name":"_treasuryContractAddress","type":"address"},{"internalType":"address","name":"_priceFeedAddress","type":"address"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_referralAddress","type":"address"}],"name":"invest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"launchTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"pendingXOXInvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"}],"name":"setupLaunchTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setupOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"}],"name":"setupStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimeNew","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimeNextRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopCurrentRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenWL","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalRoundInvested","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"updateMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newContractAddress","type":"address"}],"name":"updateTreasuryContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"updateWhiteListToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userClaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInvestedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_referralAddress","type":"address"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"whiteListedInvest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"withdrawCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xoxToken","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506128ec806100206000396000f3fe6080604052600436106102af5760003560e01c80638456cb5911610166578063c7ecaf05116100d3578063e4b2ec1e1161008f578063f3fef3a31161006c578063f3fef3a3146107d0578063f547c684146107f0578063f92b360d14610810578063fa09e6301461082657005b8063e4b2ec1e1461077a578063ef503b1e14610790578063f2fde38b146107b057005b8063c7ecaf05146106d5578063cdb4ec5e146106eb578063cfd131651461070b578063d0d587501461072b578063da7c51f614610744578063e14096bb1461076457005b8063a32bf59711610122578063a32bf5971461062a578063ab9f2f571461063f578063b210d87914610652578063bce4a98b14610672578063bd8595841461069f578063beccfbd6146106b557005b80638456cb59146105675780638529c06a1461057c578063896f0171146105935780638ce0b9d2146105b35780638da5cb5b146105e35780638e15f4731461061557005b80634e71d92d1161021c57806366708411116101d8578063703b6fa7116101b5578063703b6fa714610506578063715018a61461052657806378e979251461053b578063790ca4131461055157005b806366708411146104c657806367190416146104de5780636a41048b146104f157005b80634e71d92d1461042c578063560f53ac14610441578063585c64cb146104615780635c975abb1461047757806361f4e8a41461049b57806365f41d40146104b057005b806330f8959c1161026b57806330f8959c146103745780633197cbb6146103a15780633c00a36c146103b75780633d9acd8b146103d75780633f4ba83a146103f75780634783f0ef1461040c57005b8063026c0ff0146102b85780630589a270146102e1578063106ae27f146103015780631d15db051461031a5780632eb4a7ab146103315780632f9267231461034757005b366102b657005b005b3480156102c457600080fd5b506102ce60d05481565b6040519081526020015b60405180910390f35b3480156102ed57600080fd5b506102b66102fc3660046123a8565b610846565b34801561030d57600080fd5b506102ce6402540be40081565b34801561032657600080fd5b506102ce6201518081565b34801561033d57600080fd5b506102ce60c55481565b34801561035357600080fd5b506102ce610362366004612477565b60cd6020526000908152604090205481565b34801561038057600080fd5b506102ce61038f366004612492565b60ce6020526000908152604090205481565b3480156103ad57600080fd5b506102ce60c95481565b3480156103c357600080fd5b506102b66103d2366004612492565b610bf5565b3480156103e357600080fd5b506102ce6103f2366004612492565b610c2e565b34801561040357600080fd5b506102b6610c45565b34801561041857600080fd5b506102b6610427366004612492565b610c57565b34801561043857600080fd5b506102b6610c64565b34801561044d57600080fd5b506102b661045c366004612492565b610e06565b34801561046d57600080fd5b506102ce60d15481565b34801561048357600080fd5b5060655460ff165b60405190151581526020016102d8565b3480156104a757600080fd5b506102ce600a81565b3480156104bc57600080fd5b506102ce60995481565b3480156104d257600080fd5b506102ce6302faf08081565b6102b66104ec3660046124ab565b610e13565b3480156104fd57600080fd5b506102b661125c565b34801561051257600080fd5b506102ce610521366004612492565b6112d7565b34801561053257600080fd5b506102b66112e7565b34801561054757600080fd5b506102ce60c85481565b34801561055d57600080fd5b506102ce60c75481565b34801561057357600080fd5b506102b66112f9565b34801561058857600080fd5b506102ce6298968081565b34801561059f57600080fd5b506102b66105ae366004612477565b611309565b3480156105bf57600080fd5b5061048b6105ce366004612477565b60c46020526000908152604090205460ff1681565b3480156105ef57600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020016102d8565b34801561062157600080fd5b506102ce611333565b34801561063657600080fd5b506102ce6113b8565b6102b661064d3660046124e7565b611420565b34801561065e57600080fd5b506102b661066d366004612593565b611962565b34801561067e57600080fd5b506102ce61068d366004612477565b60ca6020526000908152604090205481565b3480156106ab57600080fd5b506102ce61271081565b3480156106c157600080fd5b5060c6546105fd906001600160a01b031681565b3480156106e157600080fd5b506102ce60d25481565b3480156106f757600080fd5b506102b6610706366004612477565b611995565b34801561071757600080fd5b506102ce610726366004612492565b6119bf565b34801561073757600080fd5b506102ce64012a05f20081565b34801561075057600080fd5b506102ce61075f366004612477565b6119cf565b34801561077057600080fd5b506102ce60975481565b34801561078657600080fd5b506102ce60985481565b34801561079c57600080fd5b506102ce6107ab366004612492565b611a59565b3480156107bc57600080fd5b506102b66107cb366004612477565b611a69565b3480156107dc57600080fd5b506102b66107eb3660046125ca565b611ae2565b3480156107fc57600080fd5b506102b661080b366004612492565b611afe565b34801561081c57600080fd5b506102ce60d35481565b34801561083257600080fd5b506102b6610841366004612477565b611b28565b600054610100900460ff16158080156108665750600054600160ff909116105b806108805750303b158015610880575060005460ff166001145b6108e85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561090b576000805461ff0019166101001790555b610913611ba7565b60c680546001600160a01b038981166001600160a01b03199283161790925560c3805488841690831617905560c28054878416921691909117905586518116600090815260c460209081526040808320805460ff199081166001908117909255838c015190951684529281902080549094169092179092558051610140810182526101f4815261021c928101929092526102449082015261026c606082015261029460808201526102bc60a08201526102e460c082015261030c60e082015261033461010082015261035c6101208201526109f290609a90600a61227d565b506040805161014081018252600c8152600b6020820152600a9181018290526009606082015260086080820152600760a0820152600660c0820152600560e082015260046101008201526003610120820152610a519160a491906122c1565b5060408051610140810182526a0422ca8b0a00a42500000081526a04f68ca6d8cd91c600000060208201819052918101919091526a05ca4ec2a79a7f670000006060820181905260808201526a069e10de76676d0800000060a0820181905260c0820181905260e082018190526101008201526a0771d2fa45345aa9000000610120820152610ae49060ae90600a6122f4565b5060408051610140810182526201d4c081526201adb06020820152620186a09181019190915262015f9060608201526201388060808201526201117060a082015261ea6060c082015261c35060e0820152619c40610100820152617530610120820152610b559060b890600a612331565b5060c882905562093a806097819055610e1060985562278d00609955610b88908390610b8290600a611c1b565b90611c2e565b60c95560cf80546001600160a01b0319166001600160a01b0385161790558015610bec576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b610bfd611c3a565b604051339082156108fc029083906000818181858888f19350505050158015610c2a573d6000803e3d6000fd5b5050565b60b881600a8110610c3e57600080fd5b0154905081565b610c4d611c94565b610c55611d03565b565b610c5f611c94565b60c555565b610c6c611d55565b6000610c77336119cf565b905060008111610cc95760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a204e6f20746f6b656e7320746f20636c61696d207965740060448201526064016108df565b60c6546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610d11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d35919061260a565b811115610d845760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20494e53554646494349454e545f4c49515549444954590060448201526064016108df565b33600090815260cd6020526040902054610d9e9082611c2e565b33600081815260cd602052604090209190915560c654610dca916001600160a01b039091169083611d9b565b60408051338152602081018390527f5ff3281652afa39429d76d70d780340afc835758126f2e9907a90335a24dba2c910160405180910390a150565b610e0e611c3a565b60c755565b610e1b611d55565b6001600160a01b038316600090815260c4602052604090205460ff16610e835760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20546f6b656e206e6f7420696e2077686974656c6973740060448201526064016108df565b6001600160a01b0381163303610eab5760405162461bcd60e51b81526004016108df90612623565b6000610eb56113b8565b60d3549091504290811015610f0c5760405162461bcd60e51b815260206004820152601d60248201527f50726553616c653a204e6f742074696d6520746f2073616c652079657400000060448201526064016108df565b60c954811115610f575760405162461bcd60e51b8152602060048201526016602482015275141c9954d85b194e8814d85b1948199a5b9a5cda195960521b60448201526064016108df565b836001600160a01b038616610f8e57610f8b68056bc75e2d63100000610f85610f7e611333565b3490611c1b565b90611e03565b90505b60008111610fae5760405162461bcd60e51b81526004016108df90612664565b6402540be4008111156110135760405162461bcd60e51b815260206004820152602760248201527f50726553616c653a204d6178696d756d20696e766573746d656e742069732072604482015266195c5d5a5c995960ca1b60648201526084016108df565b6000611052609a6110256001876126c1565b600a8110611035576110356125f4565b0154610f8561271061104c8664e8d4a51000611c1b565b90611c1b565b905060ae6110616001866126c1565b600a8110611071576110716125f4565b0154600085815260ce602052604090205461108c9083611c2e565b11156110aa5760405162461bcd60e51b81526004016108df906126d8565b6001600160a01b038716156110ce576110ce6001600160a01b038816333085611e0f565b33600090815260cb60205260409020546110e89083611c2e565b33600090815260cb602090815260408083209390935560ca9052205461110e9082611c2e565b33600090815260ca602090815260408083209390935586825260ce905220546111379082611c2e565b600085815260ce602052604081209190915560c3546001600160a01b0316630dc1949d33888660a461116a60018c6126c1565b600a811061117a5761117a6125f4565b01546040516001600160e01b031960e087901b1681526001600160a01b039485166004820152939092166024840152604483015260648201526084810188905260a4016020604051808303816000875af11580156111dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611200919061260a565b604080513381526020810186905290810184905260608101829052608081018790529091507f26ad0ef2bcf7ddf3157f7da5d9196990edbcbac0b33d75f2da3660d075d1e4889060a00160405180910390a15050505050505050565b611264611c94565b60d35442116112a55760405162461bcd60e51b815260206004820152600d60248201526c0726561647920746f2073746f7609c1b60448201526064016108df565b60006112af6113b8565b90506112d160d354610b826001846112c791906126c1565b6201518090611c1b565b60d35550565b60a481600a8110610c3e57600080fd5b6112ef611c3a565b610c556000611e4d565b611301611c94565b610c55611e9f565b611311611c3a565b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b60008060c260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad919061275c565b509195945050505050565b600060c8544210156113ca5750600090565b60d25415806113da575060d25442105b156113e55750600190565b60006114086002610b8262015180610f8560d25442611edc90919063ffffffff16565b9050600a81111561141b57600a91505090565b919050565b611428611d55565b6001600160a01b038516600090815260c4602052604090205460ff166114905760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20546f6b656e206e6f7420696e2077686974656c6973740060448201526064016108df565b6001600160a01b03831633036114b85760405162461bcd60e51b81526004016108df90612623565b60c85442908110156115185760405162461bcd60e51b815260206004820152602360248201527f50726553616c653a204e6f74207468652074696d6520666f722057686974656c6044820152621a5cdd60ea1b60648201526084016108df565b60985460c85461152791611c2e565b8111156115765760405162461bcd60e51b815260206004820152601b60248201527f50726553616c653a2057686974656c6973742066696e6973686564000000000060448201526064016108df565b6040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506115f08484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060c5549150849050611ee8565b61163c5760405162461bcd60e51b815260206004820152601760248201527f50726553616c653a20496e76616c69642070726f6f662100000000000000000060448201526064016108df565b856001600160a01b0388166116665761166368056bc75e2d63100000610f85610f7e611333565b90505b6302faf08081101561168a5760405162461bcd60e51b81526004016108df90612664565b33600090815260cc602052604090205464012a05f200906116ab9083611c2e565b11156117085760405162461bcd60e51b815260206004820152602660248201527f50726553616c653a2045786368616e676520616d6f756e7420657863656564206044820152656c696d69742160d01b60648201526084016108df565b6000611715609a82611035565b905060ae60000154600160005260ce6020527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff20613546117539083611c2e565b11156117715760405162461bcd60e51b81526004016108df906126d8565b6001600160a01b03891615611795576117956001600160a01b038a16333085611e0f565b33600090815260cc60205260409020546117af9083611c2e565b33600090815260cc602090815260408083209390935560cb905220546117d59083611c2e565b33600090815260cb602090815260408083209390935560ca905220546117fb9082611c2e565b33600090815260ca602090815260408220929092556001905260ce90527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff20613546118449082611c2e565b6001600081815260ce6020527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff206139290925560c35460a48054604051630dc1949d60e01b81523360048201526001600160a01b038d81166024830152604482018990526064820192909252608481019490945290911691630dc1949d91016020604051808303816000875af11580156118e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611904919061260a565b604080513381526020810186905290810184905260608101829052600160808201529091507f26ad0ef2bcf7ddf3157f7da5d9196990edbcbac0b33d75f2da3660d075d1e4889060a00160405180910390a150505050505050505050565b61196a611c3a565b6001600160a01b0391909116600090815260c460205260409020805460ff1916911515919091179055565b61199d611c3a565b60c380546001600160a01b0319166001600160a01b0392909216919091179055565b60ae81600a8110610c3e57600080fd5b600060c75442116119e257506000919050565b60c7546000036119f457506000919050565b6001600160a01b038216600090815260ca602052604081205490611a16611efe565b90506000611a296064610f858585611c1b565b6001600160a01b038616600090815260cd6020526040902054909150611a50908290611edc565b95945050505050565b609a81600a8110610c3e57600080fd5b611a71611c3a565b6001600160a01b038116611ad65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108df565b611adf81611e4d565b50565b611aea611c3a565b610c2a6001600160a01b0383163383611d9b565b611b06611c94565b60d281905560d3819055611b2281610b82620151806009611c1b565b60c95550565b611b30611c3a565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9b919061260a565b9050610c2a8282611ae2565b600054610100900460ff16611c125760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108df565b610c5533611e4d565b6000611c2782846127ac565b9392505050565b6000611c2782846127cb565b6033546001600160a01b03163314610c555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108df565b6033546001600160a01b0316331480611cb7575060cf546001600160a01b031633145b610c555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108df565b611d0b611f56565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff1615610c555760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108df565b6040516001600160a01b038316602482015260448101829052611dfe90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f9f565b505050565b6000611c2782846127e3565b6040516001600160a01b0380851660248301528316604482015260648101829052611e479085906323b872dd60e01b90608401611dc7565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611ea7611d55565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d383390565b6000611c2782846126c1565b600082611ef58584612071565b14949350505050565b600060c754421015611f105750600090565b6000611f32600a610b82609754610f8560c75442611edc90919063ffffffff16565b90506014811115611f4557606491505090565b611f50816005611c1b565b91505090565b60655460ff16610c555760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108df565b6000611ff4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120be9092919063ffffffff16565b805190915015611dfe57808060200190518101906120129190612805565b611dfe5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108df565b600081815b84518110156120b6576120a282868381518110612095576120956125f4565b60200260200101516120d5565b9150806120ae81612822565b915050612076565b509392505050565b60606120cd8484600085612104565b949350505050565b60008183106120f1576000828152602084905260409020611c27565b6000838152602083905260409020611c27565b6060824710156121655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108df565b600080866001600160a01b031685876040516121819190612867565b60006040518083038185875af1925050503d80600081146121be576040519150601f19603f3d011682016040523d82523d6000602084013e6121c3565b606091505b50915091506121d4878383876121df565b979650505050505050565b6060831561224e578251600003612247576001600160a01b0385163b6122475760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108df565b50816120cd565b6120cd83838151156122635781518083602001fd5b8060405162461bcd60e51b81526004016108df9190612883565b82600a81019282156122b1579160200282015b828111156122b1578251829061ffff16905591602001919060010190612290565b506122bd929150612366565b5090565b82600a81019282156122b1579160200282015b828111156122b1578251829060ff169055916020019190600101906122d4565b82600a81019282156122b1579160200282015b828111156122b157825182906affffffffffffffffffffff16905591602001919060010190612307565b82600a81019282156122b1579160200282015b828111156122b1578251829062ffffff16905591602001919060010190612344565b5b808211156122bd5760008155600101612367565b80356001600160a01b038116811461141b57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e087890312156123c157600080fd5b6123ca8761237b565b9550602088603f8901126123dd57600080fd5b6040516040810181811067ffffffffffffffff8211171561240057612400612392565b6040528060608a018b81111561241557600080fd5b838b015b818110156124375761242a8161237b565b8352918401918401612419565b508298506124448161237b565b9750505050506124566080880161237b565b925061246460a0880161237b565b915060c087013590509295509295509295565b60006020828403121561248957600080fd5b611c278261237b565b6000602082840312156124a457600080fd5b5035919050565b6000806000606084860312156124c057600080fd5b6124c98461237b565b9250602084013591506124de6040850161237b565b90509250925092565b6000806000806000608086880312156124ff57600080fd5b6125088661237b565b94506020860135935061251d6040870161237b565b9250606086013567ffffffffffffffff8082111561253a57600080fd5b818801915088601f83011261254e57600080fd5b81358181111561255d57600080fd5b8960208260051b850101111561257257600080fd5b9699959850939650602001949392505050565b8015158114611adf57600080fd5b600080604083850312156125a657600080fd5b6125af8361237b565b915060208301356125bf81612585565b809150509250929050565b600080604083850312156125dd57600080fd5b6125e68361237b565b946020939093013593505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561261c57600080fd5b5051919050565b60208082526021908201527f50726553616c653a2063616e6e6f7420726566657272616c20796f757273656c6040820152603360f91b606082015260800190565b60208082526027908201527f50726553616c653a204d696e696d756d20696e766573746d656e742069732072604082015266195c5d5a5c995960ca1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156126d3576126d36126ab565b500390565b60208082526044908201527f50726553616c653a20496e76657374656420616d6f756e74206861732065786360408201527f65656420746f74616c20646973747269627574696f6e206f66207468697320726060820152631bdd5b9960e21b608082015260a00190565b805169ffffffffffffffffffff8116811461141b57600080fd5b600080600080600060a0868803121561277457600080fd5b61277d86612742565b94506020860151935060408601519250606086015191506127a060808701612742565b90509295509295909350565b60008160001904831182151516156127c6576127c66126ab565b500290565b600082198211156127de576127de6126ab565b500190565b60008261280057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561281757600080fd5b8151611c2781612585565b600060018201612834576128346126ab565b5060010190565b60005b8381101561285657818101518382015260200161283e565b83811115611e475750506000910152565b6000825161287981846020870161283b565b9190910192915050565b60208152600082518060208401526128a281604085016020870161283b565b601f01601f1916919091016040019291505056fea26469706673582212200d9d71f1990f9fa06461824b18d4322405076a7ab73271668fa6dece7ec1c78b64736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106102af5760003560e01c80638456cb5911610166578063c7ecaf05116100d3578063e4b2ec1e1161008f578063f3fef3a31161006c578063f3fef3a3146107d0578063f547c684146107f0578063f92b360d14610810578063fa09e6301461082657005b8063e4b2ec1e1461077a578063ef503b1e14610790578063f2fde38b146107b057005b8063c7ecaf05146106d5578063cdb4ec5e146106eb578063cfd131651461070b578063d0d587501461072b578063da7c51f614610744578063e14096bb1461076457005b8063a32bf59711610122578063a32bf5971461062a578063ab9f2f571461063f578063b210d87914610652578063bce4a98b14610672578063bd8595841461069f578063beccfbd6146106b557005b80638456cb59146105675780638529c06a1461057c578063896f0171146105935780638ce0b9d2146105b35780638da5cb5b146105e35780638e15f4731461061557005b80634e71d92d1161021c57806366708411116101d8578063703b6fa7116101b5578063703b6fa714610506578063715018a61461052657806378e979251461053b578063790ca4131461055157005b806366708411146104c657806367190416146104de5780636a41048b146104f157005b80634e71d92d1461042c578063560f53ac14610441578063585c64cb146104615780635c975abb1461047757806361f4e8a41461049b57806365f41d40146104b057005b806330f8959c1161026b57806330f8959c146103745780633197cbb6146103a15780633c00a36c146103b75780633d9acd8b146103d75780633f4ba83a146103f75780634783f0ef1461040c57005b8063026c0ff0146102b85780630589a270146102e1578063106ae27f146103015780631d15db051461031a5780632eb4a7ab146103315780632f9267231461034757005b366102b657005b005b3480156102c457600080fd5b506102ce60d05481565b6040519081526020015b60405180910390f35b3480156102ed57600080fd5b506102b66102fc3660046123a8565b610846565b34801561030d57600080fd5b506102ce6402540be40081565b34801561032657600080fd5b506102ce6201518081565b34801561033d57600080fd5b506102ce60c55481565b34801561035357600080fd5b506102ce610362366004612477565b60cd6020526000908152604090205481565b34801561038057600080fd5b506102ce61038f366004612492565b60ce6020526000908152604090205481565b3480156103ad57600080fd5b506102ce60c95481565b3480156103c357600080fd5b506102b66103d2366004612492565b610bf5565b3480156103e357600080fd5b506102ce6103f2366004612492565b610c2e565b34801561040357600080fd5b506102b6610c45565b34801561041857600080fd5b506102b6610427366004612492565b610c57565b34801561043857600080fd5b506102b6610c64565b34801561044d57600080fd5b506102b661045c366004612492565b610e06565b34801561046d57600080fd5b506102ce60d15481565b34801561048357600080fd5b5060655460ff165b60405190151581526020016102d8565b3480156104a757600080fd5b506102ce600a81565b3480156104bc57600080fd5b506102ce60995481565b3480156104d257600080fd5b506102ce6302faf08081565b6102b66104ec3660046124ab565b610e13565b3480156104fd57600080fd5b506102b661125c565b34801561051257600080fd5b506102ce610521366004612492565b6112d7565b34801561053257600080fd5b506102b66112e7565b34801561054757600080fd5b506102ce60c85481565b34801561055d57600080fd5b506102ce60c75481565b34801561057357600080fd5b506102b66112f9565b34801561058857600080fd5b506102ce6298968081565b34801561059f57600080fd5b506102b66105ae366004612477565b611309565b3480156105bf57600080fd5b5061048b6105ce366004612477565b60c46020526000908152604090205460ff1681565b3480156105ef57600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020016102d8565b34801561062157600080fd5b506102ce611333565b34801561063657600080fd5b506102ce6113b8565b6102b661064d3660046124e7565b611420565b34801561065e57600080fd5b506102b661066d366004612593565b611962565b34801561067e57600080fd5b506102ce61068d366004612477565b60ca6020526000908152604090205481565b3480156106ab57600080fd5b506102ce61271081565b3480156106c157600080fd5b5060c6546105fd906001600160a01b031681565b3480156106e157600080fd5b506102ce60d25481565b3480156106f757600080fd5b506102b6610706366004612477565b611995565b34801561071757600080fd5b506102ce610726366004612492565b6119bf565b34801561073757600080fd5b506102ce64012a05f20081565b34801561075057600080fd5b506102ce61075f366004612477565b6119cf565b34801561077057600080fd5b506102ce60975481565b34801561078657600080fd5b506102ce60985481565b34801561079c57600080fd5b506102ce6107ab366004612492565b611a59565b3480156107bc57600080fd5b506102b66107cb366004612477565b611a69565b3480156107dc57600080fd5b506102b66107eb3660046125ca565b611ae2565b3480156107fc57600080fd5b506102b661080b366004612492565b611afe565b34801561081c57600080fd5b506102ce60d35481565b34801561083257600080fd5b506102b6610841366004612477565b611b28565b600054610100900460ff16158080156108665750600054600160ff909116105b806108805750303b158015610880575060005460ff166001145b6108e85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561090b576000805461ff0019166101001790555b610913611ba7565b60c680546001600160a01b038981166001600160a01b03199283161790925560c3805488841690831617905560c28054878416921691909117905586518116600090815260c460209081526040808320805460ff199081166001908117909255838c015190951684529281902080549094169092179092558051610140810182526101f4815261021c928101929092526102449082015261026c606082015261029460808201526102bc60a08201526102e460c082015261030c60e082015261033461010082015261035c6101208201526109f290609a90600a61227d565b506040805161014081018252600c8152600b6020820152600a9181018290526009606082015260086080820152600760a0820152600660c0820152600560e082015260046101008201526003610120820152610a519160a491906122c1565b5060408051610140810182526a0422ca8b0a00a42500000081526a04f68ca6d8cd91c600000060208201819052918101919091526a05ca4ec2a79a7f670000006060820181905260808201526a069e10de76676d0800000060a0820181905260c0820181905260e082018190526101008201526a0771d2fa45345aa9000000610120820152610ae49060ae90600a6122f4565b5060408051610140810182526201d4c081526201adb06020820152620186a09181019190915262015f9060608201526201388060808201526201117060a082015261ea6060c082015261c35060e0820152619c40610100820152617530610120820152610b559060b890600a612331565b5060c882905562093a806097819055610e1060985562278d00609955610b88908390610b8290600a611c1b565b90611c2e565b60c95560cf80546001600160a01b0319166001600160a01b0385161790558015610bec576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b610bfd611c3a565b604051339082156108fc029083906000818181858888f19350505050158015610c2a573d6000803e3d6000fd5b5050565b60b881600a8110610c3e57600080fd5b0154905081565b610c4d611c94565b610c55611d03565b565b610c5f611c94565b60c555565b610c6c611d55565b6000610c77336119cf565b905060008111610cc95760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a204e6f20746f6b656e7320746f20636c61696d207965740060448201526064016108df565b60c6546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610d11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d35919061260a565b811115610d845760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20494e53554646494349454e545f4c49515549444954590060448201526064016108df565b33600090815260cd6020526040902054610d9e9082611c2e565b33600081815260cd602052604090209190915560c654610dca916001600160a01b039091169083611d9b565b60408051338152602081018390527f5ff3281652afa39429d76d70d780340afc835758126f2e9907a90335a24dba2c910160405180910390a150565b610e0e611c3a565b60c755565b610e1b611d55565b6001600160a01b038316600090815260c4602052604090205460ff16610e835760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20546f6b656e206e6f7420696e2077686974656c6973740060448201526064016108df565b6001600160a01b0381163303610eab5760405162461bcd60e51b81526004016108df90612623565b6000610eb56113b8565b60d3549091504290811015610f0c5760405162461bcd60e51b815260206004820152601d60248201527f50726553616c653a204e6f742074696d6520746f2073616c652079657400000060448201526064016108df565b60c954811115610f575760405162461bcd60e51b8152602060048201526016602482015275141c9954d85b194e8814d85b1948199a5b9a5cda195960521b60448201526064016108df565b836001600160a01b038616610f8e57610f8b68056bc75e2d63100000610f85610f7e611333565b3490611c1b565b90611e03565b90505b60008111610fae5760405162461bcd60e51b81526004016108df90612664565b6402540be4008111156110135760405162461bcd60e51b815260206004820152602760248201527f50726553616c653a204d6178696d756d20696e766573746d656e742069732072604482015266195c5d5a5c995960ca1b60648201526084016108df565b6000611052609a6110256001876126c1565b600a8110611035576110356125f4565b0154610f8561271061104c8664e8d4a51000611c1b565b90611c1b565b905060ae6110616001866126c1565b600a8110611071576110716125f4565b0154600085815260ce602052604090205461108c9083611c2e565b11156110aa5760405162461bcd60e51b81526004016108df906126d8565b6001600160a01b038716156110ce576110ce6001600160a01b038816333085611e0f565b33600090815260cb60205260409020546110e89083611c2e565b33600090815260cb602090815260408083209390935560ca9052205461110e9082611c2e565b33600090815260ca602090815260408083209390935586825260ce905220546111379082611c2e565b600085815260ce602052604081209190915560c3546001600160a01b0316630dc1949d33888660a461116a60018c6126c1565b600a811061117a5761117a6125f4565b01546040516001600160e01b031960e087901b1681526001600160a01b039485166004820152939092166024840152604483015260648201526084810188905260a4016020604051808303816000875af11580156111dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611200919061260a565b604080513381526020810186905290810184905260608101829052608081018790529091507f26ad0ef2bcf7ddf3157f7da5d9196990edbcbac0b33d75f2da3660d075d1e4889060a00160405180910390a15050505050505050565b611264611c94565b60d35442116112a55760405162461bcd60e51b815260206004820152600d60248201526c0726561647920746f2073746f7609c1b60448201526064016108df565b60006112af6113b8565b90506112d160d354610b826001846112c791906126c1565b6201518090611c1b565b60d35550565b60a481600a8110610c3e57600080fd5b6112ef611c3a565b610c556000611e4d565b611301611c94565b610c55611e9f565b611311611c3a565b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b60008060c260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad919061275c565b509195945050505050565b600060c8544210156113ca5750600090565b60d25415806113da575060d25442105b156113e55750600190565b60006114086002610b8262015180610f8560d25442611edc90919063ffffffff16565b9050600a81111561141b57600a91505090565b919050565b611428611d55565b6001600160a01b038516600090815260c4602052604090205460ff166114905760405162461bcd60e51b815260206004820152601f60248201527f50726553616c653a20546f6b656e206e6f7420696e2077686974656c6973740060448201526064016108df565b6001600160a01b03831633036114b85760405162461bcd60e51b81526004016108df90612623565b60c85442908110156115185760405162461bcd60e51b815260206004820152602360248201527f50726553616c653a204e6f74207468652074696d6520666f722057686974656c6044820152621a5cdd60ea1b60648201526084016108df565b60985460c85461152791611c2e565b8111156115765760405162461bcd60e51b815260206004820152601b60248201527f50726553616c653a2057686974656c6973742066696e6973686564000000000060448201526064016108df565b6040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506115f08484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060c5549150849050611ee8565b61163c5760405162461bcd60e51b815260206004820152601760248201527f50726553616c653a20496e76616c69642070726f6f662100000000000000000060448201526064016108df565b856001600160a01b0388166116665761166368056bc75e2d63100000610f85610f7e611333565b90505b6302faf08081101561168a5760405162461bcd60e51b81526004016108df90612664565b33600090815260cc602052604090205464012a05f200906116ab9083611c2e565b11156117085760405162461bcd60e51b815260206004820152602660248201527f50726553616c653a2045786368616e676520616d6f756e7420657863656564206044820152656c696d69742160d01b60648201526084016108df565b6000611715609a82611035565b905060ae60000154600160005260ce6020527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff20613546117539083611c2e565b11156117715760405162461bcd60e51b81526004016108df906126d8565b6001600160a01b03891615611795576117956001600160a01b038a16333085611e0f565b33600090815260cc60205260409020546117af9083611c2e565b33600090815260cc602090815260408083209390935560cb905220546117d59083611c2e565b33600090815260cb602090815260408083209390935560ca905220546117fb9082611c2e565b33600090815260ca602090815260408220929092556001905260ce90527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff20613546118449082611c2e565b6001600081815260ce6020527f2c64b4c28102eb31817db0aae9385bd83769912689d15cb6b0f59dd7eff206139290925560c35460a48054604051630dc1949d60e01b81523360048201526001600160a01b038d81166024830152604482018990526064820192909252608481019490945290911691630dc1949d91016020604051808303816000875af11580156118e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611904919061260a565b604080513381526020810186905290810184905260608101829052600160808201529091507f26ad0ef2bcf7ddf3157f7da5d9196990edbcbac0b33d75f2da3660d075d1e4889060a00160405180910390a150505050505050505050565b61196a611c3a565b6001600160a01b0391909116600090815260c460205260409020805460ff1916911515919091179055565b61199d611c3a565b60c380546001600160a01b0319166001600160a01b0392909216919091179055565b60ae81600a8110610c3e57600080fd5b600060c75442116119e257506000919050565b60c7546000036119f457506000919050565b6001600160a01b038216600090815260ca602052604081205490611a16611efe565b90506000611a296064610f858585611c1b565b6001600160a01b038616600090815260cd6020526040902054909150611a50908290611edc565b95945050505050565b609a81600a8110610c3e57600080fd5b611a71611c3a565b6001600160a01b038116611ad65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108df565b611adf81611e4d565b50565b611aea611c3a565b610c2a6001600160a01b0383163383611d9b565b611b06611c94565b60d281905560d3819055611b2281610b82620151806009611c1b565b60c95550565b611b30611c3a565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9b919061260a565b9050610c2a8282611ae2565b600054610100900460ff16611c125760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108df565b610c5533611e4d565b6000611c2782846127ac565b9392505050565b6000611c2782846127cb565b6033546001600160a01b03163314610c555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108df565b6033546001600160a01b0316331480611cb7575060cf546001600160a01b031633145b610c555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108df565b611d0b611f56565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff1615610c555760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108df565b6040516001600160a01b038316602482015260448101829052611dfe90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f9f565b505050565b6000611c2782846127e3565b6040516001600160a01b0380851660248301528316604482015260648101829052611e479085906323b872dd60e01b90608401611dc7565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611ea7611d55565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d383390565b6000611c2782846126c1565b600082611ef58584612071565b14949350505050565b600060c754421015611f105750600090565b6000611f32600a610b82609754610f8560c75442611edc90919063ffffffff16565b90506014811115611f4557606491505090565b611f50816005611c1b565b91505090565b60655460ff16610c555760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108df565b6000611ff4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120be9092919063ffffffff16565b805190915015611dfe57808060200190518101906120129190612805565b611dfe5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108df565b600081815b84518110156120b6576120a282868381518110612095576120956125f4565b60200260200101516120d5565b9150806120ae81612822565b915050612076565b509392505050565b60606120cd8484600085612104565b949350505050565b60008183106120f1576000828152602084905260409020611c27565b6000838152602083905260409020611c27565b6060824710156121655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108df565b600080866001600160a01b031685876040516121819190612867565b60006040518083038185875af1925050503d80600081146121be576040519150601f19603f3d011682016040523d82523d6000602084013e6121c3565b606091505b50915091506121d4878383876121df565b979650505050505050565b6060831561224e578251600003612247576001600160a01b0385163b6122475760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108df565b50816120cd565b6120cd83838151156122635781518083602001fd5b8060405162461bcd60e51b81526004016108df9190612883565b82600a81019282156122b1579160200282015b828111156122b1578251829061ffff16905591602001919060010190612290565b506122bd929150612366565b5090565b82600a81019282156122b1579160200282015b828111156122b1578251829060ff169055916020019190600101906122d4565b82600a81019282156122b1579160200282015b828111156122b157825182906affffffffffffffffffffff16905591602001919060010190612307565b82600a81019282156122b1579160200282015b828111156122b1578251829062ffffff16905591602001919060010190612344565b5b808211156122bd5760008155600101612367565b80356001600160a01b038116811461141b57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e087890312156123c157600080fd5b6123ca8761237b565b9550602088603f8901126123dd57600080fd5b6040516040810181811067ffffffffffffffff8211171561240057612400612392565b6040528060608a018b81111561241557600080fd5b838b015b818110156124375761242a8161237b565b8352918401918401612419565b508298506124448161237b565b9750505050506124566080880161237b565b925061246460a0880161237b565b915060c087013590509295509295509295565b60006020828403121561248957600080fd5b611c278261237b565b6000602082840312156124a457600080fd5b5035919050565b6000806000606084860312156124c057600080fd5b6124c98461237b565b9250602084013591506124de6040850161237b565b90509250925092565b6000806000806000608086880312156124ff57600080fd5b6125088661237b565b94506020860135935061251d6040870161237b565b9250606086013567ffffffffffffffff8082111561253a57600080fd5b818801915088601f83011261254e57600080fd5b81358181111561255d57600080fd5b8960208260051b850101111561257257600080fd5b9699959850939650602001949392505050565b8015158114611adf57600080fd5b600080604083850312156125a657600080fd5b6125af8361237b565b915060208301356125bf81612585565b809150509250929050565b600080604083850312156125dd57600080fd5b6125e68361237b565b946020939093013593505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561261c57600080fd5b5051919050565b60208082526021908201527f50726553616c653a2063616e6e6f7420726566657272616c20796f757273656c6040820152603360f91b606082015260800190565b60208082526027908201527f50726553616c653a204d696e696d756d20696e766573746d656e742069732072604082015266195c5d5a5c995960ca1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156126d3576126d36126ab565b500390565b60208082526044908201527f50726553616c653a20496e76657374656420616d6f756e74206861732065786360408201527f65656420746f74616c20646973747269627574696f6e206f66207468697320726060820152631bdd5b9960e21b608082015260a00190565b805169ffffffffffffffffffff8116811461141b57600080fd5b600080600080600060a0868803121561277457600080fd5b61277d86612742565b94506020860151935060408601519250606086015191506127a060808701612742565b90509295509295909350565b60008160001904831182151516156127c6576127c66126ab565b500290565b600082198211156127de576127de6126ab565b500190565b60008261280057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561281757600080fd5b8151611c2781612585565b600060018201612834576128346126ab565b5060010190565b60005b8381101561285657818101518382015260200161283e565b83811115611e475750506000910152565b6000825161287981846020870161283b565b9190910192915050565b60208152600082518060208401526128a281604085016020870161283b565b601f01601f1916919091016040019291505056fea26469706673582212200d9d71f1990f9fa06461824b18d4322405076a7ab73271668fa6dece7ec1c78b64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.