Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 395 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set General Drop... | 21365279 | 14 days ago | IN | 0 ETH | 0.00164799 | ||||
Set Tiers Parama... | 21365278 | 14 days ago | IN | 0 ETH | 0.00159759 | ||||
Reset Items | 21365255 | 14 days ago | IN | 0 ETH | 0.0096037 | ||||
Buy Mystery Box | 21307110 | 22 days ago | IN | 0 ETH | 0.00284907 | ||||
Buy Mystery Box | 21305474 | 22 days ago | IN | 0 ETH | 0.00180505 | ||||
Buy Mystery Box | 21305462 | 22 days ago | IN | 0 ETH | 0.00161067 | ||||
Buy Mystery Box | 21295156 | 24 days ago | IN | 0 ETH | 0.0035419 | ||||
Buy Mystery Box | 21285936 | 25 days ago | IN | 0 ETH | 0.00308498 | ||||
Buy Mystery Box | 21285451 | 25 days ago | IN | 0 ETH | 0.00268808 | ||||
Buy Mystery Box | 21280842 | 26 days ago | IN | 0 ETH | 0.00444177 | ||||
Buy Mystery Box | 21280840 | 26 days ago | IN | 0 ETH | 0.00377069 | ||||
Buy Mystery Box | 21276491 | 26 days ago | IN | 0 ETH | 0.0023535 | ||||
Buy Mystery Box | 21273910 | 27 days ago | IN | 0 ETH | 0.00452046 | ||||
Buy Mystery Box | 21273889 | 27 days ago | IN | 0 ETH | 0.00476729 | ||||
Buy Mystery Box | 21262329 | 28 days ago | IN | 0 ETH | 0.00175437 | ||||
Buy Mystery Box | 21260532 | 29 days ago | IN | 0 ETH | 0.00235083 | ||||
Buy Mystery Box | 21260009 | 29 days ago | IN | 0 ETH | 0.00213284 | ||||
Buy Mystery Box | 21257213 | 29 days ago | IN | 0 ETH | 0.00260792 | ||||
Buy Mystery Box | 21256417 | 29 days ago | IN | 0 ETH | 0.00351713 | ||||
Buy Mystery Box | 21249760 | 30 days ago | IN | 0 ETH | 0.00277523 | ||||
Buy Mystery Box | 21249617 | 30 days ago | IN | 0 ETH | 0.00247052 | ||||
Buy Mystery Box | 21247035 | 31 days ago | IN | 0 ETH | 0.00290123 | ||||
Buy Mystery Box | 21247015 | 31 days ago | IN | 0 ETH | 0.00317249 | ||||
Buy Mystery Box | 21242953 | 31 days ago | IN | 0 ETH | 0.00324785 | ||||
Buy Mystery Box | 21242394 | 31 days ago | IN | 0 ETH | 0.00318616 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
StonesDrop
Compiler Version
v0.8.12+commit.f00d7308
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.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/ICollectionV3.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/AggregatorInterface.sol"; import "./interfaces/IFarm.sol"; contract StonesDrop is ReentrancyGuard, AccessControl { /** Events **/ event MysteryBoxDropped( uint8 tier, address collection, uint256 id, address user, uint32 version ); /** Structs **/ struct Item { uint256 startTokenId; uint256 endTokenId; ICollectionV3 collection; } struct Tier { uint16 available; uint256 amount; uint16 rewards; } struct Purchase { uint256 amount; uint32 version; } /* Storage */ mapping(address => Purchase) public bought; // General drop paramaters IFarm public stone; uint256 public maxPerWallet; uint256 public startTime; uint256 public endTime; Tier[] public tiers; // Tree data structure // About 40% gas cost reduction by using uint16. Limited to max 64K nfts. Item[] public items; uint16[] public tree; uint16 start_leaf; uint16 tree_length; uint32 current_version; address[] nftHolderAddresses; constructor() { _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); current_version = 0; } modifier isStarted() { require( startTime <= block.timestamp && endTime > block.timestamp, "Drop has not started yet!" ); _; } /** Public functions **/ /* * Get the number of available boxes for a tier */ function getAvailable(uint8 _tier) public view returns (uint256) { if (_tier >= tiers.length) { return 0; } return tiers[_tier].available; } /* *This function picks random card and mints this random card to user */ function buyMysteryBox( uint8 _tier, uint8 quantity ) external isStarted nonReentrant { address _user = _msgSender(); require(_tier < tiers.length, "Invalid tier id"); require(tiers[_tier].available >= quantity, "Sold out"); if (bought[_user].version != current_version) { bought[_user].amount = 0; bought[_user].version = current_version; } require( bought[_user].amount + quantity <= maxPerWallet, "Limit per wallet reached" ); bought[_user].amount += quantity; uint256 _amount = tiers[_tier].amount * quantity; uint256 _stones = stone.rewardedStones(_user); require(_stones >= _amount, "You do not have enough stones!"); require(stone.payment(_user, _amount), "Payment was unsuccessful"); tiers[_tier].available -= quantity; for (uint8 j = 0; j < quantity; j++) { for (uint256 i = 0; i < tiers[_tier].rewards; i++) { (ICollectionV3 collection, uint256 tokenId) = _pickNft( j * quantity + i ); mint(collection, _user, tokenId); emit MysteryBoxDropped( _tier, address(collection), tokenId, _user, current_version ); } } } /* *This function picks random card and mints this random card to user */ function giveAway( uint8 _tier, address _user ) external onlyRole(DEFAULT_ADMIN_ROLE) { require(tree[0] - tiers[_tier].available > 0, "Sold out"); (ICollectionV3 collection, uint256 tokenId) = _pickNft(1); mint(collection, _user, tokenId); emit MysteryBoxDropped( _tier, address(collection), tokenId, _user, current_version ); } function mint( ICollectionV3 collection, address user, uint256 tokenId ) internal { for (uint8 i = 0; i < nftHolderAddresses.length; i++) { if (collection.balanceOf(nftHolderAddresses[i], tokenId) > 0) { collection.safeTransferFrom( nftHolderAddresses[i], user, tokenId, 1, "" ); return; } } collection.mint(user, tokenId); } function setNftHolderAddresses( address[] memory _nftHolderAddresses ) public onlyRole(DEFAULT_ADMIN_ROLE) { delete nftHolderAddresses; for (uint8 i = 0; i < _nftHolderAddresses.length; i++) { nftHolderAddresses.push(_nftHolderAddresses[i]); } } /** Code for managing drop paramaters **/ function setGeneralDropParamaters( address _stone, uint256 _maxPerWallet, uint256 _startTime, uint256 _endTime ) public onlyRole(DEFAULT_ADMIN_ROLE) { stone = IFarm(_stone); maxPerWallet = _maxPerWallet; startTime = _startTime; endTime = _endTime; } function setTiersParamaters( Tier[] calldata _tiers ) public onlyRole(DEFAULT_ADMIN_ROLE) { delete tiers; for (uint256 i = 0; i < _tiers.length; i++) { tiers.push(_tiers[i]); } } /** Code related to the tree structure used to store items in the pack **/ function resetItems() public onlyRole(DEFAULT_ADMIN_ROLE) { delete items; start_leaf = 0; tree_length = 0; delete tree; current_version += 1; } function addItems( Item[] calldata _items ) public onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i = 0; i < _items.length; i++) { items.push(_items[i]); } } function preCompute() public onlyRole(DEFAULT_ADMIN_ROLE) { uint64 log; while (2 ** log < items.length) { log++; } start_leaf = uint16((2 ** log) - 1); tree_length = uint16(2 ** (log + 1) - 1); tree = new uint16[](tree_length); uint64 j = 0; for ( uint64 i = uint64(start_leaf); (i < tree_length) && (j < items.length); i++ ) { tree[i] = uint16( items[i - start_leaf].endTokenId - items[i - start_leaf].startTokenId + 1 ); j++; } if (tree_length > 1) { for (uint256 i = (2 ** log) - 2; i >= 1; i--) { tree[i] = tree[2 * i + 1] + tree[2 * i + 2]; } tree[0] = tree[1] + tree[2]; } } function _pickNft(uint256 seed) internal returns (ICollectionV3, uint256) { uint16 position = uint16(_getRandom(tree[0], seed)); uint16 item = _findPosition(position); _removeOne(item); require( items[item].startTokenId <= items[item].endTokenId, "Nft reward soldout" ); uint256 tokenId = items[item].startTokenId; ICollectionV3 collection = items[item].collection; items[item].startTokenId += 1; return (collection, tokenId); } function _getRandom( uint256 gamerange, uint256 seed ) internal view returns (uint256) { return 1 + (uint256( keccak256( abi.encodePacked( block.timestamp, block.difficulty, keccak256(abi.encodePacked(block.coinbase)), seed ) ) ) % gamerange); } function _findPosition(uint16 value) internal view returns (uint16) { uint16 i = 0; require(tree[0] >= value, "Value is bigger than remaining elements"); while (2 * i + 2 < tree_length) { uint16 left = 2 * i + 1; uint16 right = 2 * i + 2; if (value <= tree[left]) { i = left; } else { i = right; value = value - tree[left]; } } return i - start_leaf; } function _removeOne(uint16 position) internal { uint16 i = position + start_leaf; require(tree[i] > 0, "Element is already containing 0 values"); tree[i]--; while (i > 0) { if (i % 2 == 1) { i++; } uint16 parent = (i / 2) - 1; tree[parent] = tree[i - 1] + tree[i]; i = parent; } } }
// 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 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 (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/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// 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; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; interface AggregatorInterface { function latestAnswer() external view returns (int256 answer); }
// SPDX-License-Identifier: MIT // Latest stable version of solidity pragma solidity 0.8.12; interface ICollectionV3 { function initialize( string memory uri, uint256 _total, uint256 _whitelistedStartTime, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _percent, address _admin, address _facAddress ) external; function __CollectionV3_init_unchained( string memory uri, uint256 _total, uint256 _whitelistedStartTime, uint256 _startTime, uint256 _endTime, uint256 _amount, uint256 _percent, address _admin, address _facAddress ) external; function addExternalAddresses( address _token, address _stone, address _treasure ) external; function recoverToken(address _token) external; function changeOnlyWhitelisted(bool _status) external; function buy(address buyer, uint256 _id) external; function mint(address to, uint256 _id) external; function mintBatch( address to, uint256[] memory ids, uint256[] memory amount_ ) external; function addPayees( address[] memory payees_, uint256[] memory sharePerc_ ) external; function _addPayee(address account, uint256 sharePerc_) external; function release() external; function getAmountPer(uint256 sharePerc) external view returns (uint256); function calcPerc( uint256 _amount, uint256 _percent ) external pure returns (uint256); function calcTrasAndShare() external view returns (uint256, uint256); function setStarTime(uint256 _starTime) external; function setEndTime(uint256 _endTime) external; function setWhiteListUser(address _addr) external; function setBatchWhiteListUser(address[] calldata _addr) external; function setAmount(uint256 _amount) external; function delShare(address account) external; function totalReleased() external view returns (uint256); function released(address account) external view returns (uint256); function shares(address account) external view returns (uint256); function allShares() external view returns (address[] memory); function available() external view returns (uint256); function balanceOf( address account, uint256 id ) external view returns (uint256); function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) external; }
// SPDX-License-Identifier: MIT // Latest stable version of solidity pragma solidity 0.8.12; interface IFarm { function payment(address buyer, uint256 amount) external returns (bool); function rewardedStones(address staker) external view returns (uint256); }
{ "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
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint32","name":"version","type":"uint32"}],"name":"MysteryBoxDropped","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"endTokenId","type":"uint256"},{"internalType":"contract ICollectionV3","name":"collection","type":"address"}],"internalType":"struct StonesDrop.Item[]","name":"_items","type":"tuple[]"}],"name":"addItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"bought","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"version","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_tier","type":"uint8"},{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"buyMysteryBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_tier","type":"uint8"}],"name":"getAvailable","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":"uint8","name":"_tier","type":"uint8"},{"internalType":"address","name":"_user","type":"address"}],"name":"giveAway","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"items","outputs":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"endTokenId","type":"uint256"},{"internalType":"contract ICollectionV3","name":"collection","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preCompute","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":[],"name":"resetItems","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":"address","name":"_stone","type":"address"},{"internalType":"uint256","name":"_maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setGeneralDropParamaters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nftHolderAddresses","type":"address[]"}],"name":"setNftHolderAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint16","name":"available","type":"uint16"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint16","name":"rewards","type":"uint16"}],"internalType":"struct StonesDrop.Tier[]","name":"_tiers","type":"tuple[]"}],"name":"setTiersParamaters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stone","outputs":[{"internalType":"contract IFarm","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint16","name":"available","type":"uint16"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint16","name":"rewards","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tree","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600160009081556100229033610037565b600a805463ffffffff60201b191690556100bf565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166100bb5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b61281d80620000cf6000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063453c2310116100c3578063acec599e1161007c578063acec599e14610344578063bfb231d21461034c578063d547741f14610383578063d5f1c5aa14610396578063dc317550146103a9578063e379be89146103b157600080fd5b8063453c2310146102bd578063457110e8146102c6578063667022fd146102d957806378e979251461032057806391d1485414610329578063a217fddf1461033c57600080fd5b80632f2ff15d116101155780632f2ff15d1461024257806331352936146102555780633197cbb61461027b57806336568abe146102845780633c6f3829146102975780634196d0b8146102aa57600080fd5b80630167eb851461015d57806301ffc9a71461018d578063039af9eb146101b0578063142cbfe4146101e85780631e1a0c0c146101fd578063248a9ca31461021e575b600080fd5b600354610170906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101a061019b366004611f99565b6103c4565b6040519015158152602001610184565b6101c36101be366004611fc3565b6103fb565b6040805161ffff94851681526020810193909352921691810191909152606001610184565b6101fb6101f6366004611ff2565b610434565b005b61021061020b366004612025565b610992565b604051908152602001610184565b61021061022c366004611fc3565b6000908152600160208190526040909120015490565b6101fb610250366004612060565b6109da565b610268610263366004611fc3565b610a05565b60405161ffff9091168152602001610184565b61021060065481565b6101fb610292366004612060565b610a3d565b6101fb6102a53660046120a6565b610ab7565b6101fb6102b83660046121b5565b610b41565b61021060045481565b6101fb6102d43660046121b5565b610bc0565b6103066102e73660046121f6565b6002602052600090815260409020805460019091015463ffffffff1682565b6040805192835263ffffffff909116602083015201610184565b61021060055481565b6101a0610337366004612060565b610c2d565b610210600081565b6101fb610c58565b61035f61035a366004611fc3565b610ccb565b6040805193845260208401929092526001600160a01b031690820152606001610184565b6101fb610391366004612060565b610d07565b6101fb6103a4366004612213565b610d2d565b6101fb610d68565b6101fb6103bf36600461224e565b611194565b60006001600160e01b03198216637965db0b60e01b14806103f557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6007818154811061040b57600080fd5b600091825260209091206003909102018054600182015460029092015461ffff91821693501683565b4260055411158015610447575042600654115b6104985760405162461bcd60e51b815260206004820152601960248201527f44726f7020686173206e6f74207374617274656420796574210000000000000060448201526064015b60405180910390fd5b6104a06112be565b600754339060ff8416106104e85760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1a595c881a59608a1b604482015260640161048f565b8160ff1660078460ff16815481106105025761050261227a565b600091825260209091206003909102015461ffff1610156105505760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b604482015260640161048f565b600a546001600160a01b03821660009081526002602052604090206001015463ffffffff90811664010000000090920416146105ca576001600160a01b0381166000908152600260205260408120908155600a546001909101805464010000000090920463ffffffff1663ffffffff199092169190911790555b6004546001600160a01b0382166000908152600260205260409020546105f49060ff8516906122a6565b11156106425760405162461bcd60e51b815260206004820152601860248201527f4c696d6974207065722077616c6c657420726561636865640000000000000000604482015260640161048f565b6001600160a01b0381166000908152600260205260408120805460ff8516929061066d9084906122a6565b9250508190555060008260ff1660078560ff16815481106106905761069061227a565b9060005260206000209060030201600101546106ac91906122be565b6003546040516375c7e97360e01b81526001600160a01b038581166004830152929350600092909116906375c7e97390602401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072091906122dd565b9050818110156107725760405162461bcd60e51b815260206004820152601e60248201527f596f7520646f206e6f74206861766520656e6f7567682073746f6e6573210000604482015260640161048f565b6003546040516367a09c2360e01b81526001600160a01b03858116600483015260248201859052909116906367a09c23906044016020604051808303816000875af11580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e991906122f6565b6108355760405162461bcd60e51b815260206004820152601860248201527f5061796d656e742077617320756e7375636365737366756c0000000000000000604482015260640161048f565b8360ff1660078660ff168154811061084f5761084f61227a565b600091825260208220600390910201805490919061087290849061ffff16612318565b92506101000a81548161ffff021916908361ffff16021790555060005b8460ff168160ff1610156109805760005b60078760ff16815481106108b6576108b661227a565b600091825260209091206002600390920201015461ffff1681101561096d576000806108f8836108e68a8761233b565b60ff166108f391906122a6565b611318565b915091506109078288836114c1565b7fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c38983838a600a60049054906101000a900463ffffffff16604051610950959493929190612364565b60405180910390a1505080806109659061239d565b9150506108a0565b5080610978816123b8565b91505061088f565b5050505061098e6001600055565b5050565b60075460009060ff8316106109a957506000919050565b60078260ff16815481106109bf576109bf61227a565b600091825260209091206003909102015461ffff1692915050565b600082815260016020819052604090912001546109f6816116a6565b610a0083836116b3565b505050565b60098181548110610a1557600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b6001600160a01b0381163314610aad5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161048f565b61098e828261171e565b6000610ac2816116a6565b610ace600b6000611dfb565b60005b82518160ff161015610a0057600b838260ff1681518110610af457610af461227a565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b0390921691909117905580610b39816123b8565b915050610ad1565b6000610b4c816116a6565b610b5860076000611e19565b60005b82811015610bba576007848483818110610b7757610b7761227a565b835460018101855560009485526020909420606090910292909201926003029091019050610ba582826123ec565b50508080610bb29061239d565b915050610b5b565b50505050565b6000610bcb816116a6565b60005b82811015610bba576008848483818110610bea57610bea61227a565b835460018101855560009485526020909420606090910292909201926003029091019050610c18828261243b565b50508080610c259061239d565b915050610bce565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c63816116a6565b610c6f60086000611e3a565b600a805463ffffffff19169055610c8860096000611e5b565b6001600a60048282829054906101000a900463ffffffff16610caa919061247a565b92506101000a81548163ffffffff021916908363ffffffff16021790555050565b60088181548110610cdb57600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b031683565b60008281526001602081905260409091200154610d23816116a6565b610a00838361171e565b6000610d38816116a6565b50600380546001600160a01b0319166001600160a01b039590951694909417909355600491909155600555600655565b6000610d73816116a6565b60005b600854610d8482600261257e565b1015610d9c5780610d9481612593565b915050610d76565b6001610da982600261257e565b610db391906125ba565b600a805461ffff191661ffff929092169190911790556001610dd582826125d1565b610de090600261257e565b610dea91906125ba565b600a805463ffff000019166201000061ffff938416810291909117918290559004166001600160401b03811115610e2357610e23612090565b604051908082528060200260200182016040528015610e4c578160200160208202803683370190505b508051610e6191600991602090910190611e80565b50600a5460009061ffff165b600a5462010000900461ffff166001600160401b038216108015610e9b57506008546001600160401b038316105b15610f9e57600a54600890610eb49061ffff16836125f3565b6001600160401b031681548110610ecd57610ecd61227a565b6000918252602090912060039091020154600a54600890610ef29061ffff16846125f3565b6001600160401b031681548110610f0b57610f0b61227a565b906000526020600020906003020160010154610f2791906125ba565b610f329060016122a6565b6009826001600160401b031681548110610f4e57610f4e61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508180610f8890612593565b9250508080610f9690612593565b915050610e6d565b50600a5460016201000090910461ffff161115610a005760006002610fc3848261257e565b610fcd91906125ba565b90505b600181106110d1576009610fe58260026122be565b610ff09060026122a6565b815481106110005761100061227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600982600261103391906122be565b61103e9060016122a6565b8154811061104e5761104e61227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661107c9190612613565b6009828154811061108f5761108f61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080806110c990612630565b915050610fd0565b5060096002815481106110e6576110e661227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600960018154811061111e5761111e61227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661114c9190612613565b60096000815481106111605761116061227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550505050565b600061119f816116a6565b600060078460ff16815481106111b7576111b761227a565b600091825260208220600390910201546009805461ffff9092169290916111e0576111e061227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661120e9190612318565b61ffff161161124a5760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b604482015260640161048f565b6000806112576001611318565b915091506112668285836114c1565b7fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c385838387600a60049054906101000a900463ffffffff166040516112af959493929190612364565b60405180910390a15050505050565b600260005414156113115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161048f565b6002600055565b600080600061135c60096000815481106113345761133461227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1685611785565b905060006113698261180b565b9050611374816119c1565b60088161ffff168154811061138b5761138b61227a565b90600052602060002090600302016001015460088261ffff16815481106113b4576113b461227a565b90600052602060002090600302016000015411156114095760405162461bcd60e51b815260206004820152601260248201527113999d081c995dd85c99081cdbdb191bdd5d60721b604482015260640161048f565b600060088261ffff16815481106114225761142261227a565b9060005260206000209060030201600001549050600060088361ffff168154811061144f5761144f61227a565b906000526020600020906003020160020160009054906101000a90046001600160a01b03169050600160088461ffff168154811061148f5761148f61227a565b906000526020600020906003020160000160008282546114af91906122a6565b90915550909791965090945050505050565b60005b600b5460ff8216101561163e576000846001600160a01b031662fdd58e600b8460ff16815481106114f7576114f761227a565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101869052604401602060405180830381865afa15801561154e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157291906122dd565b111561162c57836001600160a01b031663f242432a600b8360ff168154811061159d5761159d61227a565b600091825260208220015460405160e084901b6001600160e01b03191681526001600160a01b0391821660048201529087166024820152604481018690526001606482015260a0608482015260a481019190915260c401600060405180830381600087803b15801561160e57600080fd5b505af1158015611622573d6000803e3d6000fd5b5050505050505050565b80611636816123b8565b9150506114c4565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528416906340c10f1990604401600060405180830381600087803b15801561168957600080fd5b505af115801561169d573d6000803e3d6000fd5b50505050505050565b6116b08133611bf5565b50565b6116bd8282610c2d565b61098e5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6117288282610c2d565b1561098e5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080514160601b6bffffffffffffffffffffffff191660208083019190915282516014818403018152603483018452805190820120426054840152446074840152609483015260b48083018590528351808403909101815260d490920190925280519101206000906117f990849061265d565b6118049060016122a6565b9392505050565b600080600090508261ffff16600960008154811061182b5761182b61227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1610156118ab5760405162461bcd60e51b815260206004820152602760248201527f56616c756520697320626967676572207468616e2072656d61696e696e6720656044820152666c656d656e747360c81b606482015260840161048f565b600a5462010000900461ffff166118c3826002612671565b6118ce906002612613565b61ffff1610156119b05760006118e5826002612671565b6118f0906001612613565b905060006118ff836002612671565b61190a906002612613565b905060098261ffff16815481106119235761192361227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff168561ffff161161195d578192506119a9565b80925060098261ffff16815481106119775761197761227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16856119a69190612318565b94505b50506118ab565b600a546118049061ffff1682612318565b600a546000906119d59061ffff1683612613565b9050600060098261ffff16815481106119f0576119f061227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1611611a6e5760405162461bcd60e51b815260206004820152602660248201527f456c656d656e7420697320616c726561647920636f6e7461696e696e6720302060448201526576616c75657360d01b606482015260840161048f565b60098161ffff1681548110611a8557611a8561227a565b906000526020600020906010918282040191900660020281819054906101000a900461ffff1680929190611ab89061269b565b91906101000a81548161ffff021916908361ffff160217905550505b61ffff81161561098e57611ae96002826126b9565b61ffff1660011415611b035780611aff816126da565b9150505b60006001611b126002846126f2565b611b1c9190612318565b905060098261ffff1681548110611b3557611b3561227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff166009611b64600185612318565b61ffff1681548110611b7857611b7861227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611ba69190612613565b60098261ffff1681548110611bbd57611bbd61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080915050611ad4565b611bff8282610c2d565b61098e57611c0c81611c4e565b611c17836020611c60565b604051602001611c2892919061273f565b60408051601f198184030181529082905262461bcd60e51b825261048f916004016127b4565b60606103f56001600160a01b03831660145b60606000611c6f8360026122be565b611c7a9060026122a6565b6001600160401b03811115611c9157611c91612090565b6040519080825280601f01601f191660200182016040528015611cbb576020820181803683370190505b509050600360fc1b81600081518110611cd657611cd661227a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d0557611d0561227a565b60200101906001600160f81b031916908160001a9053506000611d298460026122be565b611d349060016122a6565b90505b6001811115611dac576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d6857611d6861227a565b1a60f81b828281518110611d7e57611d7e61227a565b60200101906001600160f81b031916908160001a90535060049490941c93611da581612630565b9050611d37565b5083156118045760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161048f565b50805460008255906000526020600020908101906116b09190611f29565b50805460008255600302906000526020600020908101906116b09190611f3e565b50805460008255600302906000526020600020908101906116b09190611f6c565b50805460008255600f0160109004906000526020600020908101906116b09190611f29565b82805482825590600052602060002090600f01601090048101928215611f195791602002820160005b83821115611ee957835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611ea9565b8015611f175782816101000a81549061ffff0219169055600201602081600101049283019260010302611ee9565b505b50611f25929150611f29565b5090565b5b80821115611f255760008155600101611f2a565b5b80821115611f2557805461ffff199081168255600060018301556002820180549091169055600301611f3f565b5b80821115611f2557600080825560018201556002810180546001600160a01b0319169055600301611f6d565b600060208284031215611fab57600080fd5b81356001600160e01b03198116811461180457600080fd5b600060208284031215611fd557600080fd5b5035919050565b803560ff81168114611fed57600080fd5b919050565b6000806040838503121561200557600080fd5b61200e83611fdc565b915061201c60208401611fdc565b90509250929050565b60006020828403121561203757600080fd5b61180482611fdc565b6001600160a01b03811681146116b057600080fd5b8035611fed81612040565b6000806040838503121561207357600080fd5b82359150602083013561208581612040565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156120b957600080fd5b82356001600160401b03808211156120d057600080fd5b818501915085601f8301126120e457600080fd5b8135818111156120f6576120f6612090565b8060051b604051601f19603f8301168101818110858211171561211b5761211b612090565b60405291825284820192508381018501918883111561213957600080fd5b938501935b8285101561215e5761214f85612055565b8452938501939285019261213e565b98975050505050505050565b60008083601f84011261217c57600080fd5b5081356001600160401b0381111561219357600080fd5b6020830191508360206060830285010111156121ae57600080fd5b9250929050565b600080602083850312156121c857600080fd5b82356001600160401b038111156121de57600080fd5b6121ea8582860161216a565b90969095509350505050565b60006020828403121561220857600080fd5b813561180481612040565b6000806000806080858703121561222957600080fd5b843561223481612040565b966020860135965060408601359560600135945092505050565b6000806040838503121561226157600080fd5b61226a83611fdc565b9150602083013561208581612040565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156122b9576122b9612290565b500190565b60008160001904831182151516156122d8576122d8612290565b500290565b6000602082840312156122ef57600080fd5b5051919050565b60006020828403121561230857600080fd5b8151801515811461180457600080fd5b600061ffff8381169083168181101561233357612333612290565b039392505050565b600060ff821660ff84168160ff048111821515161561235c5761235c612290565b029392505050565b60ff9590951685526001600160a01b0393841660208601526040850192909252909116606083015263ffffffff16608082015260a00190565b60006000198214156123b1576123b1612290565b5060010190565b600060ff821660ff8114156123cf576123cf612290565b60010192915050565b6000813561ffff811681146103f557600080fd5b61240b6123f8836123d8565b825461ffff191661ffff91909116178255565b6020820135600182015561098e612424604084016123d8565b6002830161ffff821661ffff198254161781555050565b813581556020820135600182015560028101604083013561245b81612040565b81546001600160a01b0319166001600160a01b03919091161790555050565b600063ffffffff80831681851680830382111561249957612499612290565b01949350505050565b600181815b808511156124dd5781600019048211156124c3576124c3612290565b808516156124d057918102915b93841c93908002906124a7565b509250929050565b6000826124f4575060016103f5565b81612501575060006103f5565b816001811461251757600281146125215761253d565b60019150506103f5565b60ff84111561253257612532612290565b50506001821b6103f5565b5060208310610133831016604e8410600b8410161715612560575081810a6103f5565b61256a83836124a2565b806000190482111561235c5761235c612290565b60006118046001600160401b038416836124e5565b60006001600160401b03808316818114156125b0576125b0612290565b6001019392505050565b6000828210156125cc576125cc612290565b500390565b60006001600160401b0380831681851680830382111561249957612499612290565b60006001600160401b038381169083168181101561233357612333612290565b600061ffff80831681851680830382111561249957612499612290565b60008161263f5761263f612290565b506000190190565b634e487b7160e01b600052601260045260246000fd5b60008261266c5761266c612647565b500690565b600061ffff8083168185168183048111821515161561269257612692612290565b02949350505050565b600061ffff8216806126af576126af612290565b6000190192915050565b600061ffff808416806126ce576126ce612647565b92169190910692915050565b600061ffff808316818114156125b0576125b0612290565b600061ffff8084168061270757612707612647565b92169190910492915050565b60005b8381101561272e578181015183820152602001612716565b83811115610bba5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612777816017850160208801612713565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516127a8816028840160208801612713565b01602801949350505050565b60208152600082518060208401526127d3816040850160208701612713565b601f01601f1916919091016040019291505056fea264697066735822122074c20190df76a53f29d82fb1437c760cb8b0175e3a754ac09f15d73dbfe2d54b64736f6c634300080c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063453c2310116100c3578063acec599e1161007c578063acec599e14610344578063bfb231d21461034c578063d547741f14610383578063d5f1c5aa14610396578063dc317550146103a9578063e379be89146103b157600080fd5b8063453c2310146102bd578063457110e8146102c6578063667022fd146102d957806378e979251461032057806391d1485414610329578063a217fddf1461033c57600080fd5b80632f2ff15d116101155780632f2ff15d1461024257806331352936146102555780633197cbb61461027b57806336568abe146102845780633c6f3829146102975780634196d0b8146102aa57600080fd5b80630167eb851461015d57806301ffc9a71461018d578063039af9eb146101b0578063142cbfe4146101e85780631e1a0c0c146101fd578063248a9ca31461021e575b600080fd5b600354610170906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101a061019b366004611f99565b6103c4565b6040519015158152602001610184565b6101c36101be366004611fc3565b6103fb565b6040805161ffff94851681526020810193909352921691810191909152606001610184565b6101fb6101f6366004611ff2565b610434565b005b61021061020b366004612025565b610992565b604051908152602001610184565b61021061022c366004611fc3565b6000908152600160208190526040909120015490565b6101fb610250366004612060565b6109da565b610268610263366004611fc3565b610a05565b60405161ffff9091168152602001610184565b61021060065481565b6101fb610292366004612060565b610a3d565b6101fb6102a53660046120a6565b610ab7565b6101fb6102b83660046121b5565b610b41565b61021060045481565b6101fb6102d43660046121b5565b610bc0565b6103066102e73660046121f6565b6002602052600090815260409020805460019091015463ffffffff1682565b6040805192835263ffffffff909116602083015201610184565b61021060055481565b6101a0610337366004612060565b610c2d565b610210600081565b6101fb610c58565b61035f61035a366004611fc3565b610ccb565b6040805193845260208401929092526001600160a01b031690820152606001610184565b6101fb610391366004612060565b610d07565b6101fb6103a4366004612213565b610d2d565b6101fb610d68565b6101fb6103bf36600461224e565b611194565b60006001600160e01b03198216637965db0b60e01b14806103f557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6007818154811061040b57600080fd5b600091825260209091206003909102018054600182015460029092015461ffff91821693501683565b4260055411158015610447575042600654115b6104985760405162461bcd60e51b815260206004820152601960248201527f44726f7020686173206e6f74207374617274656420796574210000000000000060448201526064015b60405180910390fd5b6104a06112be565b600754339060ff8416106104e85760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1a595c881a59608a1b604482015260640161048f565b8160ff1660078460ff16815481106105025761050261227a565b600091825260209091206003909102015461ffff1610156105505760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b604482015260640161048f565b600a546001600160a01b03821660009081526002602052604090206001015463ffffffff90811664010000000090920416146105ca576001600160a01b0381166000908152600260205260408120908155600a546001909101805464010000000090920463ffffffff1663ffffffff199092169190911790555b6004546001600160a01b0382166000908152600260205260409020546105f49060ff8516906122a6565b11156106425760405162461bcd60e51b815260206004820152601860248201527f4c696d6974207065722077616c6c657420726561636865640000000000000000604482015260640161048f565b6001600160a01b0381166000908152600260205260408120805460ff8516929061066d9084906122a6565b9250508190555060008260ff1660078560ff16815481106106905761069061227a565b9060005260206000209060030201600101546106ac91906122be565b6003546040516375c7e97360e01b81526001600160a01b038581166004830152929350600092909116906375c7e97390602401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072091906122dd565b9050818110156107725760405162461bcd60e51b815260206004820152601e60248201527f596f7520646f206e6f74206861766520656e6f7567682073746f6e6573210000604482015260640161048f565b6003546040516367a09c2360e01b81526001600160a01b03858116600483015260248201859052909116906367a09c23906044016020604051808303816000875af11580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e991906122f6565b6108355760405162461bcd60e51b815260206004820152601860248201527f5061796d656e742077617320756e7375636365737366756c0000000000000000604482015260640161048f565b8360ff1660078660ff168154811061084f5761084f61227a565b600091825260208220600390910201805490919061087290849061ffff16612318565b92506101000a81548161ffff021916908361ffff16021790555060005b8460ff168160ff1610156109805760005b60078760ff16815481106108b6576108b661227a565b600091825260209091206002600390920201015461ffff1681101561096d576000806108f8836108e68a8761233b565b60ff166108f391906122a6565b611318565b915091506109078288836114c1565b7fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c38983838a600a60049054906101000a900463ffffffff16604051610950959493929190612364565b60405180910390a1505080806109659061239d565b9150506108a0565b5080610978816123b8565b91505061088f565b5050505061098e6001600055565b5050565b60075460009060ff8316106109a957506000919050565b60078260ff16815481106109bf576109bf61227a565b600091825260209091206003909102015461ffff1692915050565b600082815260016020819052604090912001546109f6816116a6565b610a0083836116b3565b505050565b60098181548110610a1557600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b6001600160a01b0381163314610aad5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161048f565b61098e828261171e565b6000610ac2816116a6565b610ace600b6000611dfb565b60005b82518160ff161015610a0057600b838260ff1681518110610af457610af461227a565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b0390921691909117905580610b39816123b8565b915050610ad1565b6000610b4c816116a6565b610b5860076000611e19565b60005b82811015610bba576007848483818110610b7757610b7761227a565b835460018101855560009485526020909420606090910292909201926003029091019050610ba582826123ec565b50508080610bb29061239d565b915050610b5b565b50505050565b6000610bcb816116a6565b60005b82811015610bba576008848483818110610bea57610bea61227a565b835460018101855560009485526020909420606090910292909201926003029091019050610c18828261243b565b50508080610c259061239d565b915050610bce565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c63816116a6565b610c6f60086000611e3a565b600a805463ffffffff19169055610c8860096000611e5b565b6001600a60048282829054906101000a900463ffffffff16610caa919061247a565b92506101000a81548163ffffffff021916908363ffffffff16021790555050565b60088181548110610cdb57600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b031683565b60008281526001602081905260409091200154610d23816116a6565b610a00838361171e565b6000610d38816116a6565b50600380546001600160a01b0319166001600160a01b039590951694909417909355600491909155600555600655565b6000610d73816116a6565b60005b600854610d8482600261257e565b1015610d9c5780610d9481612593565b915050610d76565b6001610da982600261257e565b610db391906125ba565b600a805461ffff191661ffff929092169190911790556001610dd582826125d1565b610de090600261257e565b610dea91906125ba565b600a805463ffff000019166201000061ffff938416810291909117918290559004166001600160401b03811115610e2357610e23612090565b604051908082528060200260200182016040528015610e4c578160200160208202803683370190505b508051610e6191600991602090910190611e80565b50600a5460009061ffff165b600a5462010000900461ffff166001600160401b038216108015610e9b57506008546001600160401b038316105b15610f9e57600a54600890610eb49061ffff16836125f3565b6001600160401b031681548110610ecd57610ecd61227a565b6000918252602090912060039091020154600a54600890610ef29061ffff16846125f3565b6001600160401b031681548110610f0b57610f0b61227a565b906000526020600020906003020160010154610f2791906125ba565b610f329060016122a6565b6009826001600160401b031681548110610f4e57610f4e61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508180610f8890612593565b9250508080610f9690612593565b915050610e6d565b50600a5460016201000090910461ffff161115610a005760006002610fc3848261257e565b610fcd91906125ba565b90505b600181106110d1576009610fe58260026122be565b610ff09060026122a6565b815481106110005761100061227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600982600261103391906122be565b61103e9060016122a6565b8154811061104e5761104e61227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661107c9190612613565b6009828154811061108f5761108f61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080806110c990612630565b915050610fd0565b5060096002815481106110e6576110e661227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600960018154811061111e5761111e61227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661114c9190612613565b60096000815481106111605761116061227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550505050565b600061119f816116a6565b600060078460ff16815481106111b7576111b761227a565b600091825260208220600390910201546009805461ffff9092169290916111e0576111e061227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661120e9190612318565b61ffff161161124a5760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b604482015260640161048f565b6000806112576001611318565b915091506112668285836114c1565b7fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c385838387600a60049054906101000a900463ffffffff166040516112af959493929190612364565b60405180910390a15050505050565b600260005414156113115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161048f565b6002600055565b600080600061135c60096000815481106113345761133461227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1685611785565b905060006113698261180b565b9050611374816119c1565b60088161ffff168154811061138b5761138b61227a565b90600052602060002090600302016001015460088261ffff16815481106113b4576113b461227a565b90600052602060002090600302016000015411156114095760405162461bcd60e51b815260206004820152601260248201527113999d081c995dd85c99081cdbdb191bdd5d60721b604482015260640161048f565b600060088261ffff16815481106114225761142261227a565b9060005260206000209060030201600001549050600060088361ffff168154811061144f5761144f61227a565b906000526020600020906003020160020160009054906101000a90046001600160a01b03169050600160088461ffff168154811061148f5761148f61227a565b906000526020600020906003020160000160008282546114af91906122a6565b90915550909791965090945050505050565b60005b600b5460ff8216101561163e576000846001600160a01b031662fdd58e600b8460ff16815481106114f7576114f761227a565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101869052604401602060405180830381865afa15801561154e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157291906122dd565b111561162c57836001600160a01b031663f242432a600b8360ff168154811061159d5761159d61227a565b600091825260208220015460405160e084901b6001600160e01b03191681526001600160a01b0391821660048201529087166024820152604481018690526001606482015260a0608482015260a481019190915260c401600060405180830381600087803b15801561160e57600080fd5b505af1158015611622573d6000803e3d6000fd5b5050505050505050565b80611636816123b8565b9150506114c4565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528416906340c10f1990604401600060405180830381600087803b15801561168957600080fd5b505af115801561169d573d6000803e3d6000fd5b50505050505050565b6116b08133611bf5565b50565b6116bd8282610c2d565b61098e5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6117288282610c2d565b1561098e5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080514160601b6bffffffffffffffffffffffff191660208083019190915282516014818403018152603483018452805190820120426054840152446074840152609483015260b48083018590528351808403909101815260d490920190925280519101206000906117f990849061265d565b6118049060016122a6565b9392505050565b600080600090508261ffff16600960008154811061182b5761182b61227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1610156118ab5760405162461bcd60e51b815260206004820152602760248201527f56616c756520697320626967676572207468616e2072656d61696e696e6720656044820152666c656d656e747360c81b606482015260840161048f565b600a5462010000900461ffff166118c3826002612671565b6118ce906002612613565b61ffff1610156119b05760006118e5826002612671565b6118f0906001612613565b905060006118ff836002612671565b61190a906002612613565b905060098261ffff16815481106119235761192361227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff168561ffff161161195d578192506119a9565b80925060098261ffff16815481106119775761197761227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16856119a69190612318565b94505b50506118ab565b600a546118049061ffff1682612318565b600a546000906119d59061ffff1683612613565b9050600060098261ffff16815481106119f0576119f061227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff1611611a6e5760405162461bcd60e51b815260206004820152602660248201527f456c656d656e7420697320616c726561647920636f6e7461696e696e6720302060448201526576616c75657360d01b606482015260840161048f565b60098161ffff1681548110611a8557611a8561227a565b906000526020600020906010918282040191900660020281819054906101000a900461ffff1680929190611ab89061269b565b91906101000a81548161ffff021916908361ffff160217905550505b61ffff81161561098e57611ae96002826126b9565b61ffff1660011415611b035780611aff816126da565b9150505b60006001611b126002846126f2565b611b1c9190612318565b905060098261ffff1681548110611b3557611b3561227a565b60009182526020909120601082040154600f9091166002026101000a900461ffff166009611b64600185612318565b61ffff1681548110611b7857611b7861227a565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611ba69190612613565b60098261ffff1681548110611bbd57611bbd61227a565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080915050611ad4565b611bff8282610c2d565b61098e57611c0c81611c4e565b611c17836020611c60565b604051602001611c2892919061273f565b60408051601f198184030181529082905262461bcd60e51b825261048f916004016127b4565b60606103f56001600160a01b03831660145b60606000611c6f8360026122be565b611c7a9060026122a6565b6001600160401b03811115611c9157611c91612090565b6040519080825280601f01601f191660200182016040528015611cbb576020820181803683370190505b509050600360fc1b81600081518110611cd657611cd661227a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d0557611d0561227a565b60200101906001600160f81b031916908160001a9053506000611d298460026122be565b611d349060016122a6565b90505b6001811115611dac576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d6857611d6861227a565b1a60f81b828281518110611d7e57611d7e61227a565b60200101906001600160f81b031916908160001a90535060049490941c93611da581612630565b9050611d37565b5083156118045760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161048f565b50805460008255906000526020600020908101906116b09190611f29565b50805460008255600302906000526020600020908101906116b09190611f3e565b50805460008255600302906000526020600020908101906116b09190611f6c565b50805460008255600f0160109004906000526020600020908101906116b09190611f29565b82805482825590600052602060002090600f01601090048101928215611f195791602002820160005b83821115611ee957835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611ea9565b8015611f175782816101000a81549061ffff0219169055600201602081600101049283019260010302611ee9565b505b50611f25929150611f29565b5090565b5b80821115611f255760008155600101611f2a565b5b80821115611f2557805461ffff199081168255600060018301556002820180549091169055600301611f3f565b5b80821115611f2557600080825560018201556002810180546001600160a01b0319169055600301611f6d565b600060208284031215611fab57600080fd5b81356001600160e01b03198116811461180457600080fd5b600060208284031215611fd557600080fd5b5035919050565b803560ff81168114611fed57600080fd5b919050565b6000806040838503121561200557600080fd5b61200e83611fdc565b915061201c60208401611fdc565b90509250929050565b60006020828403121561203757600080fd5b61180482611fdc565b6001600160a01b03811681146116b057600080fd5b8035611fed81612040565b6000806040838503121561207357600080fd5b82359150602083013561208581612040565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156120b957600080fd5b82356001600160401b03808211156120d057600080fd5b818501915085601f8301126120e457600080fd5b8135818111156120f6576120f6612090565b8060051b604051601f19603f8301168101818110858211171561211b5761211b612090565b60405291825284820192508381018501918883111561213957600080fd5b938501935b8285101561215e5761214f85612055565b8452938501939285019261213e565b98975050505050505050565b60008083601f84011261217c57600080fd5b5081356001600160401b0381111561219357600080fd5b6020830191508360206060830285010111156121ae57600080fd5b9250929050565b600080602083850312156121c857600080fd5b82356001600160401b038111156121de57600080fd5b6121ea8582860161216a565b90969095509350505050565b60006020828403121561220857600080fd5b813561180481612040565b6000806000806080858703121561222957600080fd5b843561223481612040565b966020860135965060408601359560600135945092505050565b6000806040838503121561226157600080fd5b61226a83611fdc565b9150602083013561208581612040565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156122b9576122b9612290565b500190565b60008160001904831182151516156122d8576122d8612290565b500290565b6000602082840312156122ef57600080fd5b5051919050565b60006020828403121561230857600080fd5b8151801515811461180457600080fd5b600061ffff8381169083168181101561233357612333612290565b039392505050565b600060ff821660ff84168160ff048111821515161561235c5761235c612290565b029392505050565b60ff9590951685526001600160a01b0393841660208601526040850192909252909116606083015263ffffffff16608082015260a00190565b60006000198214156123b1576123b1612290565b5060010190565b600060ff821660ff8114156123cf576123cf612290565b60010192915050565b6000813561ffff811681146103f557600080fd5b61240b6123f8836123d8565b825461ffff191661ffff91909116178255565b6020820135600182015561098e612424604084016123d8565b6002830161ffff821661ffff198254161781555050565b813581556020820135600182015560028101604083013561245b81612040565b81546001600160a01b0319166001600160a01b03919091161790555050565b600063ffffffff80831681851680830382111561249957612499612290565b01949350505050565b600181815b808511156124dd5781600019048211156124c3576124c3612290565b808516156124d057918102915b93841c93908002906124a7565b509250929050565b6000826124f4575060016103f5565b81612501575060006103f5565b816001811461251757600281146125215761253d565b60019150506103f5565b60ff84111561253257612532612290565b50506001821b6103f5565b5060208310610133831016604e8410600b8410161715612560575081810a6103f5565b61256a83836124a2565b806000190482111561235c5761235c612290565b60006118046001600160401b038416836124e5565b60006001600160401b03808316818114156125b0576125b0612290565b6001019392505050565b6000828210156125cc576125cc612290565b500390565b60006001600160401b0380831681851680830382111561249957612499612290565b60006001600160401b038381169083168181101561233357612333612290565b600061ffff80831681851680830382111561249957612499612290565b60008161263f5761263f612290565b506000190190565b634e487b7160e01b600052601260045260246000fd5b60008261266c5761266c612647565b500690565b600061ffff8083168185168183048111821515161561269257612692612290565b02949350505050565b600061ffff8216806126af576126af612290565b6000190192915050565b600061ffff808416806126ce576126ce612647565b92169190910692915050565b600061ffff808316818114156125b0576125b0612290565b600061ffff8084168061270757612707612647565b92169190910492915050565b60005b8381101561272e578181015183820152602001612716565b83811115610bba5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612777816017850160208801612713565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516127a8816028840160208801612713565b01602801949350505050565b60208152600082518060208401526127d3816040850160208701612713565b601f01601f1916919091016040019291505056fea264697066735822122074c20190df76a53f29d82fb1437c760cb8b0175e3a754ac09f15d73dbfe2d54b64736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.