ERC-721
NFT
Overview
Max Total Supply
0 RR
Holders
57,331
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 RRLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
REVVRacingNFT
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {AccessControlBase} from "./base/AccessControlBase.sol"; import {ContractOwnership} from "./ContractOwnership.sol"; /// @title Access control via roles management (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract AccessControl is AccessControlBase, ContractOwnership { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ContractOwnershipStorage} from "./libraries/ContractOwnershipStorage.sol"; import {ContractOwnershipBase} from "./base/ContractOwnershipBase.sol"; import {InterfaceDetection} from "./../introspection/InterfaceDetection.sol"; /// @title ERC173 Contract Ownership Standard (immutable version). /// @dev See https://eips.ethereum.org/EIPS/eip-173 /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ContractOwnership is ContractOwnershipBase, InterfaceDetection { using ContractOwnershipStorage for ContractOwnershipStorage.Layout; /// @notice Initializes the storage with an initial contract owner. /// @notice Marks the following ERC165 interface(s) as supported: ERC173. /// @dev Emits an {OwnershipTransferred} if `initialOwner` is not the zero address. /// @param initialOwner the initial contract owner. constructor(address initialOwner) { ContractOwnershipStorage.layout().constructorInit(initialOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {AccessControlStorage} from "./../libraries/AccessControlStorage.sol"; import {ContractOwnershipStorage} from "./../libraries/ContractOwnershipStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title Access control via roles management (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC173 (Contract Ownership standard). abstract contract AccessControlBase is Context { using AccessControlStorage for AccessControlStorage.Layout; using ContractOwnershipStorage for ContractOwnershipStorage.Layout; /// @notice Emitted when a role is granted. /// @param role the granted role. /// @param account the account granted with the role. /// @param operator the initiator of the grant. event RoleGranted(bytes32 role, address account, address operator); /// @notice Emitted when a role is revoked or renounced. /// @param role the revoked or renounced role. /// @param account the account losing the role. /// @param operator the initiator of the revocation, or identical to `account` for a renouncement. event RoleRevoked(bytes32 role, address account, address operator); /// @notice Grants a role to an account. /// @dev Reverts if the sender is not the contract owner. /// @dev Emits a {RoleGranted} event if the account did not previously have the role. /// @param role The role to grant. /// @param account The account to grant the role to. function grantRole(bytes32 role, address account) external { address operator = _msgSender(); ContractOwnershipStorage.layout().enforceIsContractOwner(operator); AccessControlStorage.layout().grantRole(role, account, operator); } /// @notice Revokes a role from an account. /// @dev Reverts if the sender is not the contract owner. /// @dev Emits a {RoleRevoked} event if the account previously had the role. /// @param role The role to revoke. /// @param account The account to revoke the role from. function revokeRole(bytes32 role, address account) external { address operator = _msgSender(); ContractOwnershipStorage.layout().enforceIsContractOwner(operator); AccessControlStorage.layout().revokeRole(role, account, operator); } /// @notice Renounces a role by the sender. /// @dev Reverts if the sender does not have `role`. /// @dev Emits a {RoleRevoked} event. /// @param role The role to renounce. function renounceRole(bytes32 role) external { AccessControlStorage.layout().renounceRole(_msgSender(), role); } /// @notice Retrieves whether an account has a role. /// @param role The role. /// @param account The account. /// @return whether `account` has `role`. function hasRole(bytes32 role, address account) external view returns (bool) { return AccessControlStorage.layout().hasRole(role, account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC173} from "./../interfaces/IERC173.sol"; import {ContractOwnershipStorage} from "./../libraries/ContractOwnershipStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC173 Contract Ownership Standard (proxiable version). /// @dev See https://eips.ethereum.org/EIPS/eip-173 /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC165 (Interface Detection Standard). abstract contract ContractOwnershipBase is Context, IERC173 { using ContractOwnershipStorage for ContractOwnershipStorage.Layout; /// @inheritdoc IERC173 function owner() public view virtual override returns (address) { return ContractOwnershipStorage.layout().owner(); } /// @inheritdoc IERC173 function transferOwnership(address newOwner) public virtual override { ContractOwnershipStorage.layout().transferOwnership(_msgSender(), newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC-173 Contract Ownership Standard /// @dev See https://eips.ethereum.org/EIPS/eip-173 /// @dev Note: the ERC-165 identifier for this interface is 0x7f5828d0 interface IERC173 { /// @notice Emitted when the contract ownership changes. /// @param previousOwner the previous contract owner. /// @param newOwner the new contract owner. event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice Sets the address of the new contract owner. /// @dev Reverts if the sender is not the contract owner. /// @dev Emits an {OwnershipTransferred} event if `newOwner` is different from the current contract owner. /// @param newOwner The address of the new contract owner. Using the zero address means renouncing ownership. function transferOwnership(address newOwner) external; /// @notice Gets the address of the contract owner. /// @return contractOwner The address of the contract owner. function owner() external view returns (address contractOwner); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {Bytes32} from "./../../utils/libraries/Bytes32.sol"; library AccessControlStorage { using Bytes32 for bytes32; using AccessControlStorage for AccessControlStorage.Layout; struct Layout { mapping(bytes32 => mapping(address => bool)) roles; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.core.access.AccessControl.storage")) - 1); event RoleGranted(bytes32 role, address account, address operator); event RoleRevoked(bytes32 role, address account, address operator); /// @notice Grants a role to an account. /// @dev Note: Call to this function should be properly access controlled. /// @dev Emits a {RoleGranted} event if the account did not previously have the role. /// @param role The role to grant. /// @param account The account to grant the role to. /// @param operator The account requesting the role change. function grantRole(Layout storage s, bytes32 role, address account, address operator) internal { if (!s.hasRole(role, account)) { s.roles[role][account] = true; emit RoleGranted(role, account, operator); } } /// @notice Revokes a role from an account. /// @dev Note: Call to this function should be properly access controlled. /// @dev Emits a {RoleRevoked} event if the account previously had the role. /// @param role The role to revoke. /// @param account The account to revoke the role from. /// @param operator The account requesting the role change. function revokeRole(Layout storage s, bytes32 role, address account, address operator) internal { if (s.hasRole(role, account)) { s.roles[role][account] = false; emit RoleRevoked(role, account, operator); } } /// @notice Renounces a role by the sender. /// @dev Reverts if `sender` does not have `role`. /// @dev Emits a {RoleRevoked} event. /// @param sender The message sender. /// @param role The role to renounce. function renounceRole(Layout storage s, address sender, bytes32 role) internal { s.enforceHasRole(role, sender); s.roles[role][sender] = false; emit RoleRevoked(role, sender, sender); } /// @notice Retrieves whether an account has a role. /// @param role The role. /// @param account The account. /// @return whether `account` has `role`. function hasRole(Layout storage s, bytes32 role, address account) internal view returns (bool) { return s.roles[role][account]; } /// @notice Ensures that an account has a role. /// @dev Reverts if `account` does not have `role`. /// @param role The role. /// @param account The account. function enforceHasRole(Layout storage s, bytes32 role, address account) internal view { if (!s.hasRole(role, account)) { revert(string(abi.encodePacked("AccessControl: missing '", role.toASCIIString(), "' role"))); } } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC173} from "./../interfaces/IERC173.sol"; import {ProxyInitialization} from "./../../proxy/libraries/ProxyInitialization.sol"; import {InterfaceDetectionStorage} from "./../../introspection/libraries/InterfaceDetectionStorage.sol"; library ContractOwnershipStorage { using ContractOwnershipStorage for ContractOwnershipStorage.Layout; using InterfaceDetectionStorage for InterfaceDetectionStorage.Layout; struct Layout { address contractOwner; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.core.access.ContractOwnership.storage")) - 1); bytes32 internal constant PROXY_INIT_PHASE_SLOT = bytes32(uint256(keccak256("animoca.core.access.ContractOwnership.phase")) - 1); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice Initializes the storage with an initial contract owner (immutable version). /// @notice Marks the following ERC165 interface(s) as supported: ERC173. /// @dev Note: This function should be called ONLY in the constructor of an immutable (non-proxied) contract. /// @dev Emits an {OwnershipTransferred} if `initialOwner` is not the zero address. /// @param initialOwner The initial contract owner. function constructorInit(Layout storage s, address initialOwner) internal { if (initialOwner != address(0)) { s.contractOwner = initialOwner; emit OwnershipTransferred(address(0), initialOwner); } InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC173).interfaceId, true); } /// @notice Initializes the storage with an initial contract owner (proxied version). /// @notice Sets the proxy initialization phase to `1`. /// @notice Marks the following ERC165 interface(s) as supported: ERC173. /// @dev Note: This function should be called ONLY in the init function of a proxied contract. /// @dev Reverts if the proxy initialization phase is set to `1` or above. /// @dev Emits an {OwnershipTransferred} if `initialOwner` is not the zero address. /// @param initialOwner The initial contract owner. function proxyInit(Layout storage s, address initialOwner) internal { ProxyInitialization.setPhase(PROXY_INIT_PHASE_SLOT, 1); s.constructorInit(initialOwner); } /// @notice Sets the address of the new contract owner. /// @dev Reverts if `sender` is not the contract owner. /// @dev Emits an {OwnershipTransferred} event if `newOwner` is different from the current contract owner. /// @param newOwner The address of the new contract owner. Using the zero address means renouncing ownership. function transferOwnership(Layout storage s, address sender, address newOwner) internal { address previousOwner = s.contractOwner; require(sender == previousOwner, "Ownership: not the owner"); if (previousOwner != newOwner) { s.contractOwner = newOwner; emit OwnershipTransferred(previousOwner, newOwner); } } /// @notice Gets the address of the contract owner. /// @return contractOwner The address of the contract owner. function owner(Layout storage s) internal view returns (address contractOwner) { return s.contractOwner; } /// @notice Ensures that an account is the contract owner. /// @dev Reverts if `account` is not the contract owner. /// @param account The account. function enforceIsContractOwner(Layout storage s, address account) internal view { require(account == s.contractOwner, "Ownership: not the owner"); } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC165} from "./interfaces/IERC165.sol"; import {InterfaceDetectionStorage} from "./libraries/InterfaceDetectionStorage.sol"; /// @title ERC165 Interface Detection Standard (immutable or proxiable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) or proxied implementation. abstract contract InterfaceDetection is IERC165 { using InterfaceDetectionStorage for InterfaceDetectionStorage.Layout; /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceId) external view override returns (bool) { return InterfaceDetectionStorage.layout().supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC165 Interface Detection Standard. /// @dev See https://eips.ethereum.org/EIPS/eip-165. /// @dev Note: The ERC-165 identifier for this interface is 0x01ffc9a7. interface IERC165 { /// @notice Returns whether this contract implements a given interface. /// @dev Note: This function call must use less than 30 000 gas. /// @param interfaceId the interface identifier to test. /// @return supported True if the interface is supported, false if `interfaceId` is `0xffffffff` or if the interface is not supported. function supportsInterface(bytes4 interfaceId) external view returns (bool supported); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC165} from "./../interfaces/IERC165.sol"; library InterfaceDetectionStorage { struct Layout { mapping(bytes4 => bool) supportedInterfaces; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.core.introspection.InterfaceDetection.storage")) - 1); bytes4 internal constant ILLEGAL_INTERFACE_ID = 0xffffffff; /// @notice Sets or unsets an ERC165 interface. /// @dev Reverts if `interfaceId` is `0xffffffff`. /// @param interfaceId the interface identifier. /// @param supported True to set the interface, false to unset it. function setSupportedInterface(Layout storage s, bytes4 interfaceId, bool supported) internal { require(interfaceId != ILLEGAL_INTERFACE_ID, "InterfaceDetection: wrong value"); s.supportedInterfaces[interfaceId] = supported; } /// @notice Returns whether this contract implements a given interface. /// @dev Note: This function call must use less than 30 000 gas. /// @param interfaceId The interface identifier to test. /// @return supported True if the interface is supported, false if `interfaceId` is `0xffffffff` or if the interface is not supported. function supportsInterface(Layout storage s, bytes4 interfaceId) internal view returns (bool supported) { if (interfaceId == ILLEGAL_INTERFACE_ID) { return false; } if (interfaceId == type(IERC165).interfaceId) { return true; } return s.supportedInterfaces[interfaceId]; } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IForwarderRegistry} from "./interfaces/IForwarderRegistry.sol"; import {IERC2771} from "./interfaces/IERC2771.sol"; import {ForwarderRegistryContextBase} from "./base/ForwarderRegistryContextBase.sol"; /// @title Meta-Transactions Forwarder Registry Context (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. /// @dev Derived from https://github.com/wighawag/universal-forwarder (MIT licence) abstract contract ForwarderRegistryContext is ForwarderRegistryContextBase, IERC2771 { constructor(IForwarderRegistry forwarderRegistry_) ForwarderRegistryContextBase(forwarderRegistry_) {} function forwarderRegistry() external view returns (IForwarderRegistry) { return _forwarderRegistry; } /// @inheritdoc IERC2771 function isTrustedForwarder(address forwarder) external view virtual override returns (bool) { return forwarder == address(_forwarderRegistry); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IForwarderRegistry} from "./../interfaces/IForwarderRegistry.sol"; import {ERC2771Calldata} from "./../libraries/ERC2771Calldata.sol"; /// @title Meta-Transactions Forwarder Registry Context (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Derived from https://github.com/wighawag/universal-forwarder (MIT licence) abstract contract ForwarderRegistryContextBase { IForwarderRegistry internal immutable _forwarderRegistry; constructor(IForwarderRegistry forwarderRegistry) { _forwarderRegistry = forwarderRegistry; } /// @notice Returns the message sender depending on the ForwarderRegistry-based meta-transaction context. function _msgSender() internal view virtual returns (address) { // Optimised path in case of an EOA-initiated direct tx to the contract or a call from a contract not complying with EIP-2771 // solhint-disable-next-line avoid-tx-origin if (msg.sender == tx.origin || msg.data.length < 24) { return msg.sender; } address sender = ERC2771Calldata.msgSender(); // Return the EIP-2771 calldata-appended sender address if the message was forwarded by the ForwarderRegistry or an approved forwarder if (msg.sender == address(_forwarderRegistry) || _forwarderRegistry.isApprovedForwarder(sender, msg.sender)) { return sender; } return msg.sender; } /// @notice Returns the message data depending on the ForwarderRegistry-based meta-transaction context. function _msgData() internal view virtual returns (bytes calldata) { // Optimised path in case of an EOA-initiated direct tx to the contract or a call from a contract not complying with EIP-2771 // solhint-disable-next-line avoid-tx-origin if (msg.sender == tx.origin || msg.data.length < 24) { return msg.data; } // Return the EIP-2771 calldata (minus the appended sender) if the message was forwarded by the ForwarderRegistry or an approved forwarder if (msg.sender == address(_forwarderRegistry) || _forwarderRegistry.isApprovedForwarder(ERC2771Calldata.msgSender(), msg.sender)) { return ERC2771Calldata.msgData(); } return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Secure Protocol for Native Meta Transactions. /// @dev See https://eips.ethereum.org/EIPS/eip-2771 interface IERC2771 { /// @notice Checks whether a forwarder is trusted. /// @param forwarder The forwarder to check. /// @return isTrusted True if `forwarder` is trusted, false if not. function isTrustedForwarder(address forwarder) external view returns (bool isTrusted); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Universal Meta-Transactions Forwarder Registry. /// @dev Derived from https://github.com/wighawag/universal-forwarder (MIT licence) interface IForwarderRegistry { /// @notice Checks whether an account is as an approved meta-transaction forwarder for a sender account. /// @param sender The sender account. /// @param forwarder The forwarder account. /// @return isApproved True if `forwarder` is an approved meta-transaction forwarder for `sender`, false otherwise. function isApprovedForwarder(address sender, address forwarder) external view returns (bool isApproved); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @dev Derived from https://github.com/OpenZeppelin/openzeppelin-contracts (MIT licence) /// @dev See https://eips.ethereum.org/EIPS/eip-2771 library ERC2771Calldata { /// @notice Returns the sender address appended at the end of the calldata, as specified in EIP-2771. function msgSender() internal pure returns (address sender) { assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } /// @notice Returns the calldata while omitting the appended sender address, as specified in EIP-2771. function msgData() internal pure returns (bytes calldata data) { unchecked { return msg.data[:msg.data.length - 20]; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; /// @notice Multiple calls protection for storage-modifying proxy initialization functions. library ProxyInitialization { /// @notice Sets the initialization phase during a storage-modifying proxy initialization function. /// @dev Reverts if `phase` has been reached already. /// @param storageSlot the storage slot where `phase` is stored. /// @param phase the initialization phase. function setPhase(bytes32 storageSlot, uint256 phase) internal { StorageSlot.Uint256Slot storage currentVersion = StorageSlot.getUint256Slot(storageSlot); require(currentVersion.value < phase, "Storage: phase reached"); currentVersion.value = phase; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {TokenRecoveryBase} from "./base/TokenRecoveryBase.sol"; import {ContractOwnership} from "./../access/ContractOwnership.sol"; /// @title Recovery mechanism for ETH/ERC20/ERC721 tokens accidentally sent to this contract (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract TokenRecovery is TokenRecoveryBase, ContractOwnership { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; import {IERC721} from "./../../token/ERC721/interfaces/IERC721.sol"; import {ContractOwnershipStorage} from "./../../access/libraries/ContractOwnershipStorage.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; /// @title Recovery mechanism for ETH/ERC20/ERC721 tokens accidentally sent to this contract (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC173 (Contract Ownership standard). contract TokenRecoveryBase is Context { using ContractOwnershipStorage for ContractOwnershipStorage.Layout; using SafeERC20 for IERC20; using Address for address payable; /// @notice Extract ETH tokens which were accidentally sent to the contract to a list of accounts. /// @dev Note: While contracts can generally prevent accidental ETH transfer by implementating a reverting /// `receive()` function, this can still be bypassed in a `selfdestruct(address)` scenario. /// @dev Warning: this function should be overriden for contracts which are supposed to hold ETH tokens /// so that the extraction is limited to only amounts sent accidentally. /// @dev Reverts if the sender is not the contract owner. /// @dev Reverts if `accounts` and `amounts` do not have the same length. /// @dev Reverts if one of the ETH transfers fails for any reason. /// @param accounts the list of accounts to transfer the tokens to. /// @param amounts the list of token amounts to transfer. function recoverETH(address payable[] calldata accounts, uint256[] calldata amounts) external virtual { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); uint256 length = accounts.length; require(length == amounts.length, "Recovery: inconsistent arrays"); unchecked { for (uint256 i; i != length; ++i) { accounts[i].sendValue(amounts[i]); } } } /// @notice Extract ERC20 tokens which were accidentally sent to the contract to a list of accounts. /// @dev Warning: this function should be overriden for contracts which are supposed to hold ERC20 tokens /// so that the extraction is limited to only amounts sent accidentally. /// @dev Reverts if the sender is not the contract owner. /// @dev Reverts if `accounts`, `tokens` and `amounts` do not have the same length. /// @dev Reverts if one of the ERC20 transfers fails for any reason. /// @param accounts the list of accounts to transfer the tokens to. /// @param tokens the list of ERC20 token addresses. /// @param amounts the list of token amounts to transfer. function recoverERC20s(address[] calldata accounts, IERC20[] calldata tokens, uint256[] calldata amounts) external virtual { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); uint256 length = accounts.length; require(length == tokens.length && length == amounts.length, "Recovery: inconsistent arrays"); unchecked { for (uint256 i; i != length; ++i) { tokens[i].safeTransfer(accounts[i], amounts[i]); } } } /// @notice Extract ERC721 tokens which were accidentally sent to the contract to a list of accounts. /// @dev Warning: this function should be overriden for contracts which are supposed to hold ERC721 tokens /// so that the extraction is limited to only tokens sent accidentally. /// @dev Reverts if the sender is not the contract owner. /// @dev Reverts if `accounts`, `contracts` and `amounts` do not have the same length. /// @dev Reverts if one of the ERC721 transfers fails for any reason. /// @param accounts the list of accounts to transfer the tokens to. /// @param contracts the list of ERC721 contract addresses. /// @param tokenIds the list of token ids to transfer. function recoverERC721s(address[] calldata accounts, IERC721[] calldata contracts, uint256[] calldata tokenIds) external virtual { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); uint256 length = accounts.length; require(length == contracts.length && length == tokenIds.length, "Recovery: inconsistent arrays"); unchecked { for (uint256 i; i != length; ++i) { contracts[i].transferFrom(address(this), accounts[i], tokenIds[i]); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC721Storage} from "./libraries/ERC721Storage.sol"; import {ERC721BatchTransferWithOperatorFiltererBase} from "./base/ERC721BatchTransferWithOperatorFiltererBase.sol"; /// @title ERC721 Non-Fungible Token Standard: optional extension: Batch Transfer with Operator Filterer (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721BatchTransferWithOperatorFilterer is ERC721BatchTransferWithOperatorFiltererBase { /// @notice Marks the following ERC165 interfaces(s) as supported: ERC721BatchTransfer constructor() { ERC721Storage.initERC721BatchTransfer(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC721Storage} from "./libraries/ERC721Storage.sol"; import {ERC721BurnableBase} from "./base/ERC721BurnableBase.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Burnable (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721Burnable is ERC721BurnableBase { /// @notice Marks the fllowing ERC165 interface(s) as supported: ERC721Burnable constructor() { ERC721Storage.initERC721Burnable(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC721Storage} from "./libraries/ERC721Storage.sol"; import {ERC721DeliverableBase} from "./base/ERC721DeliverableBase.sol"; import {AccessControl} from "./../../access/AccessControl.sol"; import {ContractOwnership} from "./../../access/ContractOwnership.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Deliverable (immutable version). /// @notice ERC721Deliverable implementation where burnt tokens can be minted again. /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721Deliverable is ERC721DeliverableBase, AccessControl { /// @notice Marks the following ERC165 interface(s) as supported: ERC721Deliverable. constructor() { ERC721Storage.initERC721Deliverable(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC721ContractMetadataStorage} from "./libraries/ERC721ContractMetadataStorage.sol"; import {ERC721MetadataWithBaseURIBase} from "./base/ERC721MetadataWithBaseURIBase.sol"; import {TokenMetadataWithBaseURIStorage} from "./../metadata/libraries/TokenMetadataWithBaseURIStorage.sol"; import {ContractOwnership} from "./../../access/ContractOwnership.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Metadata (immutable version). /// @notice ERC721Metadata implementation where tokenURIs are the concatenation of a base metadata URI and the token identifier (decimal). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721MetadataWithBaseURI is ERC721MetadataWithBaseURIBase, ContractOwnership { using ERC721ContractMetadataStorage for ERC721ContractMetadataStorage.Layout; using TokenMetadataWithBaseURIStorage for TokenMetadataWithBaseURIStorage.Layout; /// @notice Initializes the storage with a name and symbol. /// @notice Marks the following ERC165 interface(s) as supported: ERC721Metadata. /// @param tokenName The token name. /// @param tokenSymbol The token symbol. constructor(string memory tokenName, string memory tokenSymbol) { ERC721ContractMetadataStorage.layout().constructorInit(tokenName, tokenSymbol); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC721Storage} from "./libraries/ERC721Storage.sol"; import {ERC721MintableBase} from "./base/ERC721MintableBase.sol"; import {AccessControl} from "./../../access/AccessControl.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Mintable (immutable version). /// @notice ERC721Mintable implementation where burnt tokens can be minted again. /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721Mintable is ERC721MintableBase, AccessControl { /// @notice Marks the following ERC165 interface(s) as supported: ERC721Mintable. constructor() { ERC721Storage.initERC721Mintable(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IOperatorFilterRegistry} from "./../royalty/interfaces/IOperatorFilterRegistry.sol"; import {ERC721Storage} from "./libraries/ERC721Storage.sol"; import {OperatorFiltererStorage} from "./../royalty/libraries/OperatorFiltererStorage.sol"; import {ERC721WithOperatorFiltererBase} from "./base/ERC721WithOperatorFiltererBase.sol"; import {OperatorFiltererBase} from "./../royalty/base/OperatorFiltererBase.sol"; import {ContractOwnership} from "./../../access/ContractOwnership.sol"; /// @title ERC721 Non-Fungible Token Standard with Operator Filterer (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC721WithOperatorFilterer is ERC721WithOperatorFiltererBase, OperatorFiltererBase, ContractOwnership { using OperatorFiltererStorage for OperatorFiltererStorage.Layout; /// @notice Marks the following ERC165 interfaces as supported: ERC721. /// @notice Sets the address that the contract will make OperatorFilter checks against. /// @param registry The operator filter registry address. When set to the zero address, checks will be bypassed. constructor(IOperatorFilterRegistry registry) { ERC721Storage.init(); OperatorFiltererStorage.layout().constructorInit(registry); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721BatchTransfer} from "./../interfaces/IERC721BatchTransfer.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {OperatorFiltererStorage} from "./../../royalty/libraries/OperatorFiltererStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Batch Transfer with Operator Filterer (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC721 (Non-Fungible Token Standard). abstract contract ERC721BatchTransferWithOperatorFiltererBase is Context, IERC721BatchTransfer { using ERC721Storage for ERC721Storage.Layout; using OperatorFiltererStorage for OperatorFiltererStorage.Layout; /// @inheritdoc IERC721BatchTransfer /// @dev Reverts with OperatorNotAllowed if the sender is not `from` and is not allowed by the operator registry. function batchTransferFrom(address from, address to, uint256[] calldata tokenIds) external virtual override { address sender = _msgSender(); OperatorFiltererStorage.layout().requireAllowedOperatorForTransfer(sender, from); ERC721Storage.layout().batchTransferFrom(sender, from, to, tokenIds); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721Burnable} from "./../interfaces/IERC721Burnable.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Burnable (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC721 (Non-Fungible Token Standard). abstract contract ERC721BurnableBase is Context, IERC721Burnable { using ERC721Storage for ERC721Storage.Layout; /// @inheritdoc IERC721Burnable function burnFrom(address from, uint256 tokenId) external virtual override { ERC721Storage.layout().burnFrom(_msgSender(), from, tokenId); } /// @inheritdoc IERC721Burnable function batchBurnFrom(address from, uint256[] calldata tokenIds) external virtual override { ERC721Storage.layout().batchBurnFrom(_msgSender(), from, tokenIds); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721Deliverable} from "./../interfaces/IERC721Deliverable.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {AccessControlStorage} from "./../../../access/libraries/AccessControlStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Deliverable (proxiable version). /// @notice ERC721Deliverable implementation where burnt tokens can be minted again. /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC721 (Non-Fungible Token Standard). /// @dev Note: This contract requires AccessControl. abstract contract ERC721DeliverableBase is Context, IERC721Deliverable { using ERC721Storage for ERC721Storage.Layout; using AccessControlStorage for AccessControlStorage.Layout; // prevent variable name clash with public ERC721MintableBase.MINTER_ROLE bytes32 private constant _MINTER_ROLE = "minter"; /// @inheritdoc IERC721Deliverable /// @dev Reverts if the sender does not have the 'minter' role. function deliver(address[] calldata recipients, uint256[] calldata tokenIds) external virtual override { AccessControlStorage.layout().enforceHasRole(_MINTER_ROLE, _msgSender()); ERC721Storage.layout().deliver(recipients, tokenIds); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721Metadata} from "./../interfaces/IERC721Metadata.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {ERC721ContractMetadataStorage} from "./../libraries/ERC721ContractMetadataStorage.sol"; import {TokenMetadataWithBaseURIStorage} from "./../../metadata/libraries/TokenMetadataWithBaseURIStorage.sol"; import {ContractOwnershipStorage} from "./../../../access/libraries/ContractOwnershipStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard (proxiable version), optional extension: Metadata (proxiable version). /// @notice ERC721Metadata implementation where tokenURIs are the concatenation of a base metadata URI and the token identifier (decimal). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC721 (Non-Fungible Token Standard). /// @dev Note: This contract requires ERC173 (Contract Ownership standard). abstract contract ERC721MetadataWithBaseURIBase is Context, IERC721Metadata { using ERC721Storage for ERC721Storage.Layout; using ERC721ContractMetadataStorage for ERC721ContractMetadataStorage.Layout; using TokenMetadataWithBaseURIStorage for TokenMetadataWithBaseURIStorage.Layout; using ContractOwnershipStorage for ContractOwnershipStorage.Layout; /// @notice Emitted when the base token metadata URI is updated. /// @param baseMetadataURI The new base metadata URI. event BaseMetadataURISet(string baseMetadataURI); /// @notice Sets the base metadata URI. /// @dev Reverts if the sender is not the contract owner. /// @dev Emits a {BaseMetadataURISet} event. /// @param baseURI The base metadata URI. function setBaseMetadataURI(string calldata baseURI) external { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); TokenMetadataWithBaseURIStorage.layout().setBaseMetadataURI(baseURI); } /// @notice Gets the base metadata URI. /// @return baseURI The base metadata URI. function baseMetadataURI() external view returns (string memory baseURI) { return TokenMetadataWithBaseURIStorage.layout().baseMetadataURI(); } /// @inheritdoc IERC721Metadata function name() external view override returns (string memory tokenName) { return ERC721ContractMetadataStorage.layout().name(); } /// @inheritdoc IERC721Metadata function symbol() external view override returns (string memory tokenSymbol) { return ERC721ContractMetadataStorage.layout().symbol(); } /// @inheritdoc IERC721Metadata function tokenURI(uint256 tokenId) external view override returns (string memory uri) { ERC721Storage.layout().ownerOf(tokenId); // reverts if the token does not exist return TokenMetadataWithBaseURIStorage.layout().tokenMetadataURI(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721Mintable} from "./../interfaces/IERC721Mintable.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {AccessControlStorage} from "./../../../access/libraries/AccessControlStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard, optional extension: Mintable (proxiable version). /// @notice ERC721Mintable implementation where burnt tokens can be minted again. /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC721 (Non-Fungible Token Standard). /// @dev Note: This contract requires AccessControl. abstract contract ERC721MintableBase is Context, IERC721Mintable { using ERC721Storage for ERC721Storage.Layout; using AccessControlStorage for AccessControlStorage.Layout; bytes32 public constant MINTER_ROLE = "minter"; /// @inheritdoc IERC721Mintable /// @dev Reverts if the sender does not have the 'minter' role. function mint(address to, uint256 tokenId) external virtual override { AccessControlStorage.layout().enforceHasRole(MINTER_ROLE, _msgSender()); ERC721Storage.layout().mint(to, tokenId); } /// @inheritdoc IERC721Mintable /// @dev Reverts if the sender does not have the 'minter' role. function safeMint(address to, uint256 tokenId, bytes calldata data) external virtual override { AccessControlStorage.layout().enforceHasRole(MINTER_ROLE, _msgSender()); ERC721Storage.layout().safeMint(_msgSender(), to, tokenId, data); } /// @inheritdoc IERC721Mintable /// @dev Reverts if the sender does not have the 'minter' role. function batchMint(address to, uint256[] calldata tokenIds) external virtual override { AccessControlStorage.layout().enforceHasRole(MINTER_ROLE, _msgSender()); ERC721Storage.layout().batchMint(to, tokenIds); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721} from "./../interfaces/IERC721.sol"; import {IERC721Events} from "./../interfaces/IERC721Events.sol"; import {ERC721Storage} from "./../libraries/ERC721Storage.sol"; import {OperatorFiltererStorage} from "./../../royalty/libraries/OperatorFiltererStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC721 Non-Fungible Token Standard with Operator Filterer (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC165 (Interface Detection Standard). /// @dev Note: This contract requires OperatorFilterer. abstract contract ERC721WithOperatorFiltererBase is Context, IERC721, IERC721Events { using ERC721Storage for ERC721Storage.Layout; using OperatorFiltererStorage for OperatorFiltererStorage.Layout; /// @inheritdoc IERC721 /// @dev Reverts with OperatorNotAllowed if `to` is not the zero address and is not allowed by the operator registry. function approve(address to, uint256 tokenId) external virtual override { if (to != address(0)) { OperatorFiltererStorage.layout().requireAllowedOperatorForApproval(to); } ERC721Storage.layout().approve(_msgSender(), to, tokenId); } /// @inheritdoc IERC721 /// @dev Reverts with OperatorNotAllowed if `approved` is true and `operator` is not allowed by the operator registry. function setApprovalForAll(address operator, bool approved) external virtual override { if (approved) { OperatorFiltererStorage.layout().requireAllowedOperatorForApproval(operator); } ERC721Storage.layout().setApprovalForAll(_msgSender(), operator, approved); } /// @inheritdoc IERC721 /// @dev Reverts with OperatorNotAllowed if the sender is not `from` and is not allowed by the operator registry. function transferFrom(address from, address to, uint256 tokenId) external override { address sender = _msgSender(); OperatorFiltererStorage.layout().requireAllowedOperatorForTransfer(sender, from); ERC721Storage.layout().transferFrom(sender, from, to, tokenId); } /// @inheritdoc IERC721 /// @dev Reverts with OperatorNotAllowed if the sender is not `from` and is not allowed by the operator registry. function safeTransferFrom(address from, address to, uint256 tokenId) external virtual override { address sender = _msgSender(); OperatorFiltererStorage.layout().requireAllowedOperatorForTransfer(sender, from); ERC721Storage.layout().safeTransferFrom(sender, from, to, tokenId); } /// @inheritdoc IERC721 /// @dev Reverts with OperatorNotAllowed if the sender is not `from` and is not allowed by the operator registry. function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external virtual override { address sender = _msgSender(); OperatorFiltererStorage.layout().requireAllowedOperatorForTransfer(sender, from); ERC721Storage.layout().safeTransferFrom(sender, from, to, tokenId, data); } /// @inheritdoc IERC721 function balanceOf(address owner) external view override returns (uint256 balance) { return ERC721Storage.layout().balanceOf(owner); } /// @inheritdoc IERC721 function ownerOf(uint256 tokenId) external view override returns (address tokenOwner) { return ERC721Storage.layout().ownerOf(tokenId); } /// @inheritdoc IERC721 function getApproved(uint256 tokenId) external view override returns (address approved) { return ERC721Storage.layout().getApproved(tokenId); } /// @inheritdoc IERC721 function isApprovedForAll(address owner, address operator) external view override returns (bool approvedForAll) { return ERC721Storage.layout().isApprovedForAll(owner, operator); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, basic interface (functions). /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev This interface only contains the standard functions. See IERC721Events for the events. /// @dev Note: The ERC-165 identifier for this interface is 0x80ac58cd. interface IERC721 { /// @notice Sets or unsets an approval to transfer a single token on behalf of its owner. /// @dev Note: There can only be one approved address per token at a given time. /// @dev Note: A token approval gets reset when this token is transferred, including a self-transfer. /// @dev Reverts if `tokenId` does not exist. /// @dev Reverts if `to` is the token owner. /// @dev Reverts if the sender is not the token owner and has not been approved by the token owner. /// @dev Emits an {Approval} event. /// @param to The address to approve, or the zero address to remove any existing approval. /// @param tokenId The token identifier to give approval for. function approve(address to, uint256 tokenId) external; /// @notice Sets or unsets an approval to transfer all tokens on behalf of their owner. /// @dev Reverts if the sender is the same as `operator`. /// @dev Emits an {ApprovalForAll} event. /// @param operator The address to approve for all tokens. /// @param approved True to set an approval for all tokens, false to unset it. function setApprovalForAll(address operator, bool approved) external; /// @notice Unsafely transfers the ownership of a token to a recipient. /// @dev Note: Usage of this method is discouraged, use `safeTransferFrom` whenever possible. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for `tokenId`. /// @dev Emits a {Transfer} event. /// @param from The current token owner. /// @param to The recipient of the token transfer. Self-transfers are possible. /// @param tokenId The identifier of the token to transfer. function transferFrom(address from, address to, uint256 tokenId) external; /// @notice Safely transfers the ownership of a token to a recipient. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for `tokenId`. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event. /// @param from The current token owner. /// @param to The recipient of the token transfer. /// @param tokenId The identifier of the token to transfer. function safeTransferFrom(address from, address to, uint256 tokenId) external; /// @notice Safely transfers the ownership of a token to a recipient. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for `tokenId`. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event. /// @param from The current token owner. /// @param to The recipient of the token transfer. /// @param tokenId The identifier of the token to transfer. /// @param data Optional data to send along to a receiver contract. function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /// @notice Gets the balance of an address. /// @dev Reverts if `owner` is the zero address. /// @param owner The address to query the balance of. /// @return balance The amount owned by the owner. function balanceOf(address owner) external view returns (uint256 balance); /// @notice Gets the owner of a token. /// @dev Reverts if `tokenId` does not exist. /// @param tokenId The token identifier to query the owner of. /// @return tokenOwner The owner of the token identifier. function ownerOf(uint256 tokenId) external view returns (address tokenOwner); /// @notice Gets the approved address for a token. /// @dev Reverts if `tokenId` does not exist. /// @param tokenId The token identifier to query the approval of. /// @return approved The approved address for the token identifier, or the zero address if no approval is set. function getApproved(uint256 tokenId) external view returns (address approved); /// @notice Gets whether an operator is approved for all tokens by an owner. /// @param owner The address which gives the approval for all tokens. /// @param operator The address which receives the approval for all tokens. /// @return approvedForAll Whether the operator is approved for all tokens by the owner. function isApprovedForAll(address owner, address operator) external view returns (bool approvedForAll); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, optional extension: Batch Transfer. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0xf3993d11. interface IERC721BatchTransfer { /// @notice Unsafely transfers a batch of tokens to a recipient. /// @dev Resets the token approval for each of `tokenIds`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if one of `tokenIds` is not owned by `from`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for each of `tokenIds`. /// @dev Emits an {IERC721-Transfer} event for each of `tokenIds`. /// @param from Current tokens owner. /// @param to Address of the new token owner. /// @param tokenIds Identifiers of the tokens to transfer. function batchTransferFrom(address from, address to, uint256[] calldata tokenIds) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, optional extension: Burnable. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0x8b8b4ef5. interface IERC721Burnable { /// @notice Burns a token. /// @dev Reverts if `tokenId` is not owned by `from`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for `tokenId`. /// @dev Emits an {IERC721-Transfer} event with `to` set to the zero address. /// @param from The current token owner. /// @param tokenId The identifier of the token to burn. function burnFrom(address from, uint256 tokenId) external; /// @notice Burns a batch of tokens. /// @dev Reverts if one of `tokenIds` is not owned by `from`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for each of `tokenIds`. /// @dev Emits an {IERC721-Transfer} event with `to` set to the zero address for each of `tokenIds`. /// @param from The current tokens owner. /// @param tokenIds The identifiers of the tokens to burn. function batchBurnFrom(address from, uint256[] calldata tokenIds) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, optional extension: Deliverable. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0x9da5e832. interface IERC721Deliverable { /// @notice Unsafely mints tokens to multiple recipients. /// @dev Reverts if `recipients` and `tokenIds` have different lengths. /// @dev Reverts if one of `recipients` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Emits an {IERC721-Transfer} event from the zero address for each of `recipients` and `tokenIds`. /// @param recipients Addresses of the new tokens owners. /// @param tokenIds Identifiers of the tokens to mint. function deliver(address[] calldata recipients, uint256[] calldata tokenIds) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, basic interface (events). /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev This interface only contains the standard events, see IERC721 for the functions. /// @dev Note: The ERC-165 identifier for this interface is 0x80ac58cd. interface IERC721Events { /// @notice Emitted when a token is transferred. /// @param from The previous token owner. /// @param to The new token owner. /// @param tokenId The transferred token identifier. event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /// @notice Emitted when a single token approval is set. /// @param owner The token owner. /// @param approved The approved address. /// @param tokenId The approved token identifier. event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /// @notice Emitted when an approval for all tokens is set or unset. /// @param owner The tokens owner. /// @param operator The approved address. /// @param approved True when then approval is set, false when it is unset. event ApprovalForAll(address indexed owner, address indexed operator, bool approved); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, optional extension: Metadata. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0x5b5e139f. interface IERC721Metadata { /// @notice Gets the name of the token. E.g. "My Token". /// @return tokenName The name of the token. function name() external view returns (string memory tokenName); /// @notice Gets the symbol of the token. E.g. "TOK". /// @return tokenSymbol The symbol of the token. function symbol() external view returns (string memory tokenSymbol); /// @notice Gets the metadata URI for a token identifier. /// @dev Reverts if `tokenId` does not exist. /// @param tokenId The token identifier. /// @return uri The metadata URI for the token identifier. function tokenURI(uint256 tokenId) external view returns (string memory uri); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, optional extension: Mintable. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0x8e773e13. interface IERC721Mintable { /// @notice Unsafely mints a token. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Emits an {IERC721-Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. function mint(address to, uint256 tokenId) external; /// @notice Safely mints a token. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits an {IERC721-Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. /// @param data Optional data to pass along to the receiver call. function safeMint(address to, uint256 tokenId, bytes calldata data) external; /// @notice Unsafely mints a batch of tokens. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Emits an {IERC721-Transfer} event from the zero address for each of `tokenIds`. /// @param to Address of the new tokens owner. /// @param tokenIds Identifiers of the tokens to mint. function batchMint(address to, uint256[] calldata tokenIds) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC721 Non-Fungible Token Standard, Tokens Receiver. /// @notice Interface for supporting safe transfers from ERC721 contracts. /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev Note: The ERC-165 identifier for this interface is 0x150b7a02. interface IERC721Receiver { /// @notice Handles the receipt of an ERC721 token. /// @dev Note: This function is called by an ERC721 contract after a safe transfer. /// @dev Note: The ERC721 contract address is always the message sender. /// @param operator The initiator of the safe transfer. /// @param from The previous token owner. /// @param tokenId The token identifier. /// @param data Optional additional data with no specified format. /// @return magicValue `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` (`0x150b7a02`) to accept, any other value to refuse. function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721Metadata} from "./../interfaces/IERC721Metadata.sol"; import {ProxyInitialization} from "./../../../proxy/libraries/ProxyInitialization.sol"; import {InterfaceDetectionStorage} from "./../../../introspection/libraries/InterfaceDetectionStorage.sol"; library ERC721ContractMetadataStorage { using InterfaceDetectionStorage for InterfaceDetectionStorage.Layout; using ERC721ContractMetadataStorage for ERC721ContractMetadataStorage.Layout; struct Layout { string tokenName; string tokenSymbol; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.token.ERC721.ERC721ContractMetadata.storage")) - 1); bytes32 internal constant PROXY_INIT_PHASE_SLOT = bytes32(uint256(keccak256("animoca.token.ERC721.ERC712ContractMetadata.phase")) - 1); /// @notice Initializes the storage with a name and symbol (immutable version). /// @notice Marks the following ERC165 interface(s) as supported: ERC721Metadata. /// @dev Note: This function should be called ONLY in the constructor of an immutable (non-proxied) contract. /// @param tokenName The token name. /// @param tokenSymbol The token symbol. function constructorInit(Layout storage s, string memory tokenName, string memory tokenSymbol) internal { s.tokenName = tokenName; s.tokenSymbol = tokenSymbol; InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721Metadata).interfaceId, true); } /// @notice Initializes the storage with a name and symbol (proxied version). /// @notice Sets the proxy initialization phase to `1`. /// @notice Marks the following ERC165 interface(s) as supported: ERC721Metadata. /// @dev Note: This function should be called ONLY in the init function of a proxied contract. /// @dev Reverts if the proxy initialization phase is set to `1` or above. /// @param tokenName The token name. /// @param tokenSymbol The token symbol. function proxyInit(Layout storage s, string calldata tokenName, string calldata tokenSymbol) internal { ProxyInitialization.setPhase(PROXY_INIT_PHASE_SLOT, 1); s.tokenName = tokenName; s.tokenSymbol = tokenSymbol; InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721Metadata).interfaceId, true); } /// @notice Gets the name of the token. E.g. "My Token". /// @return tokenName The name of the token. function name(Layout storage s) internal view returns (string memory tokenName) { return s.tokenName; } /// @notice Gets the symbol of the token. E.g. "TOK". /// @return tokenSymbol The symbol of the token. function symbol(Layout storage s) internal view returns (string memory tokenSymbol) { return s.tokenSymbol; } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC721} from "./../interfaces/IERC721.sol"; import {IERC721BatchTransfer} from "./../interfaces/IERC721BatchTransfer.sol"; import {IERC721Mintable} from "./../interfaces/IERC721Mintable.sol"; import {IERC721Deliverable} from "./../interfaces/IERC721Deliverable.sol"; import {IERC721Burnable} from "./../interfaces/IERC721Burnable.sol"; import {IERC721Receiver} from "./../interfaces/IERC721Receiver.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {ProxyInitialization} from "./../../../proxy/libraries/ProxyInitialization.sol"; import {InterfaceDetectionStorage} from "./../../../introspection/libraries/InterfaceDetectionStorage.sol"; library ERC721Storage { using Address for address; using ERC721Storage for ERC721Storage.Layout; using InterfaceDetectionStorage for InterfaceDetectionStorage.Layout; struct Layout { mapping(uint256 => uint256) owners; mapping(address => uint256) balances; mapping(uint256 => address) approvals; mapping(address => mapping(address => bool)) operators; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.token.ERC721.ERC721.storage")) - 1); bytes4 internal constant ERC721_RECEIVED = IERC721Receiver.onERC721Received.selector; // Single token approval flag // This bit is set in the owner's value to indicate that there is an approval set for this token uint256 internal constant TOKEN_APPROVAL_OWNER_FLAG = 1 << 160; // Burnt token magic value // This magic number is used as the owner's value to indicate that the token has been burnt uint256 internal constant BURNT_TOKEN_OWNER_VALUE = 0xdead000000000000000000000000000000000000000000000000000000000000; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /// @notice Marks the following ERC165 interface(s) as supported: ERC721. function init() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721).interfaceId, true); } /// @notice Marks the following ERC165 interface(s) as supported: ERC721BatchTransfer. function initERC721BatchTransfer() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721BatchTransfer).interfaceId, true); } /// @notice Marks the following ERC165 interface(s) as supported: ERC721Mintable. function initERC721Mintable() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721Mintable).interfaceId, true); } /// @notice Marks the following ERC165 interface(s) as supported: ERC721Deliverable. function initERC721Deliverable() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721Deliverable).interfaceId, true); } /// @notice Marks the following ERC165 interface(s) as supported: ERC721Burnable. function initERC721Burnable() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC721Burnable).interfaceId, true); } /// @notice Sets or unsets an approval to transfer a single token on behalf of its owner. /// @dev Note: This function implements {ERC721-approve(address,uint256)}. /// @dev Reverts if `tokenId` does not exist. /// @dev Reverts if `to` is the token owner. /// @dev Reverts if `sender` is not the token owner and has not been approved by the token owner. /// @dev Emits an {Approval} event. /// @param sender The message sender. /// @param to The address to approve, or the zero address to remove any existing approval. /// @param tokenId The token identifier to give approval for. function approve(Layout storage s, address sender, address to, uint256 tokenId) internal { uint256 owner = s.owners[tokenId]; require(_tokenExists(owner), "ERC721: non-existing token"); address ownerAddress = _tokenOwner(owner); require(to != ownerAddress, "ERC721: self-approval"); require(_isOperatable(s, ownerAddress, sender), "ERC721: non-approved sender"); if (to == address(0)) { if (_tokenHasApproval(owner)) { // remove the approval bit if it is present s.owners[tokenId] = uint256(uint160(ownerAddress)); } } else { uint256 ownerWithApprovalBit = owner | TOKEN_APPROVAL_OWNER_FLAG; if (owner != ownerWithApprovalBit) { // add the approval bit if it is not present s.owners[tokenId] = ownerWithApprovalBit; } s.approvals[tokenId] = to; } emit Approval(ownerAddress, to, tokenId); } /// @notice Sets or unsets an approval to transfer all tokens on behalf of their owner. /// @dev Note: This function implements {ERC721-setApprovalForAll(address,bool)}. /// @dev Reverts if `sender` is the same as `operator`. /// @dev Emits an {ApprovalForAll} event. /// @param sender The message sender. /// @param operator The address to approve for all tokens. /// @param approved True to set an approval for all tokens, false to unset it. function setApprovalForAll(Layout storage s, address sender, address operator, bool approved) internal { require(operator != sender, "ERC721: self-approval for all"); s.operators[sender][operator] = approved; emit ApprovalForAll(sender, operator, approved); } /// @notice Unsafely transfers the ownership of a token to a recipient by a sender. /// @dev Note: This function implements {ERC721-transferFrom(address,address,uint256)}. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if `sender` is not `from` and has not been approved by `from` for `tokenId`. /// @dev Emits a {Transfer} event. /// @param sender The message sender. /// @param from The current token owner. /// @param to The recipient of the token transfer. /// @param tokenId The identifier of the token to transfer. function transferFrom(Layout storage s, address sender, address from, address to, uint256 tokenId) internal { require(to != address(0), "ERC721: transfer to address(0)"); uint256 owner = s.owners[tokenId]; require(_tokenExists(owner), "ERC721: non-existing token"); require(_tokenOwner(owner) == from, "ERC721: non-owned token"); if (!_isOperatable(s, from, sender)) { require(_tokenHasApproval(owner) && sender == s.approvals[tokenId], "ERC721: non-approved sender"); } s.owners[tokenId] = uint256(uint160(to)); if (from != to) { unchecked { // cannot underflow as balance is verified through ownership --s.balances[from]; // cannot overflow as supply cannot overflow ++s.balances[to]; } } emit Transfer(from, to, tokenId); } /// @notice Safely transfers the ownership of a token to a recipient by a sender. /// @dev Note: This function implements {ERC721-safeTransferFrom(address,address,uint256)}. /// @dev Warning: Since a `to` contract can run arbitrary code, developers should be aware of potential re-entrancy attacks. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if `sender` is not `from` and has not been approved by `from` for `tokenId`. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event. /// @param sender The message sender. /// @param from The current token owner. /// @param to The recipient of the token transfer. /// @param tokenId The identifier of the token to transfer. function safeTransferFrom(Layout storage s, address sender, address from, address to, uint256 tokenId) internal { s.transferFrom(sender, from, to, tokenId); if (to.isContract()) { _callOnERC721Received(sender, from, to, tokenId, ""); } } /// @notice Safely transfers the ownership of a token to a recipient by a sender. /// @dev Note: This function implements {ERC721-safeTransferFrom(address,address,uint256,bytes)}. /// @dev Warning: Since a `to` contract can run arbitrary code, developers should be aware of potential re-entrancy attacks. /// @dev Resets the token approval for `tokenId`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `from` is not the owner of `tokenId`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for `tokenId`. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event. /// @param sender The message sender. /// @param from The current token owner. /// @param to The recipient of the token transfer. /// @param tokenId The identifier of the token to transfer. /// @param data Optional data to send along to a receiver contract. function safeTransferFrom(Layout storage s, address sender, address from, address to, uint256 tokenId, bytes calldata data) internal { s.transferFrom(sender, from, to, tokenId); if (to.isContract()) { _callOnERC721Received(sender, from, to, tokenId, data); } } /// @notice Unsafely transfers a batch of tokens to a recipient by a sender. /// @dev Note: This function implements {ERC721BatchTransfer-batchTransferFrom(address,address,uint256[])}. /// @dev Resets the token approval for each of `tokenIds`. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if one of `tokenIds` is not owned by `from`. /// @dev Reverts if the sender is not `from` and has not been approved by `from` for each of `tokenIds`. /// @dev Emits a {Transfer} event for each of `tokenIds`. /// @param sender The message sender. /// @param from Current tokens owner. /// @param to Address of the new token owner. /// @param tokenIds Identifiers of the tokens to transfer. function batchTransferFrom(Layout storage s, address sender, address from, address to, uint256[] calldata tokenIds) internal { require(to != address(0), "ERC721: transfer to address(0)"); bool operatable = _isOperatable(s, from, sender); uint256 length = tokenIds.length; unchecked { for (uint256 i; i != length; ++i) { uint256 tokenId = tokenIds[i]; uint256 owner = s.owners[tokenId]; require(_tokenExists(owner), "ERC721: non-existing token"); require(_tokenOwner(owner) == from, "ERC721: non-owned token"); if (!operatable) { require(_tokenHasApproval(owner) && sender == s.approvals[tokenId], "ERC721: non-approved sender"); } s.owners[tokenId] = uint256(uint160(to)); emit Transfer(from, to, tokenId); } if (from != to && length != 0) { // cannot underflow as balance is verified through ownership s.balances[from] -= length; // cannot overflow as supply cannot overflow s.balances[to] += length; } } } /// @notice Unsafely mints a token. /// @dev Note: This function implements {ERC721Mintable-mint(address,uint256)}. /// @dev Note: Either `mint` or `mintOnce` should be used in a given contract, but not both. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Emits a {Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. function mint(Layout storage s, address to, uint256 tokenId) internal { require(to != address(0), "ERC721: mint to address(0)"); require(!_tokenExists(s.owners[tokenId]), "ERC721: existing token"); s.owners[tokenId] = uint256(uint160(to)); unchecked { // cannot overflow due to the cost of minting individual tokens ++s.balances[to]; } emit Transfer(address(0), to, tokenId); } /// @notice Safely mints a token. /// @dev Note: This function implements {ERC721Mintable-safeMint(address,uint256,bytes)}. /// @dev Note: Either `safeMint` or `safeMintOnce` should be used in a given contract, but not both. /// @dev Warning: Since a `to` contract can run arbitrary code, developers should be aware of potential re-entrancy attacks. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. /// @param data Optional data to pass along to the receiver call. function safeMint(Layout storage s, address sender, address to, uint256 tokenId, bytes memory data) internal { s.mint(to, tokenId); if (to.isContract()) { _callOnERC721Received(sender, address(0), to, tokenId, data); } } /// @notice Unsafely mints a batch of tokens. /// @dev Note: This function implements {ERC721Mintable-batchMint(address,uint256[])}. /// @dev Note: Either `batchMint` or `batchMintOnce` should be used in a given contract, but not both. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Emits a {Transfer} event from the zero address for each of `tokenIds`. /// @param to Address of the new tokens owner. /// @param tokenIds Identifiers of the tokens to mint. function batchMint(Layout storage s, address to, uint256[] memory tokenIds) internal { require(to != address(0), "ERC721: mint to address(0)"); uint256 length = tokenIds.length; unchecked { for (uint256 i; i != length; ++i) { uint256 tokenId = tokenIds[i]; require(!_tokenExists(s.owners[tokenId]), "ERC721: existing token"); s.owners[tokenId] = uint256(uint160(to)); emit Transfer(address(0), to, tokenId); } s.balances[to] += length; } } /// @notice Unsafely mints tokens to multiple recipients. /// @dev Note: This function implements {ERC721Deliverable-deliver(address[],uint256[])}. /// @dev Note: Either `deliver` or `deliverOnce` should be used in a given contract, but not both. /// @dev Reverts if `recipients` and `tokenIds` have different lengths. /// @dev Reverts if one of `recipients` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Emits a {Transfer} event from the zero address for each of `recipients` and `tokenIds`. /// @param recipients Addresses of the new tokens owners. /// @param tokenIds Identifiers of the tokens to mint. function deliver(Layout storage s, address[] memory recipients, uint256[] memory tokenIds) internal { uint256 length = recipients.length; require(length == tokenIds.length, "ERC721: inconsistent arrays"); unchecked { for (uint256 i; i != length; ++i) { s.mint(recipients[i], tokenIds[i]); } } } /// @notice Unsafely mints a token once. /// @dev Note: This function implements {ERC721Mintable-mint(address,uint256)}. /// @dev Note: Either `mint` or `mintOnce` should be used in a given contract, but not both. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Reverts if `tokenId` has been previously burnt. /// @dev Emits a {Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. function mintOnce(Layout storage s, address to, uint256 tokenId) internal { require(to != address(0), "ERC721: mint to address(0)"); uint256 owner = s.owners[tokenId]; require(!_tokenExists(owner), "ERC721: existing token"); require(!_tokenWasBurnt(owner), "ERC721: burnt token"); s.owners[tokenId] = uint256(uint160(to)); unchecked { // cannot overflow due to the cost of minting individual tokens ++s.balances[to]; } emit Transfer(address(0), to, tokenId); } /// @notice Safely mints a token once. /// @dev Note: This function implements {ERC721Mintable-safeMint(address,uint256,bytes)}. /// @dev Note: Either `safeMint` or `safeMintOnce` should be used in a given contract, but not both. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if `tokenId` already exists. /// @dev Reverts if `tokenId` has been previously burnt. /// @dev Reverts if `to` is a contract and the call to {IERC721Receiver-onERC721Received} fails, reverts or is rejected. /// @dev Emits a {Transfer} event from the zero address. /// @param to Address of the new token owner. /// @param tokenId Identifier of the token to mint. /// @param data Optional data to pass along to the receiver call. function safeMintOnce(Layout storage s, address sender, address to, uint256 tokenId, bytes memory data) internal { s.mintOnce(to, tokenId); if (to.isContract()) { _callOnERC721Received(sender, address(0), to, tokenId, data); } } /// @notice Unsafely mints a batch of tokens once. /// @dev Note: This function implements {ERC721Mintable-batchMint(address,uint256[])}. /// @dev Note: Either `batchMint` or `batchMintOnce` should be used in a given contract, but not both. /// @dev Reverts if `to` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Reverts if one of `tokenIds` has been previously burnt. /// @dev Emits a {Transfer} event from the zero address for each of `tokenIds`. /// @param to Address of the new tokens owner. /// @param tokenIds Identifiers of the tokens to mint. function batchMintOnce(Layout storage s, address to, uint256[] memory tokenIds) internal { require(to != address(0), "ERC721: mint to address(0)"); uint256 length = tokenIds.length; unchecked { for (uint256 i; i != length; ++i) { uint256 tokenId = tokenIds[i]; uint256 owner = s.owners[tokenId]; require(!_tokenExists(owner), "ERC721: existing token"); require(!_tokenWasBurnt(owner), "ERC721: burnt token"); s.owners[tokenId] = uint256(uint160(to)); emit Transfer(address(0), to, tokenId); } s.balances[to] += length; } } /// @notice Unsafely mints tokens to multiple recipients once. /// @dev Note: This function implements {ERC721Deliverable-deliver(address[],uint256[])}. /// @dev Note: Either `deliver` or `deliverOnce` should be used in a given contract, but not both. /// @dev Reverts if `recipients` and `tokenIds` have different lengths. /// @dev Reverts if one of `recipients` is the zero address. /// @dev Reverts if one of `tokenIds` already exists. /// @dev Reverts if one of `tokenIds` has been previously burnt. /// @dev Emits a {Transfer} event from the zero address for each of `recipients` and `tokenIds`. /// @param recipients Addresses of the new tokens owners. /// @param tokenIds Identifiers of the tokens to mint. function deliverOnce(Layout storage s, address[] memory recipients, uint256[] memory tokenIds) internal { uint256 length = recipients.length; require(length == tokenIds.length, "ERC721: inconsistent arrays"); unchecked { for (uint256 i; i != length; ++i) { address to = recipients[i]; require(to != address(0), "ERC721: mint to address(0)"); uint256 tokenId = tokenIds[i]; uint256 owner = s.owners[tokenId]; require(!_tokenExists(owner), "ERC721: existing token"); require(!_tokenWasBurnt(owner), "ERC721: burnt token"); s.owners[tokenId] = uint256(uint160(to)); ++s.balances[to]; emit Transfer(address(0), to, tokenId); } } } /// @notice Burns a token by a sender. /// @dev Note: This function implements {ERC721Burnable-burnFrom(address,uint256)}. /// @dev Reverts if `tokenId` is not owned by `from`. /// @dev Reverts if `sender` is not `from` and has not been approved by `from` for `tokenId`. /// @dev Emits a {Transfer} event with `to` set to the zero address. /// @param sender The message sender. /// @param from The current token owner. /// @param tokenId The identifier of the token to burn. function burnFrom(Layout storage s, address sender, address from, uint256 tokenId) internal { uint256 owner = s.owners[tokenId]; require(from == _tokenOwner(owner), "ERC721: non-owned token"); if (!_isOperatable(s, from, sender)) { require(_tokenHasApproval(owner) && sender == s.approvals[tokenId], "ERC721: non-approved sender"); } s.owners[tokenId] = BURNT_TOKEN_OWNER_VALUE; unchecked { // cannot underflow as balance is verified through TOKEN ownership --s.balances[from]; } emit Transfer(from, address(0), tokenId); } /// @notice Burns a batch of tokens by a sender. /// @dev Note: This function implements {ERC721Burnable-batchBurnFrom(address,uint256[])}. /// @dev Reverts if one of `tokenIds` is not owned by `from`. /// @dev Reverts if `sender` is not `from` and has not been approved by `from` for each of `tokenIds`. /// @dev Emits a {Transfer} event with `to` set to the zero address for each of `tokenIds`. /// @param sender The message sender. /// @param from The current tokens owner. /// @param tokenIds The identifiers of the tokens to burn. function batchBurnFrom(Layout storage s, address sender, address from, uint256[] calldata tokenIds) internal { bool operatable = _isOperatable(s, from, sender); uint256 length = tokenIds.length; unchecked { for (uint256 i; i != length; ++i) { uint256 tokenId = tokenIds[i]; uint256 owner = s.owners[tokenId]; require(from == _tokenOwner(owner), "ERC721: non-owned token"); if (!operatable) { require(_tokenHasApproval(owner) && sender == s.approvals[tokenId], "ERC721: non-approved sender"); } s.owners[tokenId] = BURNT_TOKEN_OWNER_VALUE; emit Transfer(from, address(0), tokenId); } if (length != 0) { s.balances[from] -= length; } } } /// @notice Gets the balance of an address. /// @dev Note: This function implements {ERC721-balanceOf(address)}. /// @dev Reverts if `owner` is the zero address. /// @param owner The address to query the balance of. /// @return balance The amount owned by the owner. function balanceOf(Layout storage s, address owner) internal view returns (uint256 balance) { require(owner != address(0), "ERC721: balance of address(0)"); return s.balances[owner]; } /// @notice Gets the owner of a token. /// @dev Note: This function implements {ERC721-ownerOf(uint256)}. /// @dev Reverts if `tokenId` does not exist. /// @param tokenId The token identifier to query the owner of. /// @return tokenOwner The owner of the token. function ownerOf(Layout storage s, uint256 tokenId) internal view returns (address tokenOwner) { uint256 owner = s.owners[tokenId]; require(_tokenExists(owner), "ERC721: non-existing token"); return _tokenOwner(owner); } /// @notice Gets the approved address for a token. /// @dev Note: This function implements {ERC721-getApproved(uint256)}. /// @dev Reverts if `tokenId` does not exist. /// @param tokenId The token identifier to query the approval of. /// @return approved The approved address for the token identifier, or the zero address if no approval is set. function getApproved(Layout storage s, uint256 tokenId) internal view returns (address approved) { uint256 owner = s.owners[tokenId]; require(_tokenExists(owner), "ERC721: non-existing token"); if (_tokenHasApproval(owner)) { return s.approvals[tokenId]; } else { return address(0); } } /// @notice Gets whether an operator is approved for all tokens by an owner. /// @dev Note: This function implements {ERC721-isApprovedForAll(address,address)}. /// @param owner The address which gives the approval for all tokens. /// @param operator The address which receives the approval for all tokens. /// @return approvedForAll Whether the operator is approved for all tokens by the owner. function isApprovedForAll(Layout storage s, address owner, address operator) internal view returns (bool approvedForAll) { return s.operators[owner][operator]; } /// @notice Gets whether a token was burnt. /// @param tokenId The token identifier. /// @return tokenWasBurnt Whether the token was burnt. function wasBurnt(Layout storage s, uint256 tokenId) internal view returns (bool tokenWasBurnt) { return _tokenWasBurnt(s.owners[tokenId]); } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } /// @notice Calls {IERC721Receiver-onERC721Received} on a target contract. /// @dev Reverts if the call to the target fails, reverts or is rejected. /// @param sender The message sender. /// @param from Previous token owner. /// @param to New token owner. /// @param tokenId Identifier of the token transferred. /// @param data Optional data to send along with the receiver contract call. function _callOnERC721Received(address sender, address from, address to, uint256 tokenId, bytes memory data) private { require(IERC721Receiver(to).onERC721Received(sender, from, tokenId, data) == ERC721_RECEIVED, "ERC721: safe transfer rejected"); } /// @notice Returns whether an account is authorised to make a transfer on behalf of an owner. /// @param owner The token owner. /// @param account The account to check the operatability of. /// @return operatable True if `account` is `owner` or is an operator for `owner`, false otherwise. function _isOperatable(Layout storage s, address owner, address account) private view returns (bool operatable) { return (owner == account) || s.operators[owner][account]; } function _tokenOwner(uint256 owner) private pure returns (address tokenOwner) { return address(uint160(owner)); } function _tokenExists(uint256 owner) private pure returns (bool tokenExists) { return uint160(owner) != 0; } function _tokenWasBurnt(uint256 owner) private pure returns (bool tokenWasBurnt) { return owner == BURNT_TOKEN_OWNER_VALUE; } function _tokenHasApproval(uint256 owner) private pure returns (bool tokenHasApproval) { return owner & TOKEN_APPROVAL_OWNER_FLAG != 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ProxyInitialization} from "./../../../proxy/libraries/ProxyInitialization.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; library TokenMetadataWithBaseURIStorage { using TokenMetadataWithBaseURIStorage for TokenMetadataWithBaseURIStorage.Layout; using Strings for uint256; struct Layout { string baseURI; } bytes32 public constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.token.metadata.TokenMetadataWithBaseURI.storage")) - 1); event BaseMetadataURISet(string baseMetadataURI); /// @notice Sets the base metadata URI. /// @dev Emits a {BaseMetadataURISet} event. /// @param baseURI The base metadata URI. function setBaseMetadataURI(Layout storage s, string calldata baseURI) internal { s.baseURI = baseURI; emit BaseMetadataURISet(baseURI); } /// @notice Gets the base metadata URI. /// @return baseURI The base metadata URI. function baseMetadataURI(Layout storage s) internal view returns (string memory baseURI) { return s.baseURI; } /// @notice Gets the token metadata URI for a token as the concatenation of the base metadata URI and the token identfier. /// @param id The token identifier. /// @return tokenURI The token metadata URI as the concatenation of the base metadata URI and the token identfier. function tokenMetadataURI(Layout storage s, uint256 id) internal view returns (string memory tokenURI) { return string(abi.encodePacked(s.baseURI, id.toString())); } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {ERC2981Storage} from "./libraries/ERC2981Storage.sol"; import {ERC2981Base} from "./base/ERC2981Base.sol"; import {ContractOwnership} from "./../../access/ContractOwnership.sol"; /// @title ERC2981 NFT Royalty Standard (immutable version). /// @dev This contract is to be used via inheritance in an immutable (non-proxied) implementation. abstract contract ERC2981 is ERC2981Base, ContractOwnership { /// @notice Marks the following ERC165 interface(s) as supported: ERC2981. constructor() { ERC2981Storage.init(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC2981} from "./../interfaces/IERC2981.sol"; import {ERC2981Storage} from "./../libraries/ERC2981Storage.sol"; import {ContractOwnershipStorage} from "./../../../access/libraries/ContractOwnershipStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title ERC2981 NFT Royalty Standard (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC165 (Interface Detection Standard). /// @dev Note: This contract requires ERC173 (Contract Ownership standard). abstract contract ERC2981Base is Context, IERC2981 { using ERC2981Storage for ERC2981Storage.Layout; using ContractOwnershipStorage for ContractOwnershipStorage.Layout; uint256 public constant ROYALTY_FEE_DENOMINATOR = ERC2981Storage.ROYALTY_FEE_DENOMINATOR; /// @notice Sets the royalty percentage. /// @dev Reverts if the sender is not the contract owner. /// @dev Reverts with IncorrectRoyaltyPercentage if `percentage` is above 100% (> FEE_DENOMINATOR). /// @param percentage The new percentage to set. For example 50000 sets 50% royalty. function setRoyaltyPercentage(uint256 percentage) external { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); ERC2981Storage.layout().setRoyaltyPercentage(percentage); } /// @notice Sets the royalty receiver. /// @dev Reverts if the sender is not the contract owner. /// @dev Reverts with IncorrectRoyaltyReceiver if `receiver` is the zero address. /// @param receiver The new receiver to set. function setRoyaltyReceiver(address receiver) external { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); ERC2981Storage.layout().setRoyaltyReceiver(receiver); } /// @inheritdoc IERC2981 function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { return ERC2981Storage.layout().royaltyInfo(tokenId, salePrice); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IOperatorFilterRegistry} from "./../interfaces/IOperatorFilterRegistry.sol"; import {OperatorFiltererStorage} from "./../libraries/OperatorFiltererStorage.sol"; import {ContractOwnershipStorage} from "./../../../access/libraries/ContractOwnershipStorage.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; /// @title Operator Filterer for token contracts (proxiable version). /// @dev This contract is to be used via inheritance in a proxied implementation. /// @dev Note: This contract requires ERC173 (Contract Ownership standard). abstract contract OperatorFiltererBase is Context { using OperatorFiltererStorage for OperatorFiltererStorage.Layout; using ContractOwnershipStorage for ContractOwnershipStorage.Layout; /// @notice Updates the address that the contract will make OperatorFilter checks against. /// @dev Reverts if the sender is not the contract owner. /// @param registry The new operator filter registry address. When set to the zero address, checks will be bypassed. function updateOperatorFilterRegistry(IOperatorFilterRegistry registry) external { ContractOwnershipStorage.layout().enforceIsContractOwner(_msgSender()); OperatorFiltererStorage.layout().updateOperatorFilterRegistry(registry); } /// @notice Gets the operator filter registry address. function operatorFilterRegistry() external view returns (IOperatorFilterRegistry) { return OperatorFiltererStorage.layout().operatorFilterRegistry(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC2981 NFT Royalty Standard. /// @dev See https://eips.ethereum.org/EIPS/eip-2981 /// @dev Note: The ERC-165 identifier for this interface is 0x2a55205a. interface IERC2981 { /// @notice Called with the sale price to determine how much royalty is owed and to whom. /// @param tokenId The NFT asset queried for royalty information /// @param salePrice The sale price of the NFT asset specified by `tokenId` /// @return receiver Address of who should be sent the royalty payment /// @return royaltyAmount The royalty payment amount for `salePrice` function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC2981} from "./../interfaces/IERC2981.sol"; import {InterfaceDetectionStorage} from "./../../../introspection/libraries/InterfaceDetectionStorage.sol"; library ERC2981Storage { using ERC2981Storage for ERC2981Storage.Layout; using InterfaceDetectionStorage for InterfaceDetectionStorage.Layout; struct Layout { address royaltyReceiver; uint96 royaltyPercentage; } bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.token.royalty.ERC2981.storage")) - 1); uint256 internal constant ROYALTY_FEE_DENOMINATOR = 100000; error IncorrectRoyaltyPercentage(uint256 percentage); error IncorrectRoyaltyReceiver(); /// @notice Marks the following ERC165 interface(s) as supported: ERC2981. function init() internal { InterfaceDetectionStorage.layout().setSupportedInterface(type(IERC2981).interfaceId, true); } /// @notice Sets the royalty percentage. /// @dev Reverts with IncorrectRoyaltyPercentage if `percentage` is above 100% (> FEE_DENOMINATOR). /// @param percentage The new percentage to set. For example 50000 sets 50% royalty. function setRoyaltyPercentage(Layout storage s, uint256 percentage) internal { if (percentage > ROYALTY_FEE_DENOMINATOR) { revert IncorrectRoyaltyPercentage(percentage); } s.royaltyPercentage = uint96(percentage); } /// @notice Sets the royalty receiver. /// @dev Reverts with IncorrectRoyaltyReceiver if `receiver` is the zero address. /// @param receiver The new receiver to set. function setRoyaltyReceiver(Layout storage s, address receiver) internal { if (receiver == address(0)) { revert IncorrectRoyaltyReceiver(); } s.royaltyReceiver = receiver; } /// @notice Called with the sale price to determine how much royalty is owed and to whom. // / @param tokenId The NFT asset queried for royalty information /// @param salePrice The sale price of the NFT asset specified by `tokenId` /// @return receiver Address of who should be sent the royalty payment /// @return royaltyAmount The royalty payment amount for `salePrice` function royaltyInfo(Layout storage s, uint256, uint256 salePrice) internal view returns (address receiver, uint256 royaltyAmount) { receiver = s.royaltyReceiver; uint256 royaltyPercentage = s.royaltyPercentage; if (salePrice == 0 || royaltyPercentage == 0) { royaltyAmount = 0; } else { if (salePrice < ROYALTY_FEE_DENOMINATOR) { royaltyAmount = (salePrice * royaltyPercentage) / ROYALTY_FEE_DENOMINATOR; } else { royaltyAmount = (salePrice / ROYALTY_FEE_DENOMINATOR) * royaltyPercentage; } } } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IOperatorFilterRegistry} from "./../interfaces/IOperatorFilterRegistry.sol"; import {ProxyInitialization} from "./../../../proxy/libraries/ProxyInitialization.sol"; library OperatorFiltererStorage { using OperatorFiltererStorage for OperatorFiltererStorage.Layout; struct Layout { IOperatorFilterRegistry registry; } bytes32 internal constant PROXY_INIT_PHASE_SLOT = bytes32(uint256(keccak256("animoca.token.royalty.OperatorFilterer.phase")) - 1); bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak256("animoca.token.royalty.OperatorFilterer.storage")) - 1); error OperatorNotAllowed(address operator); /// @notice Sets the address that the contract will make OperatorFilter checks against. /// @dev Note: This function should be called ONLY in the constructor of an immutable (non-proxied) contract. /// @param registry The operator filter registry address. When set to the zero address, checks will be bypassed. function constructorInit(Layout storage s, IOperatorFilterRegistry registry) internal { s.registry = registry; } /// @notice Sets the address that the contract will make OperatorFilter checks against. /// @dev Note: This function should be called ONLY in the init function of a proxied contract. /// @dev Reverts if the proxy initialization phase is set to `1` or above. /// @param registry The operator filter registry address. When set to the zero address, checks will be bypassed. function proxyInit(Layout storage s, IOperatorFilterRegistry registry) internal { ProxyInitialization.setPhase(PROXY_INIT_PHASE_SLOT, 1); s.constructorInit(registry); } /// @notice Updates the address that the contract will make OperatorFilter checks against. /// @param registry The new operator filter registry address. When set to the zero address, checks will be bypassed. function updateOperatorFilterRegistry(Layout storage s, IOperatorFilterRegistry registry) internal { s.registry = registry; } /// @dev Reverts with OperatorNotAllowed if `sender` is not `from` and is not allowed by a valid operator registry. function requireAllowedOperatorForTransfer(Layout storage s, address sender, address from) internal view { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred from an EOA. if (sender != from) { _checkFilterOperator(s, sender); } } /// @dev Reverts with OperatorNotAllowed if `sender` is not allowed by a valid operator registry. function requireAllowedOperatorForApproval(Layout storage s, address operator) internal view { _checkFilterOperator(s, operator); } function operatorFilterRegistry(Layout storage s) internal view returns (IOperatorFilterRegistry) { return s.registry; } function layout() internal pure returns (Layout storage s) { bytes32 position = LAYOUT_STORAGE_SLOT; assembly { s.slot := position } } function _checkFilterOperator(Layout storage s, address operator) private view { IOperatorFilterRegistry registry = s.registry; // Check registry code length to facilitate testing in environments without a deployed registry. if (address(registry) != address(0) && address(registry).code.length > 0) { if (!registry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library Bytes32 { /// @notice Converts bytes32 to base32 string. /// @param value value to convert. /// @return the converted base32 string. function toBase32String(bytes32 value) internal pure returns (string memory) { unchecked { bytes32 base32Alphabet = 0x6162636465666768696A6B6C6D6E6F707172737475767778797A323334353637; uint256 i = uint256(value); uint256 k = 52; bytes memory bstr = new bytes(k); bstr[--k] = base32Alphabet[uint8((i % 8) << 2)]; // uint8 s = uint8((256 - skip) % 5); // (i % (2**s)) << (5-s) i /= 8; while (k > 0) { bstr[--k] = base32Alphabet[i % 32]; i /= 32; } return string(bstr); } } /// @notice Converts a bytes32 value to an ASCII string, trimming the tailing zeros. /// @param value value to convert. /// @return the converted ASCII string. function toASCIIString(bytes32 value) internal pure returns (string memory) { unchecked { if (value == 0x00) return ""; bytes memory bytesString = bytes(abi.encodePacked(value)); uint256 pos = 31; while (true) { if (bytesString[pos] != 0) break; --pos; } bytes memory asciiString = new bytes(pos + 1); for (uint256 i; i <= pos; ++i) { asciiString[i] = bytesString[i]; } return string(asciiString); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 StorageSlot { 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/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IOperatorFilterRegistry} from "@animoca/ethereum-contracts/contracts/token/royalty/interfaces/IOperatorFilterRegistry.sol"; import {IForwarderRegistry} from "@animoca/ethereum-contracts/contracts/metatx/interfaces/IForwarderRegistry.sol"; import {ERC721WithOperatorFilterer} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721WithOperatorFilterer.sol"; // solhint-disable-next-line max-line-length import {ERC721BatchTransferWithOperatorFilterer} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721BatchTransferWithOperatorFilterer.sol"; import {ERC721MetadataWithBaseURI} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721MetadataWithBaseURI.sol"; import {ERC721Mintable} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721Mintable.sol"; import {ERC721Deliverable} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721Deliverable.sol"; import {ERC721Burnable} from "@animoca/ethereum-contracts/contracts/token/ERC721/ERC721Burnable.sol"; import {ERC2981} from "@animoca/ethereum-contracts/contracts/token/royalty/ERC2981.sol"; import {TokenRecovery} from "@animoca/ethereum-contracts/contracts/security/TokenRecovery.sol"; import {ContractOwnership} from "@animoca/ethereum-contracts/contracts/access/ContractOwnership.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import {ForwarderRegistryContextBase} from "@animoca/ethereum-contracts/contracts/metatx/base/ForwarderRegistryContextBase.sol"; import {ForwarderRegistryContext} from "@animoca/ethereum-contracts/contracts/metatx/ForwarderRegistryContext.sol"; contract REVVRacingNFT is ERC721WithOperatorFilterer, ERC721BatchTransferWithOperatorFilterer, ERC721MetadataWithBaseURI, ERC721Burnable, ERC721Mintable, ERC721Deliverable, ERC2981, TokenRecovery, ForwarderRegistryContext { constructor( IOperatorFilterRegistry filterRegistry, IForwarderRegistry forwarderRegistry ) ERC721WithOperatorFilterer(filterRegistry) ERC721MetadataWithBaseURI("REVV Racing NFT", "RR") ContractOwnership(msg.sender) ForwarderRegistryContext(forwarderRegistry) {} /// @inheritdoc ForwarderRegistryContextBase function _msgSender() internal view virtual override(Context, ForwarderRegistryContextBase) returns (address) { return ForwarderRegistryContextBase._msgSender(); } /// @inheritdoc ForwarderRegistryContextBase function _msgData() internal view virtual override(Context, ForwarderRegistryContextBase) returns (bytes calldata) { return ForwarderRegistryContextBase._msgData(); } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 99999 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IOperatorFilterRegistry","name":"filterRegistry","type":"address"},{"internalType":"contract IForwarderRegistry","name":"forwarderRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"IncorrectRoyaltyPercentage","type":"error"},{"inputs":[],"name":"IncorrectRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":false,"internalType":"string","name":"baseMetadataURI","type":"string"}],"name":"BaseMetadataURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROYALTY_FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseMetadataURI","outputs":[{"internalType":"string","name":"baseURI","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"deliver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"forwarderRegistry","outputs":[{"internalType":"contract IForwarderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"approved","type":"address"}],"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":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"approvedForAll","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"tokenName","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"tokenOwner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"recoverERC20s","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"contract IERC721[]","name":"contracts","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"recoverERC721s","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"recoverETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"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":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","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":"string","name":"baseURI","type":"string"}],"name":"setBaseMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setRoyaltyPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"tokenSymbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IOperatorFilterRegistry","name":"registry","type":"address"}],"name":"updateOperatorFilterRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b50604051620052be380380620052be8339810160408190526200003491620004d9565b80806040518060400160405280600f81526020016e1491559588149858da5b99c8139195608a1b81525060405180604001604052806002815260200161292960f11b8152508533620000a981620000956200019f60201b6200109d1760201c565b620001d560201b620010cb1790919060201c565b50620000bf6200026860201b620011881760201c565b620000ed81620000d96200028d60201b620011b81760201c565b620002bd60201b620011e61790919060201c565b5062000103620002da60201b620012281760201c565b6200013382826200011e620002fd60201b620012561760201c565b6200032d60201b62001284179092919060201c565b50506200014a6200037460201b620012cd1760201c565b6200015f6200039760201b620012fb1760201c565b62000174620003ba60201b620013291760201c565b62000189620003dd60201b620013571760201c565b6001600160a01b031660805250620006aa915050565b600080620001cf60017fc9ed16f33ab3a66c84bfd83099ccb2a8845871e2e1c1928f63797152f0fd54cd62000518565b92915050565b6001600160a01b038116156200022c5781546001600160a01b0319166001600160a01b03821690811783556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35b620002646307f5828d60e41b60016200024f6200040060201b620013811760201c565b6200043060201b620013af179092919060201c565b5050565b6200028b6380ac58cd60e01b60016200024f6200040060201b620013811760201c565b565b600080620001cf60017f609b85bcafa81ecfaf3ff62cdde2c6c9082a68dbe4922f07399c706bdeb7cd3162000518565b81546001600160a01b0319166001600160a01b0391909116179055565b6200028b63f3993d1160e01b60016200024f6200040060201b620013811760201c565b600080620001cf60017f9c4269c0f9f430d98876ffe9767fbf3f3232ea91a549beb549e5329532520eb362000518565b826200033a8382620005de565b50600183016200034b8282620005de565b506200036f635b5e139f60e01b60016200024f6200040060201b620013811760201c565b505050565b6200028b638b8b4ef560e01b60016200024f6200040060201b620013811760201c565b6200028b638e773e1360e01b60016200024f6200040060201b620013811760201c565b6200028b634ed2f41960e11b60016200024f6200040060201b620013811760201c565b6200028b63152a902d60e11b60016200024f6200040060201b620013811760201c565b600080620001cf60017fca9d3e17f264b0f3984e2634e94adb37fa3e6a8103f06aeae6fa59e21c769f5e62000518565b600160e01b6001600160e01b0319831601620004925760405162461bcd60e51b815260206004820152601f60248201527f496e74657266616365446574656374696f6e3a2077726f6e672076616c756500604482015260640160405180910390fd5b6001600160e01b03199190911660009081526020929092526040909120805460ff1916911515919091179055565b6001600160a01b0381168114620004d657600080fd5b50565b60008060408385031215620004ed57600080fd5b8251620004fa81620004c0565b60208401519092506200050d81620004c0565b809150509250929050565b81810381811115620001cf57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200056557607f821691505b6020821081036200058657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200036f57600081815260208120601f850160051c81016020861015620005b55750805b601f850160051c820191505b81811015620005d657828155600101620005c1565b505050505050565b81516001600160401b03811115620005fa57620005fa6200053a565b62000612816200060b845462000550565b846200058c565b602080601f8311600181146200064a5760008415620006315750858301515b600019600386901b1c1916600185901b178555620005d6565b600085815260208120601f198616915b828110156200067b578886015182559484019460019091019084016200065a565b50858210156200069a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051614be3620006db600039600081816103be0152818161043e0152818161378001526138080152614be36000f3fe608060405234801561001057600080fd5b50600436106102c85760003560e01c80638832e6e31161017b578063c3666c36116100d8578063e985e9c51161008c578063f2fde38b11610071578063f2fde38b14610630578063f3993d1114610643578063f7ba94bd1461065657600080fd5b8063e985e9c51461060a578063f24729651461061d57600080fd5b8063d5391393116100bd578063d5391393146105c6578063d547741f146105ed578063e1a8bf2c1461060057600080fd5b8063c3666c36146105a0578063c87b56dd146105b357600080fd5b806395d89b411161012f578063a22cb46511610114578063a22cb46514610572578063b0ccc31e14610585578063b88d4fde1461058d57600080fd5b806395d89b41146105575780639da5e8321461055f57600080fd5b80638da5cb5b116101605780638da5cb5b146105295780638dc251e31461053157806391d148541461054457600080fd5b80638832e6e3146105035780638bb9c5bf1461051657600080fd5b806342842e0e116102295780636352211e116101dd57806373c8a958116101c257806373c8a958146104ca57806379cc6790146104dd5780637e518ec8146104f057600080fd5b80636352211e1461049657806370a08231146104a957600080fd5b8063572b6c051161020e578063572b6c051461042e5780635b2bd79e1461047b57806361ba27da1461048357600080fd5b806342842e0e146104085780634684d7e91461041b57600080fd5b806323b872dd116102805780632b4c9f16116102655780632b4c9f16146103bc5780632f2ff15d146103e257806340c10f19146103f557600080fd5b806323b872dd1461036a5780632a55205a1461037d57600080fd5b8063081812fc116102b1578063081812fc1461030a578063095ea7b314610342578063114ba8ee1461035757600080fd5b806301ffc9a7146102cd57806306fdde03146102f5575b600080fd5b6102e06102db366004614092565b610669565b60405190151581526020015b60405180910390f35b6102fd610683565b6040516102ec919061411d565b61031d610318366004614130565b61069a565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102ec565b61035561035036600461416b565b6106ae565b005b610355610365366004614197565b6106fd565b6103556103783660046141b4565b610768565b61039061038b3660046141f5565b6107a6565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016102ec565b7f000000000000000000000000000000000000000000000000000000000000000061031d565b6103556103f0366004614217565b6107c9565b61035561040336600461416b565b6107fc565b6103556104163660046141b4565b61084b565b61035561042936600461428c565b61087c565b6102e061043c366004614197565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102fd6108f0565b610355610491366004614130565b6108fd565b61031d6104a4366004614130565b61091a565b6104bc6104b7366004614197565b61092e565b6040519081526020016102ec565b6103556104d83660046142e1565b610942565b6103556104eb36600461416b565b610a6a565b6103556104fe3660046143bd565b610a87565b6103556105113660046143ff565b610aa6565b610355610524366004614130565b610b28565b61031d610b43565b61035561053f366004614197565b610b6a565b6102e0610552366004614217565b610b87565b6102fd610bd2565b61035561056d36600461445b565b610be4565b6103556105803660046144c9565b610c88565b61031d610cb7565b61035561059b3660046144f7565b610cc4565b6103556105ae3660046142e1565b610d01565b6102fd6105c1366004614130565b610ea6565b6104bc7f6d696e746572000000000000000000000000000000000000000000000000000081565b6103556105fb366004614217565b610ec7565b6104bc620186a081565b6102e061061836600461456a565b610ef5565b61035561062b36600461428c565b610f43565b61035561063e366004614197565b610f62565b610355610651366004614598565b610f7d565b61035561066436600461445b565b610fb7565b600061067d82610677611381565b906114bb565b92915050565b6060610695610690611256565b611595565b905090565b600061067d826106a861162b565b90611659565b73ffffffffffffffffffffffffffffffffffffffff8216156106dc576106dc826106d66111b8565b9061173a565b6106f96106e7611744565b83836106f161162b565b92919061174e565b5050565b610716610708611744565b61071061109d565b90611a17565b610765816107226111b8565b9081547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff91909116179055565b50565b6000610772611744565b905061078881856107816111b8565b9190611a9a565b6107a08185858561079761162b565b93929190611ad7565b50505050565b6000806107bd84846107b6611e2c565b9190611e5a565b915091505b9250929050565b60006107d3611744565b90506107e18161071061109d565b6107f78383836107ef611f04565b929190611f32565b505050565b6108377f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b610830611f04565b9190612008565b6106f9828261084461162b565b91906120b4565b6000610855611744565b905061086481856107816111b8565b6107a08185858561087361162b565b9392919061222b565b6108a87f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107f7838383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108e9925061162b915050565b9190612271565b6060610695610690612445565b610908610708611744565b61076581610914611e2c565b90612473565b600061067d8261092861162b565b906124f9565b600061067d8261093c61162b565b9061258f565b61094d610708611744565b84838114801561095c57508082145b6109c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064015b60405180910390fd5b60005b818114610a6057610a588888838181106109e6576109e66145f1565b90506020020160208101906109fb9190614197565b858584818110610a0d57610a0d6145f1565b90506020020135888885818110610a2657610a266145f1565b9050602002016020810190610a3b9190614197565b73ffffffffffffffffffffffffffffffffffffffff16919061263b565b6001016109ca565b5050505050505050565b6106f9610a75611744565b8383610a7f61162b565b9291906126c8565b610a92610708611744565b6106f98282610a9f612445565b91906128dc565b610ad27f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107a0610add611744565b858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b1f925061162b915050565b93929190612927565b610765610b33611744565b82610b3c611f04565b919061295d565b6000610695610b5061109d565b5473ffffffffffffffffffffffffffffffffffffffff1690565b610b75610708611744565b61076581610b81611e2c565b906129f9565b6000610bcb8383610b96611f04565b60009283526020908152604080842073ffffffffffffffffffffffffffffffffffffffff909316845291905290205460ff1690565b9392505050565b6060610695610bdf611256565b612a46565b610c107f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107a084848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250610c81925061162b915050565b9190612a57565b8015610c9a57610c9a826106d66111b8565b6106f9610ca5611744565b8383610caf61162b565b929190612b1c565b6000610695610b506111b8565b6000610cce611744565b9050610cdd81876107816111b8565b610cf9818787878787610cee61162b565b959493929190612c4c565b505050505050565b610d0c610708611744565b848381148015610d1b57508082145b610d81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064016109be565b60005b818114610a6057858582818110610d9d57610d9d6145f1565b9050602002016020810190610db29190614197565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd308a8a85818110610de057610de06145f1565b9050602002016020810190610df59190614197565b878786818110610e0757610e076145f1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610e8357600080fd5b505af1158015610e97573d6000803e3d6000fd5b50505050806001019050610d84565b6060610eb48261092861162b565b5061067d82610ec1612445565b90612cc2565b6000610ed1611744565b9050610edf8161071061109d565b6107f7838383610eed611f04565b929190612cf6565b6000610bcb8383610f0461162b565b919073ffffffffffffffffffffffffffffffffffffffff9182166000908152600393909301602090815260408085209290931684525290205460ff1690565b6107f7610f4e611744565b848484610f5961162b565b93929190612dc0565b610765610f6d611744565b82610f7661109d565b9190613015565b6000610f87611744565b9050610f9681866107816111b8565b610fb08186868686610fa661162b565b9493929190613141565b5050505050565b610fc2610708611744565b8281811461102c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064016109be565b60005b818114610cf95761109584848381811061104b5761104b6145f1565b90506020020135878784818110611064576110646145f1565b90506020020160208101906110799190614197565b73ffffffffffffffffffffffffffffffffffffffff16906134bc565b60010161102f565b60008061067d60017fc9ed16f33ab3a66c84bfd83099ccb2a8845871e2e1c1928f63797152f0fd54cd61464f565b73ffffffffffffffffffffffffffffffffffffffff8116156111535781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff821690811783556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35b6106f97f7f5828d0000000000000000000000000000000000000000000000000000000006001611181611381565b91906113af565b6111b67f80ac58cd000000000000000000000000000000000000000000000000000000006001611181611381565b565b60008061067d60017f609b85bcafa81ecfaf3ff62cdde2c6c9082a68dbe4922f07399c706bdeb7cd3161464f565b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff91909116179055565b6111b67ff3993d11000000000000000000000000000000000000000000000000000000006001611181611381565b60008061067d60017f9c4269c0f9f430d98876ffe9767fbf3f3232ea91a549beb549e5329532520eb361464f565b8261128f838261472a565b506001830161129e828261472a565b506107f77f5b5e139f000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f8b8b4ef5000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f8e773e13000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f9da5e832000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f2a55205a0000000000000000000000000000000000000000000000000000000060016111815b60008061067d60017fca9d3e17f264b0f3984e2634e94adb37fa3e6a8103f06aeae6fa59e21c769f5e61464f565b7c01000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831601611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e74657266616365446574656374696f6e3a2077726f6e672076616c75650060448201526064016109be565b7fffffffff00000000000000000000000000000000000000000000000000000000919091166000908152602092909252604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60007c01000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083160161150b5750600061067d565b7ffe003659000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083160161155c5750600161067d565b507fffffffff00000000000000000000000000000000000000000000000000000000166000908152602091909152604090205460ff1690565b60608160000180546115a690614691565b80601f01602080910402602001604051908101604052809291908181526020018280546115d290614691565b801561161f5780601f106115f45761010080835404028352916020019161161f565b820191906000526020600020905b81548152906001019060200180831161160257829003601f168201915b50505050509050919050565b60008061067d60017fddf3ee18ae6d688373c219468f8be446e7ae82215f4779d821c7ea5e8c13c0c161464f565b60008181526020839052604081205473ffffffffffffffffffffffffffffffffffffffff81166116e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b74010000000000000000000000000000000000000000811615611730575050600081815260028301602052604090205473ffffffffffffffffffffffffffffffffffffffff1661067d565b600091505061067d565b6106f98282613616565b600061069561373d565b60008181526020859052604090205473ffffffffffffffffffffffffffffffffffffffff81166117da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b8073ffffffffffffffffffffffffffffffffffffffff8082169085160361185d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732313a2073656c662d617070726f76616c000000000000000000000060448201526064016109be565b611868868287613884565b6118ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff8416611933577401000000000000000000000000000000000000000082161561192e57600083815260208790526040902073ffffffffffffffffffffffffffffffffffffffff821690555b6119b4565b7401000000000000000000000000000000000000000082178083146119645760008481526020889052604090208190555b506000838152600287016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86161790555b828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050505050565b815473ffffffffffffffffffffffffffffffffffffffff8281169116146106f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f776e6572736869703a206e6f7420746865206f776e6572000000000000000060448201526064016109be565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146107f7576107f78383613616565b73ffffffffffffffffffffffffffffffffffffffff8216611b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a207472616e7366657220746f2061646472657373283029000060448201526064016109be565b60008181526020869052604090205473ffffffffffffffffffffffffffffffffffffffff8116611be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff84168173ffffffffffffffffffffffffffffffffffffffff1614611c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b611c80868587613884565b611d385774010000000000000000000000000000000000000000811615158015611cd25750600082815260028701602052604090205473ffffffffffffffffffffffffffffffffffffffff8681169116145b611d38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208790526040902073ffffffffffffffffffffffffffffffffffffffff80851691829055851614611dc95773ffffffffffffffffffffffffffffffffffffffff80851660009081526001808901602052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190559286168252919020805490910190555b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60008061067d60017f2c0cf10337caabbd02dcf226f05f5fd19a0919a41a8df8958c39b8000782685861464f565b825473ffffffffffffffffffffffffffffffffffffffff8116906000907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff16831580611ea8575080155b15611eb65760009150611efb565b620186a0841015611ee057620186a0611ecf8286614844565b611ed9919061485b565b9150611efb565b80611eee620186a08661485b565b611ef89190614844565b91505b50935093915050565b60008061067d60017fc8827d3282af6f37b64c3e9e6f3ac9df286ab0bb0fccd6f8661bf19adb368b2361464f565b60008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff166107a05760008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8681168086529184529382902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815187815292830152918316918101919091527f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d906060015b60405180910390a150505050565b60008281526020848152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f757612046826138f9565b6040516020016120569190614896565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526109be9160040161411d565b73ffffffffffffffffffffffffffffffffffffffff8216612131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206d696e7420746f206164647265737328302900000000000060448201526064016109be565b60008181526020849052604090205473ffffffffffffffffffffffffffffffffffffffff16156121bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732313a206578697374696e6720746f6b656e0000000000000000000060448201526064016109be565b60008181526020848152604080832073ffffffffffffffffffffffffffffffffffffffff86169081905580845260018088019093528184208054909301909255518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6122388585858585611ad7565b73ffffffffffffffffffffffffffffffffffffffff82163b15610fb057610fb08484848460405180602001604052806000815250613a8b565b73ffffffffffffffffffffffffffffffffffffffff82166122ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206d696e7420746f206164647265737328302900000000000060448201526064016109be565b805160005b81811461241057600083828151811061230e5761230e6145f1565b6020026020010151905061234c8660000160008381526020019081526020016000205473ffffffffffffffffffffffffffffffffffffffff16151590565b156123b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732313a206578697374696e6720746f6b656e0000000000000000000060448201526064016109be565b60008181526020879052604080822073ffffffffffffffffffffffffffffffffffffffff88169081905590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4506001016122f3565b5073ffffffffffffffffffffffffffffffffffffffff9092166000908152600190930160205250604090912080549091019055565b60008061067d60017fe94434e3c6b941c5d90218142fadcc69cb2e13723993540bfa1c131dd1d3475a61464f565b620186a08111156124b3576040517f3affc6c4000000000000000000000000000000000000000000000000000000008152600481018290526024016109be565b81546bffffffffffffffffffffffff909116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116179055565b60008181526020839052604081205473ffffffffffffffffffffffffffffffffffffffff8116612585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b805b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff821661260e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433732313a2062616c616e6365206f66206164647265737328302900000060448201526064016109be565b5073ffffffffffffffffffffffffffffffffffffffff166000908152600191909101602052604090205490565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526107f7908490613bb1565b6000818152602085905260409020548073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461276c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b612777858486613884565b61282f57740100000000000000000000000000000000000000008116151580156127c95750600082815260028601602052604090205473ffffffffffffffffffffffffffffffffffffffff8581169116145b61282f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b6000828152602086815260408083207fdead000000000000000000000000000000000000000000000000000000000000905573ffffffffffffffffffffffffffffffffffffffff86168084526001890190925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905551849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505050565b826128e8828483614902565b507f04b1dc5c136a3ce9fded8db0ce3d3366c58764ec3a8e4c2b9e52e4ddfe5ebbf7828260405161291a929190614a1c565b60405180910390a1505050565b6129328584846120b4565b73ffffffffffffffffffffffffffffffffffffffff83163b15610fb057610fb0846000858585613a8b565b612968838284612008565b60008181526020848152604080832073ffffffffffffffffffffffffffffffffffffffff86168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580518481529182018390528101919091527ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9060600161291a565b73ffffffffffffffffffffffffffffffffffffffff81166111e6576040517f6fe1b4c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608160010180546115a690614691565b815181518114612ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a20696e636f6e73697374656e7420617272617973000000000060448201526064016109be565b60005b818114610fb057612b14848281518110612ae257612ae26145f1565b6020026020010151848381518110612afc57612afc6145f1565b6020026020010151876120b49092919063ffffffff16565b600101612ac6565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612bb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433732313a2073656c662d617070726f76616c20666f7220616c6c00000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260038701602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b612c598787878787611ad7565b73ffffffffffffffffffffffffffffffffffffffff84163b15612cb957612cb98686868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a8b92505050565b50505050505050565b606082612cce83613cbd565b604051602001612cdf929190614a69565b604051602081830303815290604052905092915050565b60008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff16156107a05760008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8681168086529184529382902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055815187815292830152918316918101919091527ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90606001611ffa565b6000612dcd868587613884565b90508160005b818114612fd7576000858583818110612dee57612dee6145f1565b602090810292909201356000818152928c905260409092205491925081905073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614612ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b84612f5a5774010000000000000000000000000000000000000000811615158015612ef45750600082815260028b01602052604090205473ffffffffffffffffffffffffffffffffffffffff8a81169116145b612f5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208b905260408082207fdead00000000000000000000000000000000000000000000000000000000000090555183919073ffffffffffffffffffffffffffffffffffffffff8b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050600101612dd3565b508015612cb95773ffffffffffffffffffffffffffffffffffffffff8516600090815260018801602052604090208054829003905550505050505050565b825473ffffffffffffffffffffffffffffffffffffffff908116908316811461309a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f776e6572736869703a206e6f7420746865206f776e6572000000000000000060448201526064016109be565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107a05783547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8381169182178655604051908316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350505050565b73ffffffffffffffffffffffffffffffffffffffff83166131be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a207472616e7366657220746f2061646472657373283029000060448201526064016109be565b60006131cb878688613884565b90508160005b8181146134355760008585838181106131ec576131ec6145f1565b602090810292909201356000818152928d90526040909220549192505073ffffffffffffffffffffffffffffffffffffffff8116613286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff89168173ffffffffffffffffffffffffffffffffffffffff161461331b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b846133d4577401000000000000000000000000000000000000000081161515801561336e5750600082815260028c01602052604090205473ffffffffffffffffffffffffffffffffffffffff8b81169116145b6133d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208c9052604080822073ffffffffffffffffffffffffffffffffffffffff808c16918290559151859391928d16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450506001016131d1565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561347157508015155b15610a605773ffffffffffffffffffffffffffffffffffffffff808716600090815260018a016020526040808220805485900390559187168152208054820190555050505050505050565b80471015613526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016109be565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114613580576040519150601f19603f3d011682016040523d82523d6000602084013e613585565b606091505b50509050806107f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016109be565b815473ffffffffffffffffffffffffffffffffffffffff168015801590613654575060008173ffffffffffffffffffffffffffffffffffffffff163b115b156107f7576040517fc617113400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015282169063c617113490604401602060405180830381865afa1580156136cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ef9190614b0e565b6107f7576040517fede71dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016109be565b60003332148061374d5750601836105b1561375757503390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633148061387357506040517f8929a8ca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301523360248301527f00000000000000000000000000000000000000000000000000000000000000001690638929a8ca90604401602060405180830381865afa15801561384f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138739190614b0e565b1561387d57919050565b3391505090565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061258757505073ffffffffffffffffffffffffffffffffffffffff9182166000908152600393909301602090815260408085209290931684525290205460ff1690565b6060600082900361391857505060408051602081019091526000815290565b60008260405160200161392d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050601f5b818181518110613972576139726145f1565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036139c7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01613960565b60008160010167ffffffffffffffff8111156139e5576139e5614662565b6040519080825280601f01601f191660200182016040528015613a0f576020820181803683370190505b50905060005b828111613a8257838181518110613a2e57613a2e6145f1565b602001015160f81c60f81b828281518110613a4b57613a4b6145f1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101613a15565b50949350505050565b6040517f150b7a02000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613ae5908990899088908890600401614b2b565b6020604051808303816000875af1158015613b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b289190614b74565b7fffffffff000000000000000000000000000000000000000000000000000000001614610fb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a2073616665207472616e736665722072656a6563746564000060448201526064016109be565b6000613c13826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d7b9092919063ffffffff16565b8051909150156107f75780806020019051810190613c319190614b0e565b6107f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109be565b60606000613cca83613d8a565b600101905060008167ffffffffffffffff811115613cea57613cea614662565b6040519080825280601f01601f191660200182016040528015613d14576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084613d1e57509392505050565b60606125878484600085613e6c565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613dd3577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613e1d57662386f26fc10000830492506010015b6305f5e1008310613e35576305f5e100830492506008015b6127108310613e4957612710830492506004015b60648310613e5b576064830492506002015b600a831061067d5760010192915050565b606082471015613efe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016109be565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613f279190614b91565b60006040518083038185875af1925050503d8060008114613f64576040519150601f19603f3d011682016040523d82523d6000602084013e613f69565b606091505b5091509150613f7a87838387613f85565b979650505050505050565b6060831561401b5782516000036140145773ffffffffffffffffffffffffffffffffffffffff85163b614014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109be565b5081612587565b61258783838151156140305781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109be919061411d565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461076557600080fd5b6000602082840312156140a457600080fd5b8135610bcb81614064565b60005b838110156140ca5781810151838201526020016140b2565b50506000910152565b600081518084526140eb8160208601602086016140af565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610bcb60208301846140d3565b60006020828403121561414257600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461076557600080fd5b6000806040838503121561417e57600080fd5b823561418981614149565b946020939093013593505050565b6000602082840312156141a957600080fd5b8135610bcb81614149565b6000806000606084860312156141c957600080fd5b83356141d481614149565b925060208401356141e481614149565b929592945050506040919091013590565b6000806040838503121561420857600080fd5b50508035926020909101359150565b6000806040838503121561422a57600080fd5b82359150602083013561423c81614149565b809150509250929050565b60008083601f84011261425957600080fd5b50813567ffffffffffffffff81111561427157600080fd5b6020830191508360208260051b85010111156107c257600080fd5b6000806000604084860312156142a157600080fd5b83356142ac81614149565b9250602084013567ffffffffffffffff8111156142c857600080fd5b6142d486828701614247565b9497909650939450505050565b600080600080600080606087890312156142fa57600080fd5b863567ffffffffffffffff8082111561431257600080fd5b61431e8a838b01614247565b9098509650602089013591508082111561433757600080fd5b6143438a838b01614247565b9096509450604089013591508082111561435c57600080fd5b5061436989828a01614247565b979a9699509497509295939492505050565b60008083601f84011261438d57600080fd5b50813567ffffffffffffffff8111156143a557600080fd5b6020830191508360208285010111156107c257600080fd5b600080602083850312156143d057600080fd5b823567ffffffffffffffff8111156143e757600080fd5b6143f38582860161437b565b90969095509350505050565b6000806000806060858703121561441557600080fd5b843561442081614149565b935060208501359250604085013567ffffffffffffffff81111561444357600080fd5b61444f8782880161437b565b95989497509550505050565b6000806000806040858703121561447157600080fd5b843567ffffffffffffffff8082111561448957600080fd5b61449588838901614247565b909650945060208701359150808211156144ae57600080fd5b5061444f87828801614247565b801515811461076557600080fd5b600080604083850312156144dc57600080fd5b82356144e781614149565b9150602083013561423c816144bb565b60008060008060006080868803121561450f57600080fd5b853561451a81614149565b9450602086013561452a81614149565b935060408601359250606086013567ffffffffffffffff81111561454d57600080fd5b6145598882890161437b565b969995985093965092949392505050565b6000806040838503121561457d57600080fd5b823561458881614149565b9150602083013561423c81614149565b600080600080606085870312156145ae57600080fd5b84356145b981614149565b935060208501356145c981614149565b9250604085013567ffffffffffffffff8111156145e557600080fd5b61444f87828801614247565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561067d5761067d614620565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c908216806146a557607f821691505b6020821081036146de577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156107f757600081815260208120601f850160051c8101602086101561470b5750805b601f850160051c820191505b81811015610cf957828155600101614717565b815167ffffffffffffffff81111561474457614744614662565b614758816147528454614691565b846146e4565b602080601f8311600181146147ab57600084156147755750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610cf9565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156147f8578886015182559484019460019091019084016147d9565b508582101561483457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b808202811582820484141761067d5761067d614620565b600082614891577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f416363657373436f6e74726f6c3a206d697373696e67202700000000000000008152600082516148ce8160188501602087016140af565b7f2720726f6c6500000000000000000000000000000000000000000000000000006018939091019283015250601e01919050565b67ffffffffffffffff83111561491a5761491a614662565b61492e836149288354614691565b836146e4565b6000601f841160018114614980576000851561494a5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610fb0565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156149cf57868501358255602094850194600190920191016149af565b5086821015614a0a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b6000808454614a7781614691565b60018281168015614a8f5760018114614ac257614af1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450614af1565b8860005260208060002060005b85811015614ae85781548a820152908401908201614acf565b50505082870194505b505050508351614b058183602088016140af565b01949350505050565b600060208284031215614b2057600080fd5b8151610bcb816144bb565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152614b6a60808301846140d3565b9695505050505050565b600060208284031215614b8657600080fd5b8151610bcb81614064565b60008251614ba38184602087016140af565b919091019291505056fea2646970667358221220ef89a2cd879703969197d631acc643920fb69c2ca21634d4ffbaa7cccffe669a64736f6c63430008110033000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e0000000000000000000000003f547f87251710f70109ae0409d461b270709693
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102c85760003560e01c80638832e6e31161017b578063c3666c36116100d8578063e985e9c51161008c578063f2fde38b11610071578063f2fde38b14610630578063f3993d1114610643578063f7ba94bd1461065657600080fd5b8063e985e9c51461060a578063f24729651461061d57600080fd5b8063d5391393116100bd578063d5391393146105c6578063d547741f146105ed578063e1a8bf2c1461060057600080fd5b8063c3666c36146105a0578063c87b56dd146105b357600080fd5b806395d89b411161012f578063a22cb46511610114578063a22cb46514610572578063b0ccc31e14610585578063b88d4fde1461058d57600080fd5b806395d89b41146105575780639da5e8321461055f57600080fd5b80638da5cb5b116101605780638da5cb5b146105295780638dc251e31461053157806391d148541461054457600080fd5b80638832e6e3146105035780638bb9c5bf1461051657600080fd5b806342842e0e116102295780636352211e116101dd57806373c8a958116101c257806373c8a958146104ca57806379cc6790146104dd5780637e518ec8146104f057600080fd5b80636352211e1461049657806370a08231146104a957600080fd5b8063572b6c051161020e578063572b6c051461042e5780635b2bd79e1461047b57806361ba27da1461048357600080fd5b806342842e0e146104085780634684d7e91461041b57600080fd5b806323b872dd116102805780632b4c9f16116102655780632b4c9f16146103bc5780632f2ff15d146103e257806340c10f19146103f557600080fd5b806323b872dd1461036a5780632a55205a1461037d57600080fd5b8063081812fc116102b1578063081812fc1461030a578063095ea7b314610342578063114ba8ee1461035757600080fd5b806301ffc9a7146102cd57806306fdde03146102f5575b600080fd5b6102e06102db366004614092565b610669565b60405190151581526020015b60405180910390f35b6102fd610683565b6040516102ec919061411d565b61031d610318366004614130565b61069a565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102ec565b61035561035036600461416b565b6106ae565b005b610355610365366004614197565b6106fd565b6103556103783660046141b4565b610768565b61039061038b3660046141f5565b6107a6565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016102ec565b7f0000000000000000000000003f547f87251710f70109ae0409d461b27070969361031d565b6103556103f0366004614217565b6107c9565b61035561040336600461416b565b6107fc565b6103556104163660046141b4565b61084b565b61035561042936600461428c565b61087c565b6102e061043c366004614197565b7f0000000000000000000000003f547f87251710f70109ae0409d461b27070969373ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102fd6108f0565b610355610491366004614130565b6108fd565b61031d6104a4366004614130565b61091a565b6104bc6104b7366004614197565b61092e565b6040519081526020016102ec565b6103556104d83660046142e1565b610942565b6103556104eb36600461416b565b610a6a565b6103556104fe3660046143bd565b610a87565b6103556105113660046143ff565b610aa6565b610355610524366004614130565b610b28565b61031d610b43565b61035561053f366004614197565b610b6a565b6102e0610552366004614217565b610b87565b6102fd610bd2565b61035561056d36600461445b565b610be4565b6103556105803660046144c9565b610c88565b61031d610cb7565b61035561059b3660046144f7565b610cc4565b6103556105ae3660046142e1565b610d01565b6102fd6105c1366004614130565b610ea6565b6104bc7f6d696e746572000000000000000000000000000000000000000000000000000081565b6103556105fb366004614217565b610ec7565b6104bc620186a081565b6102e061061836600461456a565b610ef5565b61035561062b36600461428c565b610f43565b61035561063e366004614197565b610f62565b610355610651366004614598565b610f7d565b61035561066436600461445b565b610fb7565b600061067d82610677611381565b906114bb565b92915050565b6060610695610690611256565b611595565b905090565b600061067d826106a861162b565b90611659565b73ffffffffffffffffffffffffffffffffffffffff8216156106dc576106dc826106d66111b8565b9061173a565b6106f96106e7611744565b83836106f161162b565b92919061174e565b5050565b610716610708611744565b61071061109d565b90611a17565b610765816107226111b8565b9081547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff91909116179055565b50565b6000610772611744565b905061078881856107816111b8565b9190611a9a565b6107a08185858561079761162b565b93929190611ad7565b50505050565b6000806107bd84846107b6611e2c565b9190611e5a565b915091505b9250929050565b60006107d3611744565b90506107e18161071061109d565b6107f78383836107ef611f04565b929190611f32565b505050565b6108377f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b610830611f04565b9190612008565b6106f9828261084461162b565b91906120b4565b6000610855611744565b905061086481856107816111b8565b6107a08185858561087361162b565b9392919061222b565b6108a87f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107f7838383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108e9925061162b915050565b9190612271565b6060610695610690612445565b610908610708611744565b61076581610914611e2c565b90612473565b600061067d8261092861162b565b906124f9565b600061067d8261093c61162b565b9061258f565b61094d610708611744565b84838114801561095c57508082145b6109c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064015b60405180910390fd5b60005b818114610a6057610a588888838181106109e6576109e66145f1565b90506020020160208101906109fb9190614197565b858584818110610a0d57610a0d6145f1565b90506020020135888885818110610a2657610a266145f1565b9050602002016020810190610a3b9190614197565b73ffffffffffffffffffffffffffffffffffffffff16919061263b565b6001016109ca565b5050505050505050565b6106f9610a75611744565b8383610a7f61162b565b9291906126c8565b610a92610708611744565b6106f98282610a9f612445565b91906128dc565b610ad27f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107a0610add611744565b858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b1f925061162b915050565b93929190612927565b610765610b33611744565b82610b3c611f04565b919061295d565b6000610695610b5061109d565b5473ffffffffffffffffffffffffffffffffffffffff1690565b610b75610708611744565b61076581610b81611e2c565b906129f9565b6000610bcb8383610b96611f04565b60009283526020908152604080842073ffffffffffffffffffffffffffffffffffffffff909316845291905290205460ff1690565b9392505050565b6060610695610bdf611256565b612a46565b610c107f6d696e7465720000000000000000000000000000000000000000000000000000610828611744565b6107a084848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250610c81925061162b915050565b9190612a57565b8015610c9a57610c9a826106d66111b8565b6106f9610ca5611744565b8383610caf61162b565b929190612b1c565b6000610695610b506111b8565b6000610cce611744565b9050610cdd81876107816111b8565b610cf9818787878787610cee61162b565b959493929190612c4c565b505050505050565b610d0c610708611744565b848381148015610d1b57508082145b610d81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064016109be565b60005b818114610a6057858582818110610d9d57610d9d6145f1565b9050602002016020810190610db29190614197565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd308a8a85818110610de057610de06145f1565b9050602002016020810190610df59190614197565b878786818110610e0757610e076145f1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610e8357600080fd5b505af1158015610e97573d6000803e3d6000fd5b50505050806001019050610d84565b6060610eb48261092861162b565b5061067d82610ec1612445565b90612cc2565b6000610ed1611744565b9050610edf8161071061109d565b6107f7838383610eed611f04565b929190612cf6565b6000610bcb8383610f0461162b565b919073ffffffffffffffffffffffffffffffffffffffff9182166000908152600393909301602090815260408085209290931684525290205460ff1690565b6107f7610f4e611744565b848484610f5961162b565b93929190612dc0565b610765610f6d611744565b82610f7661109d565b9190613015565b6000610f87611744565b9050610f9681866107816111b8565b610fb08186868686610fa661162b565b9493929190613141565b5050505050565b610fc2610708611744565b8281811461102c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265636f766572793a20696e636f6e73697374656e742061727261797300000060448201526064016109be565b60005b818114610cf95761109584848381811061104b5761104b6145f1565b90506020020135878784818110611064576110646145f1565b90506020020160208101906110799190614197565b73ffffffffffffffffffffffffffffffffffffffff16906134bc565b60010161102f565b60008061067d60017fc9ed16f33ab3a66c84bfd83099ccb2a8845871e2e1c1928f63797152f0fd54cd61464f565b73ffffffffffffffffffffffffffffffffffffffff8116156111535781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff821690811783556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35b6106f97f7f5828d0000000000000000000000000000000000000000000000000000000006001611181611381565b91906113af565b6111b67f80ac58cd000000000000000000000000000000000000000000000000000000006001611181611381565b565b60008061067d60017f609b85bcafa81ecfaf3ff62cdde2c6c9082a68dbe4922f07399c706bdeb7cd3161464f565b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff91909116179055565b6111b67ff3993d11000000000000000000000000000000000000000000000000000000006001611181611381565b60008061067d60017f9c4269c0f9f430d98876ffe9767fbf3f3232ea91a549beb549e5329532520eb361464f565b8261128f838261472a565b506001830161129e828261472a565b506107f77f5b5e139f000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f8b8b4ef5000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f8e773e13000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f9da5e832000000000000000000000000000000000000000000000000000000006001611181611381565b6111b67f2a55205a0000000000000000000000000000000000000000000000000000000060016111815b60008061067d60017fca9d3e17f264b0f3984e2634e94adb37fa3e6a8103f06aeae6fa59e21c769f5e61464f565b7c01000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831601611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e74657266616365446574656374696f6e3a2077726f6e672076616c75650060448201526064016109be565b7fffffffff00000000000000000000000000000000000000000000000000000000919091166000908152602092909252604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60007c01000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083160161150b5750600061067d565b7ffe003659000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083160161155c5750600161067d565b507fffffffff00000000000000000000000000000000000000000000000000000000166000908152602091909152604090205460ff1690565b60608160000180546115a690614691565b80601f01602080910402602001604051908101604052809291908181526020018280546115d290614691565b801561161f5780601f106115f45761010080835404028352916020019161161f565b820191906000526020600020905b81548152906001019060200180831161160257829003601f168201915b50505050509050919050565b60008061067d60017fddf3ee18ae6d688373c219468f8be446e7ae82215f4779d821c7ea5e8c13c0c161464f565b60008181526020839052604081205473ffffffffffffffffffffffffffffffffffffffff81166116e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b74010000000000000000000000000000000000000000811615611730575050600081815260028301602052604090205473ffffffffffffffffffffffffffffffffffffffff1661067d565b600091505061067d565b6106f98282613616565b600061069561373d565b60008181526020859052604090205473ffffffffffffffffffffffffffffffffffffffff81166117da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b8073ffffffffffffffffffffffffffffffffffffffff8082169085160361185d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732313a2073656c662d617070726f76616c000000000000000000000060448201526064016109be565b611868868287613884565b6118ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff8416611933577401000000000000000000000000000000000000000082161561192e57600083815260208790526040902073ffffffffffffffffffffffffffffffffffffffff821690555b6119b4565b7401000000000000000000000000000000000000000082178083146119645760008481526020889052604090208190555b506000838152600287016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86161790555b828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050505050565b815473ffffffffffffffffffffffffffffffffffffffff8281169116146106f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f776e6572736869703a206e6f7420746865206f776e6572000000000000000060448201526064016109be565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146107f7576107f78383613616565b73ffffffffffffffffffffffffffffffffffffffff8216611b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a207472616e7366657220746f2061646472657373283029000060448201526064016109be565b60008181526020869052604090205473ffffffffffffffffffffffffffffffffffffffff8116611be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff84168173ffffffffffffffffffffffffffffffffffffffff1614611c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b611c80868587613884565b611d385774010000000000000000000000000000000000000000811615158015611cd25750600082815260028701602052604090205473ffffffffffffffffffffffffffffffffffffffff8681169116145b611d38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208790526040902073ffffffffffffffffffffffffffffffffffffffff80851691829055851614611dc95773ffffffffffffffffffffffffffffffffffffffff80851660009081526001808901602052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190559286168252919020805490910190555b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60008061067d60017f2c0cf10337caabbd02dcf226f05f5fd19a0919a41a8df8958c39b8000782685861464f565b825473ffffffffffffffffffffffffffffffffffffffff8116906000907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff16831580611ea8575080155b15611eb65760009150611efb565b620186a0841015611ee057620186a0611ecf8286614844565b611ed9919061485b565b9150611efb565b80611eee620186a08661485b565b611ef89190614844565b91505b50935093915050565b60008061067d60017fc8827d3282af6f37b64c3e9e6f3ac9df286ab0bb0fccd6f8661bf19adb368b2361464f565b60008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff166107a05760008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8681168086529184529382902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815187815292830152918316918101919091527f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d906060015b60405180910390a150505050565b60008281526020848152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f757612046826138f9565b6040516020016120569190614896565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526109be9160040161411d565b73ffffffffffffffffffffffffffffffffffffffff8216612131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206d696e7420746f206164647265737328302900000000000060448201526064016109be565b60008181526020849052604090205473ffffffffffffffffffffffffffffffffffffffff16156121bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732313a206578697374696e6720746f6b656e0000000000000000000060448201526064016109be565b60008181526020848152604080832073ffffffffffffffffffffffffffffffffffffffff86169081905580845260018088019093528184208054909301909255518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6122388585858585611ad7565b73ffffffffffffffffffffffffffffffffffffffff82163b15610fb057610fb08484848460405180602001604052806000815250613a8b565b73ffffffffffffffffffffffffffffffffffffffff82166122ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206d696e7420746f206164647265737328302900000000000060448201526064016109be565b805160005b81811461241057600083828151811061230e5761230e6145f1565b6020026020010151905061234c8660000160008381526020019081526020016000205473ffffffffffffffffffffffffffffffffffffffff16151590565b156123b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732313a206578697374696e6720746f6b656e0000000000000000000060448201526064016109be565b60008181526020879052604080822073ffffffffffffffffffffffffffffffffffffffff88169081905590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4506001016122f3565b5073ffffffffffffffffffffffffffffffffffffffff9092166000908152600190930160205250604090912080549091019055565b60008061067d60017fe94434e3c6b941c5d90218142fadcc69cb2e13723993540bfa1c131dd1d3475a61464f565b620186a08111156124b3576040517f3affc6c4000000000000000000000000000000000000000000000000000000008152600481018290526024016109be565b81546bffffffffffffffffffffffff909116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116179055565b60008181526020839052604081205473ffffffffffffffffffffffffffffffffffffffff8116612585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b805b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff821661260e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433732313a2062616c616e6365206f66206164647265737328302900000060448201526064016109be565b5073ffffffffffffffffffffffffffffffffffffffff166000908152600191909101602052604090205490565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526107f7908490613bb1565b6000818152602085905260409020548073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461276c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b612777858486613884565b61282f57740100000000000000000000000000000000000000008116151580156127c95750600082815260028601602052604090205473ffffffffffffffffffffffffffffffffffffffff8581169116145b61282f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b6000828152602086815260408083207fdead000000000000000000000000000000000000000000000000000000000000905573ffffffffffffffffffffffffffffffffffffffff86168084526001890190925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905551849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505050565b826128e8828483614902565b507f04b1dc5c136a3ce9fded8db0ce3d3366c58764ec3a8e4c2b9e52e4ddfe5ebbf7828260405161291a929190614a1c565b60405180910390a1505050565b6129328584846120b4565b73ffffffffffffffffffffffffffffffffffffffff83163b15610fb057610fb0846000858585613a8b565b612968838284612008565b60008181526020848152604080832073ffffffffffffffffffffffffffffffffffffffff86168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580518481529182018390528101919091527ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9060600161291a565b73ffffffffffffffffffffffffffffffffffffffff81166111e6576040517f6fe1b4c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608160010180546115a690614691565b815181518114612ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a20696e636f6e73697374656e7420617272617973000000000060448201526064016109be565b60005b818114610fb057612b14848281518110612ae257612ae26145f1565b6020026020010151848381518110612afc57612afc6145f1565b6020026020010151876120b49092919063ffffffff16565b600101612ac6565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612bb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433732313a2073656c662d617070726f76616c20666f7220616c6c00000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260038701602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b612c598787878787611ad7565b73ffffffffffffffffffffffffffffffffffffffff84163b15612cb957612cb98686868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a8b92505050565b50505050505050565b606082612cce83613cbd565b604051602001612cdf929190614a69565b604051602081830303815290604052905092915050565b60008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff16156107a05760008381526020858152604080832073ffffffffffffffffffffffffffffffffffffffff8681168086529184529382902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055815187815292830152918316918101919091527ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90606001611ffa565b6000612dcd868587613884565b90508160005b818114612fd7576000858583818110612dee57612dee6145f1565b602090810292909201356000818152928c905260409092205491925081905073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614612ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b84612f5a5774010000000000000000000000000000000000000000811615158015612ef45750600082815260028b01602052604090205473ffffffffffffffffffffffffffffffffffffffff8a81169116145b612f5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208b905260408082207fdead00000000000000000000000000000000000000000000000000000000000090555183919073ffffffffffffffffffffffffffffffffffffffff8b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050600101612dd3565b508015612cb95773ffffffffffffffffffffffffffffffffffffffff8516600090815260018801602052604090208054829003905550505050505050565b825473ffffffffffffffffffffffffffffffffffffffff908116908316811461309a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f776e6572736869703a206e6f7420746865206f776e6572000000000000000060448201526064016109be565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107a05783547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8381169182178655604051908316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350505050565b73ffffffffffffffffffffffffffffffffffffffff83166131be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a207472616e7366657220746f2061646472657373283029000060448201526064016109be565b60006131cb878688613884565b90508160005b8181146134355760008585838181106131ec576131ec6145f1565b602090810292909201356000818152928d90526040909220549192505073ffffffffffffffffffffffffffffffffffffffff8116613286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4552433732313a206e6f6e2d6578697374696e6720746f6b656e00000000000060448201526064016109be565b73ffffffffffffffffffffffffffffffffffffffff89168173ffffffffffffffffffffffffffffffffffffffff161461331b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732313a206e6f6e2d6f776e656420746f6b656e00000000000000000060448201526064016109be565b846133d4577401000000000000000000000000000000000000000081161515801561336e5750600082815260028c01602052604090205473ffffffffffffffffffffffffffffffffffffffff8b81169116145b6133d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732313a206e6f6e2d617070726f7665642073656e646572000000000060448201526064016109be565b600082815260208c9052604080822073ffffffffffffffffffffffffffffffffffffffff808c16918290559151859391928d16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450506001016131d1565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561347157508015155b15610a605773ffffffffffffffffffffffffffffffffffffffff808716600090815260018a016020526040808220805485900390559187168152208054820190555050505050505050565b80471015613526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016109be565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114613580576040519150601f19603f3d011682016040523d82523d6000602084013e613585565b606091505b50509050806107f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016109be565b815473ffffffffffffffffffffffffffffffffffffffff168015801590613654575060008173ffffffffffffffffffffffffffffffffffffffff163b115b156107f7576040517fc617113400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015282169063c617113490604401602060405180830381865afa1580156136cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ef9190614b0e565b6107f7576040517fede71dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016109be565b60003332148061374d5750601836105b1561375757503390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c7f0000000000000000000000003f547f87251710f70109ae0409d461b27070969373ffffffffffffffffffffffffffffffffffffffff1633148061387357506040517f8929a8ca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301523360248301527f0000000000000000000000003f547f87251710f70109ae0409d461b2707096931690638929a8ca90604401602060405180830381865afa15801561384f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138739190614b0e565b1561387d57919050565b3391505090565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061258757505073ffffffffffffffffffffffffffffffffffffffff9182166000908152600393909301602090815260408085209290931684525290205460ff1690565b6060600082900361391857505060408051602081019091526000815290565b60008260405160200161392d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050601f5b818181518110613972576139726145f1565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036139c7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01613960565b60008160010167ffffffffffffffff8111156139e5576139e5614662565b6040519080825280601f01601f191660200182016040528015613a0f576020820181803683370190505b50905060005b828111613a8257838181518110613a2e57613a2e6145f1565b602001015160f81c60f81b828281518110613a4b57613a4b6145f1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101613a15565b50949350505050565b6040517f150b7a02000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613ae5908990899088908890600401614b2b565b6020604051808303816000875af1158015613b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b289190614b74565b7fffffffff000000000000000000000000000000000000000000000000000000001614610fb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732313a2073616665207472616e736665722072656a6563746564000060448201526064016109be565b6000613c13826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d7b9092919063ffffffff16565b8051909150156107f75780806020019051810190613c319190614b0e565b6107f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109be565b60606000613cca83613d8a565b600101905060008167ffffffffffffffff811115613cea57613cea614662565b6040519080825280601f01601f191660200182016040528015613d14576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084613d1e57509392505050565b60606125878484600085613e6c565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613dd3577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613e1d57662386f26fc10000830492506010015b6305f5e1008310613e35576305f5e100830492506008015b6127108310613e4957612710830492506004015b60648310613e5b576064830492506002015b600a831061067d5760010192915050565b606082471015613efe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016109be565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613f279190614b91565b60006040518083038185875af1925050503d8060008114613f64576040519150601f19603f3d011682016040523d82523d6000602084013e613f69565b606091505b5091509150613f7a87838387613f85565b979650505050505050565b6060831561401b5782516000036140145773ffffffffffffffffffffffffffffffffffffffff85163b614014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109be565b5081612587565b61258783838151156140305781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109be919061411d565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461076557600080fd5b6000602082840312156140a457600080fd5b8135610bcb81614064565b60005b838110156140ca5781810151838201526020016140b2565b50506000910152565b600081518084526140eb8160208601602086016140af565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610bcb60208301846140d3565b60006020828403121561414257600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461076557600080fd5b6000806040838503121561417e57600080fd5b823561418981614149565b946020939093013593505050565b6000602082840312156141a957600080fd5b8135610bcb81614149565b6000806000606084860312156141c957600080fd5b83356141d481614149565b925060208401356141e481614149565b929592945050506040919091013590565b6000806040838503121561420857600080fd5b50508035926020909101359150565b6000806040838503121561422a57600080fd5b82359150602083013561423c81614149565b809150509250929050565b60008083601f84011261425957600080fd5b50813567ffffffffffffffff81111561427157600080fd5b6020830191508360208260051b85010111156107c257600080fd5b6000806000604084860312156142a157600080fd5b83356142ac81614149565b9250602084013567ffffffffffffffff8111156142c857600080fd5b6142d486828701614247565b9497909650939450505050565b600080600080600080606087890312156142fa57600080fd5b863567ffffffffffffffff8082111561431257600080fd5b61431e8a838b01614247565b9098509650602089013591508082111561433757600080fd5b6143438a838b01614247565b9096509450604089013591508082111561435c57600080fd5b5061436989828a01614247565b979a9699509497509295939492505050565b60008083601f84011261438d57600080fd5b50813567ffffffffffffffff8111156143a557600080fd5b6020830191508360208285010111156107c257600080fd5b600080602083850312156143d057600080fd5b823567ffffffffffffffff8111156143e757600080fd5b6143f38582860161437b565b90969095509350505050565b6000806000806060858703121561441557600080fd5b843561442081614149565b935060208501359250604085013567ffffffffffffffff81111561444357600080fd5b61444f8782880161437b565b95989497509550505050565b6000806000806040858703121561447157600080fd5b843567ffffffffffffffff8082111561448957600080fd5b61449588838901614247565b909650945060208701359150808211156144ae57600080fd5b5061444f87828801614247565b801515811461076557600080fd5b600080604083850312156144dc57600080fd5b82356144e781614149565b9150602083013561423c816144bb565b60008060008060006080868803121561450f57600080fd5b853561451a81614149565b9450602086013561452a81614149565b935060408601359250606086013567ffffffffffffffff81111561454d57600080fd5b6145598882890161437b565b969995985093965092949392505050565b6000806040838503121561457d57600080fd5b823561458881614149565b9150602083013561423c81614149565b600080600080606085870312156145ae57600080fd5b84356145b981614149565b935060208501356145c981614149565b9250604085013567ffffffffffffffff8111156145e557600080fd5b61444f87828801614247565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561067d5761067d614620565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c908216806146a557607f821691505b6020821081036146de577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156107f757600081815260208120601f850160051c8101602086101561470b5750805b601f850160051c820191505b81811015610cf957828155600101614717565b815167ffffffffffffffff81111561474457614744614662565b614758816147528454614691565b846146e4565b602080601f8311600181146147ab57600084156147755750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610cf9565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156147f8578886015182559484019460019091019084016147d9565b508582101561483457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b808202811582820484141761067d5761067d614620565b600082614891577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f416363657373436f6e74726f6c3a206d697373696e67202700000000000000008152600082516148ce8160188501602087016140af565b7f2720726f6c6500000000000000000000000000000000000000000000000000006018939091019283015250601e01919050565b67ffffffffffffffff83111561491a5761491a614662565b61492e836149288354614691565b836146e4565b6000601f841160018114614980576000851561494a5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610fb0565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156149cf57868501358255602094850194600190920191016149af565b5086821015614a0a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b6000808454614a7781614691565b60018281168015614a8f5760018114614ac257614af1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450614af1565b8860005260208060002060005b85811015614ae85781548a820152908401908201614acf565b50505082870194505b505050508351614b058183602088016140af565b01949350505050565b600060208284031215614b2057600080fd5b8151610bcb816144bb565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152614b6a60808301846140d3565b9695505050505050565b600060208284031215614b8657600080fd5b8151610bcb81614064565b60008251614ba38184602087016140af565b919091019291505056fea2646970667358221220ef89a2cd879703969197d631acc643920fb69c2ca21634d4ffbaa7cccffe669a64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e0000000000000000000000003f547f87251710f70109ae0409d461b270709693
-----Decoded View---------------
Arg [0] : filterRegistry (address): 0x000000000000AAeB6D7670E522A718067333cd4E
Arg [1] : forwarderRegistry (address): 0x3f547F87251710F70109Ae0409d461b270709693
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e
Arg [1] : 0000000000000000000000003f547f87251710f70109ae0409d461b270709693
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.