Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 20 from a total of 20 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw ETH | 17576941 | 614 days ago | IN | 0 ETH | 0.00046408 | ||||
Sale By ETH | 17510824 | 624 days ago | IN | 0.048 ETH | 0.00117109 | ||||
Set Price | 17496627 | 626 days ago | IN | 0 ETH | 0.00042824 | ||||
Sale By ETH | 17496458 | 626 days ago | IN | 0.49412 ETH | 0.00099989 | ||||
Sale By ETH | 17495891 | 626 days ago | IN | 0.03088 ETH | 0.00138857 | ||||
Sale By ETH | 17493070 | 626 days ago | IN | 0.0525 ETH | 0.00183837 | ||||
Sale By ETH | 17492931 | 626 days ago | IN | 2.4706 ETH | 0.00123611 | ||||
Sale By ETH | 17492795 | 626 days ago | IN | 0.02471 ETH | 0.00130188 | ||||
Sale By ETH | 17492672 | 626 days ago | IN | 0.24706 ETH | 0.00098449 | ||||
Sale By ETH | 17492634 | 626 days ago | IN | 0.02471 ETH | 0.00104489 | ||||
Sale By ETH | 17492583 | 626 days ago | IN | 0.36855 ETH | 0.00150984 | ||||
Sale By ETH | 17492528 | 626 days ago | IN | 0.02471 ETH | 0.00096114 | ||||
Sale By ETH | 17492523 | 626 days ago | IN | 0.02471 ETH | 0.00127241 | ||||
Sale By ETH | 17492303 | 626 days ago | IN | 0.49412 ETH | 0.00134674 | ||||
Set Price | 17492147 | 626 days ago | IN | 0 ETH | 0.00043632 | ||||
Sale By ETH | 17484394 | 627 days ago | IN | 0.25485 ETH | 0.00138789 | ||||
Set Sale Time | 17484343 | 627 days ago | IN | 0 ETH | 0.00057039 | ||||
Set Sale Time | 17482913 | 628 days ago | IN | 0 ETH | 0.00116339 | ||||
Set Price | 17482891 | 628 days ago | IN | 0 ETH | 0.00077347 | ||||
Set Price | 17482888 | 628 days ago | IN | 0 ETH | 0.00078561 |
Latest 14 internal transactions
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
17576941 | 614 days ago | 4.34239466 ETH | ||||
17510824 | 624 days ago | 0.00228571 ETH | ||||
17496458 | 626 days ago | 0.02353 ETH | ||||
17495891 | 626 days ago | 0.00146812 ETH | ||||
17493070 | 626 days ago | 0.00249999 ETH | ||||
17492931 | 626 days ago | 0.11765 ETH | ||||
17492795 | 626 days ago | 0.0011805 ETH | ||||
17492672 | 626 days ago | 0.011765 ETH | ||||
17492634 | 626 days ago | 0.00117344 ETH | ||||
17492583 | 626 days ago | 0.01755 ETH | ||||
17492528 | 626 days ago | 0.0011805 ETH | ||||
17492523 | 626 days ago | 0.0011805 ETH | ||||
17492303 | 626 days ago | 0.02353 ETH | ||||
17484394 | 627 days ago | 0.01213155 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
POCOPresale
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract POCOPresale is Context, AccessControlEnumerable, ReentrancyGuard, Pausable { bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); ERC20 public POCOToken; uint256 public POCO_DECIMAL = 10**18; uint256 public _supply = 2 * 10**8 * POCO_DECIMAL; uint256 public _saleStartTime; uint256 public _saleEndTime; struct ReleasePhase { uint256 _time; uint256 _numerator; uint256 _denominator; } ReleasePhase[] public _releasePhases; mapping(address => uint256) public _prices; struct TokenInfo { uint256 _amount; uint256 _claimedPhase; uint256 _claimedAmount; } mapping(address => TokenInfo) public _userInfo; event SaleEvent(address _userAddr, uint256 _amount, address _tokenAddr, uint256 _price); event ClaimEvent(address _userAddr, uint256 _fromPhase, uint256 _endPhase, uint256 _amount); modifier hasAdminRole() { require(hasRole(ADMIN_ROLE, _msgSender()), "POCOPresale: must have admin role"); _; } modifier isNotContract() { require(_msgSender() == tx.origin, "Sender is not EOA"); _; } constructor(ERC20 _pocoToken) { POCOToken = _pocoToken; _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(ADMIN_ROLE, _msgSender()); } /** **************************************** token presale functions **************************************** */ function saleByETH(uint256 _amount) public payable nonReentrant whenNotPaused isNotContract { uint256 currentTime = block.timestamp; require(currentTime >= _saleStartTime, "sale not start"); require(currentTime <= _saleEndTime, "sale already ended"); address _tokenAddress = address(0x0); require(_amount >= 10000 * 10**18, "invalid sale amount"); require(_amount <= _supply, "not enough supply"); require(_prices[_tokenAddress] > 0, "token is not the payment"); uint256 pay_amount = _amount * _prices[_tokenAddress] / POCO_DECIMAL; require(msg.value >= pay_amount, "invalid ETH balance"); setUserInfo(_msgSender(), _amount); if (msg.value > pay_amount) { (bool success, ) = msg.sender.call{value: (msg.value - pay_amount)}(""); if (!success) { revert("Ether transfer failed"); } } emit SaleEvent(_msgSender(), _amount, _tokenAddress, _prices[_tokenAddress]); } function saleByToken(address _tokenAddress, uint256 _amount) public nonReentrant whenNotPaused isNotContract { uint256 currentTime = block.timestamp; require(currentTime >= _saleStartTime, "sale not start"); require(currentTime < _saleEndTime, "sale already ended"); require(_amount >= 10000 * 10**18, "invalid sale amount"); require(_amount <= _supply, "not enough supply"); require(_prices[_tokenAddress] > 0, "token is not the payment"); uint256 pay_amount = _amount * _prices[_tokenAddress] / POCO_DECIMAL; ERC20 token = ERC20(_tokenAddress); require(token.transferFrom(_msgSender(), address(this), pay_amount), "pay error"); setUserInfo(_msgSender(), _amount); emit SaleEvent(_msgSender(), _amount, _tokenAddress, _prices[_tokenAddress]); } function setUserInfo(address _userAddr, uint256 _amount) internal { TokenInfo storage tokenInfo = _userInfo[_userAddr]; tokenInfo._amount = tokenInfo._amount + _amount; _supply = _supply - _amount; } /** **************************************** token claim functions **************************************** */ function claim() external nonReentrant whenNotPaused isNotContract { TokenInfo storage tokenInfo = _userInfo[_msgSender()]; require(tokenInfo._amount > 0, "pending claim amount is 0"); require(tokenInfo._claimedPhase < _releasePhases.length, "already claim all release phase"); require(tokenInfo._claimedAmount < tokenInfo._amount, "already claim all POCO"); uint256 currentTime = block.timestamp; uint256 pendingClaimAmount; uint256 claimedPhase; for (uint256 i = tokenInfo._claimedPhase; i < _releasePhases.length; i++) { if (currentTime < _releasePhases[i]._time) { break; } pendingClaimAmount = pendingClaimAmount + tokenInfo._amount * _releasePhases[i]._numerator / _releasePhases[i]._denominator; claimedPhase = i + 1; } emit ClaimEvent(_msgSender(), tokenInfo._claimedPhase + 1, claimedPhase, pendingClaimAmount); require(pendingClaimAmount > 0, "no POCO can be claimed"); tokenInfo._claimedPhase = claimedPhase; tokenInfo._claimedAmount = tokenInfo._claimedAmount + pendingClaimAmount; require(POCOToken.transfer(_msgSender(), pendingClaimAmount), "POCO transfer failed"); } /** **************************************** query functions **************************************** */ function getSaleStartTime() public view returns (uint256) { return _saleStartTime; } function getSaleEndTime() public view returns (uint256) { return _saleEndTime; } function getPriceByToken(address _tokenAddress) public view returns (uint256) { uint256 price = _prices[_tokenAddress]; require(price > 0, "token is not the payment"); return price; } function getSaleAmount(address _tokenAddress, uint256 _amount) public view returns (uint256) { uint256 price = _prices[_tokenAddress]; require(price > 0, "token is not the payment"); return _amount * price / POCO_DECIMAL; } function getPendingClaimAmount(uint256 _time, address _userAddr) public view returns (uint256) { uint256 pendingClaimAmount; for (uint256 i = _userInfo[_userAddr]._claimedPhase; i < _releasePhases.length; i++) { if (_time < _releasePhases[i]._time) { break; } pendingClaimAmount = pendingClaimAmount + _userInfo[_userAddr]._amount * _releasePhases[i]._numerator / _releasePhases[i]._denominator; } return pendingClaimAmount; } function getUserInfo(address _userAddr) public view returns (uint256, uint256, uint256) { return (_userInfo[_userAddr]._amount, _userInfo[_userAddr]._claimedPhase, _userInfo[_userAddr]._claimedAmount); } /** **************************************** admin setting functions **************************************** */ function setSaleTime(uint256 _startTime, uint256 _endTime) external hasAdminRole { _saleStartTime = _startTime; _saleEndTime = _endTime; } function setPrice(address _tokenAddress, uint256 _price) external hasAdminRole { _prices[_tokenAddress] = _price; } function setPOCOToken(ERC20 _erc20) external hasAdminRole { POCOToken = _erc20; } function addReleasePhases(uint256[] memory _times, uint256[] memory _numerators, uint256[] memory _denominators) external hasAdminRole { require(_times.length == _numerators.length && _times.length == _denominators.length, "invalid parameters"); for (uint256 i = 0; i < _times.length; i++) { _releasePhases.push( ReleasePhase({_time: _times[i], _numerator: _numerators[i], _denominator: _denominators[i]}) ); } } function editReleasePhase(uint256 _index, uint256 _time, uint256 _numerator, uint256 _denominator) external hasAdminRole { require(_index < _releasePhases.length, "invalid parameters"); ReleasePhase storage _phase = _releasePhases[_index]; _phase._time = _time; _phase._numerator = _numerator; _phase._denominator = _denominator; } function removeReleasePhase() external hasAdminRole { for (uint256 i = 0; i < _releasePhases.length; i++) { _releasePhases.pop(); } } function withdrawETH() external hasAdminRole { (bool success, ) = msg.sender.call{value: address(this).balance}(""); if (!success) { revert("Ether transfer failed"); } } function withdraw(address _tokenAddress) external hasAdminRole { ERC20 token = ERC20(_tokenAddress); require(token.transfer(msg.sender, token.balanceOf(address(this))), "ERC20 transfer failed"); } function pause() external hasAdminRole { _pause(); } function unpause() external hasAdminRole { _unpause(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 Pausable is Context { /** * @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. */ constructor() { _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()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ERC20","name":"_pocoToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_userAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"_fromPhase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_endPhase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ClaimEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_userAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_tokenAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"SaleEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POCOToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POCO_DECIMAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_prices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_releasePhases","outputs":[{"internalType":"uint256","name":"_time","type":"uint256"},{"internalType":"uint256","name":"_numerator","type":"uint256"},{"internalType":"uint256","name":"_denominator","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_saleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_saleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_userInfo","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_claimedPhase","type":"uint256"},{"internalType":"uint256","name":"_claimedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_times","type":"uint256[]"},{"internalType":"uint256[]","name":"_numerators","type":"uint256[]"},{"internalType":"uint256[]","name":"_denominators","type":"uint256[]"}],"name":"addReleasePhases","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_time","type":"uint256"},{"internalType":"uint256","name":"_numerator","type":"uint256"},{"internalType":"uint256","name":"_denominator","type":"uint256"}],"name":"editReleasePhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"},{"internalType":"address","name":"_userAddr","type":"address"}],"name":"getPendingClaimAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"getPriceByToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getSaleAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddr","type":"address"}],"name":"getUserInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"removeReleasePhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"saleByETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"saleByToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"_erc20","type":"address"}],"name":"setPOCOToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052670de0b6b3a764000060048190556200002290630bebc20062000225565b6005553480156200003257600080fd5b50604051620028653803806200286583398101604081905262000055916200024b565b6001600255600380546001600160a81b0319166101006001600160a01b038416021790556200008d6000620000873390565b620000c0565b620000b97fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620000c0565b506200027d565b620000cc8282620000d0565b5050565b620000e782826200011360201b620019d81760201c565b60008281526001602090815260409091206200010e91839062001a5c620001b3821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000cc576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200016f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001ca836001600160a01b038416620001d3565b90505b92915050565b60008181526001830160205260408120546200021c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001cd565b506000620001cd565b8082028115828204841417620001cd57634e487b7160e01b600052601160045260246000fd5b6000602082840312156200025e57600080fd5b81516001600160a01b03811681146200027657600080fd5b9392505050565b6125d8806200028d6000396000f3fe6080604052600436106102245760003560e01c80636f17d61111610123578063a42c887f116100ab578063d547741f1161006f578063d547741f14610692578063dcb0aeb1146106b2578063de773021146106c7578063e086e5ec146106e7578063f52b0e0a146106fc57600080fd5b8063a42c887f146105f8578063be502f6614610618578063c2b1ddaf1461063d578063ca15c87314610652578063ca87e67e1461067257600080fd5b80638456cb59116100f25780638456cb59146105565780639010d07c1461056b57806391d14854146105a3578063a02292f3146105c3578063a217fddf146105e357600080fd5b80636f17d611146104c257806375a99b9f146104fe57806375b238fc14610514578063791751ab1461053657600080fd5b80633d0bf1df116101b157806353e0bd591161017557806353e0bd59146103f657806358f0c3b6146104315780635c975abb14610447578063604767591461045f5780636386c1c71461047f57600080fd5b80633d0bf1df1461035f5780633f4ba83a1461037f57806344327679146103945780634e71d92d146103c157806351cff8d9146103d657600080fd5b806315945790116101f857806315945790146102b9578063248a9ca3146102cf5780632f2ff15d146102ff57806336568abe1461031f5780633766dc251461033f57600080fd5b8062e4768b1461022957806301ffc9a71461024b57806314066c7c1461028057806314b452e4146102a4575b600080fd5b34801561023557600080fd5b506102496102443660046120be565b61070f565b005b34801561025757600080fd5b5061026b6102663660046120ea565b610768565b60405190151581526020015b60405180910390f35b34801561028c57600080fd5b5061029660075481565b604051908152602001610277565b3480156102b057600080fd5b50600754610296565b3480156102c557600080fd5b5061029660055481565b3480156102db57600080fd5b506102966102ea366004612114565b60009081526020819052604090206001015490565b34801561030b57600080fd5b5061024961031a36600461212d565b610793565b34801561032b57600080fd5b5061024961033a36600461212d565b6107bd565b34801561034b57600080fd5b5061029661035a36600461212d565b61083b565b34801561036b57600080fd5b5061024961037a36600461215d565b61092f565b34801561038b57600080fd5b506102496109e3565b3480156103a057600080fd5b506102966103af36600461218f565b60096020526000908152604090205481565b3480156103cd57600080fd5b50610249610a21565b3480156103e257600080fd5b506102496103f136600461218f565b610dbf565b34801561040257600080fd5b50610416610411366004612114565b610f1a565b60408051938452602084019290925290820152606001610277565b34801561043d57600080fd5b5061029660045481565b34801561045357600080fd5b5060035460ff1661026b565b34801561046b57600080fd5b5061029661047a36600461218f565b610f4d565b34801561048b57600080fd5b5061041661049a36600461218f565b6001600160a01b03166000908152600a60205260409020805460018201546002909201549092565b3480156104ce57600080fd5b506104166104dd36600461218f565b600a6020526000908152604090208054600182015460029092015490919083565b34801561050a57600080fd5b5061029660065481565b34801561052057600080fd5b5061029660008051602061258383398151915281565b34801561054257600080fd5b506102496105513660046120be565b610f83565b34801561056257600080fd5b50610249611275565b34801561057757600080fd5b5061058b6105863660046121ac565b6112b1565b6040516001600160a01b039091168152602001610277565b3480156105af57600080fd5b5061026b6105be36600461212d565b6112d0565b3480156105cf57600080fd5b506102496105de36600461227f565b6112f9565b3480156105ef57600080fd5b50610296600081565b34801561060457600080fd5b5061024961061336600461218f565b611442565b34801561062457600080fd5b5060035461058b9061010090046001600160a01b031681565b34801561064957600080fd5b50600654610296565b34801561065e57600080fd5b5061029661066d366004612114565b61149e565b34801561067e57600080fd5b5061024961068d3660046121ac565b6114b5565b34801561069e57600080fd5b506102496106ad36600461212d565b6114f4565b3480156106be57600080fd5b50610249611519565b3480156106d357600080fd5b506102966106e23660046120be565b6115a5565b3480156106f357600080fd5b506102496115fa565b61024961070a366004612114565b6116be565b610727600080516020612583833981519152336112d0565b61074c5760405162461bcd60e51b815260040161074390612307565b60405180910390fd5b6001600160a01b03909116600090815260096020526040902055565b60006001600160e01b03198216635a05180f60e01b148061078d575061078d82611a71565b92915050565b6000828152602081905260409020600101546107ae81611aa6565b6107b88383611ab0565b505050565b6001600160a01b038116331461082d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610743565b6108378282611ad2565b5050565b6001600160a01b0381166000908152600a602052604081206001015481905b600854811015610927576008818154811061087757610877612348565b906000526020600020906003020160000154851061092757600881815481106108a2576108a2612348565b906000526020600020906003020160020154600882815481106108c7576108c7612348565b60009182526020808320600160039093020191909101546001600160a01b0388168352600a9091526040909120546108ff9190612374565b610909919061238b565b61091390836123ad565b91508061091f816123c0565b91505061085a565b509392505050565b610947600080516020612583833981519152336112d0565b6109635760405162461bcd60e51b815260040161074390612307565b60085484106109a95760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420706172616d657465727360701b6044820152606401610743565b6000600885815481106109be576109be612348565b6000918252602090912060039091020193845550600183019190915560029091015550565b6109fb600080516020612583833981519152336112d0565b610a175760405162461bcd60e51b815260040161074390612307565b610a1f611af4565b565b610a29611b46565b610a31611b9d565b333214610a505760405162461bcd60e51b8152600401610743906123d9565b336000908152600a602052604090208054610aad5760405162461bcd60e51b815260206004820152601960248201527f70656e64696e6720636c61696d20616d6f756e742069732030000000000000006044820152606401610743565b600854600182015410610b025760405162461bcd60e51b815260206004820152601f60248201527f616c726561647920636c61696d20616c6c2072656c65617365207068617365006044820152606401610743565b8054600282015410610b4f5760405162461bcd60e51b8152602060048201526016602482015275616c726561647920636c61696d20616c6c20504f434f60501b6044820152606401610743565b6001810154429060009081905b600854811015610c1f5760088181548110610b7957610b79612348565b9060005260206000209060030201600001548410610c1f5760088181548110610ba457610ba4612348565b90600052602060002090600302016002015460088281548110610bc957610bc9612348565b9060005260206000209060030201600101548660000154610bea9190612374565b610bf4919061238b565b610bfe90846123ad565b9250610c0b8160016123ad565b915080610c17816123c0565b915050610b5c565b507f4e745e036dca0ed1c20fb17deda6530bb4739fa43fbeb8e13854f01388c67cc933600180870154610c51916123ad565b604080516001600160a01b039093168352602083019190915281018390526060810184905260800160405180910390a160008211610cca5760405162461bcd60e51b81526020600482015260166024820152751b9bc81413d0d3c818d85b8818994818db185a5b595960521b6044820152606401610743565b600184018190556002840154610ce19083906123ad565b600285015560035461010090046001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af1158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612404565b610db15760405162461bcd60e51b81526020600482015260146024820152731413d0d3c81d1c985b9cd9995c8819985a5b195960621b6044820152606401610743565b50505050610a1f6001600255565b610dd7600080516020612583833981519152336112d0565b610df35760405162461bcd60e51b815260040161074390612307565b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190612426565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed69190612404565b6108375760405162461bcd60e51b8152602060048201526015602482015274115490cc8c081d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b60088181548110610f2a57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6001600160a01b0381166000908152600960205260408120548061078d5760405162461bcd60e51b81526004016107439061243f565b610f8b611b46565b610f93611b9d565b333214610fb25760405162461bcd60e51b8152600401610743906123d9565b6006544290811015610ff75760405162461bcd60e51b815260206004820152600e60248201526d1cd85b19481b9bdd081cdd185c9d60921b6044820152606401610743565b600754811061103d5760405162461bcd60e51b81526020600482015260126024820152711cd85b1948185b1c9958591e48195b99195960721b6044820152606401610743565b69021e19e0c9bab240000082101561108d5760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a59081cd85b1948185b5bdd5b9d606a1b6044820152606401610743565b6005548211156110d35760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820737570706c7960781b6044820152606401610743565b6001600160a01b0383166000908152600960205260409020546111085760405162461bcd60e51b81526004016107439061243f565b6004546001600160a01b0384166000908152600960205260408120549091906111319085612374565b61113b919061238b565b9050836001600160a01b0381166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018590526064016020604051808303816000875af11580156111a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c59190612404565b6111fd5760405162461bcd60e51b81526020600482015260096024820152683830bc9032b93937b960b91b6044820152606401610743565b611208335b85611be3565b7f4ed70c18c8aa7341a89557100016d424ad6c172a3e25a3237e26d4fe08ad1e7e336001600160a01b038781166000818152600960209081526040918290205482519590941685528401899052830152606082015260800160405180910390a15050506108376001600255565b61128d600080516020612583833981519152336112d0565b6112a95760405162461bcd60e51b815260040161074390612307565b610a1f611c20565b60008281526001602052604081206112c99083611c5d565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b611311600080516020612583833981519152336112d0565b61132d5760405162461bcd60e51b815260040161074390612307565b8151835114801561133f575080518351145b6113805760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420706172616d657465727360701b6044820152606401610743565b60005b835181101561143c57600860405180606001604052808684815181106113ab576113ab612348565b602002602001015181526020018584815181106113ca576113ca612348565b602002602001015181526020018484815181106113e9576113e9612348565b602090810291909101810151909152825460018181018555600094855293829020835160039092020190815590820151928101929092556040015160029091015580611434816123c0565b915050611383565b50505050565b61145a600080516020612583833981519152336112d0565b6114765760405162461bcd60e51b815260040161074390612307565b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600081815260016020526040812061078d90611c69565b6114cd600080516020612583833981519152336112d0565b6114e95760405162461bcd60e51b815260040161074390612307565b600691909155600755565b60008281526020819052604090206001015461150f81611aa6565b6107b88383611ad2565b611531600080516020612583833981519152336112d0565b61154d5760405162461bcd60e51b815260040161074390612307565b60005b6008548110156115a257600880548061156b5761156b612476565b600082815260208120600360001990930192830201818155600181018290556002015590558061159a816123c0565b915050611550565b50565b6001600160a01b038216600090815260096020526040812054806115db5760405162461bcd60e51b81526004016107439061243f565b6004546115e88285612374565b6115f2919061238b565b949350505050565b611612600080516020612583833981519152336112d0565b61162e5760405162461bcd60e51b815260040161074390612307565b604051600090339047908381818185875af1925050503d8060008114611670576040519150601f19603f3d011682016040523d82523d6000602084013e611675565b606091505b50509050806115a25760405162461bcd60e51b8152602060048201526015602482015274115d1a195c881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b6116c6611b46565b6116ce611b9d565b3332146116ed5760405162461bcd60e51b8152600401610743906123d9565b60065442908110156117325760405162461bcd60e51b815260206004820152600e60248201526d1cd85b19481b9bdd081cdd185c9d60921b6044820152606401610743565b6007548111156117795760405162461bcd60e51b81526020600482015260126024820152711cd85b1948185b1c9958591e48195b99195960721b6044820152606401610743565b600069021e19e0c9bab24000008310156117cb5760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a59081cd85b1948185b5bdd5b9d606a1b6044820152606401610743565b6005548311156118115760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820737570706c7960781b6044820152606401610743565b6001600160a01b0381166000908152600960205260409020546118465760405162461bcd60e51b81526004016107439061243f565b6004546001600160a01b03821660009081526009602052604081205490919061186f9086612374565b611879919061238b565b9050803410156118c15760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964204554482062616c616e636560681b6044820152606401610743565b6118ca33611202565b8034111561196b576000336118df833461248c565b604051600081818185875af1925050503d806000811461191b576040519150601f19603f3d011682016040523d82523d6000602084013e611920565b606091505b50509050806119695760405162461bcd60e51b8152602060048201526015602482015274115d1a195c881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b505b7f4ed70c18c8aa7341a89557100016d424ad6c172a3e25a3237e26d4fe08ad1e7e336001600160a01b038481166000818152600960209081526040918290205482519590941685528401899052830152606082015260800160405180910390a15050506115a26001600255565b6119e282826112d0565b610837576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611a183390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006112c9836001600160a01b038416611c73565b60006001600160e01b03198216637965db0b60e01b148061078d57506301ffc9a760e01b6001600160e01b031983161461078d565b6115a28133611cc2565b611aba82826119d8565b60008281526001602052604090206107b89082611a5c565b611adc8282611d1b565b60008281526001602052604090206107b89082611d80565b611afc611d95565b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6002805403611b975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610743565b60028055565b60035460ff1615610a1f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610743565b6001600160a01b0382166000908152600a602052604090208054611c089083906123ad565b8155600554611c1890839061248c565b600555505050565b611c28611b9d565b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b293390565b60006112c98383611dde565b600061078d825490565b6000818152600183016020526040812054611cba5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561078d565b50600061078d565b611ccc82826112d0565b61083757611cd981611e08565b611ce4836020611e1a565b604051602001611cf59291906124c3565b60408051601f198184030181529082905262461bcd60e51b825261074391600401612538565b611d2582826112d0565b15610837576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006112c9836001600160a01b038416611fb6565b60035460ff16610a1f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610743565b6000826000018281548110611df557611df5612348565b9060005260206000200154905092915050565b606061078d6001600160a01b03831660145b60606000611e29836002612374565b611e349060026123ad565b67ffffffffffffffff811115611e4c57611e4c6121ce565b6040519080825280601f01601f191660200182016040528015611e76576020820181803683370190505b509050600360fc1b81600081518110611e9157611e91612348565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611ec057611ec0612348565b60200101906001600160f81b031916908160001a9053506000611ee4846002612374565b611eef9060016123ad565b90505b6001811115611f67576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f2357611f23612348565b1a60f81b828281518110611f3957611f39612348565b60200101906001600160f81b031916908160001a90535060049490941c93611f608161256b565b9050611ef2565b5083156112c95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610743565b6000818152600183016020526040812054801561209f576000611fda60018361248c565b8554909150600090611fee9060019061248c565b905081811461205357600086600001828154811061200e5761200e612348565b906000526020600020015490508087600001848154811061203157612031612348565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061206457612064612476565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061078d565b600091505061078d565b6001600160a01b03811681146115a257600080fd5b600080604083850312156120d157600080fd5b82356120dc816120a9565b946020939093013593505050565b6000602082840312156120fc57600080fd5b81356001600160e01b0319811681146112c957600080fd5b60006020828403121561212657600080fd5b5035919050565b6000806040838503121561214057600080fd5b823591506020830135612152816120a9565b809150509250929050565b6000806000806080858703121561217357600080fd5b5050823594602084013594506040840135936060013592509050565b6000602082840312156121a157600080fd5b81356112c9816120a9565b600080604083850312156121bf57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126121f557600080fd5b8135602067ffffffffffffffff80831115612212576122126121ce565b8260051b604051601f19603f83011681018181108482111715612237576122376121ce565b60405293845285810183019383810192508785111561225557600080fd5b83870191505b848210156122745781358352918301919083019061225b565b979650505050505050565b60008060006060848603121561229457600080fd5b833567ffffffffffffffff808211156122ac57600080fd5b6122b8878388016121e4565b945060208601359150808211156122ce57600080fd5b6122da878388016121e4565b935060408601359150808211156122f057600080fd5b506122fd868287016121e4565b9150509250925092565b60208082526021908201527f504f434f50726573616c653a206d75737420686176652061646d696e20726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761078d5761078d61235e565b6000826123a857634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561078d5761078d61235e565b6000600182016123d2576123d261235e565b5060010190565b60208082526011908201527053656e646572206973206e6f7420454f4160781b604082015260600190565b60006020828403121561241657600080fd5b815180151581146112c957600080fd5b60006020828403121561243857600080fd5b5051919050565b60208082526018908201527f746f6b656e206973206e6f7420746865207061796d656e740000000000000000604082015260600190565b634e487b7160e01b600052603160045260246000fd5b8181038181111561078d5761078d61235e565b60005b838110156124ba5781810151838201526020016124a2565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124fb81601785016020880161249f565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161252c81602884016020880161249f565b01602801949350505050565b602081526000825180602084015261255781604085016020870161249f565b601f01601f19169190910160400192915050565b60008161257a5761257a61235e565b50600019019056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220b173db30361b23879e5ac29953d672516ba93a7b148cd85bbf71994f6a05d58e64736f6c634300081200330000000000000000000000008a89631303c74e886230058c651c3581d8e58fd0
Deployed Bytecode
0x6080604052600436106102245760003560e01c80636f17d61111610123578063a42c887f116100ab578063d547741f1161006f578063d547741f14610692578063dcb0aeb1146106b2578063de773021146106c7578063e086e5ec146106e7578063f52b0e0a146106fc57600080fd5b8063a42c887f146105f8578063be502f6614610618578063c2b1ddaf1461063d578063ca15c87314610652578063ca87e67e1461067257600080fd5b80638456cb59116100f25780638456cb59146105565780639010d07c1461056b57806391d14854146105a3578063a02292f3146105c3578063a217fddf146105e357600080fd5b80636f17d611146104c257806375a99b9f146104fe57806375b238fc14610514578063791751ab1461053657600080fd5b80633d0bf1df116101b157806353e0bd591161017557806353e0bd59146103f657806358f0c3b6146104315780635c975abb14610447578063604767591461045f5780636386c1c71461047f57600080fd5b80633d0bf1df1461035f5780633f4ba83a1461037f57806344327679146103945780634e71d92d146103c157806351cff8d9146103d657600080fd5b806315945790116101f857806315945790146102b9578063248a9ca3146102cf5780632f2ff15d146102ff57806336568abe1461031f5780633766dc251461033f57600080fd5b8062e4768b1461022957806301ffc9a71461024b57806314066c7c1461028057806314b452e4146102a4575b600080fd5b34801561023557600080fd5b506102496102443660046120be565b61070f565b005b34801561025757600080fd5b5061026b6102663660046120ea565b610768565b60405190151581526020015b60405180910390f35b34801561028c57600080fd5b5061029660075481565b604051908152602001610277565b3480156102b057600080fd5b50600754610296565b3480156102c557600080fd5b5061029660055481565b3480156102db57600080fd5b506102966102ea366004612114565b60009081526020819052604090206001015490565b34801561030b57600080fd5b5061024961031a36600461212d565b610793565b34801561032b57600080fd5b5061024961033a36600461212d565b6107bd565b34801561034b57600080fd5b5061029661035a36600461212d565b61083b565b34801561036b57600080fd5b5061024961037a36600461215d565b61092f565b34801561038b57600080fd5b506102496109e3565b3480156103a057600080fd5b506102966103af36600461218f565b60096020526000908152604090205481565b3480156103cd57600080fd5b50610249610a21565b3480156103e257600080fd5b506102496103f136600461218f565b610dbf565b34801561040257600080fd5b50610416610411366004612114565b610f1a565b60408051938452602084019290925290820152606001610277565b34801561043d57600080fd5b5061029660045481565b34801561045357600080fd5b5060035460ff1661026b565b34801561046b57600080fd5b5061029661047a36600461218f565b610f4d565b34801561048b57600080fd5b5061041661049a36600461218f565b6001600160a01b03166000908152600a60205260409020805460018201546002909201549092565b3480156104ce57600080fd5b506104166104dd36600461218f565b600a6020526000908152604090208054600182015460029092015490919083565b34801561050a57600080fd5b5061029660065481565b34801561052057600080fd5b5061029660008051602061258383398151915281565b34801561054257600080fd5b506102496105513660046120be565b610f83565b34801561056257600080fd5b50610249611275565b34801561057757600080fd5b5061058b6105863660046121ac565b6112b1565b6040516001600160a01b039091168152602001610277565b3480156105af57600080fd5b5061026b6105be36600461212d565b6112d0565b3480156105cf57600080fd5b506102496105de36600461227f565b6112f9565b3480156105ef57600080fd5b50610296600081565b34801561060457600080fd5b5061024961061336600461218f565b611442565b34801561062457600080fd5b5060035461058b9061010090046001600160a01b031681565b34801561064957600080fd5b50600654610296565b34801561065e57600080fd5b5061029661066d366004612114565b61149e565b34801561067e57600080fd5b5061024961068d3660046121ac565b6114b5565b34801561069e57600080fd5b506102496106ad36600461212d565b6114f4565b3480156106be57600080fd5b50610249611519565b3480156106d357600080fd5b506102966106e23660046120be565b6115a5565b3480156106f357600080fd5b506102496115fa565b61024961070a366004612114565b6116be565b610727600080516020612583833981519152336112d0565b61074c5760405162461bcd60e51b815260040161074390612307565b60405180910390fd5b6001600160a01b03909116600090815260096020526040902055565b60006001600160e01b03198216635a05180f60e01b148061078d575061078d82611a71565b92915050565b6000828152602081905260409020600101546107ae81611aa6565b6107b88383611ab0565b505050565b6001600160a01b038116331461082d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610743565b6108378282611ad2565b5050565b6001600160a01b0381166000908152600a602052604081206001015481905b600854811015610927576008818154811061087757610877612348565b906000526020600020906003020160000154851061092757600881815481106108a2576108a2612348565b906000526020600020906003020160020154600882815481106108c7576108c7612348565b60009182526020808320600160039093020191909101546001600160a01b0388168352600a9091526040909120546108ff9190612374565b610909919061238b565b61091390836123ad565b91508061091f816123c0565b91505061085a565b509392505050565b610947600080516020612583833981519152336112d0565b6109635760405162461bcd60e51b815260040161074390612307565b60085484106109a95760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420706172616d657465727360701b6044820152606401610743565b6000600885815481106109be576109be612348565b6000918252602090912060039091020193845550600183019190915560029091015550565b6109fb600080516020612583833981519152336112d0565b610a175760405162461bcd60e51b815260040161074390612307565b610a1f611af4565b565b610a29611b46565b610a31611b9d565b333214610a505760405162461bcd60e51b8152600401610743906123d9565b336000908152600a602052604090208054610aad5760405162461bcd60e51b815260206004820152601960248201527f70656e64696e6720636c61696d20616d6f756e742069732030000000000000006044820152606401610743565b600854600182015410610b025760405162461bcd60e51b815260206004820152601f60248201527f616c726561647920636c61696d20616c6c2072656c65617365207068617365006044820152606401610743565b8054600282015410610b4f5760405162461bcd60e51b8152602060048201526016602482015275616c726561647920636c61696d20616c6c20504f434f60501b6044820152606401610743565b6001810154429060009081905b600854811015610c1f5760088181548110610b7957610b79612348565b9060005260206000209060030201600001548410610c1f5760088181548110610ba457610ba4612348565b90600052602060002090600302016002015460088281548110610bc957610bc9612348565b9060005260206000209060030201600101548660000154610bea9190612374565b610bf4919061238b565b610bfe90846123ad565b9250610c0b8160016123ad565b915080610c17816123c0565b915050610b5c565b507f4e745e036dca0ed1c20fb17deda6530bb4739fa43fbeb8e13854f01388c67cc933600180870154610c51916123ad565b604080516001600160a01b039093168352602083019190915281018390526060810184905260800160405180910390a160008211610cca5760405162461bcd60e51b81526020600482015260166024820152751b9bc81413d0d3c818d85b8818994818db185a5b595960521b6044820152606401610743565b600184018190556002840154610ce19083906123ad565b600285015560035461010090046001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af1158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612404565b610db15760405162461bcd60e51b81526020600482015260146024820152731413d0d3c81d1c985b9cd9995c8819985a5b195960621b6044820152606401610743565b50505050610a1f6001600255565b610dd7600080516020612583833981519152336112d0565b610df35760405162461bcd60e51b815260040161074390612307565b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190612426565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed69190612404565b6108375760405162461bcd60e51b8152602060048201526015602482015274115490cc8c081d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b60088181548110610f2a57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6001600160a01b0381166000908152600960205260408120548061078d5760405162461bcd60e51b81526004016107439061243f565b610f8b611b46565b610f93611b9d565b333214610fb25760405162461bcd60e51b8152600401610743906123d9565b6006544290811015610ff75760405162461bcd60e51b815260206004820152600e60248201526d1cd85b19481b9bdd081cdd185c9d60921b6044820152606401610743565b600754811061103d5760405162461bcd60e51b81526020600482015260126024820152711cd85b1948185b1c9958591e48195b99195960721b6044820152606401610743565b69021e19e0c9bab240000082101561108d5760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a59081cd85b1948185b5bdd5b9d606a1b6044820152606401610743565b6005548211156110d35760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820737570706c7960781b6044820152606401610743565b6001600160a01b0383166000908152600960205260409020546111085760405162461bcd60e51b81526004016107439061243f565b6004546001600160a01b0384166000908152600960205260408120549091906111319085612374565b61113b919061238b565b9050836001600160a01b0381166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018590526064016020604051808303816000875af11580156111a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c59190612404565b6111fd5760405162461bcd60e51b81526020600482015260096024820152683830bc9032b93937b960b91b6044820152606401610743565b611208335b85611be3565b7f4ed70c18c8aa7341a89557100016d424ad6c172a3e25a3237e26d4fe08ad1e7e336001600160a01b038781166000818152600960209081526040918290205482519590941685528401899052830152606082015260800160405180910390a15050506108376001600255565b61128d600080516020612583833981519152336112d0565b6112a95760405162461bcd60e51b815260040161074390612307565b610a1f611c20565b60008281526001602052604081206112c99083611c5d565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b611311600080516020612583833981519152336112d0565b61132d5760405162461bcd60e51b815260040161074390612307565b8151835114801561133f575080518351145b6113805760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420706172616d657465727360701b6044820152606401610743565b60005b835181101561143c57600860405180606001604052808684815181106113ab576113ab612348565b602002602001015181526020018584815181106113ca576113ca612348565b602002602001015181526020018484815181106113e9576113e9612348565b602090810291909101810151909152825460018181018555600094855293829020835160039092020190815590820151928101929092556040015160029091015580611434816123c0565b915050611383565b50505050565b61145a600080516020612583833981519152336112d0565b6114765760405162461bcd60e51b815260040161074390612307565b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600081815260016020526040812061078d90611c69565b6114cd600080516020612583833981519152336112d0565b6114e95760405162461bcd60e51b815260040161074390612307565b600691909155600755565b60008281526020819052604090206001015461150f81611aa6565b6107b88383611ad2565b611531600080516020612583833981519152336112d0565b61154d5760405162461bcd60e51b815260040161074390612307565b60005b6008548110156115a257600880548061156b5761156b612476565b600082815260208120600360001990930192830201818155600181018290556002015590558061159a816123c0565b915050611550565b50565b6001600160a01b038216600090815260096020526040812054806115db5760405162461bcd60e51b81526004016107439061243f565b6004546115e88285612374565b6115f2919061238b565b949350505050565b611612600080516020612583833981519152336112d0565b61162e5760405162461bcd60e51b815260040161074390612307565b604051600090339047908381818185875af1925050503d8060008114611670576040519150601f19603f3d011682016040523d82523d6000602084013e611675565b606091505b50509050806115a25760405162461bcd60e51b8152602060048201526015602482015274115d1a195c881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b6116c6611b46565b6116ce611b9d565b3332146116ed5760405162461bcd60e51b8152600401610743906123d9565b60065442908110156117325760405162461bcd60e51b815260206004820152600e60248201526d1cd85b19481b9bdd081cdd185c9d60921b6044820152606401610743565b6007548111156117795760405162461bcd60e51b81526020600482015260126024820152711cd85b1948185b1c9958591e48195b99195960721b6044820152606401610743565b600069021e19e0c9bab24000008310156117cb5760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a59081cd85b1948185b5bdd5b9d606a1b6044820152606401610743565b6005548311156118115760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820737570706c7960781b6044820152606401610743565b6001600160a01b0381166000908152600960205260409020546118465760405162461bcd60e51b81526004016107439061243f565b6004546001600160a01b03821660009081526009602052604081205490919061186f9086612374565b611879919061238b565b9050803410156118c15760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964204554482062616c616e636560681b6044820152606401610743565b6118ca33611202565b8034111561196b576000336118df833461248c565b604051600081818185875af1925050503d806000811461191b576040519150601f19603f3d011682016040523d82523d6000602084013e611920565b606091505b50509050806119695760405162461bcd60e51b8152602060048201526015602482015274115d1a195c881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610743565b505b7f4ed70c18c8aa7341a89557100016d424ad6c172a3e25a3237e26d4fe08ad1e7e336001600160a01b038481166000818152600960209081526040918290205482519590941685528401899052830152606082015260800160405180910390a15050506115a26001600255565b6119e282826112d0565b610837576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611a183390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006112c9836001600160a01b038416611c73565b60006001600160e01b03198216637965db0b60e01b148061078d57506301ffc9a760e01b6001600160e01b031983161461078d565b6115a28133611cc2565b611aba82826119d8565b60008281526001602052604090206107b89082611a5c565b611adc8282611d1b565b60008281526001602052604090206107b89082611d80565b611afc611d95565b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6002805403611b975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610743565b60028055565b60035460ff1615610a1f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610743565b6001600160a01b0382166000908152600a602052604090208054611c089083906123ad565b8155600554611c1890839061248c565b600555505050565b611c28611b9d565b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b293390565b60006112c98383611dde565b600061078d825490565b6000818152600183016020526040812054611cba5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561078d565b50600061078d565b611ccc82826112d0565b61083757611cd981611e08565b611ce4836020611e1a565b604051602001611cf59291906124c3565b60408051601f198184030181529082905262461bcd60e51b825261074391600401612538565b611d2582826112d0565b15610837576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006112c9836001600160a01b038416611fb6565b60035460ff16610a1f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610743565b6000826000018281548110611df557611df5612348565b9060005260206000200154905092915050565b606061078d6001600160a01b03831660145b60606000611e29836002612374565b611e349060026123ad565b67ffffffffffffffff811115611e4c57611e4c6121ce565b6040519080825280601f01601f191660200182016040528015611e76576020820181803683370190505b509050600360fc1b81600081518110611e9157611e91612348565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611ec057611ec0612348565b60200101906001600160f81b031916908160001a9053506000611ee4846002612374565b611eef9060016123ad565b90505b6001811115611f67576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f2357611f23612348565b1a60f81b828281518110611f3957611f39612348565b60200101906001600160f81b031916908160001a90535060049490941c93611f608161256b565b9050611ef2565b5083156112c95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610743565b6000818152600183016020526040812054801561209f576000611fda60018361248c565b8554909150600090611fee9060019061248c565b905081811461205357600086600001828154811061200e5761200e612348565b906000526020600020015490508087600001848154811061203157612031612348565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061206457612064612476565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061078d565b600091505061078d565b6001600160a01b03811681146115a257600080fd5b600080604083850312156120d157600080fd5b82356120dc816120a9565b946020939093013593505050565b6000602082840312156120fc57600080fd5b81356001600160e01b0319811681146112c957600080fd5b60006020828403121561212657600080fd5b5035919050565b6000806040838503121561214057600080fd5b823591506020830135612152816120a9565b809150509250929050565b6000806000806080858703121561217357600080fd5b5050823594602084013594506040840135936060013592509050565b6000602082840312156121a157600080fd5b81356112c9816120a9565b600080604083850312156121bf57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126121f557600080fd5b8135602067ffffffffffffffff80831115612212576122126121ce565b8260051b604051601f19603f83011681018181108482111715612237576122376121ce565b60405293845285810183019383810192508785111561225557600080fd5b83870191505b848210156122745781358352918301919083019061225b565b979650505050505050565b60008060006060848603121561229457600080fd5b833567ffffffffffffffff808211156122ac57600080fd5b6122b8878388016121e4565b945060208601359150808211156122ce57600080fd5b6122da878388016121e4565b935060408601359150808211156122f057600080fd5b506122fd868287016121e4565b9150509250925092565b60208082526021908201527f504f434f50726573616c653a206d75737420686176652061646d696e20726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761078d5761078d61235e565b6000826123a857634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561078d5761078d61235e565b6000600182016123d2576123d261235e565b5060010190565b60208082526011908201527053656e646572206973206e6f7420454f4160781b604082015260600190565b60006020828403121561241657600080fd5b815180151581146112c957600080fd5b60006020828403121561243857600080fd5b5051919050565b60208082526018908201527f746f6b656e206973206e6f7420746865207061796d656e740000000000000000604082015260600190565b634e487b7160e01b600052603160045260246000fd5b8181038181111561078d5761078d61235e565b60005b838110156124ba5781810151838201526020016124a2565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124fb81601785016020880161249f565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161252c81602884016020880161249f565b01602801949350505050565b602081526000825180602084015261255781604085016020870161249f565b601f01601f19169190910160400192915050565b60008161257a5761257a61235e565b50600019019056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220b173db30361b23879e5ac29953d672516ba93a7b148cd85bbf71994f6a05d58e64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008a89631303c74e886230058c651c3581d8e58fd0
-----Decoded View---------------
Arg [0] : _pocoToken (address): 0x8a89631303C74e886230058c651C3581D8E58fD0
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008a89631303c74e886230058c651c3581d8e58fd0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.