Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 5 from a total of 5 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Owner Create Clo... | 19730597 | 260 days ago | IN | 0 ETH | 0.00128492 | ||||
Owner Create Clo... | 19607766 | 277 days ago | IN | 0 ETH | 0.00272218 | ||||
Owner Create Clo... | 16875741 | 661 days ago | IN | 0 ETH | 0.0026449 | ||||
Owner Create Clo... | 16605820 | 699 days ago | IN | 0 ETH | 0.00357481 | ||||
Transfer Ownersh... | 16598000 | 700 days ago | IN | 0 ETH | 0.00053431 |
Latest 5 internal transactions
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
19730597 | 260 days ago | Contract Creation | 0 ETH | |||
19607766 | 277 days ago | Contract Creation | 0 ETH | |||
16875741 | 661 days ago | Contract Creation | 0 ETH | |||
16605820 | 699 days ago | Contract Creation | 0 ETH | |||
16561255 | 705 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ApeTapesContractWizard
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./ERC721JUpgradeable.sol"; import "@openzeppelin/contracts/proxy/Clones.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IContractWizard.sol"; // Interface Id: 0xeb4285e2 // Ape Tapes Contract Wizard // Jason DeSante // // contract ApeTapesContractWizard is ERC165, Ownable, IContractWizard { address immutable tokenImplementation; constructor() { tokenImplementation = address(new ERC721J()); } // Token name string private _name = "Ape Tapes Contract Wizard"; // Contract ids is the total number of all the clone contracts made uint256 private _contractIds; // Mint price to create contract uint256 private _mintPrice = 1000000000000000000; // Define Contract URI string private _contractURI; // Mapping contract id with clone address mapping(uint256 => address) private cloneLibrary; // Price in wei for erc-20 address mapping(address => uint256) private _tokenPrice; // Declaring new events event TokenPriceSet(address indexed tokenContract, uint256 price); event ContractURIChange(string indexed oldContractURI); // ERC165 support function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IContractWizard).interfaceId || super.supportsInterface(interfaceId); } // Returns a contract address when you enter in a contract id. function contractByIndex(uint256 contractId) public view override returns (address) { if (contractId >= _contractIds) revert TokenIndexOutOfBounds(); return cloneLibrary[contractId]; } // Returns the a number in the index if the contract is in the directory. function inCollection(address contractAddress) public view override returns (uint256) { uint256 contractsMintedSoFar = _contractIds; unchecked { for (uint256 i; i <= contractsMintedSoFar; ++i) { if (cloneLibrary[i] == contractAddress) return i; } } // Execution should never reach this point. assert(false); return 0; } // Creates a clone. function createClone( string calldata cloneName, string calldata cloneSymbol, uint256 mintPriceWei ) public payable override returns (address) { // Requires eth if (msg.value < _mintPrice) revert NotEnoughEther(); // Creates clone address clone = Clones.clone(tokenImplementation); ERC721J(clone).initialize(cloneName, cloneSymbol, msg.sender, mintPriceWei); // Finds the next contract id uint256 contractId = _contractIds; // Assigns clone a contract id cloneLibrary[contractId] = clone; emit NewContract(clone, contractId); ++contractId; _contractIds = contractId; return clone; } // Creates a clone paying with an ERC20 token function createCloneToken( string calldata cloneName, string calldata cloneSymbol, uint256 mintPriceWei, address token ) public override returns (address) { // Requires token if (ERC20Upgradeable(token).balanceOf(msg.sender) < _tokenPrice[token]) revert NotEnoughEther(); // Checks if contract is approved if (_tokenPrice[token] == 0) revert TokenNotApproved(); // Transfer tokens ERC20Upgradeable(token).transferFrom( msg.sender, owner(), _tokenPrice[token] ); // Creates clone address clone = Clones.clone(tokenImplementation); ERC721J(clone).initialize(cloneName, cloneSymbol, msg.sender, mintPriceWei); // Finds the next contract id uint256 contractId = _contractIds; // Assigns clone a contract id cloneLibrary[contractId] = clone; emit NewContract(clone, contractId); ++contractId; _contractIds = contractId; return clone; } // Owner creates a clone. function ownerCreateClone( string calldata cloneName, string calldata cloneSymbol, uint256 mintPriceWei ) public onlyOwner returns (address) { // Creates clone address clone = Clones.clone(tokenImplementation); ERC721J(clone).initialize(cloneName, cloneSymbol, msg.sender, mintPriceWei); // Finds the next contract id uint256 contractId = _contractIds; // Assigns clone a contract id cloneLibrary[contractId] = clone; emit NewContract(clone, contractId); ++contractId; _contractIds = contractId; return clone; } // Owner adds a contract to the library. function ownerAddContract( address contractAddress ) public onlyOwner returns (address) { // Finds the next contract id uint256 contractId = _contractIds; // Assigns address a contract id cloneLibrary[contractId] = contractAddress; emit NewContract(contractAddress, contractId); ++contractId; _contractIds = contractId; return contractAddress; } // Returns the name of the contract function name() public view virtual override returns (string memory) { return _name; } // Returns contractURI internally function contractURI() public view virtual override returns (string memory) { return (_contractURI); } // Sets the contractURI function setContractURI(string memory uri) public virtual onlyOwner { emit ContractURIChange(_contractURI); _contractURI = uri; } // Returns the total amount of contracts made by the wizard function totalSupply() public view virtual override returns (uint256) { return _contractIds; } // Returns Mint Price function mintPrice() public view virtual override returns (uint256) { return _mintPrice; } // Sets the Mint Price in Wei function setMintPrice(uint256 priceWei) public virtual onlyOwner { _mintPrice = priceWei; } // Returns Token Mint Price function tokenMintPrice(address token) public view virtual override returns (uint256) { return _tokenPrice[token]; } // Sets the Token Mint Price in Wei function setTokenMintPrice(address token, uint256 price) public virtual onlyOwner { _tokenPrice[token] = price; emit TokenPriceSet(token, price); } // Function to withdraw all Ether from this contract. function withdraw() public onlyOwner { uint256 amount = address(this).balance; // Payable address can receive Ether address payable owner; owner = payable(msg.sender); // Send all Ether to owner (bool success, ) = owner.call{value: amount}(""); require(success, "Failed to send Ether"); } } // //
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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() internal onlyInitializing { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @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); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} uint256[45] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 IERC721ReceiverUpgradeable { /** * @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 `IERC721.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 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @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 tokenId); /** * @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 "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @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 v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } 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; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; // Interface Id: 0x80ac58cd import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; // Interface Id: 0x150b7a02 import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; // Interface Id: 0x5b5e139f import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol"; // Interface Id: 0x780e9d63 import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./IERC721JUpgradeable.sol"; // Interface Id: 0x75b86392 import "./IERC721JFullUpgradeable.sol"; // Interface Id: 0xa360e0cd import "./IERC721JPromoUpgradeable.sol"; // Interface Id: 0x17bbaa28 import "./IERC721JEnumerableUpgradeable.sol"; // Interface Id: 0xd2ac8720 import "./IERC2981Upgradeable.sol"; // Interface Id: 0x2a55205a error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MaxCopiesReached(); error MintToZeroAddress(); error NotEnoughEther(); error OwnerIndexOutOfBounds(); error OwnerIsOperator(); error OwnerQueryForNonexistentToken(); error QueryForNonexistentToken(); error SenderNotOwner(); error TokenAlreadyMinted(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); error URIQueryForNonexistentSong(); error TokenNotApproved(); error TokenBalanceZero(); error TokenAlreadyClaimed(); error GenerationOutOne(); error GenerationOutZero(); error SongInZero(); error NewMaxLessThanCurrentSupply(); error InvalidGeneration(); error RecycleDisabled(); error RoyaltyBPSTooHigh(); // // Version 2 of ERC721J // Jason DeSante // // Supports 1/1 original master with any edition size. // Minting a copy requires the minter to own a copy, // or for the token to be staked. // // // New in v2: custom max supply, // Mint price can be set, in eth and any erc-20 token. // Rarity affected by generation of copy // Added public mint switch (staking to the store) as an option to mint copies traditionally. // Added recycle to burn 2 songs to mint 1. Recycling is an opt in option. // Added promo system. Supports ERC721 tokens, and 721J support letting you set promos with rarity and songId. Each promo has it's own price multiplier. // Added and the ability to change the max editions of a song, the name or symbol of the contract. // Added a rarity price multiplier to make the price different for specific rarities. // Added support for splits, each song can send it's tokens to a specified address. // Added support for IERC-2981, and on chain royalties. // Added 4 interfaces to represent the essential functions in 4 main pieces of the 721J // IERC721J for the main parts, IERC721JFull for the full essentials, IERC721JPromo for the promo system, IERC721JEnumerable for the indexes // // // contract ERC721J is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable, IERC721EnumerableUpgradeable, OwnableUpgradeable, IERC721JUpgradeable, IERC721JFullUpgradeable, IERC721JPromoUpgradeable, IERC721JEnumerableUpgradeable, IERC2981Upgradeable { function initialize( string memory cloneName, string memory cloneSymbol, address cloneOwner, uint256 cloneMintPrice ) public virtual initializer { __ERC721J_init(cloneName, cloneSymbol, cloneOwner, cloneMintPrice); } using AddressUpgradeable for address; using StringsUpgradeable for uint256; // _tokenIds and _songIds for keeping track of the ongoing total tokenids, and total songids uint256 private _tokenIds; uint256 private _songIds; // Token name string private _name; // Token symbol string private _symbol; // Define the baseURI string private _baseURI; // Define mint price uint256 private _mintPrice; // Define royalty BPS uint256 private _royaltyBPS; // Define Contract URI string private _contractURI; // Define toggle recycle bool private _enableRecycle; struct tokenInfo { uint128 song; uint128 generation; } // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Mapping for song URIs. Takes songId then songGeneration combined as a number with a string for the URI. mapping(uint256 => string) private _songURIs; // Mapping of songIds to counters of copies minted for each song mapping(uint256 => uint256) private _songSerials; // Mapping for the extra info to each tokenId mapping(uint256 => tokenInfo) private _tokenIdInfo; // Mapping for the max songs. Takes songId then max amount of editions for that song. mapping(uint256 => uint256) private _maxEditions; // Mapping for erc-20 token addresses and their price in wei mapping(address => uint256) private _tokenPrice; // True or false for a tokenId if public mint (staking) is on for it mapping(uint256 => bool) private _publicMint; // Mapping for song splits. Takes songId with the address. mapping(uint256 => address payable) private _songSplits; // Mapping for rarity multipliers. Takes generation number with the multiplier percent number. mapping(uint256 => uint256) private _rarityMultipliers; // Declaring new events event TokenPriceSet(address indexed tokenContract, uint256 price); event NewMax(uint256 indexed songId, uint256 maxEditions); event NewSongURI(uint256 indexed songId, uint256 indexed generation); event NameChange(string indexed oldName); event SymbolChange(string indexed oldSymbol); event BaseURIChange(string indexed oldBaseURI); event ContractURIChange(string indexed oldContractURI); event TogglePublic(uint256 indexed tokenId); event NewSplit(uint256 indexed songId, address payable splitAddress); event NewMultiplier(uint256 indexed generation, uint256 multiplierPercent); // Initializes the contract and sets variables function __ERC721J_init( string memory name_, string memory symbol_, address owner, uint256 mintPrice_ ) internal onlyInitializing { __ERC721J_init_unchained(name_, symbol_, owner, mintPrice_); } function __ERC721J_init_unchained( string memory name_, string memory symbol_, address owner, uint256 mintPrice_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; _transferOwnership(owner); _mintPrice = mintPrice_; } // // From erc721enumerable // // Function returns the total supply of tokens minted by the contract function totalSupply() public view virtual override returns (uint256) { return _tokenIds; } function tokenByIndex(uint256 index) public view override returns (uint256) { if (index > _tokenIds - 1) revert TokenIndexOutOfBounds(); return index + 1; } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { if (index > balanceOf(owner)) revert OwnerIndexOutOfBounds(); uint256 numMintedSoFar = _tokenIds; uint256 tokenIdsIdx; address currOwnershipAddr; unchecked { for (uint256 i; i <= numMintedSoFar; ++i) { address ownership = _owners[i]; if (ownership != address(0)) { currOwnershipAddr = ownership; } if (currOwnershipAddr == owner && ownership != address(0)) { if (tokenIdsIdx == index) { return i; } ++tokenIdsIdx; } } } // Execution should never reach this point. assert(false); return 0; } // Returns the serial # of a songId function tokenOfSongByIndex(uint256 songId, uint256 index) public view override returns (uint256) { if (index > _songSerials[songId]) revert OwnerIndexOutOfBounds(); uint256 numMintedSoFar = _tokenIds; uint256 tokenIdsIdx; uint256 currSong; unchecked { for (uint256 i; i <= numMintedSoFar; ++i) { uint256 song = _tokenIdInfo[i].song; if (song != 0) { currSong = song; } if (currSong == songId && _owners[i] != address(0)) { if (tokenIdsIdx == index) { return i; } ++tokenIdsIdx; } } } // Execution should never reach this point. assert(false); return 0; } // Returns every song that has public mint set to true function tokenOfPublicByIndex(uint256 index) public view override returns (uint256) { uint256 numMintedSoFar = _tokenIds; if (index > numMintedSoFar) revert OwnerIndexOutOfBounds(); uint256 tokenIdsIdx; unchecked { for (uint256 i; i <= numMintedSoFar; ++i) { bool _public = _publicMint[i]; uint256 _song = _tokenIdInfo[i].song; if ( _public != false && _owners[i] != address(0) && _songSerials[_song] != _maxEditions[_song] ) { if (tokenIdsIdx == index) { return i; } ++tokenIdsIdx; } } } // Execution should never reach this point. assert(false); return 0; } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721ReceiverUpgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || interfaceId == type(IERC721JUpgradeable).interfaceId || interfaceId == type(IERC721JFullUpgradeable).interfaceId || interfaceId == type(IERC721JPromoUpgradeable).interfaceId || interfaceId == type(IERC721JEnumerableUpgradeable).interfaceId || interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _balances[owner]; } function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; if (owner == address(0)) revert OwnerQueryForNonexistentToken(); return owner; } // Returns the name for the contract function name() public view virtual override returns (string memory) { return _name; } // Sets the name function setName(string memory newName) public virtual onlyOwner { emit NameChange(_name); _name = newName; } // Returns the symbol for the contract function symbol() public view virtual override returns (string memory) { return _symbol; } // Sets the symbol function setSymbol(string memory newSymbol) public virtual onlyOwner { emit SymbolChange(_symbol); _symbol = newSymbol; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); uint256 songId = _tokenIdInfo[tokenId].song; uint256 songGeneration = _tokenIdInfo[tokenId].generation; string memory _tokenURI; // Shows different uri depending on serial number _tokenURI = _songURIs[(songId * (10**18)) + songGeneration]; for (uint256 i; i <= songGeneration && bytes(_tokenURI).length == 0; ++i) { _tokenURI = _songURIs[(songId * (10**18)) + songGeneration - i]; } // Set baseURI string memory base = _baseURI; // Concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } else { return ""; } } // // // URI Section // // // Returns baseURI internally function baseURI() public view virtual returns (string memory) { return _baseURI; } // Sets the baseURI function setBaseURI(string memory base) public virtual onlyOwner { emit BaseURIChange(_baseURI); _baseURI = base; } // Returns contractURI internally function contractURI() public view virtual override returns (string memory) { // Set baseURI string memory base = _baseURI; // Concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_contractURI).length > 0) { return string(abi.encodePacked(base, _contractURI)); } else { return ""; } } // Sets the contractURI function setContractURI(string memory uri) public virtual onlyOwner { emit ContractURIChange(_contractURI); _contractURI = uri; } // Sets the songURIs when minting a new song function _setSongURI(uint256 songId, string memory songURI1) internal virtual { if (songId > _songIds) revert URIQueryForNonexistentSong(); _songURIs[(songId * (10**18)) + 1] = songURI1; emit NewSongURI(songId, 1); } // Sets the songURIs when minting a new song function _setSongURI3( uint256 songId, string memory songURI1, string memory songURI2, string memory songURI3 ) internal virtual { if (songId > _songIds) revert URIQueryForNonexistentSong(); _songURIs[(songId * (10**18)) + 1] = songURI1; _songURIs[(songId * (10**18)) + 2] = songURI2; _songURIs[(songId * (10**18)) + 3] = songURI3; emit NewSongURI(songId, 3); } // Changes the songURI for one generation of a song, when given the songId and songGeneration function setSongURI( uint256 songId, uint256 songGeneration, string memory _songURI ) public virtual onlyOwner { if (songId > _songIds) revert URIQueryForNonexistentSong(); _songURIs[(songId * (10**18)) + songGeneration] = _songURI; emit NewSongURI(songId, songGeneration); } // Changes an array of songURIs when given an array of generations and songURIs function setSongURIs( uint256 songId, uint256[] memory songGenerations, string[] memory songURIs ) public virtual onlyOwner { uint256 length = songGenerations.length; if (songId > _songIds) revert URIQueryForNonexistentSong(); for (uint256 i; i < length; ++i) { _songURIs[(songId * (10**18)) + songGenerations[i]] = songURIs[i]; emit NewSongURI(songId, songGenerations[i]); } } // Changes an array of many songURIs function setManySongURIs( uint256[] memory songIds, uint256[] memory songGenerations, string[] memory songURIs ) public virtual onlyOwner { uint256 length = songGenerations.length; for (uint256 i; i < length; ++i) { if (songIds[i] > _songIds) revert URIQueryForNonexistentSong(); _songURIs[(songIds[i] * (10**18)) + songGenerations[i]] = songURIs[ i ]; emit NewSongURI(songIds[i], songGenerations[i]); } } // // ERC721 Meat and Potatoes Section // function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId); } function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } // // Transfer Section // function transferFrom( address from, address to, uint256 tokenId ) public virtual override { if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert TransferCallerNotOwnerNorApproved(); _transfer(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert TransferCallerNotOwnerNorApproved(); _transfer(from, to, tokenId); if (!_checkOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } // function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { if (!_exists(tokenId)) revert QueryForNonexistentToken(); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } // // Minting Section! // // Returns Mint Price function mintPrice() public view virtual override returns (uint256) { return _mintPrice; } // Sets the Mint Price in Wei function setMintPrice(uint256 priceWei) public virtual onlyOwner { _mintPrice = priceWei; } // Returns status of public mint for tokenId function publicMint(uint256 tokenId) public view virtual override returns (bool) { return _publicMint[tokenId]; } // Toggles Public Mint for Token Id function togglePublicMint(uint256 tokenId) public virtual { if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert SenderNotOwner(); _publicMint[tokenId] = !_publicMint[tokenId]; emit TogglePublic(tokenId); } // // Toggles an array of Token Ids public mint status function togglePublicMints(uint256[] memory tokenIds) public virtual { uint256 length = tokenIds.length; for (uint256 i; i < length; ++i) { togglePublicMint(tokenIds[i]); } } // Returns Token Mint Price function tokenMintPrice(address token) public view virtual override returns (uint256) { return _tokenPrice[token]; } // Sets the Token Mint Price in Wei function setTokenMintPrice(address token, uint256 priceWei) public virtual onlyOwner { _tokenPrice[token] = priceWei; emit TokenPriceSet(token, priceWei); } // Changes the max editions for a song function setMaxEditions(uint256 songId, uint256 maxEditions) public virtual onlyOwner { if (_songSerials[songId] > maxEditions) { revert NewMaxLessThanCurrentSupply(); } _maxEditions[songId] = maxEditions; emit NewMax(songId, maxEditions); } // Returns if recycle minting has been enabled function recycleEnabled() public view virtual returns (bool) { return _enableRecycle; } // Toggles recycle mint function toggleRecycleMint() public virtual onlyOwner { _enableRecycle = !_enableRecycle; } // Returns the address to pay out for a particular song id function splits(uint256 songId) public view virtual returns (address payable) { return _songSplits[songId]; } // Sets the split address for a song id function setSplit(uint256 songId, address payable splitAddress) public virtual onlyOwner { _songSplits[songId] = splitAddress; emit NewSplit(songId, splitAddress); } // Returns the percent price multiplier for a rarity function rarityMultiplier(uint256 generation) public view virtual override returns (uint256 multiplierPercent) { return _rarityMultipliers[generation]; } // Sets the price multiplier for a rarity function setRarityMultiplier(uint256 generation, uint256 multiplierPercent) public virtual onlyOwner { _rarityMultipliers[generation] = multiplierPercent; emit NewMultiplier(generation, multiplierPercent); } // Returns the royalty info. From ERC2981. Takes tokenId and price and returns the receiver address and royalty amount. function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address receiver, uint256 royaltyAmount) { uint256 songId = _tokenIdInfo[tokenId].song; if (address(_songSplits[songId]) != address(0)) { receiver = address(_songSplits[songId]); } else { receiver = owner(); } royaltyAmount = (salePrice * _royaltyBPS) / 10000; return (receiver, royaltyAmount); } // Returns the royalty basis points function royaltyBPS() public view virtual returns (uint256) { return _royaltyBPS; } // Sets the royalty basis points function setRoyalty(uint256 royaltyBPS_) public virtual onlyOwner { if (royaltyBPS_ > 10000) revert RoyaltyBPSTooHigh(); _royaltyBPS = royaltyBPS_; } // Sets a few variables you would want to with a new contract function setVariables2( string memory baseURI_, string memory contractURI_, uint256 royaltyBPS_ ) public virtual onlyOwner { setBaseURI(baseURI_); setContractURI(contractURI_); setRoyalty(royaltyBPS_); } // // // // // Mint Master token and set 1 piece of metadata function mintOriginal(string memory songURI1, uint256 maxEditions) public override onlyOwner { // Updates the count of total tokenids and songids uint256 id = _tokenIds; ++id; _tokenIds = id; uint256 songId = _songIds; ++songId; _songIds = songId; // Updates the count of how many of a particular song have been made _songSerials[songId] = 1; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(1); // Sets the max supply for the song _maxEditions[songId] = maxEditions; _safeMint(msg.sender, id); _setSongURI(songId, songURI1); } // Mint Master token and set 1 piece of metadata and a split address function mintOriginalSplit( string memory songURI1, uint256 maxEditions, address payable splitAddress ) public onlyOwner { // Updates the count of total tokenids and songids uint256 id = _tokenIds; ++id; _tokenIds = id; uint256 songId = _songIds; ++songId; _songIds = songId; // Updates the count of how many of a particular song have been made _songSerials[songId] = 1; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(1); // Sets the max supply for the song _maxEditions[songId] = maxEditions; // Sets the song split _songSplits[songId] = splitAddress; emit NewSplit(songId, splitAddress); _safeMint(msg.sender, id); _setSongURI(songId, songURI1); } // Intended method. Mint Master token and set 3 pieces of metadata. function mintOriginal3( string memory songURI1, string memory songURI2, string memory songURI3, uint256 maxEditions ) public override onlyOwner { // Updates the count of total tokenids and songids uint256 id = _tokenIds; ++id; _tokenIds = id; uint256 songId = _songIds; ++songId; _songIds = songId; // Updates the count of how many of a particular song have been made _songSerials[songId] = 1; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(1); // Sets the max supply for the song _maxEditions[songId] = maxEditions; _safeMint(msg.sender, id); _setSongURI3(songId, songURI1, songURI2, songURI3); } // Mint Master token and set 3 pieces of metadata and a split address. function mintOriginal3Split( string memory songURI1, string memory songURI2, string memory songURI3, uint256 maxEditions, address payable splitAddress ) public onlyOwner { // Updates the count of total tokenids and songids uint256 id = _tokenIds; ++id; _tokenIds = id; uint256 songId = _songIds; ++songId; _songIds = songId; // Updates the count of how many of a particular song have been made _songSerials[songId] = 1; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(1); // Sets the max supply for the song _maxEditions[songId] = maxEditions; // Sets the song split _songSplits[songId] = splitAddress; emit NewSplit(songId, splitAddress); _safeMint(msg.sender, id); _setSongURI3(songId, songURI1, songURI2, songURI3); } function ownerMintCopy( uint256 tokenId, uint256 songGeneration, address to ) public override onlyOwner { // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), tokenId)) if (_publicMint[tokenId] == false) revert SenderNotOwner(); if (songGeneration < 2) { revert InvalidGeneration(); } // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[tokenId].song; uint256 songSerial = _songSerials[songId]; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration); emit Copy(tokenId); _safeMintCopy(ownerOf(tokenId), to, id); } // Mints a copy to the owner's wallet function mintCopy(uint256 tokenId) public payable override { // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), tokenId)) if (_publicMint[tokenId] == false) revert SenderNotOwner(); // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[tokenId].song; uint256 songSerial = _songSerials[songId]; uint256 songGeneration = _tokenIdInfo[tokenId].generation; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Checks rarity multiplier percent uint256 multPc = 100; if (_rarityMultipliers[songGeneration] > 0) multPc = _rarityMultipliers[songGeneration]; // Requires eth if (msg.value < (_mintPrice * multPc) / 100) revert NotEnoughEther(); // Transfer eth if (address(_songSplits[songId]) != address(0)) { (bool success, ) = _songSplits[songId].call{value: msg.value}(""); require(success, "Failed to send Ether"); } // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration + 1); emit Copy(tokenId); _safeMintCopy(ownerOf(tokenId), msg.sender, id); } // Mints a copy to the address entered function mintCopyTo(uint256 tokenId, address to) public payable override { // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), tokenId)) if (_publicMint[tokenId] == false) revert SenderNotOwner(); // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[tokenId].song; uint256 songSerial = _songSerials[songId]; uint256 songGeneration = _tokenIdInfo[tokenId].generation; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Checks rarity multiplier percent uint256 multPc = 100; if (_rarityMultipliers[songGeneration] > 0) multPc = _rarityMultipliers[songGeneration]; // Requires eth if (msg.value < (_mintPrice * multPc) / 100) revert NotEnoughEther(); // Transfer eth if (address(_songSplits[songId]) != address(0)) { (bool success, ) = _songSplits[songId].call{value: msg.value}(""); require(success, "Failed to send Ether"); } // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration + 1); emit Copy(tokenId); _safeMintCopy(ownerOf(tokenId), to, id); } // Mints a copy with an erc-20 token as payment function mintCopyToken(uint256 tokenId, address token) public override { // Checks if contract is approved if (_tokenPrice[token] == 0) revert TokenNotApproved(); // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), tokenId)) if (_publicMint[tokenId] == false) revert SenderNotOwner(); // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[tokenId].song; uint256 songSerial = _songSerials[songId]; uint256 songGeneration = _tokenIdInfo[tokenId].generation; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Checks rarity multiplier percent uint256 multPc = 100; if (_rarityMultipliers[songGeneration] > 0) multPc = _rarityMultipliers[songGeneration]; uint256 rarityPrice = (_tokenPrice[token] * multPc) / 100; // Requires token if (ERC20Upgradeable(token).balanceOf(msg.sender) < rarityPrice) revert NotEnoughEther(); // Transfer tokens if (address(_songSplits[songId]) != address(0)) { ERC20Upgradeable(token).transferFrom( msg.sender, _songSplits[songId], rarityPrice ); } else { ERC20Upgradeable(token).transferFrom( msg.sender, owner(), rarityPrice ); } // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration + 1); emit Copy(tokenId); _safeMintCopy(ownerOf(tokenId), msg.sender, id); } // Mints a copy with an erc-20 token as payment to the address entered function mintCopyTokenTo( uint256 tokenId, address token, address to ) public override { // Checks if contract is approved if (_tokenPrice[token] == 0) revert TokenNotApproved(); // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), tokenId)) if (_publicMint[tokenId] == false) revert SenderNotOwner(); // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[tokenId].song; uint256 songSerial = _songSerials[songId]; uint256 songGeneration = _tokenIdInfo[tokenId].generation; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Checks rarity multiplier percent uint256 multPc = 100; if (_rarityMultipliers[songGeneration] > 0) multPc = _rarityMultipliers[songGeneration]; uint256 rarityPrice = (_tokenPrice[token] * multPc) / 100; // Requires token if (ERC20Upgradeable(token).balanceOf(msg.sender) < rarityPrice) revert NotEnoughEther(); // Transfer tokens if (address(_songSplits[songId]) != address(0)) { ERC20Upgradeable(token).transferFrom( msg.sender, _songSplits[songId], rarityPrice ); } else { ERC20Upgradeable(token).transferFrom( msg.sender, owner(), rarityPrice ); } // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration + 1); emit Copy(tokenId); _safeMintCopy(ownerOf(tokenId), to, id); } function recycleMint( uint256 mintTokenId, uint256 burnTokenId1, uint256 burnTokenId2 ) public override { if (!_isApprovedOrOwner(_msgSender(), burnTokenId1)) revert SenderNotOwner(); if (!_isApprovedOrOwner(_msgSender(), burnTokenId2)) revert SenderNotOwner(); // Requires the sender to have the tokenId in their wallet if (!_isApprovedOrOwner(_msgSender(), mintTokenId)) if (_publicMint[mintTokenId] == false) revert SenderNotOwner(); // Checks if recycling is allowed if (_enableRecycle != true) { revert RecycleDisabled(); } // Gets the songId from the tokenId uint256 songId = _tokenIdInfo[mintTokenId].song; uint256 songSerial = _songSerials[songId]; uint256 songGeneration = _tokenIdInfo[mintTokenId].generation; // Requires the song to not be sold out if (songSerial >= _maxEditions[songId]) revert MaxCopiesReached(); // Burns tokens _balances[msg.sender] -= 2; _burn(burnTokenId1); _burn(burnTokenId2); uint256 burnSongId1 = _tokenIdInfo[burnTokenId1].song; uint256 burnSongId2 = _tokenIdInfo[burnTokenId2].song; // If either burn tokens are the same songId as the token you're minting, // it updates the memory songSerial. If not it updates storage. if (burnSongId1 == burnSongId2 && burnSongId1 != songId) { _songSerials[burnSongId1] -= 2; } else { if (burnSongId1 == songId) { --songSerial; } else { --_songSerials[burnSongId1]; } if (burnSongId2 == songId) { --songSerial; } else { --_songSerials[burnSongId2]; } } // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[songId] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(songId); _tokenIdInfo[id].generation = uint128(songGeneration + 1); emit Copy(mintTokenId); emit Recycle(id, _msgSender()); _safeMintCopy(ownerOf(mintTokenId), msg.sender, id); } // // // // function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } function _safeMintCopy( address from, address to, uint256 tokenId ) internal virtual { _safeMintCopy(from, to, tokenId, ""); } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); if (!_checkOnERC721Received(address(0), to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } function _safeMintCopy( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintCopy(from, to, tokenId); if (!_checkOnERC721Received(address(0), to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } function _mint(address to, uint256 tokenId) internal virtual { if (to == address(0)) revert MintToZeroAddress(); if (_exists(tokenId)) revert TokenAlreadyMinted(); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } function _mintCopy( address from, address to, uint256 tokenId ) internal virtual { if (to == address(0)) revert MintToZeroAddress(); if (_exists(tokenId)) revert TokenAlreadyMinted(); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } // // // // // Burn function function _burn(uint256 tokenId) internal virtual { // Clear approvals _approve(address(0), tokenId); delete _owners[tokenId]; emit Transfer(msg.sender, address(0), tokenId); } // // More ERC721 Functions Meat and Potatoes style Section // function _transfer( address from, address to, uint256 tokenId ) internal virtual { if (ownerOf(tokenId) != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { if (owner == operator) revert OwnerIsOperator(); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } // function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received( _msgSender(), from, tokenId, _data ) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.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; } } // // Other Functions Section // // Function returns how many different songs have been created function totalSongs() public view virtual override returns (uint256) { return _songIds; } // Function returns what song a certain tokenid is function songOfToken(uint256 tokenId) public view virtual override returns (uint256) { return _tokenIdInfo[tokenId].song; } // Function returns what generation rarity a certain tokenid is function rarityOfToken(uint256 tokenId) public view virtual override returns (uint256) { return _tokenIdInfo[tokenId].generation; } // Function returns how many of a song are minted function songSupply(uint256 songId) public view virtual override returns (uint256) { return _songSerials[songId]; } // Function returns max of a song to be minted function maxSongSupply(uint256 songId) public view virtual override returns (uint256) { return _maxEditions[songId]; } // Returns a songURI, when given the songId and songGeneration function songURI(uint256 songId, uint256 songGeneration) public view virtual override returns (string memory) { if (songId > _songIds) revert URIQueryForNonexistentToken(); string memory _songURI; _songURI = _songURIs[(songId * (10**18)) + songGeneration]; // If that rarity does not have unique metadata, it counts down until it finds one. for (uint256 i; i <= songGeneration && bytes(_songURI).length == 0; ++i) { _songURI = _songURIs[(songId * (10**18)) + songGeneration - i]; } string memory base = _baseURI; return bytes(base).length > 0 ? string(abi.encodePacked(base, _songURI)) : ""; } // Function to withdraw all Ether from this contract. function withdraw() public onlyOwner { uint256 amount = address(this).balance; // Payable address can receive Ether address payable owner; owner = payable(msg.sender); // Send all Ether to owner (bool success, ) = owner.call{value: amount}(""); require(success, "Failed to send Ether"); } // // // Promo Section // // // Mappings // // Address to SongOut. For ERC721 mapping(address => uint256) private _addressClaim; // Address to SongIn to SongOut. For ERC721J mapping(address => mapping(uint256 => uint256)) private _addressClaimSpecific; // // Address to TokenId to bool mapping(address => mapping(uint256 => bool)) private _tokenClaim; // Address to TokenId to bool mapping(address => mapping(uint256 => bool)) private _tokenClaimSpecific; // // Set Functions // // For normal ERC721 function setPromo( address _contract, uint256 promoPercentOut, uint256 songIdOut, uint256 generationOut ) public override onlyOwner { if (generationOut == 1) revert GenerationOutOne(); uint256 _songOut = (promoPercentOut * (10**36)) + (songIdOut * (10**18)) + generationOut; _addressClaim[_contract] = _songOut; emit SetPromo(_contract, 0, _songOut); } // For ERC721J function setPromoSpecific( address _contract, uint256 songIdIn, uint256 generationIn, uint256 promoPercentOut, uint256 songIdOut, uint256 generationOut ) public override onlyOwner { if (generationOut == 1) revert GenerationOutOne(); if (songIdIn == 0 && generationIn == 0) revert SongInZero(); uint256 _songIn = (songIdIn * (10**18)) + generationIn; uint256 _songOut = (promoPercentOut * (10**36)) + (songIdOut * (10**18)) + generationOut; _addressClaimSpecific[_contract][_songIn] = _songOut; emit SetPromo(_contract, _songIn, _songOut); } // // Read Functions // // Checks if a contract address is whitelisted function promoCheck(address _contract) public view virtual override returns ( uint256 _songIdOut, uint256 _generationOut, uint256 _promoPercentOut ) { uint256 _songOut = _addressClaim[_contract]; _songIdOut = (_songOut / (10**18)) % (10**18); _generationOut = _songOut % (10**18); _promoPercentOut = _songOut / (10**36); } // // For ERC721J. Checks if a contract address, with song and rarity, is whitelisted function promoCheckSpecific( address _contract, uint256 songIdIn, uint256 generationIn ) public view virtual override returns ( uint256 _songIdOut, uint256 _generationOut, uint256 _promoPercentOut ) { uint256 _songIn = (songIdIn * (10**18)) + generationIn; uint256 _songOut = _addressClaimSpecific[_contract][_songIn]; _songIdOut = (_songOut / (10**18)) % (10**18); _generationOut = _songOut % (10**18); _promoPercentOut = _songOut / (10**36); } // // Checks if a token from a contract has been claimed through the normal contract wide whitelist. function tokenClaimCheck(address _contract, uint256 tokenId) public view virtual override returns (bool) { return _tokenClaim[_contract][tokenId]; } // // Checks if a token from a contract has been claimed through the ERC721J specific whitelist. function tokenClaimCheckSpecific(address _contract, uint256 tokenId) public view virtual override returns (bool) { return _tokenClaimSpecific[_contract][tokenId]; } // // Minting Functions // function payPromo(uint256 _songOut, uint256 _songIdOut) internal { uint256 _promoPercentOut = _songOut / (10**36); // Requires eth if (msg.value < (_mintPrice * _promoPercentOut) / 100) revert NotEnoughEther(); // Transfer eth if ( _promoPercentOut != 0 && address(_songSplits[_songIdOut]) != address(0) ) { (bool success, ) = _songSplits[_songIdOut].call{value: msg.value}( "" ); require(success, "Failed to send Ether"); } } // Internal shared function function _promoMint (address _contract, uint256 _songIn, uint256 tokenId) internal virtual { // Grabs songOut for the contract, and gets the songIdOut and generationOut from it uint256 _songOut = _addressClaimSpecific[_contract][_songIn]; uint256 _songIdOut = (_songOut / (10**18)) % (10**18); uint256 _generationOut = _songOut % (10**18); // GenerationOut being zero means you can't claim if (_generationOut == 0) revert GenerationOutZero(); // Sets songId to the most recent song if songIdOut is 0 if (_songIdOut == 0) _songIdOut = _songIds; // uint256 songSerial = _songSerials[_songIdOut]; // Requires the song to not be sold out if (songSerial >= _maxEditions[_songIdOut]) revert MaxCopiesReached(); // Sends Eth payPromo(_songOut, _songIdOut); // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[_songIdOut] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(_songIdOut); _tokenIdInfo[id].generation = uint128(_generationOut); _tokenClaimSpecific[_contract][tokenId] = true; _safeMintCopy(owner(), msg.sender, id); } // Promo mint is for ERC721 tokens function promoMint(address _contract, uint256 tokenId) public payable override { // Sets contract address as external nft ERC721J _claimContract = ERC721J(_contract); // Checks if the token has been claimed if (_tokenClaim[_contract][tokenId] != false) revert TokenAlreadyClaimed(); // Checks if msg.sender is the owner of the token from the contract if (_claimContract.ownerOf(tokenId) != msg.sender) revert SenderNotOwner(); // Grabs songOut for the contract, and gets the songIdOut and generationOut from it uint256 _songOut = _addressClaim[_contract]; uint256 _songIdOut = (_songOut / (10**18)) % (10**18); uint256 _generationOut = _songOut % (10**18); // GenerationOut being zero means you can't claim if (_generationOut == 0) revert GenerationOutZero(); // Sets songId to the most recent song if songIdOut is 0 if (_songIdOut == 0) _songIdOut = _songIds; // uint256 songSerial = _songSerials[_songIdOut]; // Requires the song to not be sold out if (songSerial >= _maxEditions[_songIdOut]) revert MaxCopiesReached(); // Sends Eth payPromo(_songOut, _songIdOut); // Updates the count of total tokenids uint256 id = _tokenIds; ++id; _tokenIds = id; // Updates the count of how many of a particular song have been made ++songSerial; _songSerials[_songIdOut] = songSerial; // Makes it easy to look up the song or gen of a tokenid _tokenIdInfo[id].song = uint128(_songIdOut); _tokenIdInfo[id].generation = uint128(_generationOut); _tokenClaim[_contract][tokenId] = true; _safeMintCopy(owner(), msg.sender, id); } // // Promo mint specific is for ERC721J tokens function promoMintSpecific(address _contract, uint256 tokenId) public payable override { // Sets contract address as external nft ERC721J _claimContract = ERC721J(_contract); // Checks if the token has been claimed if (_tokenClaimSpecific[_contract][tokenId] != false) revert TokenAlreadyClaimed(); // Checks if msg.sender is the owner of the token from the contract if (_claimContract.ownerOf(tokenId) != msg.sender) revert SenderNotOwner(); // Gets songId and generation of token from old contract uint256 _songIdIn = _claimContract.songOfToken(tokenId); uint256 _generationIn = _claimContract.rarityOfToken(tokenId); uint256 _songIn = (_songIdIn * (10**18)) + _generationIn; _promoMint(_contract, _songIn, tokenId); } // // Promo mint song is for ERC721J tokens to claim a song specific reward function promoMintSong(address _contract, uint256 tokenId) public payable { // Sets contract address as external nft ERC721J _claimContract = ERC721J(_contract); // Checks if the token has been claimed if (_tokenClaimSpecific[_contract][tokenId] != false) revert TokenAlreadyClaimed(); // Checks if msg.sender is the owner of the token from the contract if (_claimContract.ownerOf(tokenId) != msg.sender) revert SenderNotOwner(); // Gets songId of token from old contract uint256 _songIdIn = _claimContract.songOfToken(tokenId); uint256 _songIn = _songIdIn * (10**18); _promoMint(_contract, _songIn, tokenId); } // // Promo mint rarity is for ERC721J tokens to claim a rarity specific reward function promoMintRarity(address _contract, uint256 tokenId) public payable { // Sets contract address as external nft ERC721J _claimContract = ERC721J(_contract); // Checks if the token has been claimed if (_tokenClaimSpecific[_contract][tokenId] != false) revert TokenAlreadyClaimed(); // Checks if msg.sender is the owner of the token from the contract if (_claimContract.ownerOf(tokenId) != msg.sender) revert SenderNotOwner(); // Gets generation of token from old contract uint256 _generationIn = _claimContract.rarityOfToken(tokenId); uint256 _songIn = _generationIn; _promoMint(_contract, _songIn, tokenId); } // // // }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; interface IContractWizard is IERC165 { // Emits when a new contract is created event NewContract(address contractAddress, uint256 contractId); // Returns the contract metadata function contractURI() external view returns (string memory); // Returns the contract address for a contract id function contractByIndex(uint256 contractId) external view returns (address); // Creates a new contract function createClone( string memory cloneName, string memory cloneSymbol, uint256 mintPriceWei ) external payable returns (address); // Creates a new contract and pays the wizard with an ERC20 token function createCloneToken( string memory cloneName, string memory cloneSymbol, uint256 mintPriceWei, address token ) external returns (address); // Returns the contractId if an address can be found in the List of the Wizard function inCollection(address contractAddress) external view returns (uint256); // Returns the mint price in eth to create a contract function mintPrice() external view returns (uint256); // Returns the name of the contract function name() external view returns (string memory); // Returns the mint price in an ERC20 token to create a contract function tokenMintPrice(address token) external view returns (uint256); // Returns the total amount of contracts that have been minted by this Contract Wizard function totalSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./IERC721JUpgradeable.sol"; interface IERC721JEnumerableUpgradeable is IERC721JUpgradeable { // Returns an index of tokens that are set to public function tokenOfPublicByIndex(uint256 index) external view returns (uint256); // Returns an index of tokens with a particular songId function tokenOfSongByIndex(uint256 songId, uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./IERC721JUpgradeable.sol"; interface IERC721JFullUpgradeable is IERC721JUpgradeable { // Event to show which tokens were created by recycling event Recycle(uint256 tokenId, address recycleAddress); // Mint a copy with an erc-20 token function mintCopyToken(uint256 tokenId, address token) external; // Mint a copy with an erc-20 token to a wallet address of your choice function mintCopyTokenTo( uint256 tokenId, address token, address to ) external; // Returns status of public mint for tokenId function publicMint(uint256 tokenId) external view returns (bool); // Returns the percent price multiplier for a rarity function rarityMultiplier(uint256 generation) external view returns (uint256 multiplierPercent); // Recycle mint burns 2 tokens to mint 1 function recycleMint(uint256 mintTokenId, uint256 burnTokenId1, uint256 burnTokenId2) external; // Returns the mint price for an erc-20 token address function tokenMintPrice(address token) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./IERC721JUpgradeable.sol"; interface IERC721JPromoUpgradeable is IERC721JUpgradeable { // Emits when a promo is set event SetPromo( address indexed contractName, uint256 songIn, uint256 songOut ); // Takes a contract address and returns (if one exists) the promo claim set for that contract function promoCheck(address _contract) external view returns (uint256 _songIdOut, uint256 _generationOut, uint256 _promoPercentOut); // Takes a contract address, song and generation and returns (if one exists) the promo claim set for that specific set of tokens on that contract function promoCheckSpecific( address _contract, uint256 songIdIn, uint256 generationIn ) external view returns (uint256 _songIdOut, uint256 _generationOut, uint256 _promoPercentOut); // Mints a promo token using the contract wide setting function promoMint(address _contract, uint256 tokenId) external payable; // Mints a promo token using the setting that needs matching songId and generation to be accepted function promoMintSpecific(address _contract, uint256 tokenId) external payable; // Returns if a token from an address has claimed it's promo token for the contract wide reward function tokenClaimCheck(address _contract, uint256 tokenId) external view returns (bool); // Returns if a token from an address has claimed it's promo token for the specific reward function tokenClaimCheckSpecific(address _contract, uint256 tokenId) external view returns (bool); // Sets a promo claim for a contract wide reward. Any token from an ERC721 contract gets a reward. function setPromo( address _contract, uint256 promoPercentOut, uint256 songIdOut, uint256 generationOut ) external; // Sets a promo claim for a ERC721J specific reward. Any token from an ERC721J contract can get a reward based on it's song, rarity, or both. function setPromoSpecific( address _contract, uint256 songIdIn, uint256 generationIn, uint256 promoPercentOut, uint256 songIdOut, uint256 generationOut ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; interface IERC721JUpgradeable is IERC165Upgradeable { // When a copy is minted, emits the tokenId that was used to make the copy. To count referral points. event Copy(uint256 indexed tokenId); // Returns the contract metadata function contractURI() external view returns (string memory); // Returns the max supply of copies for a songId function maxSongSupply(uint256 songId) external view returns (uint256); // Mints a copy function mintCopy(uint256 tokenId) external payable; // Mints a copy to a wallet address of your choice function mintCopyTo(uint256 tokenId, address to) external payable; // Mints an original using 1 piece of metadata function mintOriginal(string memory songURI1, uint256 maxEditions) external; // Mints an original using the default 3 pieces of metadata function mintOriginal3( string memory songURI1, string memory songURI2, string memory songURI3, uint256 maxEditions ) external; // Returns the price to mint a copy function mintPrice() external view returns (uint256); // The owner of the contract can mint copies for free and also mint custom rarity copies function ownerMintCopy( uint256 tokenId, uint256 songGeneration, address to ) external; // Returns the generation / rarity of a tokenId function rarityOfToken(uint256 tokenId) external view returns (uint256); // Returns the songId for a tokenId function songOfToken(uint256 tokenId) external view returns (uint256); // Returns the current supply of copies for a songId function songSupply(uint256 songId) external view returns (uint256); // Returns the metadata for a songId and generation function songURI(uint256 songId, uint256 songGeneration) external view returns (string memory); // Returns the total amount of originals created function totalSongs() external view returns (uint256); }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotEnoughEther","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TokenNotApproved","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"oldContractURI","type":"string"}],"name":"ContractURIChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"contractId","type":"uint256"}],"name":"NewContract","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":true,"internalType":"address","name":"tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"TokenPriceSet","type":"event"},{"inputs":[{"internalType":"uint256","name":"contractId","type":"uint256"}],"name":"contractByIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"cloneName","type":"string"},{"internalType":"string","name":"cloneSymbol","type":"string"},{"internalType":"uint256","name":"mintPriceWei","type":"uint256"}],"name":"createClone","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"cloneName","type":"string"},{"internalType":"string","name":"cloneSymbol","type":"string"},{"internalType":"uint256","name":"mintPriceWei","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"name":"createCloneToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"inCollection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"ownerAddContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"cloneName","type":"string"},{"internalType":"string","name":"cloneSymbol","type":"string"},{"internalType":"uint256","name":"mintPriceWei","type":"uint256"}],"name":"ownerCreateClone","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"priceWei","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setTokenMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"tokenMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e0604052601960a08190527f41706520546170657320436f6e74726163742057697a6172640000000000000060c0908152620000409160019190620000f8565b50670de0b6b3a76400006003553480156200005a57600080fd5b506200006633620000a8565b604051620000749062000187565b604051809103906000f08015801562000091573d6000803e3d6000fd5b5060601b6001600160601b031916608052620001e9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546200010690620001ac565b90600052602060002090601f0160209004810192826200012a576000855562000175565b82601f106200014557805160ff191683800117855562000175565b8280016001018555821562000175579182015b828111156200017557825182559160200191906001019062000158565b506200018392915062000195565b5090565b615f63806200151383390190565b5b8082111562000183576000815560010162000196565b600181811c90821680620001c157607f821691505b60208210811415620001e357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c6113046200020f600039600081816104d401526108c401526113046000f3fe6080604052600436106101145760003560e01c80638083499f116100a0578063e8a3d48511610064578063e8a3d485146102dd578063ef492468146102f2578063f2fde38b14610328578063f46a8ea114610348578063f4a0a5281461036857600080fd5b80638083499f1461023f578063825662891461025f5780638da5cb5b1461027f578063938e3d7b1461029d578063949eb7f6146102bd57600080fd5b806318160ddd116100e757806318160ddd146101c95780631b62cc19146101de5780633ccfd60b146101fe5780636817c76c14610215578063715018a61461022a57600080fd5b806301ffc9a71461011957806306fdde031461014e57806316e1b7db14610170578063175453e01461019e575b600080fd5b34801561012557600080fd5b50610139610134366004610ecc565b610388565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b506101636103bf565b60405161014591906111ce565b34801561017c57600080fd5b5061019061018b366004610e62565b610451565b604051908152602001610145565b6101b16101ac366004610ef4565b6104a8565b6040516001600160a01b039091168152602001610145565b3480156101d557600080fd5b50600254610190565b3480156101ea57600080fd5b506101b16101f9366004611094565b6105e3565b34801561020a57600080fd5b50610213610623565b005b34801561022157600080fd5b50600354610190565b34801561023657600080fd5b506102136106ee565b34801561024b57600080fd5b506101b161025a366004610f65565b610724565b34801561026b57600080fd5b5061021361027a366004610e83565b6109d4565b34801561028b57600080fd5b506000546001600160a01b03166101b1565b3480156102a957600080fd5b506102136102b8366004610fea565b610a57565b3480156102c957600080fd5b506101b16102d8366004610e62565b610ad7565b3480156102e957600080fd5b50610163610b7f565b3480156102fe57600080fd5b5061019061030d366004610e62565b6001600160a01b031660009081526006602052604090205490565b34801561033457600080fd5b50610213610343366004610e62565b610b8e565b34801561035457600080fd5b506101b1610363366004610ef4565b610c29565b34801561037457600080fd5b50610213610383366004611094565b610c54565b60006001600160e01b031982166375a142f160e11b14806103b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546103ce90611256565b80601f01602080910402602001604051908101604052809291908181526020018280546103fa90611256565b80156104475780601f1061041c57610100808354040283529160200191610447565b820191906000526020600020905b81548152906001019060200180831161042a57829003601f168201915b5050505050905090565b600254600090815b818111610491576000818152600560205260409020546001600160a01b0385811691161415610489579392505050565b600101610459565b50634e487b7160e01b600052600160045260246000fd5b60006003543410156104cd57604051638a0d377960e01b815260040160405180910390fd5b60006104f87f0000000000000000000000000000000000000000000000000000000000000000610c83565b60405163f542033f60e01b81529091506001600160a01b0382169063f542033f90610531908a908a908a908a9033908b90600401611188565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b505060025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03881690811790915582519081529081018390529193507f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da10192500160405180910390a16105d581611291565b600255509695505050505050565b60006002548210610607576040516329c8c00760e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000546001600160a01b031633146106565760405162461bcd60e51b815260040161064d90611221565b60405180910390fd5b60405147903390600090829084908381818185875af1925050503d806000811461069c576040519150601f19603f3d011682016040523d82523d6000602084013e6106a1565b606091505b50509050806106e95760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161064d565b505050565b6000546001600160a01b031633146107185760405162461bcd60e51b815260040161064d90611221565b6107226000610d1b565b565b6001600160a01b0381166000818152600660205260408082205490516370a0823160e01b8152336004820152919290916370a082319060240160206040518083038186803b15801561077557600080fd5b505afa158015610789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ad91906110ac565b10156107cc57604051638a0d377960e01b815260040160405180910390fd5b6001600160a01b038216600090815260066020526040902054610802576040516332da96a360e01b815260040160405180910390fd5b816001600160a01b03166323b872dd336108246000546001600160a01b031690565b6001600160a01b038681166000908152600660205260409081902054905160e086901b6001600160e01b03191681529382166004850152911660248301526044820152606401602060405180830381600087803b15801561088457600080fd5b505af1158015610898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bc9190610eac565b5060006108e87f0000000000000000000000000000000000000000000000000000000000000000610c83565b60405163f542033f60e01b81529091506001600160a01b0382169063f542033f90610921908b908b908b908b9033908c90600401611188565b600060405180830381600087803b15801561093b57600080fd5b505af115801561094f573d6000803e3d6000fd5b505060025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03881690811790915582519081529081018390529193507f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da10192500160405180910390a16109c581611291565b60025550979650505050505050565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161064d90611221565b6001600160a01b03821660008181526006602052604090819020839055517f7fa0e112e5801d5b0fbd79c812915f0ab2461b234234b9c64a7efd9a25c6abb690610a4b9084815260200190565b60405180910390a25050565b6000546001600160a01b03163314610a815760405162461bcd60e51b815260040161064d90611221565b6004604051610a9091906110ed565b604051908190038120907f10731a038f500442db2b5f56765996b82cba52d04008447c0b4aa252f3dc134390600090a28051610ad3906004906020840190610d6b565b5050565b600080546001600160a01b03163314610b025760405162461bcd60e51b815260040161064d90611221565b60025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03871690811790915582519081529081018390527f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da101910160405180910390a1610b7281611291565b600255508190505b919050565b6060600480546103ce90611256565b6000546001600160a01b03163314610bb85760405162461bcd60e51b815260040161064d90611221565b6001600160a01b038116610c1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064d565b610c2681610d1b565b50565b600080546001600160a01b031633146104cd5760405162461bcd60e51b815260040161064d90611221565b6000546001600160a01b03163314610c7e5760405162461bcd60e51b815260040161064d90611221565b600355565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b7a5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640161064d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054610d7790611256565b90600052602060002090601f016020900481019282610d995760008555610ddf565b82601f10610db257805160ff1916838001178555610ddf565b82800160010185558215610ddf579182015b82811115610ddf578251825591602001919060010190610dc4565b50610deb929150610def565b5090565b5b80821115610deb5760008155600101610df0565b80356001600160a01b0381168114610b7a57600080fd5b60008083601f840112610e2c578182fd5b50813567ffffffffffffffff811115610e43578182fd5b602083019150836020828501011115610e5b57600080fd5b9250929050565b600060208284031215610e73578081fd5b610e7c82610e04565b9392505050565b60008060408385031215610e95578081fd5b610e9e83610e04565b946020939093013593505050565b600060208284031215610ebd578081fd5b81518015158114610e7c578182fd5b600060208284031215610edd578081fd5b81356001600160e01b031981168114610e7c578182fd5b600080600080600060608688031215610f0b578081fd5b853567ffffffffffffffff80821115610f22578283fd5b610f2e89838a01610e1b565b90975095506020880135915080821115610f46578283fd5b50610f5388828901610e1b565b96999598509660400135949350505050565b60008060008060008060808789031215610f7d578081fd5b863567ffffffffffffffff80821115610f94578283fd5b610fa08a838b01610e1b565b90985096506020890135915080821115610fb8578283fd5b50610fc589828a01610e1b565b90955093505060408701359150610fde60608801610e04565b90509295509295509295565b600060208284031215610ffb578081fd5b813567ffffffffffffffff80821115611012578283fd5b818401915084601f830112611025578283fd5b813581811115611037576110376112b8565b604051601f8201601f19908116603f0116810190838211818310171561105f5761105f6112b8565b81604052828152876020848701011115611077578586fd5b826020860160208301379182016020019490945295945050505050565b6000602082840312156110a5578081fd5b5035919050565b6000602082840312156110bd578081fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600080835482600182811c91508083168061110957607f831692505b602080841082141561112957634e487b7160e01b87526022600452602487fd5b81801561113d576001811461114e5761117a565b60ff1986168952848901965061117a565b60008a815260209020885b868110156111725781548b820152908501908301611159565b505084890196505b509498975050505050505050565b60808152600061119c60808301888a6110c4565b82810360208401526111af8187896110c4565b6001600160a01b03959095166040840152505060600152949350505050565b6000602080835283518082850152825b818110156111fa578581018301518582016040015282016111de565b8181111561120b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061126a57607f821691505b6020821081141561128b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156112b157634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220219f2f06c359ab5410c1094b3e64d157ab01628c0c1362f7dae46d37f0349bfb64736f6c63430008040033608060405234801561001057600080fd5b50615f4280620000216000396000f3fe6080604052600436106104475760003560e01c80638256628911610234578063b84c82461161012e578063e522281f116100b6578063f4a0a5281161007a578063f4a0a52814610de6578063f542033f14610e06578063f69d44a014610e26578063fa08971614610e46578063fbefbe4c14610e6657600080fd5b8063e522281f14610d12578063e8a3d48514610d32578063e985e9c514610d47578063ef49246814610d90578063f2fde38b14610dc657600080fd5b8063c47f0027116100fd578063c47f002714610c7f578063c87b56dd14610c9f578063cf332f0214610cbf578063d9d001a314610cdf578063dba07ce314610cf257600080fd5b8063b84c824614610c0a578063b88d4fde14610c2a578063b9c9d93a14610c4a578063c42f576014610c5f57600080fd5b806393464ab3116101bc578063a2a3eb4d11610180578063a2a3eb4d14610b91578063a43db37f14610ba4578063a490c6e914610bc4578063add8462e14610be4578063b609e0a014610bf757600080fd5b806393464ab314610b09578063938e3d7b14610b2957806395d89b4114610b495780639b35897014610b5e578063a22cb46514610b7157600080fd5b80638bbad281116102035780638bbad28114610a485780638da5cb5b14610a685780638f21950114610a8657806391b7501414610ab3578063933e9c1614610ae957600080fd5b806382566289146109b257806387c6b112146109d2578063884c3006146109f25780638978825814610a2857600080fd5b80633fc846de116103455780636634c727116102cd57806370a082311161029157806370a0823114610930578063715018a614610950578063749fdfab146109655780637691345f1461097d5780637ecaa0611461099d57600080fd5b80636634c727146108995780636817c76c146108b957806368d8bc8c146108ce5780636c0360eb146108ee5780636e4eff001461090357600080fd5b80634f6ccce7116103145780634f6ccce7146107f957806355f804b31461081957806357d200ae146108395780635a306e24146108595780636352211e1461087957600080fd5b80633fc846de14610746578063400d36b2146107735780634209a2e1146107b957806342842e0e146107d957600080fd5b806321ee0cc3116103d35780632dbbafd2116103975780632dbbafd2146106965780632f745c59146106ab57806335b2e0e9146106cb578063377a2045146106eb5780633ccfd60b1461073157600080fd5b806321ee0cc3146105aa57806323707cae146105ca57806323b872dd146106075780632a55205a146106275780632db115441461066657600080fd5b806318160ddd1161041a57806318160ddd146104fd57806318ba67441461051c5780631b33527b146105575780631fe279c91461056a578063208e17981461058a57600080fd5b806301ffc9a71461044c57806306fdde0314610481578063081812fc146104a3578063095ea7b3146104db575b600080fd5b34801561045857600080fd5b5061046c610467366004615625565b610e86565b60405190151581526020015b60405180910390f35b34801561048d57600080fd5b50610496610f95565b6040516104789190615c2e565b3480156104af57600080fd5b506104c36104be366004615939565b611027565b6040516001600160a01b039091168152602001610478565b3480156104e757600080fd5b506104fb6104f6366004615470565b611078565b005b34801561050957600080fd5b506097545b604051908152602001610478565b34801561052857600080fd5b5061053c61053736600461549b565b611105565b60408051938452602084019290925290820152606001610478565b6104fb610565366004615470565b6111a7565b34801561057657600080fd5b506104fb610585366004615969565b6113be565b34801561059657600080fd5b506104fb6105a5366004615969565b61178b565b3480156105b657600080fd5b506104fb6105c53660046159c3565b611823565b3480156105d657600080fd5b5061050e6105e5366004615939565b600090815260a66020526040902054600160801b90046001600160801b031690565b34801561061357600080fd5b506104fb610622366004615387565b61196b565b34801561063357600080fd5b506106476106423660046159f4565b61199e565b604080516001600160a01b039093168352602083019190915201610478565b34801561067257600080fd5b5061046c610681366004615939565b600090815260a9602052604090205460ff1690565b3480156106a257600080fd5b506104fb611a28565b3480156106b757600080fd5b5061050e6106c6366004615470565b611a66565b3480156106d757600080fd5b506104fb6106e6366004615a15565b611b2b565b3480156106f757600080fd5b5061046c610706366004615470565b6001600160a01b0391909116600090815260af60209081526040808320938352929052205460ff1690565b34801561073d57600080fd5b506104fb611c7f565b34801561075257600080fd5b5061050e610761366004615939565b600090815260ab602052604090205490565b34801561077f57600080fd5b5061046c61078e366004615470565b6001600160a01b0391909116600090815260ae60209081526040808320938352929052205460ff1690565b3480156107c557600080fd5b506104fb6107d4366004615939565b611d15565b3480156107e557600080fd5b506104fb6107f4366004615387565b611d67565b34801561080557600080fd5b5061050e610814366004615939565b611d82565b34801561082557600080fd5b506104fb61083436600461565d565b611dbe565b34801561084557600080fd5b506104fb61085436600461589f565b611e3e565b34801561086557600080fd5b506104fb610874366004615709565b611ee7565b34801561088557600080fd5b506104c3610894366004615939565b611f8c565b3480156108a557600080fd5b506104fb6108b43660046158e1565b611fc2565b3480156108c557600080fd5b50609c5461050e565b3480156108da57600080fd5b506104fb6108e9366004615586565b6120bc565b3480156108fa57600080fd5b50610496612272565b34801561090f57600080fd5b5061050e61091e366004615939565b600090815260a5602052604090205490565b34801561093c57600080fd5b5061050e61094b366004615317565b612281565b34801561095c57600080fd5b506104fb6122c6565b34801561097157600080fd5b50609f5460ff1661046c565b34801561098957600080fd5b5061050e6109983660046159f4565b6122fc565b3480156109a957600080fd5b5060985461050e565b3480156109be57600080fd5b506104fb6109cd366004615470565b6123aa565b3480156109de57600080fd5b506104fb6109ed366004615a42565b612421565b3480156109fe57600080fd5b506104c3610a0d366004615939565b600090815260aa60205260409020546001600160a01b031690565b348015610a3457600080fd5b506104fb610a43366004615509565b6124d2565b348015610a5457600080fd5b506104fb610a633660046159f4565b612617565b348015610a7457600080fd5b506065546001600160a01b03166104c3565b348015610a9257600080fd5b5061050e610aa1366004615939565b600090815260a7602052604090205490565b348015610abf57600080fd5b5061050e610ace366004615939565b600090815260a660205260409020546001600160801b031690565b348015610af557600080fd5b5061053c610b04366004615317565b6126b5565b348015610b1557600080fd5b506104fb610b24366004615939565b612727565b348015610b3557600080fd5b506104fb610b4436600461565d565b612795565b348015610b5557600080fd5b50610496612811565b6104fb610b6c366004615470565b612820565b348015610b7d57600080fd5b506104fb610b8c366004615443565b6129a6565b6104fb610b9f366004615470565b6129b1565b348015610bb057600080fd5b5061050e610bbf366004615939565b612be3565b348015610bd057600080fd5b506104fb610bdf36600461598d565b612cb2565b6104fb610bf2366004615939565b61307e565b6104fb610c05366004615969565b6132c2565b348015610c1657600080fd5b506104fb610c2536600461565d565b613516565b348015610c3657600080fd5b506104fb610c453660046153c7565b613592565b348015610c5657600080fd5b50609d5461050e565b348015610c6b57600080fd5b506104fb610c7a3660046159f4565b6135ec565b348015610c8b57600080fd5b506104fb610c9a36600461565d565b61365b565b348015610cab57600080fd5b50610496610cba366004615939565b6136d7565b348015610ccb57600080fd5b506104fb610cda366004615554565b6139bd565b6104fb610ced366004615470565b613a0a565b348015610cfe57600080fd5b506104fb610d0d3660046154cf565b613b7b565b348015610d1e57600080fd5b506104fb610d2d366004615a85565b613c70565b348015610d3e57600080fd5b50610496613f6e565b348015610d5357600080fd5b5061046c610d6236600461534f565b6001600160a01b03918216600090815260a36020908152604080832093909416825291909152205460ff1690565b348015610d9c57600080fd5b5061050e610dab366004615317565b6001600160a01b0316600090815260a8602052604090205490565b348015610dd257600080fd5b506104fb610de1366004615317565b614057565b348015610df257600080fd5b506104fb610e01366004615939565b6140f2565b348015610e1257600080fd5b506104fb610e2136600461568f565b614121565b348015610e3257600080fd5b506104fb610e41366004615794565b6141e9565b348015610e5257600080fd5b506104fb610e61366004615836565b6142e5565b348015610e7257600080fd5b50610496610e813660046159f4565b61432a565b60006001600160e01b031982166380ac58cd60e01b1480610eb757506001600160e01b03198216630a85bd0160e11b145b80610ed257506001600160e01b03198216635b5e139f60e01b145b80610eed57506001600160e01b0319821663780e9d6360e01b145b80610f0857506001600160e01b03198216633adc31c960e11b145b80610f2357506001600160e01b0319821663a360e0cd60e01b145b80610f3e57506001600160e01b031982166302f7754560e31b145b80610f5957506001600160e01b03198216630695643960e51b145b80610f7457506001600160e01b0319821663152a902d60e11b145b80610f8f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060998054610fa490615de7565b80601f0160208091040260200160405190810160405280929190818152602001828054610fd090615de7565b801561101d5780601f10610ff25761010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b5050505050905090565b600081815260a060205260408120546001600160a01b031661105c576040516333d1c03960e21b815260040160405180910390fd5b50600090815260a260205260409020546001600160a01b031690565b600061108382611f8c565b9050806001600160a01b0316836001600160a01b031614156110b85760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906110d857506110d68133610d62565b155b156110f6576040516367d9dca160e11b815260040160405180910390fd5b61110083836145d2565b505050565b60008080808461111d87670de0b6b3a7640000615d6e565b6111279190615d42565b6001600160a01b038816600090815260ad60209081526040808320848452909152902054909150670de0b6b3a76400006111618183615d5a565b61116b9190615e3d565b945061117f670de0b6b3a764000082615e3d565b935061119a6ec097ce7bc90715b34b9f100000000082615d5a565b9250505093509350939050565b6001600160a01b038216600090815260af60209081526040808320848452909152902054829060ff16156111ee57604051633d6a72ef60e11b815260040160405180910390fd5b6040516331a9108f60e11b81526004810183905233906001600160a01b03831690636352211e9060240160206040518083038186803b15801561123057600080fd5b505afa158015611244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112689190615333565b6001600160a01b03161461128f57604051630ca4a64560e11b815260040160405180910390fd5b60405163246dd40560e21b8152600481018390526000906001600160a01b038316906391b750149060240160206040518083038186803b1580156112d257600080fd5b505afa1580156112e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130a9190615951565b6040516311b83e5760e11b8152600481018590529091506000906001600160a01b038416906323707cae9060240160206040518083038186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190615951565b905060008161139f84670de0b6b3a7640000615d6e565b6113a99190615d42565b90506113b6868287614640565b505050505050565b6001600160a01b038116600090815260a860205260409020546113f4576040516332da96a360e01b815260040160405180910390fd5b6113ff335b83614795565b61143257600082815260a9602052604090205460ff1661143257604051630ca4a64560e11b815260040160405180910390fd5b600082815260a660209081526040808320546001600160801b0380821680865260a585528386205460a790955292909420549193600160801b9091041690821061148f57604051634e5d53e160e01b815260040160405180910390fd5b600081815260ab6020526040902054606490156114b75750600081815260ab60205260409020545b6001600160a01b038516600090815260a860205260408120546064906114de908490615d6e565b6114e89190615d5a565b6040516370a0823160e01b815233600482015290915081906001600160a01b038816906370a082319060240160206040518083038186803b15801561152c57600080fd5b505afa158015611540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115649190615951565b101561158357604051638a0d377960e01b815260040160405180910390fd5b600085815260aa60205260409020546001600160a01b03161561163957600085815260aa6020526040908190205490516323b872dd60e01b81526001600160a01b03808916926323b872dd926115e192339216908690600401615bcd565b602060405180830381600087803b1580156115fb57600080fd5b505af115801561160f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116339190615609565b506116ce565b856001600160a01b03166323b872dd3361165b6065546001600160a01b031690565b846040518463ffffffff1660e01b815260040161167a93929190615bcd565b602060405180830381600087803b15801561169457600080fd5b505af11580156116a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cc9190615609565b505b6097546116da81615e22565b609781905590506116ea85615e22565b600087815260a56020908152604080832084905584835260a6909152902080546001600160801b0319166001600160801b038916179055945061172e846001615d42565b600082815260a6602052604080822080546001600160801b03948516600160801b0294169390931790925590518991600080516020615eed83398151915291a261178161177a89611f8c565b3383614848565b5050505050505050565b6065546001600160a01b031633146117be5760405162461bcd60e51b81526004016117b590615c6f565b60405180910390fd5b600082815260aa602090815260409182902080546001600160a01b0319166001600160a01b038516908117909155915191825283917faa51dbbee6f7383a0d68f565068d93df0deb6e8221c932e11b870d9d5ef1573591015b60405180910390a25050565b6065546001600160a01b0316331461184d5760405162461bcd60e51b81526004016117b590615c6f565b81516098548411156118725760405163d831496960e01b815260040160405180910390fd5b60005b818110156119645782818151811061189d57634e487b7160e01b600052603260045260246000fd5b602002602001015160a460008684815181106118c957634e487b7160e01b600052603260045260246000fd5b602002602001015188670de0b6b3a76400006118e59190615d6e565b6118ef9190615d42565b8152602001908152602001600020908051906020019061191092919061511c565b5083818151811061193157634e487b7160e01b600052603260045260246000fd5b602002602001015185600080516020615ecd83398151915260405160405180910390a361195d81615e22565b9050611875565b5050505050565b611976335b82614795565b61199357604051632ce44b5f60e11b815260040160405180910390fd5b611100838383614863565b600082815260a660209081526040808320546001600160801b031680845260aa9092528220548291906001600160a01b0316156119f457600081815260aa60205260409020546001600160a01b03169250611a03565b6065546001600160a01b031692505b612710609d5485611a149190615d6e565b611a1e9190615d5a565b9150509250929050565b6065546001600160a01b03163314611a525760405162461bcd60e51b81526004016117b590615c6f565b609f805460ff19811660ff90911615179055565b6000611a7183612281565b821115611a91576040516306ed618760e11b815260040160405180910390fd5b609754600080805b838111611b1457600081815260a060205260409020546001600160a01b03168015611ac2578092505b876001600160a01b0316836001600160a01b0316148015611aeb57506001600160a01b03811615155b15611b0b5786841415611b0457509350610f8f92505050565b8360010193505b50600101611a99565b50634e487b7160e01b600052600160045260246000fd5b6065546001600160a01b03163314611b555760405162461bcd60e51b81526004016117b590615c6f565b611b60335b84614795565b611b9357600083815260a9602052604090205460ff16611b9357604051630ca4a64560e11b815260040160405180910390fd5b6002821015611bb557604051630aff1c6160e11b815260040160405180910390fd5b600083815260a660209081526040808320546001600160801b031680845260a583528184205460a79093529220548110611c0257604051634e5d53e160e01b815260040160405180910390fd5b609754611c0e81615e22565b60978190559050611c1e82615e22565b600084815260a56020908152604080832084905584835260a69091528082206001600160801b03898116600160801b02908816179055519193508791600080516020615eed8339815191529190a26113b6611c7887611f8c565b8583614848565b6065546001600160a01b03163314611ca95760405162461bcd60e51b81526004016117b590615c6f565b60405147903390600090829084908381818185875af1925050503d8060008114611cef576040519150601f19603f3d011682016040523d82523d6000602084013e611cf4565b606091505b50509050806111005760405162461bcd60e51b81526004016117b590615c41565b6065546001600160a01b03163314611d3f5760405162461bcd60e51b81526004016117b590615c6f565b612710811115611d6257604051639a996e3760e01b815260040160405180910390fd5b609d55565b61110083838360405180602001604052806000815250613592565b60006001609754611d939190615d8d565b821115611db3576040516329c8c00760e21b815260040160405180910390fd5b610f8f826001615d42565b6065546001600160a01b03163314611de85760405162461bcd60e51b81526004016117b590615c6f565b609b604051611df79190615bc1565b604051908190038120907fa1e4fe82e2a65657cfd59fd66da1338be7d996f649643c161b7c24b1de80fca990600090a28051611e3a90609b90602084019061511c565b5050565b6065546001600160a01b03163314611e685760405162461bcd60e51b81526004016117b590615c6f565b609754611e7481615e22565b6097819055609854909150611e8881615e22565b6098819055600081815260a5602090815260408083206001905585835260a68252808320600160801b6001600160801b03861617905583835260a790915290208490559050611ed73383614986565b611ee181856149a0565b50505050565b6065546001600160a01b03163314611f115760405162461bcd60e51b81526004016117b590615c6f565b609754611f1d81615e22565b6097819055609854909150611f3181615e22565b6098819055600081815260a5602090815260408083206001905585835260a68252808320600160801b6001600160801b03861617905583835260a790915290208490559050611f803383614986565b6113b681878787614a27565b600081815260a060205260408120546001600160a01b031680610f8f57604051636f96cda160e11b815260040160405180910390fd5b6065546001600160a01b03163314611fec5760405162461bcd60e51b81526004016117b590615c6f565b609754611ff881615e22565b609781905560985490915061200c81615e22565b6098819055600081815260a5602090815260408083206001905585835260a682528083206001600160801b038516600160801b17905583835260a7825280832088905560aa82529182902080546001600160a01b0319166001600160a01b038816908117909155915191825291925082917faa51dbbee6f7383a0d68f565068d93df0deb6e8221c932e11b870d9d5ef15735910160405180910390a26120b23383614986565b61196481866149a0565b6065546001600160a01b031633146120e65760405162461bcd60e51b81526004016117b590615c6f565b815160005b818110156119645760985485828151811061211657634e487b7160e01b600052603260045260246000fd5b6020026020010151111561213d5760405163d831496960e01b815260040160405180910390fd5b82818151811061215d57634e487b7160e01b600052603260045260246000fd5b602002602001015160a4600086848151811061218957634e487b7160e01b600052603260045260246000fd5b60200260200101518885815181106121b157634e487b7160e01b600052603260045260246000fd5b6020026020010151670de0b6b3a76400006121cc9190615d6e565b6121d69190615d42565b815260200190815260200160002090805190602001906121f792919061511c565b5083818151811061221857634e487b7160e01b600052603260045260246000fd5b602002602001015185828151811061224057634e487b7160e01b600052603260045260246000fd5b6020026020010151600080516020615ecd83398151915260405160405180910390a361226b81615e22565b90506120eb565b6060609b8054610fa490615de7565b60006001600160a01b0382166122aa576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b0316600090815260a1602052604090205490565b6065546001600160a01b031633146122f05760405162461bcd60e51b81526004016117b590615c6f565b6122fa6000614b38565b565b600082815260a5602052604081205482111561232b576040516306ed618760e11b815260040160405180910390fd5b609754600080805b838111611b1457600081815260a660205260409020546001600160801b0316801561235c578092505b87831480156123815750600082815260a060205260409020546001600160a01b031615155b156123a1578684141561239a57509350610f8f92505050565b8360010193505b50600101612333565b6065546001600160a01b031633146123d45760405162461bcd60e51b81526004016117b590615c6f565b6001600160a01b038216600081815260a8602052604090819020839055517f7fa0e112e5801d5b0fbd79c812915f0ab2461b234234b9c64a7efd9a25c6abb6906118179084815260200190565b6065546001600160a01b0316331461244b5760405162461bcd60e51b81526004016117b590615c6f565b60985483111561246e5760405163d831496960e01b815260040160405180910390fd5b8060a460008461248687670de0b6b3a7640000615d6e565b6124909190615d42565b815260200190815260200160002090805190602001906124b192919061511c565b5060405182908490600080516020615ecd83398151915290600090a3505050565b6065546001600160a01b031633146124fc5760405162461bcd60e51b81526004016117b590615c6f565b806001141561251e57604051634d735a1760e01b815260040160405180910390fd5b8415801561252a575083155b156125485760405163b6492b8760e01b815260040160405180910390fd5b60008461255d87670de0b6b3a7640000615d6e565b6125679190615d42565b905060008261257e85670de0b6b3a7640000615d6e565b612597876ec097ce7bc90715b34b9f1000000000615d6e565b6125a19190615d42565b6125ab9190615d42565b6001600160a01b038916600081815260ad60209081526040808320878452825291829020849055815186815290810184905292935090917ff3d95a26112395a4e1afdbcabf16c65d689274bee6edab70ad64eec78ea79b99910160405180910390a25050505050505050565b6065546001600160a01b031633146126415760405162461bcd60e51b81526004016117b590615c6f565b600082815260a5602052604090205481101561267057604051637f93bccf60e01b815260040160405180910390fd5b600082815260a76020526040908190208290555182907fef6ff7fffec358ebe25a399965e5dc1a09d7cb0796043fb250be498cc358cb3b906118179084815260200190565b6001600160a01b038116600090815260ac602052604081205481908190670de0b6b3a76400006126e58183615d5a565b6126ef9190615e3d565b9350612703670de0b6b3a764000082615e3d565b925061271e6ec097ce7bc90715b34b9f100000000082615d5a565b93959294505050565b61273033611970565b61274d57604051630ca4a64560e11b815260040160405180910390fd5b600081815260a96020526040808220805460ff19811660ff909116151790555182917f5485eb4c7a660de5c15f73d484775344edbefd95cce8491a5b5f931f640cc09691a250565b6065546001600160a01b031633146127bf5760405162461bcd60e51b81526004016117b590615c6f565b609e6040516127ce9190615bc1565b604051908190038120907f10731a038f500442db2b5f56765996b82cba52d04008447c0b4aa252f3dc134390600090a28051611e3a90609e90602084019061511c565b6060609a8054610fa490615de7565b6001600160a01b038216600090815260af60209081526040808320848452909152902054829060ff161561286757604051633d6a72ef60e11b815260040160405180910390fd5b6040516331a9108f60e11b81526004810183905233906001600160a01b03831690636352211e9060240160206040518083038186803b1580156128a957600080fd5b505afa1580156128bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e19190615333565b6001600160a01b03161461290857604051630ca4a64560e11b815260040160405180910390fd5b60405163246dd40560e21b8152600481018390526000906001600160a01b038316906391b750149060240160206040518083038186803b15801561294b57600080fd5b505afa15801561295f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129839190615951565b9050600061299982670de0b6b3a7640000615d6e565b9050611964858286614640565b611e3a338383614b8a565b6001600160a01b038216600090815260ae60209081526040808320848452909152902054829060ff16156129f857604051633d6a72ef60e11b815260040160405180910390fd5b6040516331a9108f60e11b81526004810183905233906001600160a01b03831690636352211e9060240160206040518083038186803b158015612a3a57600080fd5b505afa158015612a4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a729190615333565b6001600160a01b031614612a9957604051630ca4a64560e11b815260040160405180910390fd5b6001600160a01b038316600090815260ac602052604081205490670de0b6b3a7640000612ac68184615d5a565b612ad09190615e3d565b90506000612ae6670de0b6b3a764000084615e3d565b905080612b065760405163249a025160e21b815260040160405180910390fd5b81612b115760985491505b600082815260a5602090815260408083205460a7909252909120548110612b4b57604051634e5d53e160e01b815260040160405180910390fd5b612b558484614c2a565b609754612b6181615e22565b60978190559050612b7182615e22565b600085815260a56020908152604080832084905584835260a682528083206001600160801b03888116600160801b02908a161790556001600160a01b038c16835260ae82528083208b84529091529020805460ff19166001179055915061178161177a6065546001600160a01b031690565b60975460009080831115612c0a576040516306ed618760e11b815260040160405180910390fd5b6000805b828111611b1457600081815260a9602090815260408083205460a69092529091205460ff909116906001600160801b03168115801590612c645750600083815260a060205260409020546001600160a01b031615155b8015612c895750600081815260a7602090815260408083205460a59092529091205414155b15612ca85786841415612ca157509095945050505050565b8360010193505b5050600101612c0e565b6001600160a01b038216600090815260a86020526040902054612ce8576040516332da96a360e01b815260040160405180910390fd5b612cf133611b5a565b612d2457600083815260a9602052604090205460ff16612d2457604051630ca4a64560e11b815260040160405180910390fd5b600083815260a660209081526040808320546001600160801b0380821680865260a585528386205460a790955292909420549193600160801b90910416908210612d8157604051634e5d53e160e01b815260040160405180910390fd5b600081815260ab602052604090205460649015612da95750600081815260ab60205260409020545b6001600160a01b038616600090815260a86020526040812054606490612dd0908490615d6e565b612dda9190615d5a565b6040516370a0823160e01b815233600482015290915081906001600160a01b038916906370a082319060240160206040518083038186803b158015612e1e57600080fd5b505afa158015612e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e569190615951565b1015612e7557604051638a0d377960e01b815260040160405180910390fd5b600085815260aa60205260409020546001600160a01b031615612f2b57600085815260aa6020526040908190205490516323b872dd60e01b81526001600160a01b03808a16926323b872dd92612ed392339216908690600401615bcd565b602060405180830381600087803b158015612eed57600080fd5b505af1158015612f01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f259190615609565b50612fc0565b866001600160a01b03166323b872dd33612f4d6065546001600160a01b031690565b846040518463ffffffff1660e01b8152600401612f6c93929190615bcd565b602060405180830381600087803b158015612f8657600080fd5b505af1158015612f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fbe9190615609565b505b609754612fcc81615e22565b60978190559050612fdc85615e22565b600087815260a56020908152604080832084905584835260a6909152902080546001600160801b0319166001600160801b0389161790559450613020846001615d42565b600082815260a6602052604080822080546001600160801b03948516600160801b0294169390931790925590518a91600080516020615eed83398151915291a261307361306c8a611f8c565b8883614848565b505050505050505050565b61308733611970565b6130ba57600081815260a9602052604090205460ff166130ba57604051630ca4a64560e11b815260040160405180910390fd5b600081815260a660209081526040808320546001600160801b0380821680865260a585528386205460a790955292909420549193600160801b9091041690821061311757604051634e5d53e160e01b815260040160405180910390fd5b600081815260ab60205260409020546064901561313f5750600081815260ab60205260409020545b606481609c5461314f9190615d6e565b6131599190615d5a565b34101561317957604051638a0d377960e01b815260040160405180910390fd5b600084815260aa60205260409020546001600160a01b03161561321657600084815260aa60205260408082205490516001600160a01b039091169034908381818185875af1925050503d80600081146131ee576040519150601f19603f3d011682016040523d82523d6000602084013e6131f3565b606091505b50509050806132145760405162461bcd60e51b81526004016117b590615c41565b505b60975461322281615e22565b6097819055905061323284615e22565b600086815260a56020908152604080832084905584835260a6909152902080546001600160801b0319166001600160801b0388161790559350613276836001615d42565b600082815260a6602052604080822080546001600160801b03948516600160801b0294169390931790925590518791600080516020615eed83398151915291a26113b661177a87611f8c565b6132cb336113f9565b6132fe57600082815260a9602052604090205460ff166132fe57604051630ca4a64560e11b815260040160405180910390fd5b600082815260a660209081526040808320546001600160801b0380821680865260a585528386205460a790955292909420549193600160801b9091041690821061335b57604051634e5d53e160e01b815260040160405180910390fd5b600081815260ab6020526040902054606490156133835750600081815260ab60205260409020545b606481609c546133939190615d6e565b61339d9190615d5a565b3410156133bd57604051638a0d377960e01b815260040160405180910390fd5b600084815260aa60205260409020546001600160a01b03161561345a57600084815260aa60205260408082205490516001600160a01b039091169034908381818185875af1925050503d8060008114613432576040519150601f19603f3d011682016040523d82523d6000602084013e613437565b606091505b50509050806134585760405162461bcd60e51b81526004016117b590615c41565b505b60975461346681615e22565b6097819055905061347684615e22565b600086815260a56020908152604080832084905584835260a6909152902080546001600160801b0319166001600160801b03881617905593506134ba836001615d42565b600082815260a6602052604080822080546001600160801b03948516600160801b0294169390931790925590518891600080516020615eed83398151915291a261350d61350688611f8c565b8783614848565b50505050505050565b6065546001600160a01b031633146135405760405162461bcd60e51b81526004016117b590615c6f565b609a60405161354f9190615bc1565b604051908190038120907f0f3a31d60784657cf907bc521341ccc7c0c19faba58538cd9c14ac5b4887737490600090a28051611e3a90609a90602084019061511c565b61359b336113f9565b6135b857604051632ce44b5f60e11b815260040160405180910390fd5b6135c3848484614863565b6135cf84848484614d29565b611ee1576040516368d2bf6b60e11b815260040160405180910390fd5b6065546001600160a01b031633146136165760405162461bcd60e51b81526004016117b590615c6f565b600082815260ab6020526040908190208290555182907fbb69b052a57be2126300a5702ad98a79ab8ac71f0d3f61df1fde7e4c68143343906118179084815260200190565b6065546001600160a01b031633146136855760405162461bcd60e51b81526004016117b590615c6f565b60996040516136949190615bc1565b604051908190038120907fd3807fa54fb4a876f91813a2da7f5c40d1370d627f4837d7090b0118ac909f4a90600090a28051611e3a90609990602084019061511c565b600081815260a060205260409020546060906001600160a01b031661370f57604051630a14c4b560e41b815260040160405180910390fd5b600082815260a660205260408120546001600160801b0380821692600160801b909204169060609060a4908361374d86670de0b6b3a7640000615d6e565b6137579190615d42565b8152602001908152602001600020805461377090615de7565b80601f016020809104026020016040519081016040528092919081815260200182805461379c90615de7565b80156137e95780601f106137be576101008083540402835291602001916137e9565b820191906000526020600020905b8154815290600101906020018083116137cc57829003601f168201915b5050505050905060005b82811115801561380257508151155b156138dd5760a46000828561381f88670de0b6b3a7640000615d6e565b6138299190615d42565b6138339190615d8d565b8152602001908152602001600020805461384c90615de7565b80601f016020809104026020016040519081016040528092919081815260200182805461387890615de7565b80156138c55780601f1061389a576101008083540402835291602001916138c5565b820191906000526020600020905b8154815290600101906020018083116138a857829003601f168201915b50505050509150806138d690615e22565b90506137f3565b506000609b80546138ed90615de7565b80601f016020809104026020016040519081016040528092919081815260200182805461391990615de7565b80156139665780601f1061393b57610100808354040283529160200191613966565b820191906000526020600020905b81548152906001019060200180831161394957829003601f168201915b505050505090506000825111156139a457808260405160200161398a929190615b74565b604051602081830303815290604052945050505050919050565b5050604080516020810190915260008152949350505050565b805160005b81811015611100576139fa8382815181106139ed57634e487b7160e01b600052603260045260246000fd5b6020026020010151612727565b613a0381615e22565b90506139c2565b6001600160a01b038216600090815260af60209081526040808320848452909152902054829060ff1615613a5157604051633d6a72ef60e11b815260040160405180910390fd5b6040516331a9108f60e11b81526004810183905233906001600160a01b03831690636352211e9060240160206040518083038186803b158015613a9357600080fd5b505afa158015613aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613acb9190615333565b6001600160a01b031614613af257604051630ca4a64560e11b815260040160405180910390fd5b6040516311b83e5760e11b8152600481018390526000906001600160a01b038316906323707cae9060240160206040518083038186803b158015613b3557600080fd5b505afa158015613b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b6d9190615951565b905080611964858286614640565b6065546001600160a01b03163314613ba55760405162461bcd60e51b81526004016117b590615c6f565b8060011415613bc757604051634d735a1760e01b815260040160405180910390fd5b600081613bdc84670de0b6b3a7640000615d6e565b613bf5866ec097ce7bc90715b34b9f1000000000615d6e565b613bff9190615d42565b613c099190615d42565b6001600160a01b038616600081815260ac60205260408082208490555192935090917ff3d95a26112395a4e1afdbcabf16c65d689274bee6edab70ad64eec78ea79b9991613c61918590918252602082015260400190565b60405180910390a25050505050565b613c79336113f9565b613c9657604051630ca4a64560e11b815260040160405180910390fd5b613c9f33611970565b613cbc57604051630ca4a64560e11b815260040160405180910390fd5b613cc533611b5a565b613cf857600083815260a9602052604090205460ff16613cf857604051630ca4a64560e11b815260040160405180910390fd5b609f5460ff161515600114613d2057604051631e18b4eb60e21b815260040160405180910390fd5b600083815260a660209081526040808320546001600160801b0380821680865260a585528386205460a790955292909420549193600160801b90910416908210613d7d57604051634e5d53e160e01b815260040160405180910390fd5b33600090815260a160205260408120805460029290613d9d908490615d8d565b90915550613dac905085614e81565b613db584614e81565b600085815260a66020526040808220548683529120546001600160801b0391821691168082148015613de75750848214155b15613e1657600082815260a560205260408120805460029290613e0b908490615d8d565b90915550613e889050565b84821415613e2e57613e2784615dd0565b9350613e4f565b600082815260a5602052604081208054909190613e4a90615dd0565b909155505b84811415613e6757613e6084615dd0565b9350613e88565b600081815260a5602052604081208054909190613e8390615dd0565b909155505b609754613e9481615e22565b60978190559050613ea485615e22565b600087815260a56020908152604080832084905584835260a6909152902080546001600160801b0319166001600160801b0389161790559450613ee8846001615d42565b600082815260a6602052604080822080546001600160801b03948516600160801b0294169390931790925590518a91600080516020615eed83398151915291a26040805182815233602082015281517f0f4e612ef187f3560cfe0c40af93a735f1df1bb19c27c98a0e2a96a61d385af5929181900390910190a161307361177a8a611f8c565b60606000609b8054613f7f90615de7565b80601f0160208091040260200160405190810160405280929190818152602001828054613fab90615de7565b8015613ff85780601f10613fcd57610100808354040283529160200191613ff8565b820191906000526020600020905b815481529060010190602001808311613fdb57829003601f168201915b505050505090506000609e805461400e90615de7565b9050111561403f5780609e60405160200161402a929190615ba3565b60405160208183030381529060405291505090565b505060408051602081019091526000815290565b5090565b6065546001600160a01b031633146140815760405162461bcd60e51b81526004016117b590615c6f565b6001600160a01b0381166140e65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016117b5565b6140ef81614b38565b50565b6065546001600160a01b0316331461411c5760405162461bcd60e51b81526004016117b590615c6f565b609c55565b600054610100900460ff1661413c5760005460ff1615614140565b303b155b6141a35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016117b5565b600054610100900460ff161580156141c5576000805461ffff19166101011790555b6141d185858585614ed7565b8015611964576000805461ff00191690555050505050565b6065546001600160a01b031633146142135760405162461bcd60e51b81526004016117b590615c6f565b60975461421f81615e22565b609781905560985490915061423381615e22565b6098819055600081815260a5602090815260408083206001905585835260a682528083206001600160801b038516600160801b17905583835260a7825280832088905560aa82529182902080546001600160a01b0319166001600160a01b038816908117909155915191825291925082917faa51dbbee6f7383a0d68f565068d93df0deb6e8221c932e11b870d9d5ef15735910160405180910390a26142d93383614986565b61350d81888888614a27565b6065546001600160a01b0316331461430f5760405162461bcd60e51b81526004016117b590615c6f565b61431883611dbe565b61432182612795565b61110081611d15565b606060985483111561434f57604051630a14c4b560e41b815260040160405180910390fd5b606060a460008461436887670de0b6b3a7640000615d6e565b6143729190615d42565b8152602001908152602001600020805461438b90615de7565b80601f01602080910402602001604051908101604052809291908181526020018280546143b790615de7565b80156144045780601f106143d957610100808354040283529160200191614404565b820191906000526020600020905b8154815290600101906020018083116143e757829003601f168201915b5050505050905060005b83811115801561441d57508151155b156144f85760a46000828661443a89670de0b6b3a7640000615d6e565b6144449190615d42565b61444e9190615d8d565b8152602001908152602001600020805461446790615de7565b80601f016020809104026020016040519081016040528092919081815260200182805461449390615de7565b80156144e05780601f106144b5576101008083540402835291602001916144e0565b820191906000526020600020905b8154815290600101906020018083116144c357829003601f168201915b50505050509150806144f190615e22565b905061440e565b506000609b805461450890615de7565b80601f016020809104026020016040519081016040528092919081815260200182805461453490615de7565b80156145815780601f1061455657610100808354040283529160200191614581565b820191906000526020600020905b81548152906001019060200180831161456457829003601f168201915b5050505050905060008151116145a657604051806020016040528060008152506145c9565b80826040516020016145b9929190615b74565b6040516020818303038152906040525b95945050505050565b600081815260a26020526040902080546001600160a01b0319166001600160a01b038416908117909155819061460782611f8c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b038316600090815260ad6020908152604080832085845290915281205490670de0b6b3a76400006146788184615d5a565b6146829190615e3d565b90506000614698670de0b6b3a764000084615e3d565b9050806146b85760405163249a025160e21b815260040160405180910390fd5b816146c35760985491505b600082815260a5602090815260408083205460a79092529091205481106146fd57604051634e5d53e160e01b815260040160405180910390fd5b6147078484614c2a565b60975461471381615e22565b6097819055905061472382615e22565b600085815260a56020908152604080832084905584835260a682528083206001600160801b03888116600160801b02908a161790556001600160a01b038c16835260af82528083208a84529091529020805460ff19166001179055915061178161177a6065546001600160a01b031690565b600081815260a060205260408120546001600160a01b03166147ca57604051636c01c8cf60e11b815260040160405180910390fd5b60006147d583611f8c565b9050806001600160a01b0316846001600160a01b031614806148105750836001600160a01b031661480584611027565b6001600160a01b0316145b8061484057506001600160a01b03808216600090815260a3602090815260408083209388168352929052205460ff165b949350505050565b61110083838360405180602001604052806000815250614f0a565b826001600160a01b031661487682611f8c565b6001600160a01b03161461489c5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b0382166148c357604051633a954ecd60e21b815260040160405180910390fd5b6148ce6000826145d2565b6001600160a01b038316600090815260a1602052604081208054600192906148f7908490615d8d565b90915550506001600160a01b038216600090815260a160205260408120805460019290614925908490615d42565b9091555050600081815260a0602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611e3a828260405180602001604052806000815250614f22565b6098548211156149c35760405163d831496960e01b815260040160405180910390fd5b8060a460006149da85670de0b6b3a7640000615d6e565b6149e5906001615d42565b81526020019081526020016000209080519060200190614a0692919061511c565b506040516001908390600080516020615ecd83398151915290600090a35050565b609854841115614a4a5760405163d831496960e01b815260040160405180910390fd5b8260a46000614a6187670de0b6b3a7640000615d6e565b614a6c906001615d42565b81526020019081526020016000209080519060200190614a8d92919061511c565b508160a46000614aa587670de0b6b3a7640000615d6e565b614ab0906002615d42565b81526020019081526020016000209080519060200190614ad192919061511c565b508060a46000614ae987670de0b6b3a7640000615d6e565b614af4906003615d42565b81526020019081526020016000209080519060200190614b1592919061511c565b506040516003908590600080516020615ecd83398151915290600090a350505050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415614bbd57604051634c91180b60e01b815260040160405180910390fd5b6001600160a01b03838116600081815260a36020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000614c456ec097ce7bc90715b34b9f100000000084615d5a565b9050606481609c54614c579190615d6e565b614c619190615d5a565b341015614c8157604051638a0d377960e01b815260040160405180910390fd5b8015801590614ca65750600082815260aa60205260409020546001600160a01b031615155b1561110057600082815260aa60205260408082205490516001600160a01b039091169034908381818185875af1925050503d8060008114614d03576040519150601f19603f3d011682016040523d82523d6000602084013e614d08565b606091505b5050905080611ee15760405162461bcd60e51b81526004016117b590615c41565b60006001600160a01b0384163b15614e7657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614d6d903390899088908890600401615bf1565b602060405180830381600087803b158015614d8757600080fd5b505af1925050508015614db7575060408051601f3d908101601f19168201909252614db491810190615641565b60015b614e5c573d808015614de5576040519150601f19603f3d011682016040523d82523d6000602084013e614dea565b606091505b508051614e545760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016117b5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050614840565b506001949350505050565b614e8c6000826145d2565b600081815260a0602052604080822080546001600160a01b03191690555182919033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a450565b600054610100900460ff16614efe5760405162461bcd60e51b81526004016117b590615ca4565b611ee184848484614f56565b614f15848484614fb6565b6135cf6000848484614d29565b614f2c838361503a565b614f396000848484614d29565b611100576040516368d2bf6b60e11b815260040160405180910390fd5b600054610100900460ff16614f7d5760405162461bcd60e51b81526004016117b590615ca4565b8351614f9090609990602087019061511c565b508251614fa490609a90602086019061511c565b50614fae82614b38565b609c55505050565b6001600160a01b038216614fdc57604051622e076360e81b815260040160405180910390fd5b600081815260a060205260409020546001600160a01b0316156150115760405162a5a1f560e01b815260040160405180910390fd5b6001600160a01b038216600090815260a160205260408120805460019290614925908490615d42565b6001600160a01b03821661506057604051622e076360e81b815260040160405180910390fd5b600081815260a060205260409020546001600160a01b0316156150955760405162a5a1f560e01b815260040160405180910390fd5b6001600160a01b038216600090815260a1602052604081208054600192906150be908490615d42565b9091555050600081815260a0602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461512890615de7565b90600052602060002090601f01602090048101928261514a5760008555615190565b82601f1061516357805160ff1916838001178555615190565b82800160010185558215615190579182015b82811115615190578251825591602001919060010190615175565b506140539291505b808211156140535760008155600101615198565b60006001600160401b038311156151c5576151c5615e7d565b6151d8601f8401601f1916602001615cef565b90508281528383830111156151ec57600080fd5b828260208301376000602084830101529392505050565b600082601f830112615213578081fd5b8135602061522861522383615d1f565b615cef565b80838252828201915082860187848660051b8901011115615247578586fd5b855b858110156152875781356001600160401b03811115615266578788fd5b6152748a87838c01016152f1565b8552509284019290840190600101615249565b5090979650505050505050565b600082601f8301126152a4578081fd5b813560206152b461522383615d1f565b80838252828201915082860187848660051b89010111156152d3578586fd5b855b85811015615287578135845292840192908401906001016152d5565b600082601f830112615301578081fd5b615310838335602085016151ac565b9392505050565b600060208284031215615328578081fd5b813561531081615e93565b600060208284031215615344578081fd5b815161531081615e93565b60008060408385031215615361578081fd5b823561536c81615e93565b9150602083013561537c81615e93565b809150509250929050565b60008060006060848603121561539b578081fd5b83356153a681615e93565b925060208401356153b681615e93565b929592945050506040919091013590565b600080600080608085870312156153dc578081fd5b84356153e781615e93565b935060208501356153f781615e93565b92506040850135915060608501356001600160401b03811115615418578182fd5b8501601f81018713615428578182fd5b615437878235602084016151ac565b91505092959194509250565b60008060408385031215615455578182fd5b823561546081615e93565b9150602083013561537c81615ea8565b60008060408385031215615482578182fd5b823561548d81615e93565b946020939093013593505050565b6000806000606084860312156154af578081fd5b83356154ba81615e93565b95602085013595506040909401359392505050565b600080600080608085870312156154e4578182fd5b84356154ef81615e93565b966020860135965060408601359560600135945092505050565b60008060008060008060c08789031215615521578384fd5b863561552c81615e93565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b600060208284031215615565578081fd5b81356001600160401b0381111561557a578182fd5b61484084828501615294565b60008060006060848603121561559a578081fd5b83356001600160401b03808211156155b0578283fd5b6155bc87838801615294565b945060208601359150808211156155d1578283fd5b6155dd87838801615294565b935060408601359150808211156155f2578283fd5b506155ff86828701615203565b9150509250925092565b60006020828403121561561a578081fd5b815161531081615ea8565b600060208284031215615636578081fd5b813561531081615eb6565b600060208284031215615652578081fd5b815161531081615eb6565b60006020828403121561566e578081fd5b81356001600160401b03811115615683578182fd5b614840848285016152f1565b600080600080608085870312156156a4578182fd5b84356001600160401b03808211156156ba578384fd5b6156c6888389016152f1565b955060208701359150808211156156db578384fd5b506156e8878288016152f1565b93505060408501356156f981615e93565b9396929550929360600135925050565b6000806000806080858703121561571e578182fd5b84356001600160401b0380821115615734578384fd5b615740888389016152f1565b95506020870135915080821115615755578384fd5b615761888389016152f1565b94506040870135915080821115615776578384fd5b50615783878288016152f1565b949793965093946060013593505050565b600080600080600060a086880312156157ab578283fd5b85356001600160401b03808211156157c1578485fd5b6157cd89838a016152f1565b965060208801359150808211156157e2578485fd5b6157ee89838a016152f1565b95506040880135915080821115615803578485fd5b50615810888289016152f1565b93505060608601359150608086013561582881615e93565b809150509295509295909350565b60008060006060848603121561584a578081fd5b83356001600160401b0380821115615860578283fd5b61586c878388016152f1565b94506020860135915080821115615881578283fd5b5061588e868287016152f1565b925050604084013590509250925092565b600080604083850312156158b1578182fd5b82356001600160401b038111156158c6578283fd5b6158d2858286016152f1565b95602094909401359450505050565b6000806000606084860312156158f5578081fd5b83356001600160401b0381111561590a578182fd5b615916868287016152f1565b93505060208401359150604084013561592e81615e93565b809150509250925092565b60006020828403121561594a578081fd5b5035919050565b600060208284031215615962578081fd5b5051919050565b6000806040838503121561597b578182fd5b82359150602083013561537c81615e93565b6000806000606084860312156159a1578081fd5b8335925060208401356159b381615e93565b9150604084013561592e81615e93565b6000806000606084860312156159d7578081fd5b8335925060208401356001600160401b03808211156155d1578283fd5b60008060408385031215615a06578182fd5b50508035926020909101359150565b600080600060608486031215615a29578081fd5b8335925060208401359150604084013561592e81615e93565b600080600060608486031215615a56578081fd5b833592506020840135915060408401356001600160401b03811115615a79578182fd5b6155ff868287016152f1565b600080600060608486031215615a99578081fd5b505081359360208301359350604090920135919050565b60008151808452615ac8816020860160208601615da4565b601f01601f19169290920160200192915050565b8054600090600181811c9080831680615af657607f831692505b6020808410821415615b1657634e487b7160e01b86526022600452602486fd5b818015615b2a5760018114615b3b57615b68565b60ff19861689528489019650615b68565b60008881526020902060005b86811015615b605781548b820152908501908301615b47565b505084890196505b50505050505092915050565b60008351615b86818460208801615da4565b835190830190615b9a818360208801615da4565b01949350505050565b60008351615bb5818460208801615da4565b6145c981840185615adc565b60006153108284615adc565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615c2490830184615ab0565b9695505050505050565b6020815260006153106020830184615ab0565b6020808252601490820152732330b4b632b2103a379039b2b7321022ba3432b960611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f191681016001600160401b0381118282101715615d1757615d17615e7d565b604052919050565b60006001600160401b03821115615d3857615d38615e7d565b5060051b60200190565b60008219821115615d5557615d55615e51565b500190565b600082615d6957615d69615e67565b500490565b6000816000190483118215151615615d8857615d88615e51565b500290565b600082821015615d9f57615d9f615e51565b500390565b60005b83811015615dbf578181015183820152602001615da7565b83811115611ee15750506000910152565b600081615ddf57615ddf615e51565b506000190190565b600181811c90821680615dfb57607f821691505b60208210811415615e1c57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e3657615e36615e51565b5060010190565b600082615e4c57615e4c615e67565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146140ef57600080fd5b80151581146140ef57600080fd5b6001600160e01b0319811681146140ef57600080fdfe2d9816ddb9fb82aba8816fbdfe0e4cabf3a31829d7ad63b579feac6fde35f5ecbff11c0072d6987ed41b2668c3d63de84b9ff1dfb38807d377797b92ea008b5da2646970667358221220c81e91dd0067f956674f3ee498e5f8eb709d55bf7b002d20457df3a199c4d6f164736f6c63430008040033
Deployed Bytecode
0x6080604052600436106101145760003560e01c80638083499f116100a0578063e8a3d48511610064578063e8a3d485146102dd578063ef492468146102f2578063f2fde38b14610328578063f46a8ea114610348578063f4a0a5281461036857600080fd5b80638083499f1461023f578063825662891461025f5780638da5cb5b1461027f578063938e3d7b1461029d578063949eb7f6146102bd57600080fd5b806318160ddd116100e757806318160ddd146101c95780631b62cc19146101de5780633ccfd60b146101fe5780636817c76c14610215578063715018a61461022a57600080fd5b806301ffc9a71461011957806306fdde031461014e57806316e1b7db14610170578063175453e01461019e575b600080fd5b34801561012557600080fd5b50610139610134366004610ecc565b610388565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b506101636103bf565b60405161014591906111ce565b34801561017c57600080fd5b5061019061018b366004610e62565b610451565b604051908152602001610145565b6101b16101ac366004610ef4565b6104a8565b6040516001600160a01b039091168152602001610145565b3480156101d557600080fd5b50600254610190565b3480156101ea57600080fd5b506101b16101f9366004611094565b6105e3565b34801561020a57600080fd5b50610213610623565b005b34801561022157600080fd5b50600354610190565b34801561023657600080fd5b506102136106ee565b34801561024b57600080fd5b506101b161025a366004610f65565b610724565b34801561026b57600080fd5b5061021361027a366004610e83565b6109d4565b34801561028b57600080fd5b506000546001600160a01b03166101b1565b3480156102a957600080fd5b506102136102b8366004610fea565b610a57565b3480156102c957600080fd5b506101b16102d8366004610e62565b610ad7565b3480156102e957600080fd5b50610163610b7f565b3480156102fe57600080fd5b5061019061030d366004610e62565b6001600160a01b031660009081526006602052604090205490565b34801561033457600080fd5b50610213610343366004610e62565b610b8e565b34801561035457600080fd5b506101b1610363366004610ef4565b610c29565b34801561037457600080fd5b50610213610383366004611094565b610c54565b60006001600160e01b031982166375a142f160e11b14806103b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546103ce90611256565b80601f01602080910402602001604051908101604052809291908181526020018280546103fa90611256565b80156104475780601f1061041c57610100808354040283529160200191610447565b820191906000526020600020905b81548152906001019060200180831161042a57829003601f168201915b5050505050905090565b600254600090815b818111610491576000818152600560205260409020546001600160a01b0385811691161415610489579392505050565b600101610459565b50634e487b7160e01b600052600160045260246000fd5b60006003543410156104cd57604051638a0d377960e01b815260040160405180910390fd5b60006104f87f0000000000000000000000008fe8919095e79ad3db2c6d4793e6bce151b6403c610c83565b60405163f542033f60e01b81529091506001600160a01b0382169063f542033f90610531908a908a908a908a9033908b90600401611188565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b505060025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03881690811790915582519081529081018390529193507f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da10192500160405180910390a16105d581611291565b600255509695505050505050565b60006002548210610607576040516329c8c00760e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000546001600160a01b031633146106565760405162461bcd60e51b815260040161064d90611221565b60405180910390fd5b60405147903390600090829084908381818185875af1925050503d806000811461069c576040519150601f19603f3d011682016040523d82523d6000602084013e6106a1565b606091505b50509050806106e95760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161064d565b505050565b6000546001600160a01b031633146107185760405162461bcd60e51b815260040161064d90611221565b6107226000610d1b565b565b6001600160a01b0381166000818152600660205260408082205490516370a0823160e01b8152336004820152919290916370a082319060240160206040518083038186803b15801561077557600080fd5b505afa158015610789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ad91906110ac565b10156107cc57604051638a0d377960e01b815260040160405180910390fd5b6001600160a01b038216600090815260066020526040902054610802576040516332da96a360e01b815260040160405180910390fd5b816001600160a01b03166323b872dd336108246000546001600160a01b031690565b6001600160a01b038681166000908152600660205260409081902054905160e086901b6001600160e01b03191681529382166004850152911660248301526044820152606401602060405180830381600087803b15801561088457600080fd5b505af1158015610898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bc9190610eac565b5060006108e87f0000000000000000000000008fe8919095e79ad3db2c6d4793e6bce151b6403c610c83565b60405163f542033f60e01b81529091506001600160a01b0382169063f542033f90610921908b908b908b908b9033908c90600401611188565b600060405180830381600087803b15801561093b57600080fd5b505af115801561094f573d6000803e3d6000fd5b505060025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03881690811790915582519081529081018390529193507f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da10192500160405180910390a16109c581611291565b60025550979650505050505050565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161064d90611221565b6001600160a01b03821660008181526006602052604090819020839055517f7fa0e112e5801d5b0fbd79c812915f0ab2461b234234b9c64a7efd9a25c6abb690610a4b9084815260200190565b60405180910390a25050565b6000546001600160a01b03163314610a815760405162461bcd60e51b815260040161064d90611221565b6004604051610a9091906110ed565b604051908190038120907f10731a038f500442db2b5f56765996b82cba52d04008447c0b4aa252f3dc134390600090a28051610ad3906004906020840190610d6b565b5050565b600080546001600160a01b03163314610b025760405162461bcd60e51b815260040161064d90611221565b60025460008181526005602090815260409182902080546001600160a01b0319166001600160a01b03871690811790915582519081529081018390527f55c7305a5c9d8ed04ec6b7022640ccb643505db82828b0e24554c0d4d99da101910160405180910390a1610b7281611291565b600255508190505b919050565b6060600480546103ce90611256565b6000546001600160a01b03163314610bb85760405162461bcd60e51b815260040161064d90611221565b6001600160a01b038116610c1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064d565b610c2681610d1b565b50565b600080546001600160a01b031633146104cd5760405162461bcd60e51b815260040161064d90611221565b6000546001600160a01b03163314610c7e5760405162461bcd60e51b815260040161064d90611221565b600355565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b7a5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640161064d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054610d7790611256565b90600052602060002090601f016020900481019282610d995760008555610ddf565b82601f10610db257805160ff1916838001178555610ddf565b82800160010185558215610ddf579182015b82811115610ddf578251825591602001919060010190610dc4565b50610deb929150610def565b5090565b5b80821115610deb5760008155600101610df0565b80356001600160a01b0381168114610b7a57600080fd5b60008083601f840112610e2c578182fd5b50813567ffffffffffffffff811115610e43578182fd5b602083019150836020828501011115610e5b57600080fd5b9250929050565b600060208284031215610e73578081fd5b610e7c82610e04565b9392505050565b60008060408385031215610e95578081fd5b610e9e83610e04565b946020939093013593505050565b600060208284031215610ebd578081fd5b81518015158114610e7c578182fd5b600060208284031215610edd578081fd5b81356001600160e01b031981168114610e7c578182fd5b600080600080600060608688031215610f0b578081fd5b853567ffffffffffffffff80821115610f22578283fd5b610f2e89838a01610e1b565b90975095506020880135915080821115610f46578283fd5b50610f5388828901610e1b565b96999598509660400135949350505050565b60008060008060008060808789031215610f7d578081fd5b863567ffffffffffffffff80821115610f94578283fd5b610fa08a838b01610e1b565b90985096506020890135915080821115610fb8578283fd5b50610fc589828a01610e1b565b90955093505060408701359150610fde60608801610e04565b90509295509295509295565b600060208284031215610ffb578081fd5b813567ffffffffffffffff80821115611012578283fd5b818401915084601f830112611025578283fd5b813581811115611037576110376112b8565b604051601f8201601f19908116603f0116810190838211818310171561105f5761105f6112b8565b81604052828152876020848701011115611077578586fd5b826020860160208301379182016020019490945295945050505050565b6000602082840312156110a5578081fd5b5035919050565b6000602082840312156110bd578081fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600080835482600182811c91508083168061110957607f831692505b602080841082141561112957634e487b7160e01b87526022600452602487fd5b81801561113d576001811461114e5761117a565b60ff1986168952848901965061117a565b60008a815260209020885b868110156111725781548b820152908501908301611159565b505084890196505b509498975050505050505050565b60808152600061119c60808301888a6110c4565b82810360208401526111af8187896110c4565b6001600160a01b03959095166040840152505060600152949350505050565b6000602080835283518082850152825b818110156111fa578581018301518582016040015282016111de565b8181111561120b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061126a57607f821691505b6020821081141561128b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156112b157634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220219f2f06c359ab5410c1094b3e64d157ab01628c0c1362f7dae46d37f0349bfb64736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.