Overview
CRO Balance
0 CRO
CRO Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 12228286 | 262 days ago | IN | 0 CRO | 51.98622676 |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Resources
Compiler Version
v0.8.4+commit.c7e474f2
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.4; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import "../token/IERC20Burnable.sol"; import "../utils/Constants.sol"; import "./ResourceConstants.sol"; contract Resources is Initializable, AccessControlUpgradeable, UUPSUpgradeable, ERC1155BurnableUpgradeable, ERC1155SupplyUpgradeable, EIP712Upgradeable, ERC2981Upgradeable { bytes32 public constant WHITELISTED_OPERATOR_ROLE = keccak256("WHITELISTED_OPERATOR_ROLE"); struct MintRequest { address to; uint256[] ids; uint256[] amounts; uint256 expire; uint256 nonce; } struct UpkeepRequest { address from; uint256 meeple; uint256[] costIds; uint256[] costAmounts; uint256 expire; uint256 nonce; } struct CraftRequest { address from; uint256 fortuneRequired; uint256[] resourcesIdsRequired; uint256[] resourcesAmountsRequired; uint256[] resourcesIdsCrafted; uint256[] resourcesAmountsCrafted; uint256 expire; uint256 nonce; } event MintRequestSuccess(bytes32 indexed digest); event MintRequestCancelled(bytes32 indexed digest); event MintRequestByAdmin(MintRequest request); event TaxPaid(address indexed from, uint256 id, uint256 amount); event Upkeep(bytes32 indexed digest); event MeepleActive(address indexed player, uint256 amount, uint256 lastUpkeep); event Deposit(address indexed from, uint256[] ids, uint256[] amounts); event Craft(bytes32 indexed digest); using AddressUpgradeable for address; mapping(bytes32 => bool) private _processedDigests; mapping(uint256 => string) uris; mapping(address => uint256) public lastUpkeep; mapping (uint => uint8) public transferTaxForId; mapping (address => uint256) public activeMeeples; uint256 public upkeepInterval; bool doingUpkeep; bool doingTax; IERC20Burnable public fortune; // uint256[] public limits; // uint256[] public crafted; mapping(uint256 => uint256) public _limits; mapping (uint256 => uint256) public _crafted; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize() public initializer { __AccessControl_init(); __UUPSUpgradeable_init(); __ERC1155_init(""); __ERC1155Burnable_init(); __ERC1155Supply_init(); __EIP712_init("Resources", "1"); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(UPGRADER_ROLE, msg.sender); _grantRole(SIG_ROLE, msg.sender); setDefaultRoyalty(0xB5d4f12b5E7d8Ce43FECe177a6C75dF14994FBe6, 500); } function _authorizeUpgrade(address newImplementation) internal onlyRole(UPGRADER_ROLE) override {} function setUri(uint256 _tokenId, string memory _uri) public onlyRole(SIG_ROLE) { uris[_tokenId] = _uri; } function uri( uint256 _tokenId ) public view virtual override returns (string memory) { return uris[_tokenId]; } function domainSeparator() public view returns (bytes32) { return _domainSeparatorV4(); } function hashMintRequest(MintRequest calldata mintRequest) public view returns (bytes32) { bytes32 structHash = keccak256( abi.encode( keccak256("MintRequest(address to,uint256[] ids,uint256[] amounts,uint256 expire,uint256 nonce)"), mintRequest.to, keccak256(abi.encodePacked(mintRequest.ids)), keccak256(abi.encodePacked(mintRequest.amounts)), mintRequest.expire, mintRequest.nonce ) ); return _hashTypedDataV4(structHash); } function hashUpkeepRequest(UpkeepRequest calldata upkeepRequest) public view returns (bytes32) { bytes32 structHash = keccak256( abi.encode( keccak256("UpkeepRequest(address from,uint256 meeple,uint256[] costIds,uint256[] costAmounts,uint256 expire,uint256 nonce)"), upkeepRequest.from, upkeepRequest.meeple, keccak256(abi.encodePacked(upkeepRequest.costIds)), keccak256(abi.encodePacked(upkeepRequest.costAmounts)), upkeepRequest.expire, upkeepRequest.nonce ) ); return _hashTypedDataV4(structHash); } function hashCraftRequest(CraftRequest calldata craftRequest) public view returns (bytes32) { bytes32 structHash = keccak256( abi.encode( keccak256("CraftRequest(address from,uint256 fortuneRequired,uint256[] resourcesIdsRequired,uint256[] resourcesAmountsRequired,uint256[] resourcesIdsCrafted,uint256[] resourcesAmountsCrafted,uint256 expire,uint256 nonce)"), craftRequest.from, craftRequest.fortuneRequired, keccak256(abi.encodePacked(craftRequest.resourcesIdsRequired)), keccak256(abi.encodePacked(craftRequest.resourcesAmountsRequired)), keccak256(abi.encodePacked(craftRequest.resourcesIdsCrafted)), keccak256(abi.encodePacked(craftRequest.resourcesAmountsCrafted)), craftRequest.expire, craftRequest.nonce ) ); return _hashTypedDataV4(structHash); } function mint( MintRequest calldata request ) external { require(hasRole(SIG_ROLE, msg.sender), "Resources: caller does not have SIG_ROLE"); _mintBatch(request.to, request.ids, request.amounts, ""); emit MintRequestByAdmin(request); } function airdrop(address[] calldata _receipients, uint id, uint amount) external onlyRole(SIG_ROLE) { for(uint i = 0; i < _receipients.length; i++){ _mint(_receipients[i], id, amount, ""); } } function mintWithSig( MintRequest calldata request, bytes calldata signature ) external { require(request.ids.length == request.amounts.length, "Resources: ids and amounts length mismatch"); bytes32 digest = hashMintRequest(request); require(!_processedDigests[digest], "Resources: signature already used"); address signer = ECDSAUpgradeable.recover(digest, signature); require(hasRole(SIG_ROLE, signer), "Resources: invalid signature"); require(block.timestamp <= request.expire, "Resources: signature expired"); _mintBatch(request.to, request.ids, request.amounts, ""); _processedDigests[digest] = true; emit MintRequestSuccess(digest); } function invalidateRequest( MintRequest calldata request, bytes calldata signature ) external { if(request.to != msg.sender){ require(hasRole(SIG_ROLE, msg.sender), "Resources: caller does not have SIG_ROLE"); } bytes32 digest = hashMintRequest(request); address signer = ECDSAUpgradeable.recover(digest, signature); require(hasRole(SIG_ROLE, signer), "Resources: invalid signature"); require(!_processedDigests[digest], "Resources: signature already used or invalidated"); require(block.timestamp <= request.expire, "Resources: signature expired"); _processedDigests[digest] = true; emit MintRequestCancelled(digest); } function craftWithLimits(CraftRequest calldata request, bytes calldata signature) external { for(uint i = 0; i < request.resourcesIdsCrafted.length; i++){ if(_crafted[request.resourcesIdsCrafted[i]] >= _limits[request.resourcesIdsCrafted[i]]){ revert("Resources: limit reached"); } _crafted[request.resourcesIdsCrafted[i]] += request.resourcesAmountsCrafted[i]; } craftItems(request, signature); } function craftItems(CraftRequest calldata request, bytes calldata signature) public{ require(msg.sender == request.from, "Resources: caller does not match request.from"); bytes32 digest = hashCraftRequest(request); require(!_processedDigests[digest], "Resources: signature already used"); address signer = ECDSAUpgradeable.recover(digest, signature); require(hasRole(SIG_ROLE, signer), "Resources: invalid signature"); require(block.timestamp <= request.expire, "Resources: signature expired"); if(request.fortuneRequired > 0){ fortune.burnFrom(msg.sender, request.fortuneRequired); } if(request.resourcesIdsRequired.length > 0){ _burnBatch(msg.sender, request.resourcesIdsRequired, request.resourcesAmountsRequired); } if(request.resourcesIdsCrafted.length > 0){ _mintBatch(msg.sender, request.resourcesIdsCrafted, request.resourcesAmountsCrafted, ""); } _processedDigests[digest] = true; emit Craft(digest); } function setTestUpkeepValues(address _player, uint256 _lastUpkeep, uint256 _activeMeeples) external onlyRole(SIG_ROLE) { lastUpkeep[_player] = _lastUpkeep; activeMeeples[_player] = _activeMeeples; emit MeepleActive(_player, _activeMeeples, _lastUpkeep); } function upkeep(UpkeepRequest calldata request, bytes calldata signature) external{ require(msg.sender == request.from, "Resources: caller does not match request.from"); bytes32 digest = hashUpkeepRequest(request); require(!_processedDigests[digest], "Resources: signature already used"); address signer = ECDSAUpgradeable.recover(digest, signature); require(hasRole(SIG_ROLE, signer), "Resources: invalid signature"); require(block.timestamp <= request.expire, "Resources: signature expired"); doingUpkeep = true; _burnBatch(msg.sender, request.costIds, request.costAmounts); doingUpkeep = false; _processedDigests[digest] = true; if(lastUpkeep[msg.sender] + upkeepInterval >= block.timestamp){ if(activeMeeples[msg.sender] + request.meeple > balanceOf(msg.sender, MEEPLE)){ activeMeeples[msg.sender] = balanceOf(msg.sender, MEEPLE); } else { activeMeeples[msg.sender] += request.meeple; } } else { lastUpkeep[msg.sender] = block.timestamp; activeMeeples[msg.sender] = balanceOf(msg.sender, MEEPLE) < request.meeple ? balanceOf(msg.sender, MEEPLE) : request.meeple; } emit Upkeep(digest); emit MeepleActive(msg.sender, activeMeeples[msg.sender], lastUpkeep[msg.sender]); } function deposit(uint256[] calldata ids, uint256[] calldata amounts) external { _burnBatch(msg.sender, ids, amounts); emit Deposit(msg.sender, ids, amounts); } function _safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) internal override { address operator = _msgSender(); if (!hasRole(WHITELISTED_OPERATOR_ROLE, operator)) { amount = applyTransferTax(from, id, amount); } super._safeTransferFrom(from, to, id, amount, data); } function _safeBatchTransferFrom(address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal override { address operator = _msgSender(); if (!hasRole(WHITELISTED_OPERATOR_ROLE, operator)) { for (uint256 i = 0; i < ids.length; i++) { amounts[i] = applyTransferTax(from, ids[i], amounts[i]); } } super._safeBatchTransferFrom(from, to, ids, amounts, data); } function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal override(ERC1155Upgradeable, ERC1155SupplyUpgradeable){ super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } function _afterTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal override { super._afterTokenTransfer(operator, from, to, ids, amounts, data); for(uint256 i = 0; i < ids.length; i++){ if(ids[i] == MEEPLE){ if(from != address(0)){ if(to != address(0)){ require(block.timestamp <= lastUpkeep[from] + upkeepInterval, "Resources: upkeep not paid"); require(amounts[i] <= activeMeeples[from], "Resources: not enough active meeples"); } if(!doingUpkeep){ if (activeMeeples[from] >= amounts[i]) { activeMeeples[from] -= amounts[i]; } else { activeMeeples[from] = 0; } if(balanceOf(from, MEEPLE) == 0){ lastUpkeep[from] = 0; } if(!doingTax) emit MeepleActive(from, activeMeeples[from], lastUpkeep[from]); } } if(to != address(0)) { activeMeeples[to] += amounts[i]; if(lastUpkeep[to] == 0){ lastUpkeep[to] = block.timestamp; } emit MeepleActive(to, activeMeeples[to], lastUpkeep[to]); } } } } //returns amount left after tax function applyTransferTax(address from, uint256 id, uint256 amount) internal returns (uint256) { uint8 transferTax = transferTaxForId[id]; if (transferTax != 0) { uint256 tax = (amount * transferTax) / 100; if (tax > 0) { doingTax = true; _burn(from, id, tax); doingTax = false; emit TaxPaid(from, id, tax); return amount - tax; } } return amount; } function supportsInterface(bytes4 interfaceId) public view override(ERC1155Upgradeable, AccessControlUpgradeable, ERC2981Upgradeable) returns (bool){ return super.supportsInterface(interfaceId); } function setDefaultRoyalty( address receiver, uint96 feeNumerator ) public onlyRole(DEFAULT_ADMIN_ROLE) { _setDefaultRoyalty(receiver, feeNumerator); } function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) public onlyRole(DEFAULT_ADMIN_ROLE) { _setTokenRoyalty(tokenId, receiver, feeNumerator); } function setTokenTax(uint id, uint8 tax) public onlyRole(DEFAULT_ADMIN_ROLE) { transferTaxForId[id] = tax; } function setUpkeepInterval(uint256 interval) public onlyRole(DEFAULT_ADMIN_ROLE) { upkeepInterval = interval; } function setLimit(uint id, uint amount) public onlyRole(DEFAULT_ADMIN_ROLE) { _limits[id] = amount; } function clearCrafted(uint id) public onlyRole(SIG_ROLE) { _crafted[id] = 0; } function setFortune(IERC20Burnable _fortune) public onlyRole(DEFAULT_ADMIN_ROLE) { fortune = _fortune; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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: * * ``` * 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}: * * ``` * 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. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } 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(IAccessControlUpgradeable).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 ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgradeable.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()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @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.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ function __ERC1155_init(string memory uri_) internal onlyInitializing { __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Burnable_init() internal onlyInitializing { } function __ERC1155Burnable_init_unchained() internal onlyInitializing { } function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burnBatch(account, ids, values); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155SupplyUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Supply_init() internal onlyInitializing { } function __ERC1155Supply_init_unchained() internal onlyInitializing { } mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155SupplyUpgradeable.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSAUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ * * @custom:storage-size 52 */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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 IERC165Upgradeable { /** * @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.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { 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 = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; uint256 constant KOBAN = 1; uint256 constant MEEPLE = 2;
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IERC20Burnable is IERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) external ; /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; //Roles bytes32 constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); bytes32 constant SIG_ROLE = keccak256("SIG_ROLE"); bytes32 constant STAFF_ROLE = keccak256("STAFF_ROLE"); bytes32 constant SERVER_ROLE = keccak256("SERVER_ROLE"); //Scale to be used with SafePct uint16 constant PORT_SCALE = 10_000;
{ "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":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"Craft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastUpkeep","type":"uint256"}],"name":"MeepleActive","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct Resources.MintRequest","name":"request","type":"tuple"}],"name":"MintRequestByAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"MintRequestCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"MintRequestSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TaxPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"Upkeep","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELISTED_OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_crafted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_limits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"activeMeeples","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_receipients","type":"address[]"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"clearCrafted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"fortuneRequired","type":"uint256"},{"internalType":"uint256[]","name":"resourcesIdsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesIdsCrafted","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsCrafted","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.CraftRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"craftItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"fortuneRequired","type":"uint256"},{"internalType":"uint256[]","name":"resourcesIdsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesIdsCrafted","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsCrafted","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.CraftRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"craftWithLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fortune","outputs":[{"internalType":"contract IERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"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":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"fortuneRequired","type":"uint256"},{"internalType":"uint256[]","name":"resourcesIdsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsRequired","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesIdsCrafted","type":"uint256[]"},{"internalType":"uint256[]","name":"resourcesAmountsCrafted","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.CraftRequest","name":"craftRequest","type":"tuple"}],"name":"hashCraftRequest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.MintRequest","name":"mintRequest","type":"tuple"}],"name":"hashMintRequest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"meeple","type":"uint256"},{"internalType":"uint256[]","name":"costIds","type":"uint256[]"},{"internalType":"uint256[]","name":"costAmounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.UpkeepRequest","name":"upkeepRequest","type":"tuple"}],"name":"hashUpkeepRequest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.MintRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"invalidateRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUpkeep","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.MintRequest","name":"request","type":"tuple"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.MintRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintWithSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Burnable","name":"_fortune","type":"address"}],"name":"setFortune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_player","type":"address"},{"internalType":"uint256","name":"_lastUpkeep","type":"uint256"},{"internalType":"uint256","name":"_activeMeeples","type":"uint256"}],"name":"setTestUpkeepValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"tax","type":"uint8"}],"name":"setTokenTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interval","type":"uint256"}],"name":"setUpkeepInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferTaxForId","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"meeple","type":"uint256"},{"internalType":"uint256[]","name":"costIds","type":"uint256[]"},{"internalType":"uint256[]","name":"costAmounts","type":"uint256[]"},{"internalType":"uint256","name":"expire","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Resources.UpkeepRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"upkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upkeepInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c615c986200012660003960008181610e8701528181610ec70152818161126a015281816112aa01526114480152615c986000f3fe6080604052600436106102fe5760003560e01c80636b20c45411610190578063a860d137116100dc578063e7d5d36111610095578063f223885a1161006f578063f223885a14610a0f578063f242432a14610a2f578063f5298aca14610a4f578063f698da2514610a6f57600080fd5b8063e7d5d36114610978578063e985e9c5146109a6578063efb2c9fa146109ef57600080fd5b8063a860d13714610887578063bd85b039146108a7578063bde773bd146108d5578063c231ff67146108f5578063d547741f14610938578063e7b1883c1461095857600080fd5b8063782f08ae1161014957806391d148541161012357806391d1485414610812578063a217fddf14610832578063a22cb46514610847578063a496dedf1461086757600080fd5b8063782f08ae146107bd5780638129fc1c146107dd578063823da974146107f257600080fd5b80636b20c454146106ef5780636f2488581461070f5780636f51819f1461073d57806372e4c9f61461075d57806373a42a391461077d578063752e9a8f1461079d57600080fd5b8063341e97e31161024f5780634f558e79116102085780635944c753116101e25780635944c753146106565780635a74373c14610676578063627443f81461068d578063678ff538146106bb57600080fd5b80634f558e79146105f15780634fcbe7411461062157806352d1902d1461064157600080fd5b8063341e97e31461052357806336568abe146105515780633659cfe6146105715780634e1273f4146105915780634e36d0cd146105be5780634f1ef286146105de57600080fd5b8063149cf52b116102bc578063248a9ca311610296578063248a9ca3146104745780632a55205a146104a45780632eb2c2d6146104e35780632f2ff15d1461050357600080fd5b8063149cf52b146103f5578063177de89c14610415578063207add911461045457600080fd5b8062fdd58e1461030357806301ffc9a71461033657806304634d8d146103665780630646cc33146103885780630e89341c146103a8578063138ab32c146103d5575b600080fd5b34801561030f57600080fd5b5061032361031e366004614c8f565b610a84565b6040519081526020015b60405180910390f35b34801561034257600080fd5b50610356610351366004614eee565b610b1c565b604051901515815260200161032d565b34801561037257600080fd5b50610386610381366004614cee565b610b2d565b005b34801561039457600080fd5b506103866103a3366004614a3c565b610b47565b3480156103b457600080fd5b506103c86103c3366004614e9a565b610b7e565b60405161032d91906153c0565b3480156103e157600080fd5b506103866103f0366004615140565b610c21565b34801561040157600080fd5b50610386610410366004614cba565b610c50565b34801561042157600080fd5b506101fd5461043c906201000090046001600160a01b031681565b6040516001600160a01b03909116815260200161032d565b34801561046057600080fd5b5061038661046f36600461511f565b610cbe565b34801561048057600080fd5b5061032361048f366004614e9a565b60009081526065602052604090206001015490565b3480156104b057600080fd5b506104c46104bf36600461511f565b610cdd565b604080516001600160a01b03909316835260208301919091520161032d565b3480156104ef57600080fd5b506103866104fe366004614a90565b610d8d565b34801561050f57600080fd5b5061038661051e366004614eca565b610dd9565b34801561052f57600080fd5b5061032361053e366004614a3c565b6101fb6020526000908152604090205481565b34801561055d57600080fd5b5061038661056c366004614eca565b610dfe565b34801561057d57600080fd5b5061038661058c366004614a3c565b610e7c565b34801561059d57600080fd5b506105b16105ac366004614d70565b610f5c565b60405161032d9190615388565b3480156105ca57600080fd5b506103866105d9366004614f60565b6110bd565b6103866105ec366004614c42565b61125f565b3480156105fd57600080fd5b5061035661060c366004614e9a565b600090815261015f6020526040902054151590565b34801561062d57600080fd5b5061032361063c366004614fc5565b61132c565b34801561064d57600080fd5b5061032361143b565b34801561066257600080fd5b50610386610671366004615095565b6114ef565b34801561068257600080fd5b506103236101fc5481565b34801561069957600080fd5b506103236106a8366004614a3c565b6101f96020526000908152604090205481565b3480156106c757600080fd5b506103237f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274381565b3480156106fb57600080fd5b5061038661070a366004614b9f565b61150b565b34801561071b57600080fd5b5061032361072a366004614e9a565b6101fe6020526000908152604090205481565b34801561074957600080fd5b50610386610758366004614e9a565b61154e565b34801561076957600080fd5b50610386610778366004614e9a565b611579565b34801561078957600080fd5b5061038661079836600461505f565b61158b565b3480156107a957600080fd5b506103236107b8366004614f26565b6118d4565b3480156107c957600080fd5b506103866107d83660046150d2565b611a3e565b3480156107e957600080fd5b50610386611a76565b3480156107fe57600080fd5b5061038661080d366004614fc5565b611c68565b34801561081e57600080fd5b5061035661082d366004614eca565b611d6c565b34801561083e57600080fd5b50610323600081565b34801561085357600080fd5b50610386610862366004614c11565b611d97565b34801561087357600080fd5b50610386610882366004614d22565b611da2565b34801561089357600080fd5b506103866108a2366004614f60565b611e2e565b3480156108b357600080fd5b506103236108c2366004614e9a565b600090815261015f602052604090205490565b3480156108e157600080fd5b506103866108f0366004614ff7565b612094565b34801561090157600080fd5b50610926610910366004614e9a565b6101fa6020526000908152604090205460ff1681565b60405160ff909116815260200161032d565b34801561094457600080fd5b50610386610953366004614eca565b61224e565b34801561096457600080fd5b50610386610973366004614ff7565b612273565b34801561098457600080fd5b50610323610993366004614e9a565b6101ff6020526000908152604090205481565b3480156109b257600080fd5b506103566109c1366004614a58565b6001600160a01b03918216600090815260fc6020908152604080832093909416825291909152205460ff1690565b3480156109fb57600080fd5b50610323610a0a36600461502d565b61246f565b348015610a1b57600080fd5b50610386610a2a366004614e32565b61255e565b348015610a3b57600080fd5b50610386610a4a366004614b39565b61260b565b348015610a5b57600080fd5b50610386610a6a366004614cba565b612650565b348015610a7b57600080fd5b50610323612693565b60006001600160a01b038316610af45760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600090815260fb602090815260408083206001600160a01b03949094168352929052205490565b6000610b27826126a2565b92915050565b6000610b38816126c7565b610b4283836126d1565b505050565b6000610b52816126c7565b506101fd80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b60008181526101f860205260409020805460609190610b9c90615a68565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc890615a68565b8015610c155780601f10610bea57610100808354040283529160200191610c15565b820191906000526020600020905b815481529060010190602001808311610bf857829003601f168201915b50505050509050919050565b6000610c2c816126c7565b5060009182526101fa6020526040909120805460ff191660ff909216919091179055565b600080516020615bfc833981519152610c68816126c7565b6001600160a01b03841660008181526101f9602090815260408083208790556101fb8252918290208590558151858152908101869052600080516020615c4383398151915291015b60405180910390a250505050565b6000610cc9816126c7565b5060009182526101fe602052604090912055565b60008281526101c6602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610d545750604080518082019091526101c5546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d73906001600160601b0316876159ef565b610d7d91906159cf565b91519350909150505b9250929050565b6001600160a01b038516331480610da95750610da985336109c1565b610dc55760405162461bcd60e51b8152600401610aeb90615539565b610dd2858585858561278c565b5050505050565b600082815260656020526040902060010154610df4816126c7565b610b42838361286c565b6001600160a01b0381163314610e6e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610aeb565b610e7882826128f2565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610ec55760405162461bcd60e51b8152600401610aeb906154ed565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f0e600080516020615bdc833981519152546001600160a01b031690565b6001600160a01b031614610f345760405162461bcd60e51b8152600401610aeb90615587565b610f3d81612959565b60408051600080825260208201909252610f5991839190612983565b50565b60608151835114610fc15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610aeb565b600083516001600160401b03811115610fea57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611013578160200160208202803683370190505b50905060005b84518110156110b55761107a85828151811061104557634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061106d57634e487b7160e01b600052603260045260246000fd5b6020026020010151610a84565b82828151811061109a57634e487b7160e01b600052603260045260246000fd5b60209081029190910101526110ae81615ac9565b9050611019565b509392505050565b60005b6110cd6080850185615906565b9050811015611253576101fe60006110e86080870187615906565b8481811061110657634e487b7160e01b600052603260045260246000fd5b905060200201358152602001908152602001600020546101ff60008680608001906111319190615906565b8581811061114f57634e487b7160e01b600052603260045260246000fd5b90506020020135815260200190815260200160002054106111b25760405162461bcd60e51b815260206004820152601860248201527f5265736f75726365733a206c696d6974207265616368656400000000000000006044820152606401610aeb565b6111bf60a0850185615906565b828181106111dd57634e487b7160e01b600052603260045260246000fd5b905060200201356101ff60008680608001906111f99190615906565b8581811061121757634e487b7160e01b600052603260045260246000fd5b905060200201358152602001908152602001600020600082825461123b91906159b7565b9091555081905061124b81615ac9565b9150506110c0565b50610b42838383611e2e565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156112a85760405162461bcd60e51b8152600401610aeb906154ed565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112f1600080516020615bdc833981519152546001600160a01b031690565b6001600160a01b0316146113175760405162461bcd60e51b8152600401610aeb90615587565b61132082612959565b610e7882826001612983565b6000807f2554d7789d596128fb66e019c8882171935d76346b67f136dfefa47e5bf001d061135d6020850185614a3c565b61136a6020860186615906565b60405160200161137b929190615203565b604051602081830303815290604052805190602001208580604001906113a19190615906565b6040516020016113b2929190615203565b6040516020818303038152906040528051906020012086606001358760800135604051602001611413969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120905061143481612afd565b9392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114db5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610aeb565b50600080516020615bdc8339815191525b90565b60006114fa816126c7565b611505848484612b4b565b50505050565b6001600160a01b038316331480611527575061152783336109c1565b6115435760405162461bcd60e51b8152600401610aeb90615539565b610b42838383612c17565b600080516020615bfc833981519152611566816126c7565b5060009081526101ff6020526040812055565b6000611584816126c7565b506101fc55565b6115986020840184614a3c565b6001600160a01b0316336001600160a01b0316146115c85760405162461bcd60e51b8152600401610aeb9061545f565b60006115d38461246f565b60008181526101f7602052604090205490915060ff16156116065760405162461bcd60e51b8152600401610aeb906154ac565b60006116488285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b9050611662600080516020615bfc83398151915282611d6c565b61167e5760405162461bcd60e51b8152600401610aeb90615724565b84608001354211156116a25760405162461bcd60e51b8152600401610aeb906156a5565b6101fd805460ff19166001179055611737336116c16040880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611700925050506060890189615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612c1792505050565b6101fd805460ff1990811690915560008381526101f76020908152604080832080549094166001179093556101fc543383526101f990915291902054429161177e916159b7565b106118075761178e336002610a84565b3360009081526101fb60209081526040909120546117af91880135906159b7565b11156117d6576117c0336002610a84565b3360009081526101fb6020526040902055611858565b3360009081526101fb6020908152604082208054918801359290916117fc9084906159b7565b909155506118589050565b3360008181526101f9602090815260409091204290558601359061182c906002610a84565b1061183b578460200135611846565b611846336002610a84565b3360009081526101fb60205260409020555b60405182907f6131d8c6f0dde62907d8706f45f4130ba111e134ba99ae5e1b4659bb753b4ec790600090a23360008181526101fb60209081526040808320546101f990925291829020549151600080516020615c43833981519152926118c5928252602082015260400190565b60405180910390a25050505050565b6000807fa1369ee06e725f6d94b282bbe417df9176fe35a4b394b2e939603c0a60f243f16119056020850185614a3c565b60208501356119176040870187615906565b604051602001611928929190615203565b60408051601f19818403018152919052805160209091012061194d6060880188615906565b60405160200161195e929190615203565b60408051601f1981840301815291905280516020909101206119836080890189615906565b604051602001611994929190615203565b60408051601f1981840301815291905280516020909101206119b960a08a018a615906565b6040516020016119ca929190615203565b60408051601f198184030181528282528051602091820120908301989098526001600160a01b03909616958101959095526060850193909352608084019190915260a083015260c08083019190915260e0808301939093528501356101008201529084013561012082015261014001611413565b600080516020615bfc833981519152611a56816126c7565b60008381526101f8602090815260409091208351611505928501906147dc565b600054610100900460ff1615808015611a965750600054600160ff909116105b80611ab05750303b158015611ab0575060005460ff166001145b611b135760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aeb565b6000805460ff191660011790558015611b36576000805461ff0019166101001790555b611b3e612df8565b611b46612df8565b611b5e60405180602001604052806000815250612e21565b611b66612df8565b611b6e612df8565b611bb2604051806040016040528060098152602001685265736f757263657360b81b815250604051806040016040528060018152602001603160f81b815250612e51565b611bbd60003361286c565b611be77f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e33361286c565b611bff600080516020615bfc8339815191523361286c565b611c1f73b5d4f12b5e7d8ce43fece177a6c75df14994fbe66101f4610b2d565b8015610f59576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b611c80600080516020615bfc83398151915233611d6c565b611c9c5760405162461bcd60e51b8152600401610aeb906156dc565b611d3d611cac6020830183614a3c565b611cb96020840184615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf8925050506040850185615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612e82915050565b7f5ebfafc2e4bcbb722f34b25aab01bf27d0ff910d45fdb932b9b08438d5292f2881604051611c5d9190615879565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610e78338383613008565b600080516020615bfc833981519152611dba816126c7565b60005b84811015611e2657611e14868683818110611de857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611dfd9190614a3c565b8585604051806020016040528060008152506130e9565b80611e1e81615ac9565b915050611dbd565b505050505050565b611e3b6020840184614a3c565b6001600160a01b0316336001600160a01b031614611e6b5760405162461bcd60e51b8152600401610aeb9061545f565b6000611e76846118d4565b60008181526101f7602052604090205490915060ff1615611ea95760405162461bcd60e51b8152600401610aeb906154ac565b6000611eeb8285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b9050611f05600080516020615bfc83398151915282611d6c565b611f215760405162461bcd60e51b8152600401610aeb90615724565b8460c00135421115611f455760405162461bcd60e51b8152600401610aeb906156a5565b602085013515611fbd576101fd5460405163079cc67960e41b815233600482015260208701356024820152620100009091046001600160a01b0316906379cc679090604401600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505b6000611fcc6040870187615906565b90501115611fe557611fe5336116c16040880188615906565b6000611ff46080870187615906565b9050111561204c5761204c3361200d6080880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf89250505060a0890189615906565b60008281526101f76020526040808220805460ff191660011790555183917f631aafe679aa052fcd6a015ee77f4fea396205ccada6f7d4e1f9691ca2e8db0691a25050505050565b336120a26020850185614a3c565b6001600160a01b0316146120e4576120c8600080516020615bfc83398151915233611d6c565b6120e45760405162461bcd60e51b8152600401610aeb906156dc565b60006120ef8461132c565b905060006121338285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b905061214d600080516020615bfc83398151915282611d6c565b6121695760405162461bcd60e51b8152600401610aeb90615724565b60008281526101f7602052604090205460ff16156121e25760405162461bcd60e51b815260206004820152603060248201527f5265736f75726365733a207369676e617475726520616c72656164792075736560448201526f19081bdc881a5b9d985b1a59185d195960821b6064820152608401610aeb565b84606001354211156122065760405162461bcd60e51b8152600401610aeb906156a5565b60008281526101f76020526040808220805460ff191660011790555183917f383592cfab2d2f510ba971675c925b357581c2d54e2b040e3189c58d992c86a891a25050505050565b600082815260656020526040902060010154612269816126c7565b610b4283836128f2565b6122806040840184615906565b905061228f6020850185615906565b9050146122f15760405162461bcd60e51b815260206004820152602a60248201527f5265736f75726365733a2069647320616e6420616d6f756e7473206c656e67746044820152690d040dad2e6dac2e8c6d60b31b6064820152608401610aeb565b60006122fc8461132c565b60008181526101f7602052604090205490915060ff161561232f5760405162461bcd60e51b8152600401610aeb906154ac565b60006123718285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b905061238b600080516020615bfc83398151915282611d6c565b6123a75760405162461bcd60e51b8152600401610aeb90615724565b84606001354211156123cb5760405162461bcd60e51b8152600401610aeb906156a5565b6124276123db6020870187614a3c565b6123e86020880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf8925050506040890189615906565b60008281526101f76020526040808220805460ff191660011790555183917f9344895d8662d254397908c354d6d3047ac7e17dee80af14464c842f844ccd2391a25050505050565b6000807fde1ebae86485f73a424f5c64497d92b863e378ed19804679a9dd7857f27b840f6124a06020850185614a3c565b60208501356124b26040870187615906565b6040516020016124c3929190615203565b60408051601f1981840301815291905280516020909101206124e86060880188615906565b6040516020016124f9929190615203565b60408051601f198184030181528282528051602091820120908301969096526001600160a01b0390941693810193909352606083019190915260808083019190915260a08083019390935285013560c08201529084013560e082015261010001611413565b6125cc3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612c1792505050565b336001600160a01b03167fb9dbc1274cee7131d155a093abd5d0ee37b318bb61a5a10b916a7ebfbf2e061185858585604051610cb09493929190615361565b6001600160a01b038516331480612627575061262785336109c1565b6126435760405162461bcd60e51b8152600401610aeb90615539565b610dd285858585856131e3565b6001600160a01b03831633148061266c575061266c83336109c1565b6126885760405162461bcd60e51b8152600401610aeb90615539565b610b4283838361322d565b600061269d613353565b905090565b60006001600160e01b0319821663152a902d60e11b1480610b275750610b27826133d0565b610f598133613410565b6127106001600160601b03821611156126fc5760405162461bcd60e51b8152600401610aeb906157a6565b6001600160a01b0382166127525760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610aeb565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b909102176101c555565b336127b77f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274382611d6c565b61285f5760005b845181101561285d57612820878683815181106127eb57634e487b7160e01b600052603260045260246000fd5b602002602001015186848151811061281357634e487b7160e01b600052603260045260246000fd5b6020026020010151613469565b84828151811061284057634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061285581615ac9565b9150506127be565b505b611e26868686868661352e565b6128768282611d6c565b610e785760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128ae3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128fc8282611d6c565b15610e785760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610e78816126c7565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156129b657610b42836136fd565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129ef57600080fd5b505afa925050508015612a1f575060408051601f3d908101601f19168201909252612a1c91810190614eb2565b60015b612a825760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610aeb565b600080516020615bdc8339815191528114612af15760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610aeb565b50610b42838383613799565b6000610b27612b0a613353565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6127106001600160601b0382161115612b765760405162461bcd60e51b8152600401610aeb906157a6565b6001600160a01b038216612bcc5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610aeb565b6040805180820182526001600160a01b0393841681526001600160601b03928316602080830191825260009687526101c690529190942093519051909116600160a01b029116179055565b6001600160a01b038316612c3d5760405162461bcd60e51b8152600401610aeb90615618565b8051825114612c5e5760405162461bcd60e51b8152600401610aeb906157f0565b6000339050612c81818560008686604051806020016040528060008152506137be565b60005b8351811015612d65576000848281518110612caf57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110612cdb57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815260fb835260408082206001600160a01b038c168352909352919091205490915081811015612d2c5760405162461bcd60e51b8152600401610aeb9061541b565b600092835260fb602090815260408085206001600160a01b038b1686529091529092209103905580612d5d81615ac9565b915050612c84565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612db692919061539b565b60405180910390a4611505818560008686604051806020016040528060008152506137cc565b6000806000612deb8585613bbd565b915091506110b581613c00565b600054610100900460ff16612e1f5760405162461bcd60e51b8152600401610aeb9061575b565b565b600054610100900460ff16612e485760405162461bcd60e51b8152600401610aeb9061575b565b610f5981613d86565b600054610100900460ff16612e785760405162461bcd60e51b8152600401610aeb9061575b565b610e788282613db6565b6001600160a01b038416612ea85760405162461bcd60e51b8152600401610aeb90615838565b8151835114612ec95760405162461bcd60e51b8152600401610aeb906157f0565b33612ed9816000878787876137be565b60005b8451811015612f9157838181518110612f0557634e487b7160e01b600052603260045260246000fd5b602002602001015160fb6000878481518110612f3157634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254612f7991906159b7565b90915550819050612f8981615ac9565b915050612edc565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612fe292919061539b565b60405180910390a4612ff9816000878787876137cc565b610dd281600087878787613df9565b816001600160a01b0316836001600160a01b0316141561307c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610aeb565b6001600160a01b03838116600081815260fc6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661310f5760405162461bcd60e51b8152600401610aeb90615838565b33600061311b85613f64565b9050600061312885613f64565b9050613139836000898585896137be565b600086815260fb602090815260408083206001600160a01b038b1684529091528120805487929061316b9084906159b7565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46131cb836000898585896137cc565b6131da83600089898989613fbd565b50505050505050565b3361320e7f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274382611d6c565b6132205761321d868585613469565b92505b611e268686868686614087565b6001600160a01b0383166132535760405162461bcd60e51b8152600401610aeb90615618565b33600061325f84613f64565b9050600061326c84613f64565b905061328c838760008585604051806020016040528060008152506137be565b600085815260fb602090815260408083206001600160a01b038a168452909152902054848110156132cf5760405162461bcd60e51b8152600401610aeb9061541b565b600086815260fb602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46131da848860008686604051806020016040528060008152506137cc565b600061269d7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133836101915490565b610192546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60006001600160e01b03198216636cdb3d1360e11b148061340157506001600160e01b031982166303a24d0760e21b145b80610b275750610b27826141d1565b61341a8282611d6c565b610e785761342781614206565b613432836020614218565b604051602001613443929190615249565b60408051601f198184030181529082905262461bcd60e51b8252610aeb916004016153c0565b60008281526101fa602052604081205460ff168015613525576000606461349360ff8416866159ef565b61349d91906159cf565b90508015613523576101fd805461ff0019166101001790556134c086868361322d565b6101fd805461ff001916905560408051868152602081018390526001600160a01b038816917fb0a068ff9b2c6f72d5af72f3f94b79d10fe7995889678a9c0f6a33caa63cb4d2910160405180910390a261351a8185615a0e565b92505050611434565b505b50909392505050565b815183511461354f5760405162461bcd60e51b8152600401610aeb906157f0565b6001600160a01b0384166135755760405162461bcd60e51b8152600401610aeb906155d3565b336135848187878787876137be565b60005b84518110156136895760008582815181106135b257634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106135de57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815260fb835260408082206001600160a01b038e16835290935291909120549091508181101561362f5760405162461bcd60e51b8152600401610aeb9061565b565b600083815260fb602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061366e9084906159b7565b925050819055505050508061368290615ac9565b9050613587565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516136d992919061539b565b60405180910390a46136ef8187878787876137cc565b611e26818787878787613df9565b6001600160a01b0381163b61376a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610aeb565b600080516020615bdc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6137a2836143f9565b6000825111806137af5750805b15610b42576115058383614439565b611e2686868686868661452d565b60005b83518110156131da5760028482815181106137fa57634e487b7160e01b600052603260045260246000fd5b60200260200101511415613bab576001600160a01b03861615613aab576001600160a01b0385161561393b576101fc546001600160a01b03871660009081526101f9602052604090205461384e91906159b7565b42111561389d5760405162461bcd60e51b815260206004820152601a60248201527f5265736f75726365733a2075706b656570206e6f7420706169640000000000006044820152606401610aeb565b6001600160a01b03861660009081526101fb602052604090205483518490839081106138d957634e487b7160e01b600052603260045260246000fd5b6020026020010151111561393b5760405162461bcd60e51b8152602060048201526024808201527f5265736f75726365733a206e6f7420656e6f75676820616374697665206d6565604482015263706c657360e01b6064820152608401610aeb565b6101fd5460ff16613aab5782818151811061396657634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000886001600160a01b03166001600160a01b031681526020019081526020016000205410613a02578281815181106139ba57634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546139f79190615a0e565b90915550613a1d9050565b6001600160a01b03861660009081526101fb60205260408120555b613a28866002610a84565b613a47576001600160a01b03861660009081526101f960205260408120555b6101fd54610100900460ff16613aab576001600160a01b03861660008181526101fb60209081526040808320546101f990925291829020549151600080516020615c4383398151915292613aa2928252602082015260400190565b60405180910390a25b6001600160a01b03851615613bab57828181518110613ada57634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000876001600160a01b03166001600160a01b031681526020019081526020016000206000828254613b1791906159b7565b90915550506001600160a01b03851660009081526101f96020526040902054613b57576001600160a01b03851660009081526101f9602052604090204290555b6001600160a01b03851660008181526101fb60209081526040808320546101f990925291829020549151600080516020615c4383398151915292613ba2928252602082015260400190565b60405180910390a25b80613bb581615ac9565b9150506137cf565b600080825160411415613bf45760208301516040840151606085015160001a613be8878285856146e1565b94509450505050610d86565b50600090506002610d86565b6000816004811115613c2257634e487b7160e01b600052602160045260246000fd5b1415613c2b5750565b6001816004811115613c4d57634e487b7160e01b600052602160045260246000fd5b1415613c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610aeb565b6002816004811115613cbd57634e487b7160e01b600052602160045260246000fd5b1415613d0b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610aeb565b6003816004811115613d2d57634e487b7160e01b600052602160045260246000fd5b1415610f595760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610aeb565b600054610100900460ff16613dad5760405162461bcd60e51b8152600401610aeb9061575b565b610f59816147a5565b600054610100900460ff16613ddd5760405162461bcd60e51b8152600401610aeb9061575b565b8151602092830120815191909201206101919190915561019255565b6001600160a01b0384163b15611e265760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613e3d90899089908890889088906004016152be565b602060405180830381600087803b158015613e5757600080fd5b505af1925050508015613e87575060408051601f3d908101601f19168201909252613e8491810190614f0a565b60015b613f3457613e93615b10565b806308c379a01415613ecd5750613ea8615b27565b80613eb35750613ecf565b8060405162461bcd60e51b8152600401610aeb91906153c0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610aeb565b6001600160e01b0319811663bc197c8160e01b146131da5760405162461bcd60e51b8152600401610aeb906153d3565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613fac57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b15611e265760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190614001908990899088908890889060040161531c565b602060405180830381600087803b15801561401b57600080fd5b505af192505050801561404b575060408051601f3d908101601f1916820190925261404891810190614f0a565b60015b61405757613e93615b10565b6001600160e01b0319811663f23a6e6160e01b146131da5760405162461bcd60e51b8152600401610aeb906153d3565b6001600160a01b0384166140ad5760405162461bcd60e51b8152600401610aeb906155d3565b3360006140b985613f64565b905060006140c685613f64565b90506140d68389898585896137be565b600086815260fb602090815260408083206001600160a01b038c168452909152902054858110156141195760405162461bcd60e51b8152600401610aeb9061565b565b600087815260fb602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906141589084906159b7565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46141b8848a8a86868a6137cc565b6141c6848a8a8a8a8a613fbd565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b1480610b2757506301ffc9a760e01b6001600160e01b0319831614610b27565b6060610b276001600160a01b03831660145b606060006142278360026159ef565b6142329060026159b7565b6001600160401b0381111561425757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015614281576020820181803683370190505b509050600360fc1b816000815181106142aa57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106142e757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061430b8460026159ef565b6143169060016159b7565b90505b60018111156143aa576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061435857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061437c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936143a381615a51565b9050614319565b5083156114345760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610aeb565b614402816136fd565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6144a15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610aeb565b600080846001600160a01b0316846040516144bc919061522d565b600060405180830381855af49150503d80600081146144f7576040519150601f19603f3d011682016040523d82523d6000602084013e6144fc565b606091505b50915091506145248282604051806060016040528060278152602001615c1c602791396147b8565b95945050505050565b6001600160a01b0385166145d15760005b83518110156145cf5782818151811061456757634e487b7160e01b600052603260045260246000fd5b602002602001015161015f600086848151811061459457634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546145b991906159b7565b909155506145c8905081615ac9565b905061453e565b505b6001600160a01b038416611e265760005b83518110156131da57600084828151811061460d57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061463957634e487b7160e01b600052603260045260246000fd5b60200260200101519050600061015f6000848152602001908152602001600020549050818110156146bd5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610aeb565b600092835261015f6020526040909220910390556146da81615ac9565b90506145e2565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614718575060009050600361479c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561476c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166147955760006001925092505061479c565b9150600090505b94509492505050565b8051610e789060fd9060208401906147dc565b606083156147c7575081611434565b6114348383815115613eb35781518083602001fd5b8280546147e890615a68565b90600052602060002090601f01602090048101928261480a5760008555614850565b82601f1061482357805160ff1916838001178555614850565b82800160010185558215614850579182015b82811115614850578251825591602001919060010190614835565b5061485c929150614860565b5090565b5b8082111561485c5760008155600101614861565b60006001600160401b0383111561488e5761488e615afa565b6040516148a5601f8501601f191660200182615a9d565b8091508381528484840111156148ba57600080fd5b83836020830137600060208583010152509392505050565b60008083601f8401126148e3578182fd5b5081356001600160401b038111156148f9578182fd5b6020830191508360208260051b8501011115610d8657600080fd5b600082601f830112614924578081fd5b813560206149318261594d565b60405161493e8282615a9d565b8381528281019150858301600585901b8701840188101561495d578586fd5b855b8581101561497b5781358452928401929084019060010161495f565b5090979650505050505050565b60008083601f840112614999578182fd5b5081356001600160401b038111156149af578182fd5b602083019150836020828501011115610d8657600080fd5b600082601f8301126149d7578081fd5b61143483833560208501614875565b600061010082840312156149f8578081fd5b50919050565b600060a082840312156149f8578081fd5b600060c082840312156149f8578081fd5b80356001600160601b0381168114614a3757600080fd5b919050565b600060208284031215614a4d578081fd5b813561143481615bb0565b60008060408385031215614a6a578081fd5b8235614a7581615bb0565b91506020830135614a8581615bb0565b809150509250929050565b600080600080600060a08688031215614aa7578081fd5b8535614ab281615bb0565b94506020860135614ac281615bb0565b935060408601356001600160401b0380821115614add578283fd5b614ae989838a01614914565b94506060880135915080821115614afe578283fd5b614b0a89838a01614914565b93506080880135915080821115614b1f578283fd5b50614b2c888289016149c7565b9150509295509295909350565b600080600080600060a08688031215614b50578283fd5b8535614b5b81615bb0565b94506020860135614b6b81615bb0565b9350604086013592506060860135915060808601356001600160401b03811115614b93578182fd5b614b2c888289016149c7565b600080600060608486031215614bb3578081fd5b8335614bbe81615bb0565b925060208401356001600160401b0380821115614bd9578283fd5b614be587838801614914565b93506040860135915080821115614bfa578283fd5b50614c0786828701614914565b9150509250925092565b60008060408385031215614c23578182fd5b8235614c2e81615bb0565b915060208301358015158114614a85578182fd5b60008060408385031215614c54578182fd5b8235614c5f81615bb0565b915060208301356001600160401b03811115614c79578182fd5b614c85858286016149c7565b9150509250929050565b60008060408385031215614ca1578182fd5b8235614cac81615bb0565b946020939093013593505050565b600080600060608486031215614cce578081fd5b8335614cd981615bb0565b95602085013595506040909401359392505050565b60008060408385031215614d00578182fd5b8235614d0b81615bb0565b9150614d1960208401614a20565b90509250929050565b60008060008060608587031215614d37578182fd5b84356001600160401b03811115614d4c578283fd5b614d58878288016148d2565b90989097506020870135966040013595509350505050565b60008060408385031215614d82578182fd5b82356001600160401b0380821115614d98578384fd5b818501915085601f830112614dab578384fd5b81356020614db88261594d565b604051614dc58282615a9d565b8381528281019150858301600585901b870184018b1015614de4578889fd5b8896505b84871015614e0f578035614dfb81615bb0565b835260019690960195918301918301614de8565b5096505086013592505080821115614e25578283fd5b50614c8585828601614914565b60008060008060408587031215614e47578182fd5b84356001600160401b0380821115614e5d578384fd5b614e69888389016148d2565b90965094506020870135915080821115614e81578384fd5b50614e8e878288016148d2565b95989497509550505050565b600060208284031215614eab578081fd5b5035919050565b600060208284031215614ec3578081fd5b5051919050565b60008060408385031215614edc578182fd5b823591506020830135614a8581615bb0565b600060208284031215614eff578081fd5b813561143481615bc5565b600060208284031215614f1b578081fd5b815161143481615bc5565b600060208284031215614f37578081fd5b81356001600160401b03811115614f4c578182fd5b614f58848285016149e6565b949350505050565b600080600060408486031215614f74578081fd5b83356001600160401b0380821115614f8a578283fd5b614f96878388016149e6565b94506020860135915080821115614fab578283fd5b50614fb886828701614988565b9497909650939450505050565b600060208284031215614fd6578081fd5b81356001600160401b03811115614feb578182fd5b614f58848285016149fe565b60008060006040848603121561500b578081fd5b83356001600160401b0380821115615021578283fd5b614f96878388016149fe565b60006020828403121561503e578081fd5b81356001600160401b03811115615053578182fd5b614f5884828501614a0f565b600080600060408486031215615073578081fd5b83356001600160401b0380821115615089578283fd5b614f9687838801614a0f565b6000806000606084860312156150a9578081fd5b8335925060208401356150bb81615bb0565b91506150c960408501614a20565b90509250925092565b600080604083850312156150e4578182fd5b8235915060208301356001600160401b03811115615100578182fd5b8301601f81018513615110578182fd5b614c8585823560208401614875565b60008060408385031215615131578182fd5b50508035926020909101359150565b60008060408385031215615152578182fd5b82359150602083013560ff81168114614a85578182fd5b81835260006001600160fb1b03831115615181578081fd5b8260051b80836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b838110156151cc578151875295820195908201906001016151b0565b509495945050505050565b600081518084526151ef816020860160208601615a25565b601f01601f19169290920160200192915050565b60006001600160fb1b03831115615218578081fd5b8260051b808584379190910190815292915050565b6000825161523f818460208701615a25565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615281816017850160208801615a25565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516152b2816028840160208801615a25565b01602801949350505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906152ea9083018661519d565b82810360608401526152fc818661519d565b9050828103608084015261531081856151d7565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615356908301846151d7565b979650505050505050565b604081526000615375604083018688615169565b8281036020840152615356818587615169565b602081526000611434602083018461519d565b6040815260006153ae604083018561519d565b8281036020840152614524818561519d565b60208152600061143460208301846151d7565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6020808252602d908201527f5265736f75726365733a2063616c6c657220646f6573206e6f74206d6174636860408201526c20726571756573742e66726f6d60981b606082015260800190565b60208082526021908201527f5265736f75726365733a207369676e617475726520616c7265616479207573656040820152601960fa1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252601c908201527f5265736f75726365733a207369676e6174757265206578706972656400000000604082015260600190565b60208082526028908201527f5265736f75726365733a2063616c6c657220646f6573206e6f742068617665206040820152675349475f524f4c4560c01b606082015260800190565b6020808252601c908201527f5265736f75726365733a20696e76616c6964207369676e617475726500000000604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b602081526000823561588a81615bb0565b6001600160a01b03166020838101919091526158a890840184615970565b60a060408501526158bd60c085018284615169565b9150506158cd6040850185615970565b848303601f190160608601526158e4838284615169565b9250505060608401356080840152608084013560a08401528091505092915050565b6000808335601e1984360301811261591c578283fd5b8301803591506001600160401b03821115615935578283fd5b6020019150600581901b3603821315610d8657600080fd5b60006001600160401b0382111561596657615966615afa565b5060051b60200190565b6000808335601e19843603018112615986578283fd5b83016020810192503590506001600160401b038111156159a557600080fd5b8060051b3603831315610d8657600080fd5b600082198211156159ca576159ca615ae4565b500190565b6000826159ea57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615615a0957615a09615ae4565b500290565b600082821015615a2057615a20615ae4565b500390565b60005b83811015615a40578181015183820152602001615a28565b838111156115055750506000910152565b600081615a6057615a60615ae4565b506000190190565b600181811c90821680615a7c57607f821691505b602082108114156149f857634e487b7160e01b600052602260045260246000fd5b601f8201601f191681016001600160401b0381118282101715615ac257615ac2615afa565b6040525050565b6000600019821415615add57615add615ae4565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156114ec57600481823e5160e01c90565b600060443d1015615b355790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615b6457505050505090565b8285019150815181811115615b7c5750505050505090565b843d8701016020828501011115615b965750505050505090565b615ba560208286010187615a9d565b509095945050505050565b6001600160a01b0381168114610f5957600080fd5b6001600160e01b031981168114610f5957600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcce80e833f1c3f0c050749e11fed407dc3dacd109611ea11097e9f5eb6abd9aad416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564d3ef2a638e7a0fdb619d8427aa3275d94766b4619bcd37f650c1c32b1fcb2e96a26469706673582212208a2b13569e5d4cc600474ef7ad24cd2efd4c4ba0afb04bf71e5ea73b5ae99c0264736f6c63430008040033
Deployed Bytecode
0x6080604052600436106102fe5760003560e01c80636b20c45411610190578063a860d137116100dc578063e7d5d36111610095578063f223885a1161006f578063f223885a14610a0f578063f242432a14610a2f578063f5298aca14610a4f578063f698da2514610a6f57600080fd5b8063e7d5d36114610978578063e985e9c5146109a6578063efb2c9fa146109ef57600080fd5b8063a860d13714610887578063bd85b039146108a7578063bde773bd146108d5578063c231ff67146108f5578063d547741f14610938578063e7b1883c1461095857600080fd5b8063782f08ae1161014957806391d148541161012357806391d1485414610812578063a217fddf14610832578063a22cb46514610847578063a496dedf1461086757600080fd5b8063782f08ae146107bd5780638129fc1c146107dd578063823da974146107f257600080fd5b80636b20c454146106ef5780636f2488581461070f5780636f51819f1461073d57806372e4c9f61461075d57806373a42a391461077d578063752e9a8f1461079d57600080fd5b8063341e97e31161024f5780634f558e79116102085780635944c753116101e25780635944c753146106565780635a74373c14610676578063627443f81461068d578063678ff538146106bb57600080fd5b80634f558e79146105f15780634fcbe7411461062157806352d1902d1461064157600080fd5b8063341e97e31461052357806336568abe146105515780633659cfe6146105715780634e1273f4146105915780634e36d0cd146105be5780634f1ef286146105de57600080fd5b8063149cf52b116102bc578063248a9ca311610296578063248a9ca3146104745780632a55205a146104a45780632eb2c2d6146104e35780632f2ff15d1461050357600080fd5b8063149cf52b146103f5578063177de89c14610415578063207add911461045457600080fd5b8062fdd58e1461030357806301ffc9a71461033657806304634d8d146103665780630646cc33146103885780630e89341c146103a8578063138ab32c146103d5575b600080fd5b34801561030f57600080fd5b5061032361031e366004614c8f565b610a84565b6040519081526020015b60405180910390f35b34801561034257600080fd5b50610356610351366004614eee565b610b1c565b604051901515815260200161032d565b34801561037257600080fd5b50610386610381366004614cee565b610b2d565b005b34801561039457600080fd5b506103866103a3366004614a3c565b610b47565b3480156103b457600080fd5b506103c86103c3366004614e9a565b610b7e565b60405161032d91906153c0565b3480156103e157600080fd5b506103866103f0366004615140565b610c21565b34801561040157600080fd5b50610386610410366004614cba565b610c50565b34801561042157600080fd5b506101fd5461043c906201000090046001600160a01b031681565b6040516001600160a01b03909116815260200161032d565b34801561046057600080fd5b5061038661046f36600461511f565b610cbe565b34801561048057600080fd5b5061032361048f366004614e9a565b60009081526065602052604090206001015490565b3480156104b057600080fd5b506104c46104bf36600461511f565b610cdd565b604080516001600160a01b03909316835260208301919091520161032d565b3480156104ef57600080fd5b506103866104fe366004614a90565b610d8d565b34801561050f57600080fd5b5061038661051e366004614eca565b610dd9565b34801561052f57600080fd5b5061032361053e366004614a3c565b6101fb6020526000908152604090205481565b34801561055d57600080fd5b5061038661056c366004614eca565b610dfe565b34801561057d57600080fd5b5061038661058c366004614a3c565b610e7c565b34801561059d57600080fd5b506105b16105ac366004614d70565b610f5c565b60405161032d9190615388565b3480156105ca57600080fd5b506103866105d9366004614f60565b6110bd565b6103866105ec366004614c42565b61125f565b3480156105fd57600080fd5b5061035661060c366004614e9a565b600090815261015f6020526040902054151590565b34801561062d57600080fd5b5061032361063c366004614fc5565b61132c565b34801561064d57600080fd5b5061032361143b565b34801561066257600080fd5b50610386610671366004615095565b6114ef565b34801561068257600080fd5b506103236101fc5481565b34801561069957600080fd5b506103236106a8366004614a3c565b6101f96020526000908152604090205481565b3480156106c757600080fd5b506103237f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274381565b3480156106fb57600080fd5b5061038661070a366004614b9f565b61150b565b34801561071b57600080fd5b5061032361072a366004614e9a565b6101fe6020526000908152604090205481565b34801561074957600080fd5b50610386610758366004614e9a565b61154e565b34801561076957600080fd5b50610386610778366004614e9a565b611579565b34801561078957600080fd5b5061038661079836600461505f565b61158b565b3480156107a957600080fd5b506103236107b8366004614f26565b6118d4565b3480156107c957600080fd5b506103866107d83660046150d2565b611a3e565b3480156107e957600080fd5b50610386611a76565b3480156107fe57600080fd5b5061038661080d366004614fc5565b611c68565b34801561081e57600080fd5b5061035661082d366004614eca565b611d6c565b34801561083e57600080fd5b50610323600081565b34801561085357600080fd5b50610386610862366004614c11565b611d97565b34801561087357600080fd5b50610386610882366004614d22565b611da2565b34801561089357600080fd5b506103866108a2366004614f60565b611e2e565b3480156108b357600080fd5b506103236108c2366004614e9a565b600090815261015f602052604090205490565b3480156108e157600080fd5b506103866108f0366004614ff7565b612094565b34801561090157600080fd5b50610926610910366004614e9a565b6101fa6020526000908152604090205460ff1681565b60405160ff909116815260200161032d565b34801561094457600080fd5b50610386610953366004614eca565b61224e565b34801561096457600080fd5b50610386610973366004614ff7565b612273565b34801561098457600080fd5b50610323610993366004614e9a565b6101ff6020526000908152604090205481565b3480156109b257600080fd5b506103566109c1366004614a58565b6001600160a01b03918216600090815260fc6020908152604080832093909416825291909152205460ff1690565b3480156109fb57600080fd5b50610323610a0a36600461502d565b61246f565b348015610a1b57600080fd5b50610386610a2a366004614e32565b61255e565b348015610a3b57600080fd5b50610386610a4a366004614b39565b61260b565b348015610a5b57600080fd5b50610386610a6a366004614cba565b612650565b348015610a7b57600080fd5b50610323612693565b60006001600160a01b038316610af45760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600090815260fb602090815260408083206001600160a01b03949094168352929052205490565b6000610b27826126a2565b92915050565b6000610b38816126c7565b610b4283836126d1565b505050565b6000610b52816126c7565b506101fd80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b60008181526101f860205260409020805460609190610b9c90615a68565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc890615a68565b8015610c155780601f10610bea57610100808354040283529160200191610c15565b820191906000526020600020905b815481529060010190602001808311610bf857829003601f168201915b50505050509050919050565b6000610c2c816126c7565b5060009182526101fa6020526040909120805460ff191660ff909216919091179055565b600080516020615bfc833981519152610c68816126c7565b6001600160a01b03841660008181526101f9602090815260408083208790556101fb8252918290208590558151858152908101869052600080516020615c4383398151915291015b60405180910390a250505050565b6000610cc9816126c7565b5060009182526101fe602052604090912055565b60008281526101c6602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610d545750604080518082019091526101c5546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d73906001600160601b0316876159ef565b610d7d91906159cf565b91519350909150505b9250929050565b6001600160a01b038516331480610da95750610da985336109c1565b610dc55760405162461bcd60e51b8152600401610aeb90615539565b610dd2858585858561278c565b5050505050565b600082815260656020526040902060010154610df4816126c7565b610b42838361286c565b6001600160a01b0381163314610e6e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610aeb565b610e7882826128f2565b5050565b306001600160a01b037f000000000000000000000000e361ff6179f5bf0f232072efced70378694bc5be161415610ec55760405162461bcd60e51b8152600401610aeb906154ed565b7f000000000000000000000000e361ff6179f5bf0f232072efced70378694bc5be6001600160a01b0316610f0e600080516020615bdc833981519152546001600160a01b031690565b6001600160a01b031614610f345760405162461bcd60e51b8152600401610aeb90615587565b610f3d81612959565b60408051600080825260208201909252610f5991839190612983565b50565b60608151835114610fc15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610aeb565b600083516001600160401b03811115610fea57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611013578160200160208202803683370190505b50905060005b84518110156110b55761107a85828151811061104557634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061106d57634e487b7160e01b600052603260045260246000fd5b6020026020010151610a84565b82828151811061109a57634e487b7160e01b600052603260045260246000fd5b60209081029190910101526110ae81615ac9565b9050611019565b509392505050565b60005b6110cd6080850185615906565b9050811015611253576101fe60006110e86080870187615906565b8481811061110657634e487b7160e01b600052603260045260246000fd5b905060200201358152602001908152602001600020546101ff60008680608001906111319190615906565b8581811061114f57634e487b7160e01b600052603260045260246000fd5b90506020020135815260200190815260200160002054106111b25760405162461bcd60e51b815260206004820152601860248201527f5265736f75726365733a206c696d6974207265616368656400000000000000006044820152606401610aeb565b6111bf60a0850185615906565b828181106111dd57634e487b7160e01b600052603260045260246000fd5b905060200201356101ff60008680608001906111f99190615906565b8581811061121757634e487b7160e01b600052603260045260246000fd5b905060200201358152602001908152602001600020600082825461123b91906159b7565b9091555081905061124b81615ac9565b9150506110c0565b50610b42838383611e2e565b306001600160a01b037f000000000000000000000000e361ff6179f5bf0f232072efced70378694bc5be1614156112a85760405162461bcd60e51b8152600401610aeb906154ed565b7f000000000000000000000000e361ff6179f5bf0f232072efced70378694bc5be6001600160a01b03166112f1600080516020615bdc833981519152546001600160a01b031690565b6001600160a01b0316146113175760405162461bcd60e51b8152600401610aeb90615587565b61132082612959565b610e7882826001612983565b6000807f2554d7789d596128fb66e019c8882171935d76346b67f136dfefa47e5bf001d061135d6020850185614a3c565b61136a6020860186615906565b60405160200161137b929190615203565b604051602081830303815290604052805190602001208580604001906113a19190615906565b6040516020016113b2929190615203565b6040516020818303038152906040528051906020012086606001358760800135604051602001611413969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120905061143481612afd565b9392505050565b6000306001600160a01b037f000000000000000000000000e361ff6179f5bf0f232072efced70378694bc5be16146114db5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610aeb565b50600080516020615bdc8339815191525b90565b60006114fa816126c7565b611505848484612b4b565b50505050565b6001600160a01b038316331480611527575061152783336109c1565b6115435760405162461bcd60e51b8152600401610aeb90615539565b610b42838383612c17565b600080516020615bfc833981519152611566816126c7565b5060009081526101ff6020526040812055565b6000611584816126c7565b506101fc55565b6115986020840184614a3c565b6001600160a01b0316336001600160a01b0316146115c85760405162461bcd60e51b8152600401610aeb9061545f565b60006115d38461246f565b60008181526101f7602052604090205490915060ff16156116065760405162461bcd60e51b8152600401610aeb906154ac565b60006116488285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b9050611662600080516020615bfc83398151915282611d6c565b61167e5760405162461bcd60e51b8152600401610aeb90615724565b84608001354211156116a25760405162461bcd60e51b8152600401610aeb906156a5565b6101fd805460ff19166001179055611737336116c16040880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611700925050506060890189615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612c1792505050565b6101fd805460ff1990811690915560008381526101f76020908152604080832080549094166001179093556101fc543383526101f990915291902054429161177e916159b7565b106118075761178e336002610a84565b3360009081526101fb60209081526040909120546117af91880135906159b7565b11156117d6576117c0336002610a84565b3360009081526101fb6020526040902055611858565b3360009081526101fb6020908152604082208054918801359290916117fc9084906159b7565b909155506118589050565b3360008181526101f9602090815260409091204290558601359061182c906002610a84565b1061183b578460200135611846565b611846336002610a84565b3360009081526101fb60205260409020555b60405182907f6131d8c6f0dde62907d8706f45f4130ba111e134ba99ae5e1b4659bb753b4ec790600090a23360008181526101fb60209081526040808320546101f990925291829020549151600080516020615c43833981519152926118c5928252602082015260400190565b60405180910390a25050505050565b6000807fa1369ee06e725f6d94b282bbe417df9176fe35a4b394b2e939603c0a60f243f16119056020850185614a3c565b60208501356119176040870187615906565b604051602001611928929190615203565b60408051601f19818403018152919052805160209091012061194d6060880188615906565b60405160200161195e929190615203565b60408051601f1981840301815291905280516020909101206119836080890189615906565b604051602001611994929190615203565b60408051601f1981840301815291905280516020909101206119b960a08a018a615906565b6040516020016119ca929190615203565b60408051601f198184030181528282528051602091820120908301989098526001600160a01b03909616958101959095526060850193909352608084019190915260a083015260c08083019190915260e0808301939093528501356101008201529084013561012082015261014001611413565b600080516020615bfc833981519152611a56816126c7565b60008381526101f8602090815260409091208351611505928501906147dc565b600054610100900460ff1615808015611a965750600054600160ff909116105b80611ab05750303b158015611ab0575060005460ff166001145b611b135760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aeb565b6000805460ff191660011790558015611b36576000805461ff0019166101001790555b611b3e612df8565b611b46612df8565b611b5e60405180602001604052806000815250612e21565b611b66612df8565b611b6e612df8565b611bb2604051806040016040528060098152602001685265736f757263657360b81b815250604051806040016040528060018152602001603160f81b815250612e51565b611bbd60003361286c565b611be77f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e33361286c565b611bff600080516020615bfc8339815191523361286c565b611c1f73b5d4f12b5e7d8ce43fece177a6c75df14994fbe66101f4610b2d565b8015610f59576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b611c80600080516020615bfc83398151915233611d6c565b611c9c5760405162461bcd60e51b8152600401610aeb906156dc565b611d3d611cac6020830183614a3c565b611cb96020840184615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf8925050506040850185615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612e82915050565b7f5ebfafc2e4bcbb722f34b25aab01bf27d0ff910d45fdb932b9b08438d5292f2881604051611c5d9190615879565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610e78338383613008565b600080516020615bfc833981519152611dba816126c7565b60005b84811015611e2657611e14868683818110611de857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611dfd9190614a3c565b8585604051806020016040528060008152506130e9565b80611e1e81615ac9565b915050611dbd565b505050505050565b611e3b6020840184614a3c565b6001600160a01b0316336001600160a01b031614611e6b5760405162461bcd60e51b8152600401610aeb9061545f565b6000611e76846118d4565b60008181526101f7602052604090205490915060ff1615611ea95760405162461bcd60e51b8152600401610aeb906154ac565b6000611eeb8285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b9050611f05600080516020615bfc83398151915282611d6c565b611f215760405162461bcd60e51b8152600401610aeb90615724565b8460c00135421115611f455760405162461bcd60e51b8152600401610aeb906156a5565b602085013515611fbd576101fd5460405163079cc67960e41b815233600482015260208701356024820152620100009091046001600160a01b0316906379cc679090604401600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505b6000611fcc6040870187615906565b90501115611fe557611fe5336116c16040880188615906565b6000611ff46080870187615906565b9050111561204c5761204c3361200d6080880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf89250505060a0890189615906565b60008281526101f76020526040808220805460ff191660011790555183917f631aafe679aa052fcd6a015ee77f4fea396205ccada6f7d4e1f9691ca2e8db0691a25050505050565b336120a26020850185614a3c565b6001600160a01b0316146120e4576120c8600080516020615bfc83398151915233611d6c565b6120e45760405162461bcd60e51b8152600401610aeb906156dc565b60006120ef8461132c565b905060006121338285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b905061214d600080516020615bfc83398151915282611d6c565b6121695760405162461bcd60e51b8152600401610aeb90615724565b60008281526101f7602052604090205460ff16156121e25760405162461bcd60e51b815260206004820152603060248201527f5265736f75726365733a207369676e617475726520616c72656164792075736560448201526f19081bdc881a5b9d985b1a59185d195960821b6064820152608401610aeb565b84606001354211156122065760405162461bcd60e51b8152600401610aeb906156a5565b60008281526101f76020526040808220805460ff191660011790555183917f383592cfab2d2f510ba971675c925b357581c2d54e2b040e3189c58d992c86a891a25050505050565b600082815260656020526040902060010154612269816126c7565b610b4283836128f2565b6122806040840184615906565b905061228f6020850185615906565b9050146122f15760405162461bcd60e51b815260206004820152602a60248201527f5265736f75726365733a2069647320616e6420616d6f756e7473206c656e67746044820152690d040dad2e6dac2e8c6d60b31b6064820152608401610aeb565b60006122fc8461132c565b60008181526101f7602052604090205490915060ff161561232f5760405162461bcd60e51b8152600401610aeb906154ac565b60006123718285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ddc92505050565b905061238b600080516020615bfc83398151915282611d6c565b6123a75760405162461bcd60e51b8152600401610aeb90615724565b84606001354211156123cb5760405162461bcd60e51b8152600401610aeb906156a5565b6124276123db6020870187614a3c565b6123e86020880188615906565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cf8925050506040890189615906565b60008281526101f76020526040808220805460ff191660011790555183917f9344895d8662d254397908c354d6d3047ac7e17dee80af14464c842f844ccd2391a25050505050565b6000807fde1ebae86485f73a424f5c64497d92b863e378ed19804679a9dd7857f27b840f6124a06020850185614a3c565b60208501356124b26040870187615906565b6040516020016124c3929190615203565b60408051601f1981840301815291905280516020909101206124e86060880188615906565b6040516020016124f9929190615203565b60408051601f198184030181528282528051602091820120908301969096526001600160a01b0390941693810193909352606083019190915260808083019190915260a08083019390935285013560c08201529084013560e082015261010001611413565b6125cc3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612c1792505050565b336001600160a01b03167fb9dbc1274cee7131d155a093abd5d0ee37b318bb61a5a10b916a7ebfbf2e061185858585604051610cb09493929190615361565b6001600160a01b038516331480612627575061262785336109c1565b6126435760405162461bcd60e51b8152600401610aeb90615539565b610dd285858585856131e3565b6001600160a01b03831633148061266c575061266c83336109c1565b6126885760405162461bcd60e51b8152600401610aeb90615539565b610b4283838361322d565b600061269d613353565b905090565b60006001600160e01b0319821663152a902d60e11b1480610b275750610b27826133d0565b610f598133613410565b6127106001600160601b03821611156126fc5760405162461bcd60e51b8152600401610aeb906157a6565b6001600160a01b0382166127525760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610aeb565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b909102176101c555565b336127b77f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274382611d6c565b61285f5760005b845181101561285d57612820878683815181106127eb57634e487b7160e01b600052603260045260246000fd5b602002602001015186848151811061281357634e487b7160e01b600052603260045260246000fd5b6020026020010151613469565b84828151811061284057634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061285581615ac9565b9150506127be565b505b611e26868686868661352e565b6128768282611d6c565b610e785760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128ae3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128fc8282611d6c565b15610e785760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610e78816126c7565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156129b657610b42836136fd565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129ef57600080fd5b505afa925050508015612a1f575060408051601f3d908101601f19168201909252612a1c91810190614eb2565b60015b612a825760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610aeb565b600080516020615bdc8339815191528114612af15760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610aeb565b50610b42838383613799565b6000610b27612b0a613353565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6127106001600160601b0382161115612b765760405162461bcd60e51b8152600401610aeb906157a6565b6001600160a01b038216612bcc5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610aeb565b6040805180820182526001600160a01b0393841681526001600160601b03928316602080830191825260009687526101c690529190942093519051909116600160a01b029116179055565b6001600160a01b038316612c3d5760405162461bcd60e51b8152600401610aeb90615618565b8051825114612c5e5760405162461bcd60e51b8152600401610aeb906157f0565b6000339050612c81818560008686604051806020016040528060008152506137be565b60005b8351811015612d65576000848281518110612caf57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110612cdb57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815260fb835260408082206001600160a01b038c168352909352919091205490915081811015612d2c5760405162461bcd60e51b8152600401610aeb9061541b565b600092835260fb602090815260408085206001600160a01b038b1686529091529092209103905580612d5d81615ac9565b915050612c84565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612db692919061539b565b60405180910390a4611505818560008686604051806020016040528060008152506137cc565b6000806000612deb8585613bbd565b915091506110b581613c00565b600054610100900460ff16612e1f5760405162461bcd60e51b8152600401610aeb9061575b565b565b600054610100900460ff16612e485760405162461bcd60e51b8152600401610aeb9061575b565b610f5981613d86565b600054610100900460ff16612e785760405162461bcd60e51b8152600401610aeb9061575b565b610e788282613db6565b6001600160a01b038416612ea85760405162461bcd60e51b8152600401610aeb90615838565b8151835114612ec95760405162461bcd60e51b8152600401610aeb906157f0565b33612ed9816000878787876137be565b60005b8451811015612f9157838181518110612f0557634e487b7160e01b600052603260045260246000fd5b602002602001015160fb6000878481518110612f3157634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254612f7991906159b7565b90915550819050612f8981615ac9565b915050612edc565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612fe292919061539b565b60405180910390a4612ff9816000878787876137cc565b610dd281600087878787613df9565b816001600160a01b0316836001600160a01b0316141561307c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610aeb565b6001600160a01b03838116600081815260fc6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661310f5760405162461bcd60e51b8152600401610aeb90615838565b33600061311b85613f64565b9050600061312885613f64565b9050613139836000898585896137be565b600086815260fb602090815260408083206001600160a01b038b1684529091528120805487929061316b9084906159b7565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46131cb836000898585896137cc565b6131da83600089898989613fbd565b50505050505050565b3361320e7f2e999d733fd66be04919b0ede319832aa9e511b2f2d7ef3cb2264eeffc03274382611d6c565b6132205761321d868585613469565b92505b611e268686868686614087565b6001600160a01b0383166132535760405162461bcd60e51b8152600401610aeb90615618565b33600061325f84613f64565b9050600061326c84613f64565b905061328c838760008585604051806020016040528060008152506137be565b600085815260fb602090815260408083206001600160a01b038a168452909152902054848110156132cf5760405162461bcd60e51b8152600401610aeb9061541b565b600086815260fb602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46131da848860008686604051806020016040528060008152506137cc565b600061269d7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133836101915490565b610192546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60006001600160e01b03198216636cdb3d1360e11b148061340157506001600160e01b031982166303a24d0760e21b145b80610b275750610b27826141d1565b61341a8282611d6c565b610e785761342781614206565b613432836020614218565b604051602001613443929190615249565b60408051601f198184030181529082905262461bcd60e51b8252610aeb916004016153c0565b60008281526101fa602052604081205460ff168015613525576000606461349360ff8416866159ef565b61349d91906159cf565b90508015613523576101fd805461ff0019166101001790556134c086868361322d565b6101fd805461ff001916905560408051868152602081018390526001600160a01b038816917fb0a068ff9b2c6f72d5af72f3f94b79d10fe7995889678a9c0f6a33caa63cb4d2910160405180910390a261351a8185615a0e565b92505050611434565b505b50909392505050565b815183511461354f5760405162461bcd60e51b8152600401610aeb906157f0565b6001600160a01b0384166135755760405162461bcd60e51b8152600401610aeb906155d3565b336135848187878787876137be565b60005b84518110156136895760008582815181106135b257634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106135de57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815260fb835260408082206001600160a01b038e16835290935291909120549091508181101561362f5760405162461bcd60e51b8152600401610aeb9061565b565b600083815260fb602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061366e9084906159b7565b925050819055505050508061368290615ac9565b9050613587565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516136d992919061539b565b60405180910390a46136ef8187878787876137cc565b611e26818787878787613df9565b6001600160a01b0381163b61376a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610aeb565b600080516020615bdc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6137a2836143f9565b6000825111806137af5750805b15610b42576115058383614439565b611e2686868686868661452d565b60005b83518110156131da5760028482815181106137fa57634e487b7160e01b600052603260045260246000fd5b60200260200101511415613bab576001600160a01b03861615613aab576001600160a01b0385161561393b576101fc546001600160a01b03871660009081526101f9602052604090205461384e91906159b7565b42111561389d5760405162461bcd60e51b815260206004820152601a60248201527f5265736f75726365733a2075706b656570206e6f7420706169640000000000006044820152606401610aeb565b6001600160a01b03861660009081526101fb602052604090205483518490839081106138d957634e487b7160e01b600052603260045260246000fd5b6020026020010151111561393b5760405162461bcd60e51b8152602060048201526024808201527f5265736f75726365733a206e6f7420656e6f75676820616374697665206d6565604482015263706c657360e01b6064820152608401610aeb565b6101fd5460ff16613aab5782818151811061396657634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000886001600160a01b03166001600160a01b031681526020019081526020016000205410613a02578281815181106139ba57634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546139f79190615a0e565b90915550613a1d9050565b6001600160a01b03861660009081526101fb60205260408120555b613a28866002610a84565b613a47576001600160a01b03861660009081526101f960205260408120555b6101fd54610100900460ff16613aab576001600160a01b03861660008181526101fb60209081526040808320546101f990925291829020549151600080516020615c4383398151915292613aa2928252602082015260400190565b60405180910390a25b6001600160a01b03851615613bab57828181518110613ada57634e487b7160e01b600052603260045260246000fd5b60200260200101516101fb6000876001600160a01b03166001600160a01b031681526020019081526020016000206000828254613b1791906159b7565b90915550506001600160a01b03851660009081526101f96020526040902054613b57576001600160a01b03851660009081526101f9602052604090204290555b6001600160a01b03851660008181526101fb60209081526040808320546101f990925291829020549151600080516020615c4383398151915292613ba2928252602082015260400190565b60405180910390a25b80613bb581615ac9565b9150506137cf565b600080825160411415613bf45760208301516040840151606085015160001a613be8878285856146e1565b94509450505050610d86565b50600090506002610d86565b6000816004811115613c2257634e487b7160e01b600052602160045260246000fd5b1415613c2b5750565b6001816004811115613c4d57634e487b7160e01b600052602160045260246000fd5b1415613c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610aeb565b6002816004811115613cbd57634e487b7160e01b600052602160045260246000fd5b1415613d0b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610aeb565b6003816004811115613d2d57634e487b7160e01b600052602160045260246000fd5b1415610f595760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610aeb565b600054610100900460ff16613dad5760405162461bcd60e51b8152600401610aeb9061575b565b610f59816147a5565b600054610100900460ff16613ddd5760405162461bcd60e51b8152600401610aeb9061575b565b8151602092830120815191909201206101919190915561019255565b6001600160a01b0384163b15611e265760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613e3d90899089908890889088906004016152be565b602060405180830381600087803b158015613e5757600080fd5b505af1925050508015613e87575060408051601f3d908101601f19168201909252613e8491810190614f0a565b60015b613f3457613e93615b10565b806308c379a01415613ecd5750613ea8615b27565b80613eb35750613ecf565b8060405162461bcd60e51b8152600401610aeb91906153c0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610aeb565b6001600160e01b0319811663bc197c8160e01b146131da5760405162461bcd60e51b8152600401610aeb906153d3565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613fac57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b15611e265760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190614001908990899088908890889060040161531c565b602060405180830381600087803b15801561401b57600080fd5b505af192505050801561404b575060408051601f3d908101601f1916820190925261404891810190614f0a565b60015b61405757613e93615b10565b6001600160e01b0319811663f23a6e6160e01b146131da5760405162461bcd60e51b8152600401610aeb906153d3565b6001600160a01b0384166140ad5760405162461bcd60e51b8152600401610aeb906155d3565b3360006140b985613f64565b905060006140c685613f64565b90506140d68389898585896137be565b600086815260fb602090815260408083206001600160a01b038c168452909152902054858110156141195760405162461bcd60e51b8152600401610aeb9061565b565b600087815260fb602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906141589084906159b7565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46141b8848a8a86868a6137cc565b6141c6848a8a8a8a8a613fbd565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b1480610b2757506301ffc9a760e01b6001600160e01b0319831614610b27565b6060610b276001600160a01b03831660145b606060006142278360026159ef565b6142329060026159b7565b6001600160401b0381111561425757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015614281576020820181803683370190505b509050600360fc1b816000815181106142aa57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106142e757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061430b8460026159ef565b6143169060016159b7565b90505b60018111156143aa576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061435857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061437c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936143a381615a51565b9050614319565b5083156114345760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610aeb565b614402816136fd565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6144a15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610aeb565b600080846001600160a01b0316846040516144bc919061522d565b600060405180830381855af49150503d80600081146144f7576040519150601f19603f3d011682016040523d82523d6000602084013e6144fc565b606091505b50915091506145248282604051806060016040528060278152602001615c1c602791396147b8565b95945050505050565b6001600160a01b0385166145d15760005b83518110156145cf5782818151811061456757634e487b7160e01b600052603260045260246000fd5b602002602001015161015f600086848151811061459457634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546145b991906159b7565b909155506145c8905081615ac9565b905061453e565b505b6001600160a01b038416611e265760005b83518110156131da57600084828151811061460d57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061463957634e487b7160e01b600052603260045260246000fd5b60200260200101519050600061015f6000848152602001908152602001600020549050818110156146bd5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610aeb565b600092835261015f6020526040909220910390556146da81615ac9565b90506145e2565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614718575060009050600361479c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561476c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166147955760006001925092505061479c565b9150600090505b94509492505050565b8051610e789060fd9060208401906147dc565b606083156147c7575081611434565b6114348383815115613eb35781518083602001fd5b8280546147e890615a68565b90600052602060002090601f01602090048101928261480a5760008555614850565b82601f1061482357805160ff1916838001178555614850565b82800160010185558215614850579182015b82811115614850578251825591602001919060010190614835565b5061485c929150614860565b5090565b5b8082111561485c5760008155600101614861565b60006001600160401b0383111561488e5761488e615afa565b6040516148a5601f8501601f191660200182615a9d565b8091508381528484840111156148ba57600080fd5b83836020830137600060208583010152509392505050565b60008083601f8401126148e3578182fd5b5081356001600160401b038111156148f9578182fd5b6020830191508360208260051b8501011115610d8657600080fd5b600082601f830112614924578081fd5b813560206149318261594d565b60405161493e8282615a9d565b8381528281019150858301600585901b8701840188101561495d578586fd5b855b8581101561497b5781358452928401929084019060010161495f565b5090979650505050505050565b60008083601f840112614999578182fd5b5081356001600160401b038111156149af578182fd5b602083019150836020828501011115610d8657600080fd5b600082601f8301126149d7578081fd5b61143483833560208501614875565b600061010082840312156149f8578081fd5b50919050565b600060a082840312156149f8578081fd5b600060c082840312156149f8578081fd5b80356001600160601b0381168114614a3757600080fd5b919050565b600060208284031215614a4d578081fd5b813561143481615bb0565b60008060408385031215614a6a578081fd5b8235614a7581615bb0565b91506020830135614a8581615bb0565b809150509250929050565b600080600080600060a08688031215614aa7578081fd5b8535614ab281615bb0565b94506020860135614ac281615bb0565b935060408601356001600160401b0380821115614add578283fd5b614ae989838a01614914565b94506060880135915080821115614afe578283fd5b614b0a89838a01614914565b93506080880135915080821115614b1f578283fd5b50614b2c888289016149c7565b9150509295509295909350565b600080600080600060a08688031215614b50578283fd5b8535614b5b81615bb0565b94506020860135614b6b81615bb0565b9350604086013592506060860135915060808601356001600160401b03811115614b93578182fd5b614b2c888289016149c7565b600080600060608486031215614bb3578081fd5b8335614bbe81615bb0565b925060208401356001600160401b0380821115614bd9578283fd5b614be587838801614914565b93506040860135915080821115614bfa578283fd5b50614c0786828701614914565b9150509250925092565b60008060408385031215614c23578182fd5b8235614c2e81615bb0565b915060208301358015158114614a85578182fd5b60008060408385031215614c54578182fd5b8235614c5f81615bb0565b915060208301356001600160401b03811115614c79578182fd5b614c85858286016149c7565b9150509250929050565b60008060408385031215614ca1578182fd5b8235614cac81615bb0565b946020939093013593505050565b600080600060608486031215614cce578081fd5b8335614cd981615bb0565b95602085013595506040909401359392505050565b60008060408385031215614d00578182fd5b8235614d0b81615bb0565b9150614d1960208401614a20565b90509250929050565b60008060008060608587031215614d37578182fd5b84356001600160401b03811115614d4c578283fd5b614d58878288016148d2565b90989097506020870135966040013595509350505050565b60008060408385031215614d82578182fd5b82356001600160401b0380821115614d98578384fd5b818501915085601f830112614dab578384fd5b81356020614db88261594d565b604051614dc58282615a9d565b8381528281019150858301600585901b870184018b1015614de4578889fd5b8896505b84871015614e0f578035614dfb81615bb0565b835260019690960195918301918301614de8565b5096505086013592505080821115614e25578283fd5b50614c8585828601614914565b60008060008060408587031215614e47578182fd5b84356001600160401b0380821115614e5d578384fd5b614e69888389016148d2565b90965094506020870135915080821115614e81578384fd5b50614e8e878288016148d2565b95989497509550505050565b600060208284031215614eab578081fd5b5035919050565b600060208284031215614ec3578081fd5b5051919050565b60008060408385031215614edc578182fd5b823591506020830135614a8581615bb0565b600060208284031215614eff578081fd5b813561143481615bc5565b600060208284031215614f1b578081fd5b815161143481615bc5565b600060208284031215614f37578081fd5b81356001600160401b03811115614f4c578182fd5b614f58848285016149e6565b949350505050565b600080600060408486031215614f74578081fd5b83356001600160401b0380821115614f8a578283fd5b614f96878388016149e6565b94506020860135915080821115614fab578283fd5b50614fb886828701614988565b9497909650939450505050565b600060208284031215614fd6578081fd5b81356001600160401b03811115614feb578182fd5b614f58848285016149fe565b60008060006040848603121561500b578081fd5b83356001600160401b0380821115615021578283fd5b614f96878388016149fe565b60006020828403121561503e578081fd5b81356001600160401b03811115615053578182fd5b614f5884828501614a0f565b600080600060408486031215615073578081fd5b83356001600160401b0380821115615089578283fd5b614f9687838801614a0f565b6000806000606084860312156150a9578081fd5b8335925060208401356150bb81615bb0565b91506150c960408501614a20565b90509250925092565b600080604083850312156150e4578182fd5b8235915060208301356001600160401b03811115615100578182fd5b8301601f81018513615110578182fd5b614c8585823560208401614875565b60008060408385031215615131578182fd5b50508035926020909101359150565b60008060408385031215615152578182fd5b82359150602083013560ff81168114614a85578182fd5b81835260006001600160fb1b03831115615181578081fd5b8260051b80836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b838110156151cc578151875295820195908201906001016151b0565b509495945050505050565b600081518084526151ef816020860160208601615a25565b601f01601f19169290920160200192915050565b60006001600160fb1b03831115615218578081fd5b8260051b808584379190910190815292915050565b6000825161523f818460208701615a25565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615281816017850160208801615a25565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516152b2816028840160208801615a25565b01602801949350505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906152ea9083018661519d565b82810360608401526152fc818661519d565b9050828103608084015261531081856151d7565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615356908301846151d7565b979650505050505050565b604081526000615375604083018688615169565b8281036020840152615356818587615169565b602081526000611434602083018461519d565b6040815260006153ae604083018561519d565b8281036020840152614524818561519d565b60208152600061143460208301846151d7565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6020808252602d908201527f5265736f75726365733a2063616c6c657220646f6573206e6f74206d6174636860408201526c20726571756573742e66726f6d60981b606082015260800190565b60208082526021908201527f5265736f75726365733a207369676e617475726520616c7265616479207573656040820152601960fa1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252601c908201527f5265736f75726365733a207369676e6174757265206578706972656400000000604082015260600190565b60208082526028908201527f5265736f75726365733a2063616c6c657220646f6573206e6f742068617665206040820152675349475f524f4c4560c01b606082015260800190565b6020808252601c908201527f5265736f75726365733a20696e76616c6964207369676e617475726500000000604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b602081526000823561588a81615bb0565b6001600160a01b03166020838101919091526158a890840184615970565b60a060408501526158bd60c085018284615169565b9150506158cd6040850185615970565b848303601f190160608601526158e4838284615169565b9250505060608401356080840152608084013560a08401528091505092915050565b6000808335601e1984360301811261591c578283fd5b8301803591506001600160401b03821115615935578283fd5b6020019150600581901b3603821315610d8657600080fd5b60006001600160401b0382111561596657615966615afa565b5060051b60200190565b6000808335601e19843603018112615986578283fd5b83016020810192503590506001600160401b038111156159a557600080fd5b8060051b3603831315610d8657600080fd5b600082198211156159ca576159ca615ae4565b500190565b6000826159ea57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615615a0957615a09615ae4565b500290565b600082821015615a2057615a20615ae4565b500390565b60005b83811015615a40578181015183820152602001615a28565b838111156115055750506000910152565b600081615a6057615a60615ae4565b506000190190565b600181811c90821680615a7c57607f821691505b602082108114156149f857634e487b7160e01b600052602260045260246000fd5b601f8201601f191681016001600160401b0381118282101715615ac257615ac2615afa565b6040525050565b6000600019821415615add57615add615ae4565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156114ec57600481823e5160e01c90565b600060443d1015615b355790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615b6457505050505090565b8285019150815181811115615b7c5750505050505090565b843d8701016020828501011115615b965750505050505090565b615ba560208286010187615a9d565b509095945050505050565b6001600160a01b0381168114610f5957600080fd5b6001600160e01b031981168114610f5957600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcce80e833f1c3f0c050749e11fed407dc3dacd109611ea11097e9f5eb6abd9aad416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564d3ef2a638e7a0fdb619d8427aa3275d94766b4619bcd37f650c1c32b1fcb2e96a26469706673582212208a2b13569e5d4cc600474ef7ad24cd2efd4c4ba0afb04bf71e5ea73b5ae99c0264736f6c63430008040033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.