More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 201 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Migrate From V2 | 21250516 | 1 hr ago | IN | 0 ETH | 0.00137678 | ||||
Migrate From V2 | 21244661 | 20 hrs ago | IN | 0 ETH | 0.00122463 | ||||
Migrate From V2 | 21241798 | 30 hrs ago | IN | 0 ETH | 0.00092547 | ||||
Migrate From V2 | 21241755 | 30 hrs ago | IN | 0 ETH | 0.00114456 | ||||
Migrate From V2 | 21225201 | 3 days ago | IN | 0 ETH | 0.00084188 | ||||
Migrate From V2 | 21223828 | 3 days ago | IN | 0 ETH | 0.00216043 | ||||
Migrate From V2 | 21223637 | 3 days ago | IN | 0 ETH | 0.00287462 | ||||
Migrate From V2 | 21223378 | 3 days ago | IN | 0 ETH | 0.0024603 | ||||
Migrate From V2 | 21223038 | 3 days ago | IN | 0 ETH | 0.00115184 | ||||
Migrate From V2 | 21223029 | 3 days ago | IN | 0 ETH | 0.00229442 | ||||
Migrate From V2 | 21223008 | 3 days ago | IN | 0 ETH | 0.00224026 | ||||
Migrate From V2 | 21222204 | 3 days ago | IN | 0 ETH | 0.0017901 | ||||
Migrate From V2 | 21217049 | 4 days ago | IN | 0 ETH | 0.00275704 | ||||
Migrate From V2 | 21216286 | 4 days ago | IN | 0 ETH | 0.00324842 | ||||
Migrate From V2 | 21213185 | 5 days ago | IN | 0 ETH | 0.00088939 | ||||
Set Approval For... | 21213086 | 5 days ago | IN | 0 ETH | 0.00051882 | ||||
Migrate From V2 | 21208564 | 5 days ago | IN | 0 ETH | 0.00127048 | ||||
Migrate From V2 | 21208431 | 5 days ago | IN | 0 ETH | 0.00040936 | ||||
Migrate From V2 | 21208411 | 5 days ago | IN | 0 ETH | 0.00043159 | ||||
Migrate From V2 | 21205761 | 6 days ago | IN | 0 ETH | 0.00085121 | ||||
Migrate From V2 | 21201553 | 6 days ago | IN | 0 ETH | 0.00276171 | ||||
Migrate From V2 | 21200426 | 7 days ago | IN | 0 ETH | 0.00210592 | ||||
Migrate From V2 | 21196480 | 7 days ago | IN | 0 ETH | 0.00146182 | ||||
Migrate From V2 | 21196451 | 7 days ago | IN | 0 ETH | 0.00147275 | ||||
Migrate From V2 | 21196440 | 7 days ago | IN | 0 ETH | 0.00151316 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
GmV3
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 150 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /// @title gmDAO Token v3 /// @notice This contract implements the gmDAO Token v3 functionality. /// @dev The contract uses OpenZeppelin libraries and custom implementations for ERC721Enumerable and Ownable functionality. pragma solidity ^0.8.20; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; 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); } contract GmV3 is ERC721EnumerableUpgradeable, OwnableUpgradeable, IERC2981, IERC1155Receiver, ReentrancyGuard { struct Project { string name; // The name of the project string tokenBase; // The base URI for token metadata address v1Contract; // Address of the version 1 contract address v2Contract; // Address of the version 2 contract address payable ownerAddress; // Address of the project owner address payable royaltyAddress; // Address to receive royalties uint96 royalty; // Royalty percentage (out of 10000) uint24 v1Id; // Royalty percentage (out of 10000) } event SpecialTokenMinted(uint256 oldId, uint256 newId); Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 and Ownable contracts with project data. * @param _p The project data. */ function initProject(Project calldata _p) public initializer { __ERC721_init(_p.name, "gmDAO"); __Ownable_init(_p.ownerAddress); project = _p; } /** * @notice Migrates tokens from v1 and v2 contracts to the current contract. * @dev Checks ownership and transfers tokens, then mints new tokens in this contract. * @param tokenIds The list of token IDs to migrate. * @param a The address to receive the migrated tokens. */ function migrateFromV2( uint256[] calldata tokenIds, address a ) public nonReentrant { IERC721 v2Contract = IERC721(project.v2Contract); uint256 normalLength = _normalOwners.length; uint256 specialLength = _specialOwners.length; uint256 normalC; uint256 specialC; for (uint256 i; i < tokenIds.length; i++) { bool ownsInV2 = v2Contract.ownerOf(tokenIds[i]) == msg.sender; require(ownsInV2, "Wallet doesn't hold token"); IERC721 currentContract = v2Contract; require( currentContract.isApprovedForAll(msg.sender, address(this)) || currentContract.getApproved(tokenIds[i]) == address(this), "V2 not approved to transfer token. Please set approval." ); currentContract.transferFrom( msg.sender, address(this), tokenIds[i] ); if (tokenIds[i] < 870) { uint256 tokenId = normalLength + normalC; normalC++; _mint(a, tokenId); } else { uint256 tokenId = specialLength + specialC; specialC++; _mint(a, tokenId + 870); emit SpecialTokenMinted(tokenIds[i], tokenId + 870); } } } /** * @notice Migrates a specified count of an ERC1155 token from the v1 contract to the current contract. * @dev Checks ownership and transfers tokens, then mints new tokens in this contract. * @param count The number of tokens to transfer. * @param a The address to receive the migrated tokens. */ function migrateFromV1(uint256 count, address a) public nonReentrant { IERC1155 v1Contract = IERC1155(project.v1Contract); uint256 normalLength = _normalOwners.length; require( v1Contract.balanceOf(msg.sender, project.v1Id) >= count, "Wallet doesn't hold v1 tokens" ); require( v1Contract.isApprovedForAll(msg.sender, address(this)), "Contract not approved to transfer token. Please set approval." ); v1Contract.safeTransferFrom( msg.sender, address(this), project.v1Id, count, // Transfer the specified count of tokens "" ); // Only mint normal tokens for (uint256 i = 0; i < count; i++) { uint256 newTokenId = normalLength + i; _mint(a, newTokenId); } } /** * @notice Returns a list of token IDs owned by the specified address. * @param _owner The address to query. * @return An array of token IDs owned by the address. */ function walletOfOwner( address _owner ) public view returns (uint256[] memory) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) return new uint256[](0); uint256[] memory tokensId = new uint256[](tokenCount); for (uint256 i; i < tokenCount; i++) { tokensId[i] = tokenOfOwnerByIndex(_owner, i); } return tokensId; } /** * @notice Batch transfers tokens from one address to another. * @param _from The address to transfer tokens from. * @param _to The address to transfer tokens to. * @param _tokenIds The list of token IDs to transfer. */ function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { for (uint256 i; i < _tokenIds.length; i++) { transferFrom(_from, _to, _tokenIds[i]); } } /** * @notice Batch safely transfers tokens from one address to another. * @param _from The address to transfer tokens from. * @param _to The address to transfer tokens to. * @param _tokenIds The list of token IDs to transfer. * @param data_ Additional data to send along with the transfer. */ function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { for (uint256 i; i < _tokenIds.length; i++) { safeTransferFrom(_from, _to, _tokenIds[i], data_); } } /** * @notice Returns the royalty information for a given token ID and sale price. * @dev This function is required by the ERC2981 standard. * @param _salePrice The sale price of the token. * @return receiver The address to receive the royalties. * @return royaltyAmount The amount of royalties owed. */ function royaltyInfo( uint256, uint256 _salePrice ) external view override returns (address receiver, uint256 royaltyAmount) { receiver = project.royaltyAddress; royaltyAmount = (_salePrice * project.royalty) / 10000; } /** * @notice Returns the metadata of the token with the given ID. * @dev It returns a JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { require(_exists(_tokenId), "Token not found"); return string.concat(project.tokenBase, Strings.toString(_tokenId)); } /** * @notice Returns the maximum supply of tokens. * @dev This function is a pure function and returns a constant value. * @return The maximum supply of tokens. */ function maxSupply() public pure returns (uint256) { return 900; } /** * @notice Allows the owner to set the metadata base URL for the project. * @dev Only callable by the owner. * @param _tokenBase String representing the base URL for tokens. */ function setTokenBase(string calldata _tokenBase) public onlyOwner { project.tokenBase = _tokenBase; } /** * @notice Sets the address to receive royalties. * @param _royaltyAddress The new royalty recipient address. */ function setRoyaltyAddress( address payable _royaltyAddress ) public onlyOwner { require(_royaltyAddress != address(0), "Invalid address"); project.royaltyAddress = _royaltyAddress; } /** * @notice Sets the royalty percentage. * @param _royalty The new royalty percentage (out of 10000). */ function setRoyalty(uint96 _royalty) public onlyOwner { require(_royalty <= 10000, "Royalty percentage too high"); project.royalty = _royalty; } function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external override returns (bytes4) { require( msg.sender == project.v1Contract, "Invalid ERC1155 token sender" ); // Additional logic if necessary // Return the acceptance magic value return IERC1155Receiver.onERC1155Received.selector; } function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override returns (bytes4) { require( msg.sender == project.v1Contract, "Invalid ERC1155 token sender" ); // Additional logic if necessary // Return the acceptance magic value return IERC1155Receiver.onERC1155BatchReceived.selector; } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721EnumerableUpgradeable, IERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || // ERC2981 Royalties interfaceId == type(IERC1155Receiver).interfaceId || // ERC1155 Receiver super.supportsInterface(interfaceId); } // Override _msgSender to resolve conflict between base classes. function _msgSender() internal view virtual override(ContextUpgradeable, ERC721C) returns (address) { return super._msgSender(); } // Override _msgData to resolve conflict between base classes. function _msgData() internal view virtual override(ContextUpgradeable, ERC721C) returns (bytes calldata) { return super._msgData(); } function _requireCallerIsContractOwner() internal view virtual override { require(owner() == _msgSender(), "Ownable: Caller is not the owner"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; abstract contract OwnablePermissions is Context { function _requireCallerIsContractOwner() internal view virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ICreatorToken { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (address validator); function setTransferValidator(address validator) external; function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ICreatorTokenLegacy { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (address validator); function setTransferValidator(address validator) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ITransferValidator { function applyCollectionTransferPolicy(address caller, address from, address to) external view; function validateTransfer(address caller, address from, address to) external view; function validateTransfer(address caller, address from, address to, uint256 tokenId) external view; function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external; function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external; function afterAuthorizedTransfer(address token, uint256 tokenId) external; function beforeAuthorizedTransfer(address operator, address token) external; function afterAuthorizedTransfer(address token) external; function beforeAuthorizedTransfer(address token, uint256 tokenId) external; function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external; function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ITransferValidatorSetTokenType { function setTokenTypeOfCollection(address collection, uint16 tokenType) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; /** * @title AutomaticValidatorTransferApproval * @author Limit Break, Inc. * @notice Base contract mix-in that provides boilerplate code giving the contract owner the * option to automatically approve a 721-C transfer validator implementation for transfers. */ abstract contract AutomaticValidatorTransferApproval is OwnablePermissions { /// @dev Emitted when the automatic approval flag is modified by the creator. event AutomaticApprovalOfTransferValidatorSet(bool autoApproved); /// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens. bool public autoApproveTransfersFromValidator; /** * @notice Sets if the transfer validator is automatically approved as an operator for all token owners. * * @dev Throws when the caller is not the contract owner. * * @param autoApprove If true, the collection's transfer validator will be automatically approved to * transfer holder's tokens. */ function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external { _requireCallerIsContractOwner(); autoApproveTransfersFromValidator = autoApprove; emit AutomaticApprovalOfTransferValidatorSet(autoApprove); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; import "../interfaces/ICreatorToken.sol"; import "../interfaces/ICreatorTokenLegacy.sol"; import "../interfaces/ITransferValidator.sol"; import "./TransferValidation.sol"; import "../interfaces/ITransferValidatorSetTokenType.sol"; /** * @title CreatorTokenBase * @author Limit Break, Inc. * @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token * transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3. * This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer * restrictions and security policies. * * <h4>Features:</h4> * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul> * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul> * * <h4>Benefits:</h4> * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul> * <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul> * <ul>Can be easily integrated into other token contracts as a base contract.</ul> * * <h4>Intended Usage:</h4> * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and * security policies.</ul> * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the * creator token.</ul> * * <h4>Compatibility:</h4> * <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul> */ abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken { /// @dev Thrown when setting a transfer validator address that has no deployed code. error CreatorTokenBase__InvalidTransferValidatorContract(); /// @dev The default transfer validator that will be used if no transfer validator has been set by the creator. address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C0078c2328597Ca70F5451ffF5A7B38D4E947); /// @dev Used to determine if the default transfer validator is applied. /// @dev Set to true when the creator sets a transfer validator address. bool private isValidatorInitialized; /// @dev Address of the transfer validator to apply to transactions. address private transferValidator; constructor() { _emitDefaultTransferValidator(); _registerTokenType(DEFAULT_TRANSFER_VALIDATOR); } /** * @notice Sets the transfer validator for the token contract. * * @dev Throws when provided validator contract is not the zero address and does not have code. * @dev Throws when the caller is not the contract owner. * * @dev <h4>Postconditions:</h4> * 1. The transferValidator address is updated. * 2. The `TransferValidatorUpdated` event is emitted. * * @param transferValidator_ The address of the transfer validator contract. */ function setTransferValidator(address transferValidator_) public { _requireCallerIsContractOwner(); bool isValidTransferValidator = transferValidator_.code.length > 0; if(transferValidator_ != address(0) && !isValidTransferValidator) { revert CreatorTokenBase__InvalidTransferValidatorContract(); } emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_); isValidatorInitialized = true; transferValidator = transferValidator_; _registerTokenType(transferValidator_); } /** * @notice Returns the transfer validator contract address for this token contract. */ function getTransferValidator() public view override returns (address validator) { validator = transferValidator; if (validator == address(0)) { if (!isValidatorInitialized) { validator = DEFAULT_TRANSFER_VALIDATOR; } } } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the * transfer validator is expected to pre-validate the transfer. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. * @param tokenId The token id being transferred. */ function _preValidateTransfer( address caller, address from, address to, uint256 tokenId, uint256 /*value*/) internal virtual override { address validator = getTransferValidator(); if (validator != address(0)) { if (msg.sender == validator) { return; } ITransferValidator(validator).validateTransfer(caller, from, to, tokenId); } } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the * transfer validator is expected to pre-validate the transfer. * * @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator. * @dev The `tokenId` for ERC20 tokens should be set to `0`. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. * @param tokenId The token id being transferred. * @param amount The amount of token being transferred. */ function _preValidateTransfer( address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 /*value*/) internal virtual override { address validator = getTransferValidator(); if (validator != address(0)) { if (msg.sender == validator) { return; } ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount); } } function _tokenType() internal virtual pure returns(uint16); function _registerTokenType(address validator) internal { if (validator != address(0)) { uint256 validatorCodeSize; assembly { validatorCodeSize := extcodesize(validator) } if(validatorCodeSize > 0) { try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) { } catch { } } } } /** * @dev Used during contract deployment for constructable and cloneable creator tokens * @dev to emit the `TransferValidatorUpdated` event signaling the validator for the contract * @dev is the default transfer validator. */ function _emitDefaultTransferValidator() internal { emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title TransferValidation * @author Limit Break, Inc. * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks. * Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows * developers to validate or customize transfers within the context of a mint, a burn, or a transfer. */ abstract contract TransferValidation is Context { /// @dev Thrown when the from and to address are both the zero address. error ShouldNotMintToBurnAddress(); /*************************************************************************/ /* Transfers Without Amounts */ /*************************************************************************/ /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /*************************************************************************/ /* Transfers With Amounts */ /*************************************************************************/ /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, amount, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, amount, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, amount, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, amount, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @dev Constant bytes32 value of 0x000...000 bytes32 constant ZERO_BYTES32 = bytes32(0); /// @dev Constant value of 0 uint256 constant ZERO = 0; /// @dev Constant value of 1 uint256 constant ONE = 1; /// @dev Constant value representing an open order in storage uint8 constant ORDER_STATE_OPEN = 0; /// @dev Constant value representing a filled order in storage uint8 constant ORDER_STATE_FILLED = 1; /// @dev Constant value representing a cancelled order in storage uint8 constant ORDER_STATE_CANCELLED = 2; /// @dev Constant value representing the ERC721 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC721 = 721; /// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC1155 = 1155; /// @dev Constant value representing the ERC20 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC20 = 20; /// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s` bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @dev EIP-712 typehash used for validating signature based stored approvals bytes32 constant UPDATE_APPROVAL_TYPEHASH = keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)"); /// @dev EIP-712 typehash used for validating a single use permit without additional data bytes32 constant SINGLE_USE_PERMIT_TYPEHASH = keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)"); /// @dev EIP-712 typehash used for validating a single use permit with additional data string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB = "PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,"; /// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB = "PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,"; /// @dev Pausable flag for stored approval transfers of ERC721 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0; /// @dev Pausable flag for stored approval transfers of ERC1155 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1; /// @dev Pausable flag for stored approval transfers of ERC20 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2; /// @dev Pausable flag for single use permit transfers of ERC721 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3; /// @dev Pausable flag for single use permit transfers of ERC1155 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4; /// @dev Pausable flag for single use permit transfers of ERC20 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5; /// @dev Pausable flag for order fill transfers of ERC1155 assets uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6; /// @dev Pausable flag for order fill transfers of ERC20 assets uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 // 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 pragma solidity ^0.8.20; library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@limitbreak/creator-token-standards/src/utils/AutomaticValidatorTransferApproval.sol"; import "@limitbreak/creator-token-standards/src/utils/CreatorTokenBase.sol"; import "./ERC721Upgradeable.sol"; import "@limitbreak/creator-token-standards/src/interfaces/ITransferValidatorSetTokenType.sol"; import {TOKEN_TYPE_ERC721} from "@limitbreak/permit-c/src/Constants.sol"; /** * @title ERC721C * @author Limit Break, Inc. * @notice Extends OpenZeppelin's ERC721 implementation with Creator Token functionality, which * allows the contract owner to update the transfer validation logic by managing a security policy in * an external transfer validation security policy registry. See {CreatorTokenTransferValidator}. */ abstract contract ERC721C is ERC721Upgradeable, CreatorTokenBase, AutomaticValidatorTransferApproval { /** * @dev Override _msgData to resolve conflict between base classes. */ function _msgData() internal view virtual override(Context, ContextUpgradeable) returns (bytes calldata) { return super._msgData(); // You can choose either ContextUpgradeable._msgData() or OwnableUpgradeable._msgData(). } /** * @dev Override _msgSender to resolve conflict between base classes. */ function _msgSender() internal view virtual override(Context, ContextUpgradeable) returns (address) { return super._msgSender(); // You can choose ContextUpgradeable._msgSender() or OwnableUpgradeable._msgSender(). } /** * @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved * for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers. */ function isApprovedForAll( address owner, address operator ) public view virtual override returns (bool isApproved) { isApproved = super.isApprovedForAll(owner, operator); if (!isApproved) { if (autoApproveTransfersFromValidator) { isApproved = operator == address(getTransferValidator()); } } } /** * @notice Indicates whether the contract implements the specified interface. * @dev Overrides supportsInterface in ERC165. * @param interfaceId The interface id * @return true if the contract implements the specified interface, false otherwise */ function supportsInterface( bytes4 interfaceId ) public view virtual override returns (bool) { return interfaceId == type(ICreatorToken).interfaceId || interfaceId == type(ICreatorTokenLegacy).interfaceId || super.supportsInterface(interfaceId); } /** * @notice Returns the function selector for the transfer validator's validation function to be called * @notice for transaction simulation. */ function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) { functionSignature = bytes4( keccak256("validateTransfer(address,address,address,uint256)") ); isViewFunction = true; } /// @dev Ties the _beforeTokenTransfer hook to transfer validation logic. function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); for (uint256 i = 0; i < batchSize; ) { _validateBeforeTransfer(from, to, firstTokenId + i); unchecked { ++i; } } } /// @dev Ties the _afterTokenTransfer hook to transfer validation logic. function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._afterTokenTransfer(from, to, firstTokenId, batchSize); for (uint256 i = 0; i < batchSize; ) { _validateAfterTransfer(from, to, firstTokenId + i); unchecked { ++i; } } } function _tokenType() internal pure override returns (uint16) { return uint16(TOKEN_TYPE_ERC721); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; /* import "./ERC721Upgradeable.sol"; */ import "./ERC721C.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account but rips out the core of the gas-wasting processing that comes from OpenZeppelin. */ abstract contract ERC721EnumerableUpgradeable is ERC721C, IERC721Enumerable { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721C, IERC165) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || // ERC721 Enumerable super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _normalOwners.length + _specialOwners.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex( uint256 index ) public view virtual override returns (uint256) { require( index < totalSupply(), "ERC721Enumerable: global index out of bounds" ); uint256 numNormalTokens = 870; // Assuming 870 normal tokens uint256 tokenId; uint256 count = 0; // Iterate over normal token range for (tokenId = 0; tokenId < numNormalTokens; tokenId++) { if (_exists(tokenId)) { if (count == index) { return tokenId; } count++; } } // Iterate over special token range for ( tokenId = numNormalTokens; tokenId < numNormalTokens + 30; tokenId++ ) { // Assuming 30 special tokens if (_exists(tokenId)) { if (count == index) { return tokenId; } count++; } } revert("ERC721Enumerable: global index out of bounds"); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex( address owner, uint256 index ) public view virtual override returns (uint256 tokenId) { require( index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds" ); uint256 count; for (uint256 i = 0; i < _normalOwners.length; i++) { if (owner == _normalOwners[i]) { if (count == index) return i; // Token ID for normal tokens else count++; } } uint256 specialIndex = 870; for (uint256 i = 0; i < _specialOwners.length; i++) { if (owner == _specialOwners[i]) { if (count == index) return specialIndex + i; // Token ID for special tokens else count++; } } revert("ERC721Enumerable: owner index out of bounds"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "./Address.sol"; /** * @dev Implementation of the {IERC721} interface. * This is an upgradeable version of the ERC721 contract. */ abstract contract ERC721Upgradeable is ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; // Mapping from token ID to owner address address[] internal _normalOwners; address[] internal _specialOwners; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. * @param name_ The name of the token. * @param symbol_ The symbol of the token. */ function __ERC721_init( string memory name_, string memory symbol_ ) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained( string memory name_, string memory symbol_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf( address owner ) public view virtual override returns (uint256) { require( owner != address(0), "ERC721: balance query for the zero address" ); uint256 count; for (uint256 i; i < _normalOwners.length; ++i) { if (owner == _normalOwners[i]) ++count; } for (uint256 i; i < _specialOwners.length; ++i) { if (owner == _specialOwners[i]) ++count; } return count; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf( uint256 tokenId ) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: owner query for nonexistent token"); address owner; if (tokenId < 870) { owner = _normalOwners[tokenId]; } else { owner = _specialOwners[tokenId - 870]; } require( owner != address(0), "ERC721: owner query for nonexistent token" ); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved( uint256 tokenId ) public view virtual override returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll( address operator, bool approved ) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll( address owner, address operator ) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { if (tokenId < 870) { return tokenId < _normalOwners.length && _normalOwners[tokenId] != address(0); } else { return tokenId < (_specialOwners.length + 870) && _specialOwners[tokenId - 870] != address(0); } } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner( address spender, uint256 tokenId ) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721: operator query for nonexistent token" ); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); if (tokenId < 870) { _normalOwners.push(to); } else { _specialOwners.push(to); } emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own" ); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId); if (tokenId < 870) { _normalOwners[tokenId] = to; } else { _specialOwners[tokenId - 870] = to; } emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received( _msgSender(), from, tokenId, _data ) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert( "ERC721: transfer to non ERC721Receiver implementer" ); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.20; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init(address _ownerOnInit) internal onlyInitializing { __Ownable_init_unchained(_ownerOnInit); } function __Ownable_init_unchained( address _ownerOnInit ) internal onlyInitializing { _transferOwnership(_ownerOnInit); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 150, "details": { "yul": true } }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","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":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newId","type":"uint256"}],"name":"SpecialTokenMinted","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"batchSafeTransferFrom","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":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"tokenBase","type":"string"},{"internalType":"address","name":"v1Contract","type":"address"},{"internalType":"address","name":"v2Contract","type":"address"},{"internalType":"address payable","name":"ownerAddress","type":"address"},{"internalType":"address payable","name":"royaltyAddress","type":"address"},{"internalType":"uint96","name":"royalty","type":"uint96"},{"internalType":"uint24","name":"v1Id","type":"uint24"}],"internalType":"struct GmV3.Project","name":"_p","type":"tuple"}],"name":"initProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"address","name":"a","type":"address"}],"name":"migrateFromV1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"a","type":"address"}],"name":"migrateFromV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","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":"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":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_royalty","type":"uint96"}],"name":"setRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenBase","type":"string"}],"name":"setTokenBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","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":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60808060405234620000d5576000908181527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac604073721c0078c2328597ca70f5451fff5a7b38d4e94792836020820152a1803b6200006e575b60016039556040516138419081620000db8239f35b8082913b15620000d257819060446040518095819363fb2de5d760e01b83523060048401526102d160248401525af11562000059576001600160401b038211620000be5750604052388062000059565b634e487b7160e01b81526041600452602490fd5b50fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c8063014635461461027757806301ffc9a71461027257806306d254da1461026d57806306fdde0314610268578063081812fc14610263578063095ea7b31461025e578063098144d4146102595780630d705df61461025457806318160ddd1461024f57806323b872dd1461024a5780632a55205a146102455780632f745c591461024057806342842e0e1461023b578063438b6300146102365780634f6ccce7146102315780635a4fee301461022c5780636221d13c146102275780636352211e1461022257806370a082311461021d578063715018a614610218578063755206e5146102135780638da5cb5b1461020e578063916358a31461020957806395d89b41146102045780639e05d240146101ff578063a1ec514e146101fa578063a22cb465146101f5578063a9fc664e146101f0578063b88d4fde146101eb578063bc197c81146101e6578063c2bafe52146101e1578063c87b56dd146101dc578063cac92669146101d7578063d5abeb01146101d2578063e985e9c5146101cd578063f23a6e61146101c8578063f2fde38b146101c35763f3993d11146101be57600080fd5b611aaa565b611a10565b6119a1565b611963565b611946565b611898565b6116e9565b6115a8565b611505565b6114af565b6113e4565b6112f4565b611139565b6110cd565b61103e565b610f1d565b610ec7565b610ba4565b610b13565b610aec565b610ace565b610aa8565b610a15565b610890565b610827565b6107ff565b6107d4565b610785565b61075c565b61070d565b6106e5565b6106ca565b6105ab565b61057b565b6104be565b6103d7565b6102cd565b61028c565b600091031261028757565b600080fd5b3461028757600036600319011261028757602060405173721c0078c2328597ca70f5451fff5a7b38d4e9478152f35b6001600160e01b031981160361028757565b34610287576020366003190112610287576103226004356102ed816102bb565b63ffffffff60e01b1663152a902d60e11b81149081156103b5575b8115610326575b5060405190151581529081906020820190565b0390f35b63780e9d6360e01b811491508115610340575b503861030f565b632b435fdb60e21b8114915081156103a4575b8115610361575b5038610339565b6380ac58cd60e01b811491508115610393575b8115610382575b503861035a565b6301ffc9a760e01b1490503861037b565b635b5e139f60e01b81149150610374565b63503e914d60e11b81149150610353565b630271189760e51b81149150610308565b6001600160a01b0381160361028757565b34610287576020366003190112610287576004356103f4816103c6565b6007546001600160a01b03919061040e908316331461263d565b16801561042b57603f80546001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606490fd5b60005b8381106104755750506000910152565b8181015183820152602001610465565b9060209161049e81518092818552858086019101610462565b601f01601f1916010190565b9060206104bb928181520190610485565b90565b3461028757600080600319360112610578576040518180546104df81611c0b565b808452906001908181169081156105505750600114610515575b6103228461050981880382610912565b604051918291826104aa565b93508180526020938483205b82841061053d57505050816103229361050992820101936104f9565b8054858501870152928501928101610521565b61032296506105099450602092508593915060ff191682840152151560051b820101936104f9565b80fd5b34610287576020366003190112610287576020610599600435612ddb565b6040516001600160a01b039091168152f35b34610287576040366003190112610287576004356105c8816103c6565b6024356105d481612d1d565b6001600160a01b03818116908416811461067b573314908115610669575b501561060357610601916135aa565b005b60405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608490fd5b6106759150339061274c565b386105f2565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b34610287576000366003190112610287576020610599611b2a565b34610287576000366003190112610287576040805163657711f560e11b815260016020820152f35b346102875760003660031901126102875760206107286127a8565b604051908152f35b606090600319011261028757600435610748816103c6565b90602435610755816103c6565b9060443590565b346102875761060161076d36610730565b9161078061077b8433612fb7565b612e5e565b613441565b3461028757604036600319011261028757602435603f548060a01c918281029281840414901517156107cf57604080516001600160a01b0390921682526127109092046020820152f35b612209565b346102875760403660031901126102875760206107286004356107f6816103c6565b60243590612989565b346102875761060161081036610730565b906040519261081e846108dc565b60008452612ec4565b34610287576020806003193601126102875761084d600435610848816103c6565b61249e565b906040519181839283018184528251809152816040850193019160005b82811061087957505050500390f35b83518552869550938101939281019260010161086a565b3461028757602036600319011261028757602061072860043561282b565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116108d757604052565b6108ae565b602081019081106001600160401b038211176108d757604052565b604081019081106001600160401b038211176108d757604052565b90601f801991011681019081106001600160401b038211176108d757604052565b6001600160401b0381116108d75760051b60200190565b81601f820112156102875780359161096183610933565b9261096f6040519485610912565b808452602092838086019260051b820101928311610287578301905b828210610999575050505090565b8135815290830190830161098b565b6001600160401b0381116108d757601f01601f191660200190565b9291926109cf826109a8565b916109dd6040519384610912565b829481845281830111610287578281602093846000960137010152565b9080601f83011215610287578160206104bb933591016109c3565b3461028757608036600319011261028757600435610a32816103c6565b60243590610a3f826103c6565b6001600160401b0360443581811161028757610a5f90369060040161094a565b9060643590811161028757610a789036906004016109fa565b60005b82518110156106015780610a9e83610a96610aa3948761248a565b518888612ec4565b61221f565b610a7b565b3461028757600036600319011261028757602060ff60065460a81c166040519015158152f35b34610287576020366003190112610287576020610599600435612d1d565b34610287576020366003190112610287576020610728600435610b0e816103c6565b612c03565b34610287576000806003193601126105785760075481906001600160a01b03811690610b4033831461263d565b6001600160a01b0319166007557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b9181601f84011215610287578235916001600160401b038311610287576020808501948460051b01011161028757565b34610287576040806003193601126102875760049081356001600160401b03811161028757610bd69036908401610b74565b90602435610be3816103c6565b610beb612367565b603d54610c08906001600160a01b03165b6001600160a01b031690565b93600254906003549460009485918660018060a01b03809a16905b828110610c34576106016001603955565b610c3f818486612244565b3586516331a9108f60e11b81528d8180610c63602095869483019190602083019252565b0381875afa908115610df4578e610c8c8f93610cb2948694600092610ea8575b5016331461226e565b895163e985e9c560e01b8152339181019182523060208301529283918291604090910190565b0381875afa908115610df457600091610e7b575b508d8115610df9575b50610cda91506122cf565b610ce5818486612244565b3590823b156102875786516323b872dd60e01b815233818f0190815230602082015260408101939093529160009083908190606001038183875af1918215610df457610d6792610ddb575b508a86610366610d4184888a612244565b351015610d6c575050610a9e610d60610d5a8c8b61235a565b9b61221f565b9a8a613141565b610c23565b610d9a610da0917f9148ffbe75006fe48f56f32dd79f9537af65d84285cc83129455dc22db5da7829361235a565b9761221f565b96610db3610dad8261233b565b8c613141565b610dc8610dc184888a612244565b359161233b565b89519182526020820152604090a161221f565b80610de8610dee926108c4565b8061027c565b38610d30565b611b6a565b610e2a91508290610e0b85888a612244565b35908a51938492839263020604bf60e21b845283019190602083019252565b0381875afa908115610df457610cda92600092610e4e575b50508c1630148d610ccf565b610e6d9250803d10610e74575b610e658183610912565b810190612259565b3880610e42565b503d610e5b565b610e9b9150823d8411610ea1575b610e938183610912565b8101906122ba565b38610cc6565b503d610e89565b610ec0919250853d8711610e7457610e658183610912565b9038610c83565b34610287576000366003190112610287576007546040516001600160a01b039091168152602090f35b9181601f84011215610287578235916001600160401b038311610287576020838186019501011161028757565b3461028757602080600319360112610287576001600160401b0360043581811161028757610f4f903690600401610ef0565b91610f6560018060a01b0360075416331461263d565b82116108d757610f7f82610f7a603b54611c0b565b611c45565b600092601f8311600114610fbd5750918192600092610fb2575b5050600019600383901b1c191660019190911b17603b55005b013590503880610f99565b603b600052601f198316937fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d929181905b868210611026575050836001951061100c575b505050811b01603b55005b0135600019600384901b60f8161c19169055388080611001565b80600184968294958701358155019501920190610fee565b34610287576000806003193601126105785760405181600180549061106282611c0b565b808552918181169081156105505750600114611088576103228461050981880382610912565b80945082526020938483205b8284106110b057505050816103229361050992820101936104f9565b8054858501870152928501928101611094565b8015150361028757565b34610287576020366003190112610287577f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc602060043561110d816110c3565b6111156126f4565b151560065460ff60a81b8260a81b169060ff60a81b191617600655604051908152a1005b3461028757604036600319011261028757602435600435611159826103c6565b611161612367565b603c54611176906001600160a01b0316610bfc565b600254604080549051627eeac760e11b815233600482015262ffffff9091166024820181905291926001600160a01b0316906020908181604481865afa908115610df4576111d09187916000916112c7575b5010156123cc565b60405163e985e9c560e01b81523360048201523060248201528181604481865afa908115610df45761120b926000926112aa575b5050612418565b803b1561028757604051637921219560e11b815233600482015230602482015262ffffff9290921660448301526064820184905260a06084830152600060a4830181905290829060c490829084905af18015610df457611297575b5060005b82811061127b576106016001603955565b80610a9e61128c611292938561235a565b86613141565b61126a565b80610de86112a4926108c4565b38611266565b6112c09250803d10610ea157610e938183610912565b3880611204565b6112e79150843d86116112ed575b6112df8183610912565b8101906123bd565b386111c8565b503d6112d5565b3461028757604036600319011261028757600435611311816103c6565b60243561131d816110c3565b6001600160a01b0382169133831461139f578161135c61136d9233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b3461028757602036600319011261028757600435611401816103c6565b6114096126f4565b6001600160a01b0381161515813b15816114a7575b5061149557807fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61060192611451611b2a565b604080516001600160a01b03928316815292909116602083015290a1600680546001600160a81b031916600883901b610100600160a81b0316176001179055611b76565b6040516332483afb60e01b8152600490fd5b90503861141e565b34610287576080366003190112610287576004356114cc816103c6565b6024356114d8816103c6565b606435916001600160401b038311610287576114fb6106019336906004016109fa565b9160443591612ec4565b346102875760a0366003190112610287576115216004356103c6565b61152c6024356103c6565b6001600160401b036044358181116102875761154c903690600401610b74565b505060643581811161028757611566903690600401610b74565b505060843590811161028757611580903690600401610ef0565b505061032261158d6126d4565b6040516001600160e01b031990911681529081906020820190565b3461028757600319602036820112610287576004356001600160401b039182821161028757610100908236030112610287576000805160206137ec833981519152549160ff8360401c16159216801590816116e1575b60011490816116d7575b1590816116ce575b506116bc576000805160206137ec833981519152805467ffffffffffffffff191660011790556116489082611697575b6004016120af565b61164e57005b6000805160206137ec833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1005b6000805160206137ec833981519152805460ff60401b1916600160401b179055611640565b60405163f92ee8a960e01b8152600490fd5b90501538611610565b303b159150611608565b8391506115fe565b346102875760203660031901126102875760043561170681612f4f565b15611850576000908072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8181811015611842575b50506d04ee2d6d415b85acef810000000080831015611833575b50662386f26fc1000080831015611824575b506305f5e10080831015611815575b5061271080831015611806575b5060648210156117f6575b600a809210156117ec575b60019081602161179f82870161260b565b95860101905b6117b6575b61032261050986612541565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a8353049182156117e7579190826117a5565b6117aa565b916001019161178e565b9190606460029104910191611783565b60049193920491019138611778565b6008919392049101913861176b565b6010919392049101913861175c565b6020919392049101913861174a565b604094500491503880611730565b60405162461bcd60e51b815260206004820152600f60248201526e151bdad95b881b9bdd08199bdd5b99608a1b6044820152606490fd5b6001600160601b0381160361028757565b34610287576020366003190112610287576004356118b581611887565b6118ca60018060a01b0360075416331461263d565b6127106001600160601b0382161161190157603f80546001600160a01b031660a09290921b6001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152601b60248201527f526f79616c74792070657263656e7461676520746f6f206869676800000000006044820152606490fd5b346102875760003660031901126102875760206040516103848152f35b34610287576040366003190112610287576020611997600435611985816103c6565b60243590611992826103c6565b61274c565b6040519015158152f35b346102875760a0366003190112610287576119bd6004356103c6565b6119c86024356103c6565b6084356001600160401b038111610287576119e7903690600401610ef0565b50506119fe60018060a01b03603c54163314612688565b60405163f23a6e6160e01b8152602090f35b3461028757602036600319011261028757600435611a2d816103c6565b6007546001600160a01b0390611a46908216331461263d565b811615611a5657610601906137a2565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b3461028757606036600319011261028757600435611ac7816103c6565b60243590611ad4826103c6565b6044356001600160401b03811161028757611af390369060040161094a565b60005b81518110156106015780610a9e611b10611b25938561248a565b51611b1e61077b8233612fb7565b8686613441565b611af6565b600654600881901c6001600160a01b031691908215611b465750565b60ff1615611b51575b565b73721c0078c2328597ca70f5451fff5a7b38d4e9479150565b6040513d6000823e3d90fd5b6001600160a01b0381169081611b8a575050565b3b611b93575b50565b803b15610287576000809160446040518094819363fb2de5d760e01b83523060048401526102d160248401525af115611b9057611b4f906108c4565b903590601e198136030182121561028757018035906001600160401b0382116102875760200191813603831361028757565b356104bb816103c6565b90600182811c92168015611c3b575b6020831014611c2557565b634e487b7160e01b600052602260045260246000fd5b91607f1691611c1a565b601f8111611c51575050565b600090603b825260208220906020601f850160051c83019410611c8f575b601f0160051c01915b828110611c8457505050565b818155600101611c78565b9092508290611c6f565b601f8111611ca5575050565b60009081805260208220906020601f850160051c83019410611ce2575b601f0160051c01915b828110611cd757505050565b818155600101611ccb565b9092508290611cc2565b601f8111611cf8575050565b600090603a825260208220906020601f850160051c83019410611d36575b601f0160051c01915b828110611d2b57505050565b818155600101611d1f565b9092508290611d16565b90601f8211611d4d575050565b60019160009083825260208220906020601f850160051c83019410611d8d575b601f0160051c01915b828110611d835750505050565b8181558301611d76565b9092508290611d6d565b91906001600160401b0381116108d757611db681610f7a603b54611c0b565b6000601f8211600114611df057819293600092611de5575b50508160011b916000199060031b1c191617603b55565b013590503880611dce565b603b600052601f198216937fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d91805b868110611e575750836001959610611e3d575b505050811b01603b55565b0135600019600384901b60f8161c19169055388080611e32565b90926020600181928686013581550194019101611e1f565b356104bb81611887565b3562ffffff811681036102875790565b611e938180611bcf565b906001600160401b0382116108d757611eb682611eb1603a54611c0b565b611cec565b600090601f83116001146120225792826120039360e093611b4f96600092612017575b50508160011b916000199060031b1c191617603a555b611f05611eff6020830183611bcf565b90611d97565b611f36611f1460408301611c01565b603c80546001600160a01b0319166001600160a01b0392909216919091179055565b611f67611f4560608301611c01565b603d80546001600160a01b0319166001600160a01b0392909216919091179055565b611f98611f7660808301611c01565b603e80546001600160a01b0319166001600160a01b0392909216919091179055565b611fc9611fa760a08301611c01565b603f80546001600160a01b0319166001600160a01b0392909216919091179055565b611ffd611fd860c08301611e6f565b603f80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b01611e79565b62ffffff1662ffffff196040541617604055565b013590503880611ed9565b603a6000527fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e91601f198416815b81811061209757509360e093611b4f969360019383612003981061207d575b505050811b01603a55611eef565b0135600019600384901b60f8161c1916905538808061206f565b91936020600181928787013581550195019201612050565b6120c36120bc8280611bcf565b36916109c3565b604051906120d0826108f7565b60058252602064676d44414f60d81b818401526120eb612a92565b6120f3612a92565b8151906001600160401b0382116108d75760009261211a836121158654611c0b565b611c99565b81601f841160011461217b575091808492611b4f9796946121549692612170575b50508160011b916000199060031b1c1916179055612ac1565b61216b612166610bfc60808401611c01565b61378e565b611e89565b01519050388061213b565b600080529190601f1984167f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639386905b8282106121f1575050926001928592611b4f9998966121549896106121d8575b505050811b019055612ac1565b015160001960f88460031b161c191690553880806121cb565b806001869782949787015181550196019401906121ab565b634e487b7160e01b600052601160045260246000fd5b60001981146107cf5760010190565b634e487b7160e01b600052603260045260246000fd5b91908110156122545760051b0190565b61222e565b9081602091031261028757516104bb816103c6565b1561227557565b60405162461bcd60e51b815260206004820152601960248201527f57616c6c657420646f65736e277420686f6c6420746f6b656e000000000000006044820152606490fd5b9081602091031261028757516104bb816110c3565b156122d657565b60405162461bcd60e51b815260206004820152603760248201527f5632206e6f7420617070726f76656420746f207472616e7366657220746f6b65604482015276371710283632b0b9b29039b2ba1030b8383937bb30b61760491b6064820152608490fd5b9061036682018092116107cf57565b906103669182018092116107cf57565b919082018092116107cf57565b600260395414612378576002603955565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b90816020910312610287575190565b156123d357565b60405162461bcd60e51b815260206004820152601d60248201527f57616c6c657420646f65736e277420686f6c6420763120746f6b656e730000006044820152606490fd5b1561241f57565b60405162461bcd60e51b815260206004820152603d60248201527f436f6e7472616374206e6f7420617070726f76656420746f207472616e73666560448201527f7220746f6b656e2e20506c656173652073657420617070726f76616c2e0000006064820152608490fd5b80518210156122545760209160051b010190565b906124a882612c03565b801561250f576124b781610933565b906124c56040519283610912565b808252601f196124d482610933565b0136602084013760005b8181106124ec575090925050565b806124fa61250a9287612989565b612504828661248a565b5261221f565b6124de565b50905060405161251e816108dc565b60008152600036813790565b9061253d60209282815194859201610462565b0190565b9060405191826000603b5461255581611c0b565b6001918083169081156125e35750600114612588575b505061257a90611b4f9361252a565b03601f198101845283610912565b603b60009081526020935090917fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d5b8383106125cd575050508201018261257a61256b565b80548984018601528895509184019181016125b7565b61257a9450611b4f969350602092915060ff191682860152801515028401019181945061256b565b90612615826109a8565b6126226040519182610912565b8281528092612633601f19916109a8565b0190602036910137565b1561264457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561268f57565b60405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964204552433131353520746f6b656e2073656e646572000000006044820152606490fd5b6126e960018060a01b03603c54163314612688565b63bc197c8160e01b90565b6007546001600160a01b0316330361270857565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b039081166000908152600560209081526040808320858516845290915290205460ff169291908315612783575050565b60ff60065460a81c16612794575050565b80919293506127a1611b2a565b1691161490565b60025460035481018091116107cf5790565b60809060208152602c60208201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b60608201520190565b1561280e57565b60405162461bcd60e51b815280612827600482016127ba565b0390fd5b61283d6128366127a8565b8210612807565b600091825b61036681106128af57506103665b61038481106128725760405162461bcd60e51b815280612827600482016127ba565b61287b81612f4f565b61288e575b6128899061221f565b612850565b928281146128aa576128a26128899161221f565b939050612880565b509050565b6128b881612f4f565b6128cb575b6128c69061221f565b612842565b928281146128aa576128df6128c69161221f565b9390506128bd565b60809060208152602b60208201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b60608201520190565b1561293a57565b60405162461bcd60e51b815280612827600482016128e7565b60025481101561225457600260005260206000200190600090565b60035481101561225457600360005260206000200190600090565b9061299d61299683612c03565b8210612933565b60009081600254905b818110612a415750506003549260005b8481106129d65760405162461bcd60e51b815280612827600482016128e7565b6129fa610bfc6129e58361296e565b905460039190911b1c6001600160a01b031690565b6001600160a01b03831614612a18575b612a139061221f565b6129b6565b92828103612a2d575050506104bb915061234a565b612a39612a139161221f565b939050612a0a565b612a50610bfc6129e583612953565b6001600160a01b03861614612a6e575b612a699061221f565b6129a6565b92828103612a7e57505050905090565b612a8a612a699161221f565b939050612a60565b60ff6000805160206137ec8339815191525460401c1615612aaf57565b604051631afcd79f60e31b8152600490fd5b9081516001600160401b0381116108d757600190612ae881612ae38454611c0b565b611d40565b602080601f8311600114612b23575081929394600092612b18575b5050600019600383901b1c191690821b179055565b015190503880612b03565b6001600052601f198316959091907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6926000905b888210612b8d5750508385969710612b74575b505050811b019055565b015160001960f88460031b161c19169055388080612b6a565b808785968294968601518155019501930190612b57565b15612bab57565b60405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608490fd5b6001600160a01b0316612c17811515612ba4565b60009081600254905b818110612c765750506003549060005b828110612c3d5750505090565b612c4c610bfc6129e58361296e565b8214612c61575b612c5c9061221f565b612c30565b92612c6e612c5c9161221f565b939050612c53565b612c85610bfc6129e583612953565b8314612c9a575b612c959061221f565b612c20565b92612ca7612c959161221f565b939050612c8c565b15612cb657565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608490fd5b610365198101919082116107cf57565b612d2e612d2982612f4f565b612caf565b6000610366821015612d8b57506002548110156122545760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01546001600160a01b03165b6104bb6001600160a01b0382161515612caf565b9061036519908181018181116107cf576003541115612254576003909252017fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316612d77565b612de481612f4f565b15612e04576000908152600460205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b15612e6557565b60405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608490fd5b90612ee8939291612ed861077b8433612fb7565b612ee3838383613441565b613684565b15612eef57565b60405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b61036680821015612f8b575060025481109081612f6a575090565b612f749150612953565b905460039190911b1c6001600160a01b0316151590565b6003549081018091116107cf5781109081612fa4575090565b612f749150612fb290612d0d565b61296e565b612fc082612f4f565b1561301957612fce82612d1d565b6001600160a01b038281168282168114949091908515613001575b5050508215612ff757505090565b6104bb925061274c565b61300e9192939550612ddb565b161491388080612fe9565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b60035490600160401b8210156108d75760018201806003558210156122545760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b0319166001600160a01b03909216919091179055565b60025490600160401b8210156108d75760018201806002558210156122545760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b038116919082156132005761315c82612f4f565b6131bb5781611b4f9361316f8284613244565b6103668210156131ad57613182836130da565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4613244565b6131b683613073565b613182565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60005b600190818110156132815780840184116107cf576001600160a01b03831661327b57604051635cbd944160e01b8152600490fd5b01613247565b50505050565b909160005b60019081811015613302578083018084116107cf576001600160a01b03868116159086161580806132fb575b156132cf57604051635cbd944160e01b8152600490fd5b156132dd575b50500161328c565b156132e9575b806132d5565b6132f590868633613309565b386132e3565b50816132b8565b5050505050565b9092916001600160a01b03918261331e611b2a565b168061332d575b505050505050565b80331461332557803b15610287576000948460849481604051998a98899763657711f560e11b895216600488015216602486015216604484015260648301525afa8015610df457613383575b8080808080613325565b80610de8613390926108c4565b38613379565b60005b600190818110156133025780850185116107cf576001600160a01b038381161590816133de575b50156133d857604051635cbd944160e01b8152600490fd5b01613399565b9050841615386133c0565b156133f057565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b919061344c82612d1d565b6001600160a01b03808516949181168590036134ff57611b4f9484918416906134768215156133e9565b613481838686613287565b61348a83613556565b6103668310156134ea576134c0856134a185612953565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4613396565b6134fa856134a1612fb286612d0d565b6134c0565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608490fd5b600081815260046020526040812080546001600160a01b03191690556001600160a01b0361358383612d1d565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258280a4565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b03806135e384612d1d565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b9081602091031261028757516104bb816102bb565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526104bb92910190610485565b3d1561367f573d90613665826109a8565b916136736040519384610912565b82523d6000602084013e565b606090565b92909190823b15613785576136b7926020926000604051809681958294630a85bd0160e11b9a8b85523360048601613623565b03926001600160a01b03165af160009181613755575b50613747576136da613654565b805190816137425760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b602001fd5b6001600160e01b0319161490565b61377791925060203d811161377e575b61376f8183610912565b81019061360e565b90386136cd565b503d613765565b50505050600190565b611b4f9061379a612a92565b6137a2612a92565b600780546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a356fef0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a264697066735822122077bd119dd7ba763f9a946c5324df09478c7fd04796d039bf419c3119813372f364736f6c63430008140033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c8063014635461461027757806301ffc9a71461027257806306d254da1461026d57806306fdde0314610268578063081812fc14610263578063095ea7b31461025e578063098144d4146102595780630d705df61461025457806318160ddd1461024f57806323b872dd1461024a5780632a55205a146102455780632f745c591461024057806342842e0e1461023b578063438b6300146102365780634f6ccce7146102315780635a4fee301461022c5780636221d13c146102275780636352211e1461022257806370a082311461021d578063715018a614610218578063755206e5146102135780638da5cb5b1461020e578063916358a31461020957806395d89b41146102045780639e05d240146101ff578063a1ec514e146101fa578063a22cb465146101f5578063a9fc664e146101f0578063b88d4fde146101eb578063bc197c81146101e6578063c2bafe52146101e1578063c87b56dd146101dc578063cac92669146101d7578063d5abeb01146101d2578063e985e9c5146101cd578063f23a6e61146101c8578063f2fde38b146101c35763f3993d11146101be57600080fd5b611aaa565b611a10565b6119a1565b611963565b611946565b611898565b6116e9565b6115a8565b611505565b6114af565b6113e4565b6112f4565b611139565b6110cd565b61103e565b610f1d565b610ec7565b610ba4565b610b13565b610aec565b610ace565b610aa8565b610a15565b610890565b610827565b6107ff565b6107d4565b610785565b61075c565b61070d565b6106e5565b6106ca565b6105ab565b61057b565b6104be565b6103d7565b6102cd565b61028c565b600091031261028757565b600080fd5b3461028757600036600319011261028757602060405173721c0078c2328597ca70f5451fff5a7b38d4e9478152f35b6001600160e01b031981160361028757565b34610287576020366003190112610287576103226004356102ed816102bb565b63ffffffff60e01b1663152a902d60e11b81149081156103b5575b8115610326575b5060405190151581529081906020820190565b0390f35b63780e9d6360e01b811491508115610340575b503861030f565b632b435fdb60e21b8114915081156103a4575b8115610361575b5038610339565b6380ac58cd60e01b811491508115610393575b8115610382575b503861035a565b6301ffc9a760e01b1490503861037b565b635b5e139f60e01b81149150610374565b63503e914d60e11b81149150610353565b630271189760e51b81149150610308565b6001600160a01b0381160361028757565b34610287576020366003190112610287576004356103f4816103c6565b6007546001600160a01b03919061040e908316331461263d565b16801561042b57603f80546001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606490fd5b60005b8381106104755750506000910152565b8181015183820152602001610465565b9060209161049e81518092818552858086019101610462565b601f01601f1916010190565b9060206104bb928181520190610485565b90565b3461028757600080600319360112610578576040518180546104df81611c0b565b808452906001908181169081156105505750600114610515575b6103228461050981880382610912565b604051918291826104aa565b93508180526020938483205b82841061053d57505050816103229361050992820101936104f9565b8054858501870152928501928101610521565b61032296506105099450602092508593915060ff191682840152151560051b820101936104f9565b80fd5b34610287576020366003190112610287576020610599600435612ddb565b6040516001600160a01b039091168152f35b34610287576040366003190112610287576004356105c8816103c6565b6024356105d481612d1d565b6001600160a01b03818116908416811461067b573314908115610669575b501561060357610601916135aa565b005b60405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608490fd5b6106759150339061274c565b386105f2565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b34610287576000366003190112610287576020610599611b2a565b34610287576000366003190112610287576040805163657711f560e11b815260016020820152f35b346102875760003660031901126102875760206107286127a8565b604051908152f35b606090600319011261028757600435610748816103c6565b90602435610755816103c6565b9060443590565b346102875761060161076d36610730565b9161078061077b8433612fb7565b612e5e565b613441565b3461028757604036600319011261028757602435603f548060a01c918281029281840414901517156107cf57604080516001600160a01b0390921682526127109092046020820152f35b612209565b346102875760403660031901126102875760206107286004356107f6816103c6565b60243590612989565b346102875761060161081036610730565b906040519261081e846108dc565b60008452612ec4565b34610287576020806003193601126102875761084d600435610848816103c6565b61249e565b906040519181839283018184528251809152816040850193019160005b82811061087957505050500390f35b83518552869550938101939281019260010161086a565b3461028757602036600319011261028757602061072860043561282b565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116108d757604052565b6108ae565b602081019081106001600160401b038211176108d757604052565b604081019081106001600160401b038211176108d757604052565b90601f801991011681019081106001600160401b038211176108d757604052565b6001600160401b0381116108d75760051b60200190565b81601f820112156102875780359161096183610933565b9261096f6040519485610912565b808452602092838086019260051b820101928311610287578301905b828210610999575050505090565b8135815290830190830161098b565b6001600160401b0381116108d757601f01601f191660200190565b9291926109cf826109a8565b916109dd6040519384610912565b829481845281830111610287578281602093846000960137010152565b9080601f83011215610287578160206104bb933591016109c3565b3461028757608036600319011261028757600435610a32816103c6565b60243590610a3f826103c6565b6001600160401b0360443581811161028757610a5f90369060040161094a565b9060643590811161028757610a789036906004016109fa565b60005b82518110156106015780610a9e83610a96610aa3948761248a565b518888612ec4565b61221f565b610a7b565b3461028757600036600319011261028757602060ff60065460a81c166040519015158152f35b34610287576020366003190112610287576020610599600435612d1d565b34610287576020366003190112610287576020610728600435610b0e816103c6565b612c03565b34610287576000806003193601126105785760075481906001600160a01b03811690610b4033831461263d565b6001600160a01b0319166007557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b9181601f84011215610287578235916001600160401b038311610287576020808501948460051b01011161028757565b34610287576040806003193601126102875760049081356001600160401b03811161028757610bd69036908401610b74565b90602435610be3816103c6565b610beb612367565b603d54610c08906001600160a01b03165b6001600160a01b031690565b93600254906003549460009485918660018060a01b03809a16905b828110610c34576106016001603955565b610c3f818486612244565b3586516331a9108f60e11b81528d8180610c63602095869483019190602083019252565b0381875afa908115610df4578e610c8c8f93610cb2948694600092610ea8575b5016331461226e565b895163e985e9c560e01b8152339181019182523060208301529283918291604090910190565b0381875afa908115610df457600091610e7b575b508d8115610df9575b50610cda91506122cf565b610ce5818486612244565b3590823b156102875786516323b872dd60e01b815233818f0190815230602082015260408101939093529160009083908190606001038183875af1918215610df457610d6792610ddb575b508a86610366610d4184888a612244565b351015610d6c575050610a9e610d60610d5a8c8b61235a565b9b61221f565b9a8a613141565b610c23565b610d9a610da0917f9148ffbe75006fe48f56f32dd79f9537af65d84285cc83129455dc22db5da7829361235a565b9761221f565b96610db3610dad8261233b565b8c613141565b610dc8610dc184888a612244565b359161233b565b89519182526020820152604090a161221f565b80610de8610dee926108c4565b8061027c565b38610d30565b611b6a565b610e2a91508290610e0b85888a612244565b35908a51938492839263020604bf60e21b845283019190602083019252565b0381875afa908115610df457610cda92600092610e4e575b50508c1630148d610ccf565b610e6d9250803d10610e74575b610e658183610912565b810190612259565b3880610e42565b503d610e5b565b610e9b9150823d8411610ea1575b610e938183610912565b8101906122ba565b38610cc6565b503d610e89565b610ec0919250853d8711610e7457610e658183610912565b9038610c83565b34610287576000366003190112610287576007546040516001600160a01b039091168152602090f35b9181601f84011215610287578235916001600160401b038311610287576020838186019501011161028757565b3461028757602080600319360112610287576001600160401b0360043581811161028757610f4f903690600401610ef0565b91610f6560018060a01b0360075416331461263d565b82116108d757610f7f82610f7a603b54611c0b565b611c45565b600092601f8311600114610fbd5750918192600092610fb2575b5050600019600383901b1c191660019190911b17603b55005b013590503880610f99565b603b600052601f198316937fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d929181905b868210611026575050836001951061100c575b505050811b01603b55005b0135600019600384901b60f8161c19169055388080611001565b80600184968294958701358155019501920190610fee565b34610287576000806003193601126105785760405181600180549061106282611c0b565b808552918181169081156105505750600114611088576103228461050981880382610912565b80945082526020938483205b8284106110b057505050816103229361050992820101936104f9565b8054858501870152928501928101611094565b8015150361028757565b34610287576020366003190112610287577f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc602060043561110d816110c3565b6111156126f4565b151560065460ff60a81b8260a81b169060ff60a81b191617600655604051908152a1005b3461028757604036600319011261028757602435600435611159826103c6565b611161612367565b603c54611176906001600160a01b0316610bfc565b600254604080549051627eeac760e11b815233600482015262ffffff9091166024820181905291926001600160a01b0316906020908181604481865afa908115610df4576111d09187916000916112c7575b5010156123cc565b60405163e985e9c560e01b81523360048201523060248201528181604481865afa908115610df45761120b926000926112aa575b5050612418565b803b1561028757604051637921219560e11b815233600482015230602482015262ffffff9290921660448301526064820184905260a06084830152600060a4830181905290829060c490829084905af18015610df457611297575b5060005b82811061127b576106016001603955565b80610a9e61128c611292938561235a565b86613141565b61126a565b80610de86112a4926108c4565b38611266565b6112c09250803d10610ea157610e938183610912565b3880611204565b6112e79150843d86116112ed575b6112df8183610912565b8101906123bd565b386111c8565b503d6112d5565b3461028757604036600319011261028757600435611311816103c6565b60243561131d816110c3565b6001600160a01b0382169133831461139f578161135c61136d9233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b3461028757602036600319011261028757600435611401816103c6565b6114096126f4565b6001600160a01b0381161515813b15816114a7575b5061149557807fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61060192611451611b2a565b604080516001600160a01b03928316815292909116602083015290a1600680546001600160a81b031916600883901b610100600160a81b0316176001179055611b76565b6040516332483afb60e01b8152600490fd5b90503861141e565b34610287576080366003190112610287576004356114cc816103c6565b6024356114d8816103c6565b606435916001600160401b038311610287576114fb6106019336906004016109fa565b9160443591612ec4565b346102875760a0366003190112610287576115216004356103c6565b61152c6024356103c6565b6001600160401b036044358181116102875761154c903690600401610b74565b505060643581811161028757611566903690600401610b74565b505060843590811161028757611580903690600401610ef0565b505061032261158d6126d4565b6040516001600160e01b031990911681529081906020820190565b3461028757600319602036820112610287576004356001600160401b039182821161028757610100908236030112610287576000805160206137ec833981519152549160ff8360401c16159216801590816116e1575b60011490816116d7575b1590816116ce575b506116bc576000805160206137ec833981519152805467ffffffffffffffff191660011790556116489082611697575b6004016120af565b61164e57005b6000805160206137ec833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1005b6000805160206137ec833981519152805460ff60401b1916600160401b179055611640565b60405163f92ee8a960e01b8152600490fd5b90501538611610565b303b159150611608565b8391506115fe565b346102875760203660031901126102875760043561170681612f4f565b15611850576000908072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8181811015611842575b50506d04ee2d6d415b85acef810000000080831015611833575b50662386f26fc1000080831015611824575b506305f5e10080831015611815575b5061271080831015611806575b5060648210156117f6575b600a809210156117ec575b60019081602161179f82870161260b565b95860101905b6117b6575b61032261050986612541565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a8353049182156117e7579190826117a5565b6117aa565b916001019161178e565b9190606460029104910191611783565b60049193920491019138611778565b6008919392049101913861176b565b6010919392049101913861175c565b6020919392049101913861174a565b604094500491503880611730565b60405162461bcd60e51b815260206004820152600f60248201526e151bdad95b881b9bdd08199bdd5b99608a1b6044820152606490fd5b6001600160601b0381160361028757565b34610287576020366003190112610287576004356118b581611887565b6118ca60018060a01b0360075416331461263d565b6127106001600160601b0382161161190157603f80546001600160a01b031660a09290921b6001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152601b60248201527f526f79616c74792070657263656e7461676520746f6f206869676800000000006044820152606490fd5b346102875760003660031901126102875760206040516103848152f35b34610287576040366003190112610287576020611997600435611985816103c6565b60243590611992826103c6565b61274c565b6040519015158152f35b346102875760a0366003190112610287576119bd6004356103c6565b6119c86024356103c6565b6084356001600160401b038111610287576119e7903690600401610ef0565b50506119fe60018060a01b03603c54163314612688565b60405163f23a6e6160e01b8152602090f35b3461028757602036600319011261028757600435611a2d816103c6565b6007546001600160a01b0390611a46908216331461263d565b811615611a5657610601906137a2565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b3461028757606036600319011261028757600435611ac7816103c6565b60243590611ad4826103c6565b6044356001600160401b03811161028757611af390369060040161094a565b60005b81518110156106015780610a9e611b10611b25938561248a565b51611b1e61077b8233612fb7565b8686613441565b611af6565b600654600881901c6001600160a01b031691908215611b465750565b60ff1615611b51575b565b73721c0078c2328597ca70f5451fff5a7b38d4e9479150565b6040513d6000823e3d90fd5b6001600160a01b0381169081611b8a575050565b3b611b93575b50565b803b15610287576000809160446040518094819363fb2de5d760e01b83523060048401526102d160248401525af115611b9057611b4f906108c4565b903590601e198136030182121561028757018035906001600160401b0382116102875760200191813603831361028757565b356104bb816103c6565b90600182811c92168015611c3b575b6020831014611c2557565b634e487b7160e01b600052602260045260246000fd5b91607f1691611c1a565b601f8111611c51575050565b600090603b825260208220906020601f850160051c83019410611c8f575b601f0160051c01915b828110611c8457505050565b818155600101611c78565b9092508290611c6f565b601f8111611ca5575050565b60009081805260208220906020601f850160051c83019410611ce2575b601f0160051c01915b828110611cd757505050565b818155600101611ccb565b9092508290611cc2565b601f8111611cf8575050565b600090603a825260208220906020601f850160051c83019410611d36575b601f0160051c01915b828110611d2b57505050565b818155600101611d1f565b9092508290611d16565b90601f8211611d4d575050565b60019160009083825260208220906020601f850160051c83019410611d8d575b601f0160051c01915b828110611d835750505050565b8181558301611d76565b9092508290611d6d565b91906001600160401b0381116108d757611db681610f7a603b54611c0b565b6000601f8211600114611df057819293600092611de5575b50508160011b916000199060031b1c191617603b55565b013590503880611dce565b603b600052601f198216937fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d91805b868110611e575750836001959610611e3d575b505050811b01603b55565b0135600019600384901b60f8161c19169055388080611e32565b90926020600181928686013581550194019101611e1f565b356104bb81611887565b3562ffffff811681036102875790565b611e938180611bcf565b906001600160401b0382116108d757611eb682611eb1603a54611c0b565b611cec565b600090601f83116001146120225792826120039360e093611b4f96600092612017575b50508160011b916000199060031b1c191617603a555b611f05611eff6020830183611bcf565b90611d97565b611f36611f1460408301611c01565b603c80546001600160a01b0319166001600160a01b0392909216919091179055565b611f67611f4560608301611c01565b603d80546001600160a01b0319166001600160a01b0392909216919091179055565b611f98611f7660808301611c01565b603e80546001600160a01b0319166001600160a01b0392909216919091179055565b611fc9611fa760a08301611c01565b603f80546001600160a01b0319166001600160a01b0392909216919091179055565b611ffd611fd860c08301611e6f565b603f80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b01611e79565b62ffffff1662ffffff196040541617604055565b013590503880611ed9565b603a6000527fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e91601f198416815b81811061209757509360e093611b4f969360019383612003981061207d575b505050811b01603a55611eef565b0135600019600384901b60f8161c1916905538808061206f565b91936020600181928787013581550195019201612050565b6120c36120bc8280611bcf565b36916109c3565b604051906120d0826108f7565b60058252602064676d44414f60d81b818401526120eb612a92565b6120f3612a92565b8151906001600160401b0382116108d75760009261211a836121158654611c0b565b611c99565b81601f841160011461217b575091808492611b4f9796946121549692612170575b50508160011b916000199060031b1c1916179055612ac1565b61216b612166610bfc60808401611c01565b61378e565b611e89565b01519050388061213b565b600080529190601f1984167f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639386905b8282106121f1575050926001928592611b4f9998966121549896106121d8575b505050811b019055612ac1565b015160001960f88460031b161c191690553880806121cb565b806001869782949787015181550196019401906121ab565b634e487b7160e01b600052601160045260246000fd5b60001981146107cf5760010190565b634e487b7160e01b600052603260045260246000fd5b91908110156122545760051b0190565b61222e565b9081602091031261028757516104bb816103c6565b1561227557565b60405162461bcd60e51b815260206004820152601960248201527f57616c6c657420646f65736e277420686f6c6420746f6b656e000000000000006044820152606490fd5b9081602091031261028757516104bb816110c3565b156122d657565b60405162461bcd60e51b815260206004820152603760248201527f5632206e6f7420617070726f76656420746f207472616e7366657220746f6b65604482015276371710283632b0b9b29039b2ba1030b8383937bb30b61760491b6064820152608490fd5b9061036682018092116107cf57565b906103669182018092116107cf57565b919082018092116107cf57565b600260395414612378576002603955565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b90816020910312610287575190565b156123d357565b60405162461bcd60e51b815260206004820152601d60248201527f57616c6c657420646f65736e277420686f6c6420763120746f6b656e730000006044820152606490fd5b1561241f57565b60405162461bcd60e51b815260206004820152603d60248201527f436f6e7472616374206e6f7420617070726f76656420746f207472616e73666560448201527f7220746f6b656e2e20506c656173652073657420617070726f76616c2e0000006064820152608490fd5b80518210156122545760209160051b010190565b906124a882612c03565b801561250f576124b781610933565b906124c56040519283610912565b808252601f196124d482610933565b0136602084013760005b8181106124ec575090925050565b806124fa61250a9287612989565b612504828661248a565b5261221f565b6124de565b50905060405161251e816108dc565b60008152600036813790565b9061253d60209282815194859201610462565b0190565b9060405191826000603b5461255581611c0b565b6001918083169081156125e35750600114612588575b505061257a90611b4f9361252a565b03601f198101845283610912565b603b60009081526020935090917fbbe3212124853f8b0084a66a2d057c2966e251e132af3691db153ab65f0d1a4d5b8383106125cd575050508201018261257a61256b565b80548984018601528895509184019181016125b7565b61257a9450611b4f969350602092915060ff191682860152801515028401019181945061256b565b90612615826109a8565b6126226040519182610912565b8281528092612633601f19916109a8565b0190602036910137565b1561264457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561268f57565b60405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964204552433131353520746f6b656e2073656e646572000000006044820152606490fd5b6126e960018060a01b03603c54163314612688565b63bc197c8160e01b90565b6007546001600160a01b0316330361270857565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b039081166000908152600560209081526040808320858516845290915290205460ff169291908315612783575050565b60ff60065460a81c16612794575050565b80919293506127a1611b2a565b1691161490565b60025460035481018091116107cf5790565b60809060208152602c60208201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b60608201520190565b1561280e57565b60405162461bcd60e51b815280612827600482016127ba565b0390fd5b61283d6128366127a8565b8210612807565b600091825b61036681106128af57506103665b61038481106128725760405162461bcd60e51b815280612827600482016127ba565b61287b81612f4f565b61288e575b6128899061221f565b612850565b928281146128aa576128a26128899161221f565b939050612880565b509050565b6128b881612f4f565b6128cb575b6128c69061221f565b612842565b928281146128aa576128df6128c69161221f565b9390506128bd565b60809060208152602b60208201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b60608201520190565b1561293a57565b60405162461bcd60e51b815280612827600482016128e7565b60025481101561225457600260005260206000200190600090565b60035481101561225457600360005260206000200190600090565b9061299d61299683612c03565b8210612933565b60009081600254905b818110612a415750506003549260005b8481106129d65760405162461bcd60e51b815280612827600482016128e7565b6129fa610bfc6129e58361296e565b905460039190911b1c6001600160a01b031690565b6001600160a01b03831614612a18575b612a139061221f565b6129b6565b92828103612a2d575050506104bb915061234a565b612a39612a139161221f565b939050612a0a565b612a50610bfc6129e583612953565b6001600160a01b03861614612a6e575b612a699061221f565b6129a6565b92828103612a7e57505050905090565b612a8a612a699161221f565b939050612a60565b60ff6000805160206137ec8339815191525460401c1615612aaf57565b604051631afcd79f60e31b8152600490fd5b9081516001600160401b0381116108d757600190612ae881612ae38454611c0b565b611d40565b602080601f8311600114612b23575081929394600092612b18575b5050600019600383901b1c191690821b179055565b015190503880612b03565b6001600052601f198316959091907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6926000905b888210612b8d5750508385969710612b74575b505050811b019055565b015160001960f88460031b161c19169055388080612b6a565b808785968294968601518155019501930190612b57565b15612bab57565b60405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608490fd5b6001600160a01b0316612c17811515612ba4565b60009081600254905b818110612c765750506003549060005b828110612c3d5750505090565b612c4c610bfc6129e58361296e565b8214612c61575b612c5c9061221f565b612c30565b92612c6e612c5c9161221f565b939050612c53565b612c85610bfc6129e583612953565b8314612c9a575b612c959061221f565b612c20565b92612ca7612c959161221f565b939050612c8c565b15612cb657565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608490fd5b610365198101919082116107cf57565b612d2e612d2982612f4f565b612caf565b6000610366821015612d8b57506002548110156122545760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01546001600160a01b03165b6104bb6001600160a01b0382161515612caf565b9061036519908181018181116107cf576003541115612254576003909252017fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316612d77565b612de481612f4f565b15612e04576000908152600460205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b15612e6557565b60405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608490fd5b90612ee8939291612ed861077b8433612fb7565b612ee3838383613441565b613684565b15612eef57565b60405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b61036680821015612f8b575060025481109081612f6a575090565b612f749150612953565b905460039190911b1c6001600160a01b0316151590565b6003549081018091116107cf5781109081612fa4575090565b612f749150612fb290612d0d565b61296e565b612fc082612f4f565b1561301957612fce82612d1d565b6001600160a01b038281168282168114949091908515613001575b5050508215612ff757505090565b6104bb925061274c565b61300e9192939550612ddb565b161491388080612fe9565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b60035490600160401b8210156108d75760018201806003558210156122545760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b0319166001600160a01b03909216919091179055565b60025490600160401b8210156108d75760018201806002558210156122545760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b038116919082156132005761315c82612f4f565b6131bb5781611b4f9361316f8284613244565b6103668210156131ad57613182836130da565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4613244565b6131b683613073565b613182565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60005b600190818110156132815780840184116107cf576001600160a01b03831661327b57604051635cbd944160e01b8152600490fd5b01613247565b50505050565b909160005b60019081811015613302578083018084116107cf576001600160a01b03868116159086161580806132fb575b156132cf57604051635cbd944160e01b8152600490fd5b156132dd575b50500161328c565b156132e9575b806132d5565b6132f590868633613309565b386132e3565b50816132b8565b5050505050565b9092916001600160a01b03918261331e611b2a565b168061332d575b505050505050565b80331461332557803b15610287576000948460849481604051998a98899763657711f560e11b895216600488015216602486015216604484015260648301525afa8015610df457613383575b8080808080613325565b80610de8613390926108c4565b38613379565b60005b600190818110156133025780850185116107cf576001600160a01b038381161590816133de575b50156133d857604051635cbd944160e01b8152600490fd5b01613399565b9050841615386133c0565b156133f057565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b919061344c82612d1d565b6001600160a01b03808516949181168590036134ff57611b4f9484918416906134768215156133e9565b613481838686613287565b61348a83613556565b6103668310156134ea576134c0856134a185612953565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4613396565b6134fa856134a1612fb286612d0d565b6134c0565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608490fd5b600081815260046020526040812080546001600160a01b03191690556001600160a01b0361358383612d1d565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258280a4565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b03806135e384612d1d565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b9081602091031261028757516104bb816102bb565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526104bb92910190610485565b3d1561367f573d90613665826109a8565b916136736040519384610912565b82523d6000602084013e565b606090565b92909190823b15613785576136b7926020926000604051809681958294630a85bd0160e11b9a8b85523360048601613623565b03926001600160a01b03165af160009181613755575b50613747576136da613654565b805190816137425760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b602001fd5b6001600160e01b0319161490565b61377791925060203d811161377e575b61376f8183610912565b81019061360e565b90386136cd565b503d613765565b50505050600190565b611b4f9061379a612a92565b6137a2612a92565b600780546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a356fef0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a264697066735822122077bd119dd7ba763f9a946c5324df09478c7fd04796d039bf419c3119813372f364736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.