ERC-1155
Overview
Max Total Supply
0 JoynAsset
Holders
189
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
JoynAssetShared
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./JoynAsset.sol"; import "./TokenIdentifiers.sol"; /** * @title JoynAssetShared * OpenSea shared asset contract - A contract for easily creating custom assets on OpenSea */ contract JoynAssetShared is JoynAsset, ReentrancyGuard { // Migration contract address JoynAssetShared public migrationTarget; mapping(address => bool) public sharedProxyAddresses; struct Ownership { uint256 id; address owner; } using TokenIdentifiers for uint256; event CreatorChanged(uint256 indexed _id, address indexed _creator); mapping(uint256 => address) internal _creatorOverride; /** * @dev Require msg.sender to be the creator of the token id */ modifier creatorOnly(uint256 _id) { require( _isCreatorOrProxy(_id, _msgSender()), "JoynAssetShared#creatorOnly: ONLY_CREATOR_ALLOWED" ); _; } /** * @dev Require the caller to own the full supply of the token */ modifier onlyFullTokenOwner(uint256 _id) { require( _ownsTokenAmount(_msgSender(), _id, _id.tokenMaxSupply()), "JoynAssetShared#onlyFullTokenOwner: ONLY_FULL_TOKEN_OWNER_ALLOWED" ); _; } constructor( string memory _name, string memory _symbol, address _proxyRegistryAddress, string memory _templateURI, address _migrationAddress ) JoynAsset(_name, _symbol, _proxyRegistryAddress, _templateURI) { migrationTarget = JoynAssetShared(_migrationAddress); } /** * @dev Allows owner to change the proxy registry */ function setProxyRegistryAddress(address _address) public onlyOwnerOrProxy { proxyRegistryAddress = _address; } /** * @dev Allows owner to add a shared proxy address */ function addSharedProxyAddress(address _address) public onlyOwnerOrProxy { sharedProxyAddresses[_address] = true; } /** * @dev Allows owner to remove a shared proxy address */ function removeSharedProxyAddress( address _address ) public onlyOwnerOrProxy { delete sharedProxyAddresses[_address]; } /** * @dev Allows owner to disable the ability to migrate */ function disableMigrate() public onlyOwnerOrProxy { migrationTarget = JoynAssetShared(address(0)); } /** * @dev Migrate state from previous contract */ function migrate(Ownership[] memory _ownerships) public onlyOwnerOrProxy { JoynAssetShared _migrationTarget = migrationTarget; require( _migrationTarget != JoynAssetShared(address(0)), "JoynAssetShared#migrate: MIGRATE_DISABLED" ); string memory _migrationTargetTemplateURI = _migrationTarget .templateURI(); for (uint256 i = 0; i < _ownerships.length; ++i) { uint256 id = _ownerships[i].id; address owner = _ownerships[i].owner; require( owner != address(0), "JoynAssetShared#migrate: ZERO_ADDRESS_NOT_ALLOWED" ); uint256 previousAmount = _migrationTarget.balanceOf(owner, id); if (previousAmount == 0) { continue; } _mint(owner, id, previousAmount, ""); if ( keccak256(bytes(_migrationTarget.uri(id))) != keccak256(bytes(_migrationTargetTemplateURI)) ) { _setPermanentURI(id, _migrationTarget.uri(id)); } } } function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) public override nonReentrant creatorOnly(_id) { _mint(_to, _id, _quantity, _data); } function batchMint( address _to, uint256[] memory _ids, uint256[] memory _quantities, bytes memory _data ) public override nonReentrant { for (uint256 i = 0; i < _ids.length; i++) { require( _isCreatorOrProxy(_ids[i], _msgSender()), "JoynAssetShared#_batchMint: ONLY_CREATOR_ALLOWED" ); } _batchMint(_to, _ids, _quantities, _data); } ///////////////////////////////// // CONVENIENCE CREATOR METHODS // ///////////////////////////////// /** * @dev Will update the URI for the token * @param _id The token ID to update. msg.sender must be its creator, the uri must be impermanent, * and the creator must own all of the token supply * @param _uri New URI for the token. */ function setURI( uint256 _id, string memory _uri ) public override creatorOnly(_id) onlyImpermanentURI(_id) onlyFullTokenOwner(_id) { _setURI(_id, _uri); } /** * @dev setURI, but permanent */ function setPermanentURI( uint256 _id, string memory _uri ) public override creatorOnly(_id) onlyImpermanentURI(_id) onlyFullTokenOwner(_id) { _setPermanentURI(_id, _uri); } /** * @dev Change the creator address for given token * @param _to Address of the new creator * @param _id Token IDs to change creator of */ function setCreator(uint256 _id, address _to) public creatorOnly(_id) { require( _to != address(0), "JoynAssetShared#setCreator: INVALID_ADDRESS." ); _creatorOverride[_id] = _to; emit CreatorChanged(_id, _to); } /** * @dev Get the creator for a token * @param _id The token id to look up */ function creator(uint256 _id) public view returns (address) { if (_creatorOverride[_id] != address(0)) { return _creatorOverride[_id]; } else { return _id.tokenCreator(); } } /** * @dev Get the maximum supply for a token * @param _id The token id to look up */ function maxSupply(uint256 _id) public pure returns (uint256) { return _id.tokenMaxSupply(); } // Override ERC1155Tradable for birth events function _origin(uint256 _id) internal pure override returns (address) { return _id.tokenCreator(); } function _requireMintable(address _address, uint256 _id) internal view { require( _isCreatorOrProxy(_id, _address), "JoynAssetShared#_requireMintable: ONLY_CREATOR_ALLOWED" ); } function _remainingSupply( uint256 _id ) internal view override returns (uint256) { return maxSupply(_id) - totalSupply(_id); } function _isCreatorOrProxy( uint256 _id, address _address ) internal view override returns (bool) { address creator_ = creator(_id); return creator_ == _address || _isProxyForUser(creator_, _address); } // Overrides ERC1155Tradable to allow a shared proxy address function _isProxyForUser( address _user, address _address ) internal view override returns (bool) { if (sharedProxyAddresses[_address]) { return true; } return super._isProxyForUser(_user, _address); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn(address from, uint256 id, uint256 amount) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract ContextMixin { function msgSender() internal view returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and( mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff ) } } else { sender = payable(msg.sender); } return sender; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {Initializable} from "./Initializable.sol"; contract EIP712Base is Initializable { struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } string public constant ERC712_VERSION = "1"; bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256( bytes( "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)" ) ); bytes32 internal domainSeperator; // supposed to be called once while initializing. // one of the contracts that inherits this contract follows proxy pattern // so it is not possible to do this in a constructor function _initializeEIP712(string memory name) internal initializer { _setDomainSeperator(name); } function _setDomainSeperator(string memory name) internal { domainSeperator = keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(ERC712_VERSION)), address(this), bytes32(getChainId()) ) ); } function getDomainSeperator() public view returns (bytes32) { return domainSeperator; } function getChainId() public view returns (uint256) { uint256 id; assembly { id := chainid() } return id; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash( bytes32 messageHash ) internal view returns (bytes32) { return keccak256( abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash) ); } }
pragma solidity ^0.8.4; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {EIP712Base} from "./EIP712Base.sol"; contract NativeMetaTransaction is EIP712Base { bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256( bytes( "MetaTransaction(uint256 nonce,address from,bytes functionSignature)" ) ); event MetaTransactionExecuted( address userAddress, address payable relayerAddress, bytes functionSignature ); mapping(address => uint256) nonces; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } function executeMetaTransaction( address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV ) external payable returns (bytes memory) { MetaTransaction memory metaTx = MetaTransaction({ nonce: nonces[userAddress], from: userAddress, functionSignature: functionSignature }); require( verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match" ); // increase nonce for user (to avoid re-use) nonces[userAddress] += 1; emit MetaTransactionExecuted( userAddress, payable(msg.sender), functionSignature ); // Append userAddress and relayer address at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call( abi.encodePacked(functionSignature, userAddress) ); require(success, "Function call not successful"); return returnData; } function hashMetaTransaction( MetaTransaction memory metaTx ) internal pure returns (bytes32) { return keccak256( abi.encode( META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature) ) ); } function getNonce(address user) public view returns (uint256 nonce) { nonce = nonces[user]; } function verify( address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV ) internal view returns (bool) { require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER"); return signer == ecrecover( toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./common/meta-transactions/ContentMixin.sol"; import "./common/meta-transactions/NativeMetaTransaction.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** * @title ERC1155Tradable * ERC1155Tradable - ERC1155 contract that whitelists an operator address, has create and mint functionality, and supports useful standards from OpenZeppelin, like exists(), name(), symbol(), and totalSupply() */ contract ERC1155Tradable is ContextMixin, ERC1155, NativeMetaTransaction, Ownable, Pausable { using Address for address; // Proxy registry address address public proxyRegistryAddress; // Contract name string public name; // Contract symbol string public symbol; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private balances; mapping(uint256 => uint256) private _supply; constructor( string memory _name, string memory _symbol, address _proxyRegistryAddress ) ERC1155("") { name = _name; symbol = _symbol; proxyRegistryAddress = _proxyRegistryAddress; _initializeEIP712(name); } /** * @dev Throws if called by any account other than the owner or their proxy */ modifier onlyOwnerOrProxy() { require( _isOwnerOrProxy(_msgSender()), "ERC1155Tradable#onlyOwner: CALLER_IS_NOT_OWNER" ); _; } /** * @dev Throws if called by any account other than _from or their proxy */ modifier onlyApproved(address _from) { require( _from == _msgSender() || isApprovedForAll(_from, _msgSender()), "ERC1155Tradable#onlyApproved: CALLER_NOT_ALLOWED" ); _; } function _isOwnerOrProxy(address _address) internal view returns (bool) { return owner() == _address || _isProxyForUser(owner(), _address); } function pause() external onlyOwnerOrProxy { _pause(); } function unpause() external onlyOwnerOrProxy { _unpause(); } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf( address account, uint256 id ) public view virtual override returns (uint256) { require( account != address(0), "ERC1155: balance query for the zero address" ); return balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require( accounts.length == ids.length, "ERC1155: accounts and ids length mismatch" ); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev Returns the total quantity for a token ID * @param _id uint256 ID of the token to query * @return amount of token in existence */ function totalSupply(uint256 _id) public view returns (uint256) { return _supply[_id]; } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-free listings. */ function isApprovedForAll( address _owner, address _operator ) public view override returns (bool isOperator) { // Whitelist OpenSea proxy contracts for easy trading. if (_isProxyForUser(_owner, _operator)) { return true; } return super.isApprovedForAll(_owner, _operator); } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override whenNotPaused onlyApproved(from) { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer( operator, from, to, asSingletonArray(id), asSingletonArray(amount), data ); uint256 fromBalance = balances[id][from]; require( fromBalance >= amount, "ERC1155: insufficient balance for transfer" ); balances[id][from] = fromBalance - amount; balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override whenNotPaused onlyApproved(from) { require( ids.length == amounts.length, "ERC1155: IDS_AMOUNTS_LENGTH_MISMATCH" ); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = balances[id][from]; require( fromBalance >= amount, "ERC1155: insufficient balance for transfer" ); balances[id][from] = fromBalance - amount; balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); doSafeBatchTransferAcceptanceCheck( operator, from, to, ids, amounts, data ); } /** * @dev Hook to be called right before minting * @param _id Token ID to mint * @param _quantity Amount of tokens to mint */ function _beforeMint(uint256 _id, uint256 _quantity) internal virtual {} /** * @dev Mints some amount of tokens to an address * @param _to Address of the future owner of the token * @param _id Token ID to mint * @param _quantity Amount of tokens to mint * @param _data Data to pass if receiver is contract */ function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) public virtual onlyOwnerOrProxy { _mint(_to, _id, _quantity, _data); } /** * @dev Mint tokens for each id in _ids * @param _to The address to mint tokens to * @param _ids Array of ids to mint * @param _quantities Array of amounts of tokens to mint per id * @param _data Data to pass if receiver is contract */ function batchMint( address _to, uint256[] memory _ids, uint256[] memory _quantities, bytes memory _data ) public virtual onlyOwnerOrProxy { _batchMint(_to, _ids, _quantities, _data); } /** * @dev Burns amount of a given token id * @param _from The address to burn tokens from * @param _id Token ID to burn * @param _quantity Amount to burn */ function burn( address _from, uint256 _id, uint256 _quantity ) public virtual onlyApproved(_from) { _burn(_from, _id, _quantity); } /** * @dev Burns tokens for each id in _ids * @param _from The address to burn tokens from * @param _ids Array of token ids to burn * @param _quantities Array of the amount to be burned */ function batchBurn( address _from, uint256[] memory _ids, uint256[] memory _quantities ) public virtual onlyApproved(_from) { _burnBatch(_from, _ids, _quantities); } /** * @dev Returns whether the specified token is minted * @param _id uint256 ID of the token to query the existence of * @return bool whether the token exists */ function exists(uint256 _id) public view returns (bool) { return _supply[_id] > 0; } // Overrides ERC1155 _mint to allow changing birth events to creator transfers, // and to set _supply function _mint( address _to, uint256 _id, uint256 _amount, bytes memory _data ) internal virtual override whenNotPaused { address operator = _msgSender(); _beforeTokenTransfer( operator, address(0), _to, asSingletonArray(_id), asSingletonArray(_amount), _data ); _beforeMint(_id, _amount); // Add _amount balances[_id][_to] += _amount; _supply[_id] += _amount; // Origin of token will be the _from parameter address origin = _origin(_id); // Emit event emit TransferSingle(operator, origin, _to, _id, _amount); // Calling onReceive method if recipient is contract doSafeTransferAcceptanceCheck( operator, origin, _to, _id, _amount, _data ); } // Overrides ERC1155MintBurn to change the batch birth events to creator transfers, and to set _supply function _batchMint( address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) internal virtual whenNotPaused { require( _ids.length == _amounts.length, "ERC1155Tradable#batchMint: INVALID_ARRAYS_LENGTH" ); // Number of mints to execute uint256 nMint = _ids.length; // Origin of tokens will be the _from parameter address origin = _origin(_ids[0]); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), _to, _ids, _amounts, _data); // Executing all minting for (uint256 i = 0; i < nMint; i++) { // Update storage balance uint256 id = _ids[i]; uint256 amount = _amounts[i]; _beforeMint(id, amount); require( _origin(id) == origin, "ERC1155Tradable#batchMint: MULTIPLE_ORIGINS_NOT_ALLOWED" ); balances[id][_to] += amount; _supply[id] += amount; } // Emit batch mint event emit TransferBatch(operator, origin, _to, _ids, _amounts); // Calling onReceive method if recipient is contract doSafeBatchTransferAcceptanceCheck( operator, origin, _to, _ids, _amounts, _data ); } /** * @dev Destroys `amount` tokens of token type `id` from `account` * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens of token type `id`. */ function _burn( address account, uint256 id, uint256 amount ) internal override whenNotPaused { require(account != address(0), "ERC1155#_burn: BURN_FROM_ZERO_ADDRESS"); require(amount > 0, "ERC1155#_burn: AMOUNT_LESS_THAN_ONE"); address operator = _msgSender(); _beforeTokenTransfer( operator, account, address(0), asSingletonArray(id), asSingletonArray(amount), "" ); uint256 accountBalance = balances[id][account]; require( accountBalance >= amount, "ERC1155#_burn: AMOUNT_EXCEEDS_BALANCE" ); balances[id][account] = accountBalance - amount; _supply[id] -= amount; emit TransferSingle(operator, account, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal override whenNotPaused { require(account != address(0), "ERC1155: BURN_FROM_ZERO_ADDRESS"); require( ids.length == amounts.length, "ERC1155: IDS_AMOUNTS_LENGTH_MISMATCH" ); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = balances[id][account]; require( accountBalance >= amount, "ERC1155#_burnBatch: AMOUNT_EXCEEDS_BALANCE" ); balances[id][account] = accountBalance - amount; _supply[id] -= amount; } emit TransferBatch(operator, account, address(0), ids, amounts); } // Override this to change birth events' _from address function _origin( uint256 /* _id */ ) internal view virtual returns (address) { return address(0); } // PROXY HELPER METHODS function _isProxyForUser( address _user, address _address ) internal view virtual returns (bool) { if (!proxyRegistryAddress.isContract()) { return false; } ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); return address(proxyRegistry.proxies(_user)) == _address; } // Copied from OpenZeppelin // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/c3ae4790c71b7f53cc8fff743536dcb7031fed74/contracts/token/ERC1155/ERC1155.sol#L394 function doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received( operator, from, id, amount, data ) returns (bytes4 response) { if ( response != IERC1155Receiver(to).onERC1155Received.selector ) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } // Copied from OpenZeppelin // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/c3ae4790c71b7f53cc8fff743536dcb7031fed74/contracts/token/ERC1155/ERC1155.sol#L417 function doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived( operator, from, ids, amounts, data ) returns (bytes4 response) { if ( response != IERC1155Receiver(to).onERC1155BatchReceived.selector ) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } // Copied from OpenZeppelin // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/c3ae4790c71b7f53cc8fff743536dcb7031fed74/contracts/token/ERC1155/ERC1155.sol#L440 function asSingletonArray( uint256 element ) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } /** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. */ function _msgSender() internal view override returns (address sender) { return ContextMixin.msgSender(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./ERC1155Tradable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title AssetContract * AssetContract - A contract for easily creating non-fungible assets on OpenSea. */ contract JoynAsset is ERC1155Tradable { event PermanentURI(string _value, uint256 indexed _id); uint256 constant TOKEN_SUPPLY_CAP = 1; string public templateURI; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURI; // Mapping for whether a token URI is set permanently mapping(uint256 => bool) private _isPermanentURI; modifier onlyTokenAmountOwned( address _from, uint256 _id, uint256 _quantity ) { require( _ownsTokenAmount(_from, _id, _quantity), "AssetContract#onlyTokenAmountOwned: ONLY_TOKEN_AMOUNT_OWNED_ALLOWED" ); _; } /** * @dev Require the URI to be impermanent */ modifier onlyImpermanentURI(uint256 id) { require( !isPermanentURI(id), "AssetContract#onlyImpermanentURI: URI_CANNOT_BE_CHANGED" ); _; } constructor( string memory _name, string memory _symbol, address _proxyRegistryAddress, string memory _templateURI ) ERC1155Tradable(_name, _symbol, _proxyRegistryAddress) { if (bytes(_templateURI).length > 0) { setTemplateURI(_templateURI); } } function openSeaVersion() public pure returns (string memory) { return "2.1.0"; } /** * @dev Require _from to own a specified quantity of the token */ function _ownsTokenAmount( address _from, uint256 _id, uint256 _quantity ) internal view returns (bool) { return balanceOf(_from, _id) >= _quantity; } /** * Compat for factory interfaces on OpenSea * Indicates that this contract can return balances for * tokens that haven't been minted yet */ function supportsFactoryInterface() public pure returns (bool) { return true; } function setTemplateURI(string memory _uri) public onlyOwnerOrProxy { templateURI = _uri; } function setURI( uint256 _id, string memory _uri ) public virtual onlyOwnerOrProxy onlyImpermanentURI(_id) { _setURI(_id, _uri); } function setPermanentURI( uint256 _id, string memory _uri ) public virtual onlyOwnerOrProxy onlyImpermanentURI(_id) { _setPermanentURI(_id, _uri); } function isPermanentURI(uint256 _id) public view returns (bool) { return _isPermanentURI[_id]; } function uri(uint256 _id) public view override returns (string memory) { string memory tokenUri = _tokenURI[_id]; if (bytes(tokenUri).length != 0) { return tokenUri; } return string(abi.encodePacked(templateURI, "/", Strings.toString(_id))); } function balanceOf( address _owner, uint256 _id ) public view virtual override returns (uint256) { uint256 balance = super.balanceOf(_owner, _id); return _isCreatorOrProxy(_id, _owner) ? balance + _remainingSupply(_id) : balance; } function safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data ) public override { uint256 mintedBalance = super.balanceOf(_from, _id); if (mintedBalance < _amount) { // Only mint what _from doesn't already have mint(_to, _id, _amount - mintedBalance, _data); if (mintedBalance > 0) { super.safeTransferFrom(_from, _to, _id, mintedBalance, _data); } } else { super.safeTransferFrom(_from, _to, _id, _amount, _data); } } function safeBatchTransferFrom( address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) public override { require( _ids.length == _amounts.length, "AssetContract#safeBatchTransferFrom: INVALID_ARRAYS_LENGTH" ); for (uint256 i = 0; i < _ids.length; i++) { safeTransferFrom(_from, _to, _ids[i], _amounts[i], _data); } } function _beforeMint( uint256 _id, uint256 _quantity ) internal view override { require( _quantity <= _remainingSupply(_id), "AssetContract#_beforeMint: QUANTITY_EXCEEDS_TOKEN_SUPPLY_CAP" ); } // Overrides ERC1155Tradable burn to check for quantity owned function burn( address _from, uint256 _id, uint256 _quantity ) public override onlyTokenAmountOwned(_from, _id, _quantity) { super.burn(_from, _id, _quantity); } // Overrides ERC1155Tradable batchBurn to check for quantity owned function batchBurn( address _from, uint256[] memory _ids, uint256[] memory _quantities ) public override { for (uint256 i = 0; i < _ids.length; i++) { require( _ownsTokenAmount(_from, _ids[i], _quantities[i]), "AssetContract#batchBurn: ONLY_TOKEN_AMOUNT_OWNED_ALLOWED" ); } super.batchBurn(_from, _ids, _quantities); } function _mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) internal override { super._mint(_to, _id, _quantity, _data); if (_data.length > 1) { setURI(_id, string(_data)); } } function _isCreatorOrProxy( uint256, address _address ) internal view virtual returns (bool) { return _isOwnerOrProxy(_address); } function _remainingSupply( uint256 _id ) internal view virtual returns (uint256) { return TOKEN_SUPPLY_CAP - totalSupply(_id); } // Override ERC1155Tradable for birth events function _origin( uint256 /* _id */ ) internal view virtual override returns (address) { return owner(); } function _batchMint( address _to, uint256[] memory _ids, uint256[] memory _quantities, bytes memory _data ) internal virtual override { super._batchMint(_to, _ids, _quantities, _data); if (_data.length > 1) { for (uint256 i = 0; i < _ids.length; i++) { setURI(_ids[i], string(_data)); } } } function _setURI(uint256 _id, string memory _uri) internal { _tokenURI[_id] = _uri; emit URI(_uri, _id); } function _setPermanentURI( uint256 _id, string memory _uri ) internal virtual { require( bytes(_uri).length > 0, "AssetContract#setPermanentURI: ONLY_VALID_URI" ); _isPermanentURI[_id] = true; _setURI(_id, _uri); emit PermanentURI(_uri, _id); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Strings.sol"; /* DESIGN NOTES: Token ids are a concatenation of: * creator: hex address of the creator of the token. 160 bits * index: Index for this token (the regular ID), up to 2^56 - 1. 56 bits * supply: Supply cap for this token, up to 2^40 - 1 (1 trillion). 40 bits */ /** * @title TokenIdentifiers * support for authentication and metadata for token ids */ library TokenIdentifiers { uint8 constant ADDRESS_BITS = 160; uint8 constant INDEX_BITS = 56; uint8 constant SUPPLY_BITS = 40; uint256 constant SUPPLY_MASK = (uint256(1) << SUPPLY_BITS) - 1; uint256 constant INDEX_MASK = ((uint256(1) << INDEX_BITS) - 1) ^ SUPPLY_MASK; function tokenMaxSupply(uint256 _id) internal pure returns (uint256) { return _id & SUPPLY_MASK; } function tokenIndex(uint256 _id) internal pure returns (uint256) { return _id & INDEX_MASK; } function tokenCreator(uint256 _id) internal pure returns (address) { return address(uint160(_id >> (INDEX_BITS + SUPPLY_BITS))); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_proxyRegistryAddress","type":"address"},{"internalType":"string","name":"_templateURI","type":"string"},{"internalType":"address","name":"_migrationAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":true,"internalType":"address","name":"_creator","type":"address"}],"name":"CreatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addSharedProxyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_quantities","type":"uint256[]"}],"name":"batchBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_quantities","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"batchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"creator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableMigrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"isPermanentURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct JoynAssetShared.Ownership[]","name":"_ownerships","type":"tuple[]"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"migrationTarget","outputs":[{"internalType":"contract JoynAssetShared","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openSeaVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeSharedProxyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"setCreator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setPermanentURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setProxyRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setTemplateURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sharedProxyAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supportsFactoryInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"templateURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526003805460ff191690553480156200001b57600080fd5b5060405162004aff38038062004aff8339810160408190526200003e916200065e565b84848484838383604051806020016040528060008152506200006681620001ac60201b60201c565b506200007b62000075620001be565b620001da565b6006805460ff60a01b191690556008620000968482620007ab565b506009620000a58382620007ab565b50600780546001600160a01b0319166001600160a01b03831617905560088054620001619190620000d6906200071c565b80601f016020809104026020016040519081016040528092919081815260200182805462000104906200071c565b8015620001555780601f10620001295761010080835404028352916020019162000155565b820191906000526020600020905b8154815290600101906020018083116200013757829003601f168201915b50506200022c92505050565b505081511590506200017857620001788162000291565b50506001600f555050601080546001600160a01b0319166001600160a01b0392909216919091179055506200089792505050565b6002620001ba8282620007ab565b5050565b6000620001d56200031860201b620019ab1760201c565b905090565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60035460ff1615620002765760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b60448201526064015b60405180910390fd5b620002818162000376565b506003805460ff19166001179055565b620002a56200029f620001be565b62000418565b6200030a5760405162461bcd60e51b815260206004820152602e60248201527f455243313135355472616461626c65236f6e6c794f776e65723a2043414c4c4560448201526d292fa4a9afa727aa2fa7aba722a960911b60648201526084016200026d565b600c620001ba8282620007ab565b60003033036200037057600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150620003739050565b50335b90565b6040518060800160405280604f815260200162004ab0604f9139805160209182012082519282019290922060408051808201825260018152603160f81b90840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608401523060808401524660a0808501919091528151808503909101815260c090930190528151910120600455565b60006001600160a01b038216620004376006546001600160a01b031690565b6001600160a01b03161480620004665750620004666200045f6006546001600160a01b031690565b836200046c565b92915050565b6001600160a01b03811660009081526011602052604081205460ff1615620004975750600162000466565b620004ae8383620004b560201b62001a071760201c565b9392505050565b600754600090620004db906001600160a01b031662000571602090811b62001aa817901c565b620004e95750600062000466565b60075460405163c455279160e01b81526001600160a01b03858116600483015291821691841690829063c455279190602401602060405180830381865afa15801562000539573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200055f919062000877565b6001600160a01b031614949350505050565b6001600160a01b03163b151590565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620005a857600080fd5b81516001600160401b0380821115620005c557620005c562000580565b604051601f8301601f19908116603f01168101908282118183101715620005f057620005f062000580565b816040528381526020925086838588010111156200060d57600080fd5b600091505b8382101562000631578582018301518183018401529082019062000612565b600093810190920192909252949350505050565b6001600160a01b03811681146200065b57600080fd5b50565b600080600080600060a086880312156200067757600080fd5b85516001600160401b03808211156200068f57600080fd5b6200069d89838a0162000596565b96506020880151915080821115620006b457600080fd5b620006c289838a0162000596565b955060408801519150620006d68262000645565b606088015191945080821115620006ec57600080fd5b50620006fb8882890162000596565b92505060808601516200070e8162000645565b809150509295509295909350565b600181811c908216806200073157607f821691505b6020821081036200075257634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620007a657600081815260208120601f850160051c81016020861015620007815750805b601f850160051c820191505b81811015620007a2578281556001016200078d565b5050505b505050565b81516001600160401b03811115620007c757620007c762000580565b620007df81620007d884546200071c565b8462000758565b602080601f831160018114620008175760008415620007fe5750858301515b600019600386901b1c1916600185901b178555620007a2565b600085815260208120601f198616915b82811015620008485788860151825594840194600190910190840162000827565b5085821015620008675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200088a57600080fd5b8151620004ae8162000645565b61420980620008a76000396000f3fe6080604052600436106102715760003560e01c8063715018a61161014f578063a50aa5c3116100c1578063e985e9c51161007a578063e985e9c5146107a4578063f242432a146107c4578063f2fde38b146107e4578063f5298aca14610804578063f6eb127a14610824578063f923e8c31461084457600080fd5b8063a50aa5c3146106e3578063b48ab8b614610703578063bd85b03914610723578063c311c52314610750578063cd7c032614610764578063d26ea6c01461078457600080fd5b8063869f759411610113578063869f7594146106305780638da5cb5b1461065057806391686f531461066e57806395d89b411461068e5780639e037eea146106a3578063a22cb465146106c357600080fd5b8063715018a614610596578063731133e9146105ab57806373505d35146105cb5780638456cb59146105fb578063862440e21461061057600080fd5b80632eb2c2d6116101e85780634060b25e116101ac5780634060b25e146104955780634e1273f4146104c35780634f558e79146104f0578063510b51581461051f5780635b51acff146105575780635c975abb1461057757600080fd5b80632eb2c2d61461040d5780632f1c982c1461042d5780633408e4701461044d5780633588ad7c146104605780633f4ba83a1461048057600080fd5b80630e89341c1161023a5780630e89341c146103255780630f7e5970146103455780631e7d9dbb1461037257806320379ee5146103a257806324d88785146103b75780632d0335ab146103d757600080fd5b8062fdd58e1461027657806301ffc9a7146102a957806306fdde03146102d95780630bb2465a146102fb5780630c53c51c14610312575b600080fd5b34801561028257600080fd5b50610296610291366004613206565b610859565b6040519081526020015b60405180910390f35b3480156102b557600080fd5b506102c96102c4366004613248565b610899565b60405190151581526020016102a0565b3480156102e557600080fd5b506102ee6108e9565b6040516102a091906132b5565b34801561030757600080fd5b50610310610977565b005b6102ee6103203660046133b2565b6109be565b34801561033157600080fd5b506102ee61034036600461342f565b610b96565b34801561035157600080fd5b506102ee604051806040016040528060018152602001603160f81b81525081565b34801561037e57600080fd5b506102c961038d36600461342f565b6000908152600e602052604090205460ff1690565b3480156103ae57600080fd5b50600454610296565b3480156103c357600080fd5b506103106103d2366004613448565b610c76565b3480156103e357600080fd5b506102966103f236600461347c565b6001600160a01b031660009081526005602052604090205490565b34801561041957600080fd5b5061031061042836600461352d565b610cad565b34801561043957600080fd5b506103106104483660046135da565b610d89565b34801561045957600080fd5b5046610296565b34801561046c57600080fd5b5061031061047b366004613699565b611103565b34801561048c57600080fd5b506103106111aa565b3480156104a157600080fd5b506040805180820190915260058152640322e312e360dc1b60208201526102ee565b3480156104cf57600080fd5b506104e36104de3660046136df565b6111db565b6040516102a091906137dc565b3480156104fc57600080fd5b506102c961050b36600461342f565b6000908152600b6020526040902054151590565b34801561052b57600080fd5b5061053f61053a36600461342f565b611304565b6040516001600160a01b0390911681526020016102a0565b34801561056357600080fd5b5060105461053f906001600160a01b031681565b34801561058357600080fd5b50600654600160a01b900460ff166102c9565b3480156105a257600080fd5b50610310611346565b3480156105b757600080fd5b506103106105c63660046137ef565b611358565b3480156105d757600080fd5b506102c96105e636600461347c565b60116020526000908152604090205460ff1681565b34801561060757600080fd5b506103106113a0565b34801561061c57600080fd5b5061031061062b366004613699565b6113cf565b34801561063c57600080fd5b5061029661064b36600461342f565b61145b565b34801561065c57600080fd5b506006546001600160a01b031661053f565b34801561067a57600080fd5b50610310610689366004613851565b611466565b34801561069a57600080fd5b506102ee611554565b3480156106af57600080fd5b506103106106be36600461347c565b611561565b3480156106cf57600080fd5b506103106106de366004613881565b6115a9565b3480156106ef57600080fd5b506103106106fe36600461347c565b6115bb565b34801561070f57600080fd5b5061031061071e3660046138b4565b611606565b34801561072f57600080fd5b5061029661073e36600461342f565b6000908152600b602052604090205490565b34801561075c57600080fd5b5060016102c9565b34801561077057600080fd5b5060075461053f906001600160a01b031681565b34801561079057600080fd5b5061031061079f36600461347c565b6116cd565b3480156107b057600080fd5b506102c96107bf366004613942565b611716565b3480156107d057600080fd5b506103106107df366004613970565b611760565b3480156107f057600080fd5b506103106107ff36600461347c565b6117b0565b34801561081057600080fd5b5061031061081f3660046139d8565b611829565b34801561083057600080fd5b5061031061083f366004613a0d565b6118c0565b34801561085057600080fd5b506102ee61199e565b6000806108668484611ab7565b90506108728385611b4b565b61087c578061088f565b61088583611b7e565b61088f9082613a98565b9150505b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806108ca57506001600160e01b031982166303a24d0760e21b145b8061089357506301ffc9a760e01b6001600160e01b0319831614610893565b600880546108f690613aab565b80601f016020809104026020016040519081016040528092919081815260200182805461092290613aab565b801561096f5780601f106109445761010080835404028352916020019161096f565b820191906000526020600020905b81548152906001019060200180831161095257829003601f168201915b505050505081565b610987610982611ba0565b611baf565b6109ac5760405162461bcd60e51b81526004016109a390613ae5565b60405180910390fd5b601080546001600160a01b0319169055565b60408051606081810183526001600160a01b038816600081815260056020908152908590205484528301529181018690526109fc8782878787611bf8565b610a525760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084016109a3565b6001600160a01b0387166000908152600560205260408120805460019290610a7b908490613a98565b90915550506040517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b90610ab490899033908a90613b33565b60405180910390a1600080306001600160a01b0316888a604051602001610adc929190613b68565b60408051601f1981840301815290829052610af691613b9f565b6000604051808303816000865af19150503d8060008114610b33576040519150601f19603f3d011682016040523d82523d6000602084013e610b38565b606091505b509150915081610b8a5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c0000000060448201526064016109a3565b98975050505050505050565b6000818152600d6020526040812080546060929190610bb490613aab565b80601f0160208091040260200160405190810160405280929190818152602001828054610be090613aab565b8015610c2d5780601f10610c0257610100808354040283529160200191610c2d565b820191906000526020600020905b815481529060010190602001808311610c1057829003601f168201915b505050505090508051600014610c435792915050565b600c610c4e84611ce8565b604051602001610c5f929190613bbb565b604051602081830303815290604052915050919050565b610c81610982611ba0565b610c9d5760405162461bcd60e51b81526004016109a390613ae5565b600c610ca98282613c95565b5050565b8151835114610d245760405162461bcd60e51b815260206004820152603a60248201527f4173736574436f6e7472616374237361666542617463685472616e736665724660448201527f726f6d3a20494e56414c49445f4152524159535f4c454e47544800000000000060648201526084016109a3565b60005b8351811015610d8157610d6f8686868481518110610d4757610d47613d54565b6020026020010151868581518110610d6157610d61613d54565b602002602001015186611760565b80610d7981613d6a565b915050610d27565b505050505050565b610d94610982611ba0565b610db05760405162461bcd60e51b81526004016109a390613ae5565b6010546001600160a01b031680610e1b5760405162461bcd60e51b815260206004820152602960248201527f4a6f796e4173736574536861726564236d6967726174653a204d49475241544560448201526817d11254d05093115160ba1b60648201526084016109a3565b6000816001600160a01b031663f923e8c36040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e839190810190613d83565b905060005b83518110156110fd576000848281518110610ea557610ea5613d54565b60200260200101516000015190506000858381518110610ec757610ec7613d54565b602002602001015160200151905060006001600160a01b0316816001600160a01b031603610f515760405162461bcd60e51b815260206004820152603160248201527f4a6f796e4173736574536861726564236d6967726174653a205a45524f5f414460448201527011149154d4d7d393d517d0531313d5d151607a1b60648201526084016109a3565b604051627eeac760e11b81526001600160a01b038281166004830152602482018490526000919087169062fdd58e90604401602060405180830381865afa158015610fa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc49190613e04565b905080600003610fd6575050506110ed565b610ff182848360405180602001604052806000815250611d7a565b845160208601206040516303a24d0760e21b8152600481018590526001600160a01b03881690630e89341c90602401600060405180830381865afa15801561103d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110659190810190613d83565b80519060200120146110e9576040516303a24d0760e21b8152600481018490526110e99084906001600160a01b03891690630e89341c90602401600060405180830381865afa1580156110bc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110e49190810190613d83565b611d9a565b5050505b6110f681613d6a565b9050610e88565b50505050565b8161111581611110611ba0565b611b4b565b6111315760405162461bcd60e51b81526004016109a390613e1d565b6000838152600e6020526040902054839060ff16156111625760405162461bcd60e51b81526004016109a390613e6e565b8361117d61116e611ba0565b8261117884611e60565b611e7b565b6111995760405162461bcd60e51b81526004016109a390613ecb565b6111a38585611d9a565b5050505050565b6111b5610982611ba0565b6111d15760405162461bcd60e51b81526004016109a390613ae5565b6111d9611e92565b565b606081518351146112405760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016109a3565b600083516001600160401b0381111561125b5761125b6132c8565b604051908082528060200260200182016040528015611284578160200160208202803683370190505b50905060005b84518110156112fc576112cf8582815181106112a8576112a8613d54565b60200260200101518583815181106112c2576112c2613d54565b6020026020010151610859565b8282815181106112e1576112e1613d54565b60209081029190910101526112f581613d6a565b905061128a565b509392505050565b6000818152601260205260408120546001600160a01b03161561133d57506000908152601260205260409020546001600160a01b031690565b61089382611eed565b61134e611f07565b6111d96000611f80565b611360611fd2565b8261136d81611110611ba0565b6113895760405162461bcd60e51b81526004016109a390613e1d565b61139585858585611d7a565b506110fd6001600f55565b6113ab610982611ba0565b6113c75760405162461bcd60e51b81526004016109a390613ae5565b6111d961202b565b816113dc81611110611ba0565b6113f85760405162461bcd60e51b81526004016109a390613e1d565b6000838152600e6020526040902054839060ff16156114295760405162461bcd60e51b81526004016109a390613e6e565b8361143561116e611ba0565b6114515760405162461bcd60e51b81526004016109a390613ecb565b6111a3858561206f565b600061089382611e60565b8161147381611110611ba0565b61148f5760405162461bcd60e51b81526004016109a390613e1d565b6001600160a01b0382166114fa5760405162461bcd60e51b815260206004820152602c60248201527f4a6f796e41737365745368617265642373657443726561746f723a20494e564160448201526b2624a22fa0a2222922a9a99760a11b60648201526084016109a3565b60008381526012602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051909185917f39071c63e44267bfdefc7b625c0df99d3ce2e6ff98d9f5e9e8a7ab43cdf5000d9190a3505050565b600980546108f690613aab565b61156c610982611ba0565b6115885760405162461bcd60e51b81526004016109a390613ae5565b6001600160a01b03166000908152601160205260409020805460ff19169055565b610ca96115b4611ba0565b83836120b8565b6115c6610982611ba0565b6115e25760405162461bcd60e51b81526004016109a390613ae5565b6001600160a01b03166000908152601160205260409020805460ff19166001179055565b61160e611fd2565b60005b83518110156116b65761163f84828151811061162f5761162f613d54565b6020026020010151611110611ba0565b6116a45760405162461bcd60e51b815260206004820152603060248201527f4a6f796e4173736574536861726564235f62617463684d696e743a204f4e4c5960448201526f17d0d491505513d497d0531313d5d15160821b60648201526084016109a3565b806116ae81613d6a565b915050611611565b506116c384848484612198565b6110fd6001600f55565b6116d8610982611ba0565b6116f45760405162461bcd60e51b81526004016109a390613ae5565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600061172283836121ef565b1561172f57506001610893565b6001600160a01b0380841660009081526001602090815260408083209386168352929052205460ff165b9392505050565b600061176c8685611ab7565b9050828110156117a35761178b85856117858487613f32565b85611358565b801561179e5761179e8686868486612222565b610d81565b610d818686868686612222565b6117b8611f07565b6001600160a01b03811661181d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a3565b61182681611f80565b50565b828282611837838383611e7b565b6118b55760405162461bcd60e51b815260206004820152604360248201527f4173736574436f6e7472616374236f6e6c79546f6b656e416d6f756e744f776e60448201527f65643a204f4e4c595f544f4b454e5f414d4f554e545f4f574e45445f414c4c4f60648201526215d15160ea1b608482015260a4016109a3565b610d81868686612435565b60005b825181101561198d57611909848483815181106118e2576118e2613d54565b60200260200101518484815181106118fc576118fc613d54565b6020026020010151611e7b565b61197b5760405162461bcd60e51b815260206004820152603860248201527f4173736574436f6e74726163742362617463684275726e3a204f4e4c595f544f60448201527f4b454e5f414d4f554e545f4f574e45445f414c4c4f574544000000000000000060648201526084016109a3565b8061198581613d6a565b9150506118c3565b5061199983838361248b565b505050565b600c80546108f690613aab565b6000303303611a0157600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150611a049050565b50335b90565b6007546000906001600160a01b03163b611a2357506000610893565b60075460405163c455279160e01b81526001600160a01b03858116600483015291821691841690829063c455279190602401602060405180830381865afa158015611a72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a969190613f45565b6001600160a01b031614949350505050565b6001600160a01b03163b151590565b60006001600160a01b038316611b235760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084016109a3565b506000908152600a602090815260408083206001600160a01b03949094168352929052205490565b600080611b5784611304565b9050826001600160a01b0316816001600160a01b0316148061088f575061088f81846121ef565b6000818152600b6020526040812054611b968361145b565b6108939190613f32565b6000611baa6119ab565b905090565b6000816001600160a01b0316611bcd6006546001600160a01b031690565b6001600160a01b031614806108935750610893611bf26006546001600160a01b031690565b836121ef565b60006001600160a01b038616611c5e5760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201526424a3a722a960d91b60648201526084016109a3565b6001611c71611c6c876124e1565b61255e565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015611cbf573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60606000611cf58361258e565b60010190506000816001600160401b03811115611d1457611d146132c8565b6040519080825280601f01601f191660200182016040528015611d3e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611d4857509392505050565b611d8684848484612666565b6001815111156110fd576110fd83826113cf565b6000815111611e015760405162461bcd60e51b815260206004820152602d60248201527f4173736574436f6e7472616374237365745065726d616e656e745552493a204f60448201526c4e4c595f56414c49445f55524960981b60648201526084016109a3565b6000828152600e60205260409020805460ff19166001179055611e24828261206f565b817fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b5565720782604051611e5491906132b5565b60405180910390a25050565b6000611e73600165010000000000613f32565b909116919050565b600081611e888585610859565b1015949350505050565b611e9a612773565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611ed0611ba0565b6040516001600160a01b03909116815260200160405180910390a1565b6000611efb60286038613f62565b60ff169190911c919050565b611f0f611ba0565b6001600160a01b0316611f2a6006546001600160a01b031690565b6001600160a01b0316146111d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a3565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600f54036120245760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a3565b6002600f55565b6120336127c3565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ed0611ba0565b6000828152600d602052604090206120878282613c95565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b82604051611e5491906132b5565b816001600160a01b0316836001600160a01b03160361212b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016109a3565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121a484848484612810565b6001815111156110fd5760005b83518110156111a3576121dd8482815181106121cf576121cf613d54565b6020026020010151836113cf565b806121e781613d6a565b9150506121b1565b6001600160a01b03811660009081526011602052604081205460ff161561221857506001610893565b6117598383611a07565b61222a6127c3565b84612233611ba0565b6001600160a01b0316816001600160a01b031614806122595750612259816107bf611ba0565b6122755760405162461bcd60e51b81526004016109a390613f7b565b6001600160a01b0385166122d95760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016109a3565b60006122e3611ba0565b90506122fd8188886122f489612a73565b6111a389612a73565b6000858152600a602090815260408083206001600160a01b038b168452909152902054848110156123835760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016109a3565b61238d8582613f32565b6000878152600a602090815260408083206001600160a01b038d811685529252808320939093558916815290812080548792906123cb908490613a98565b909155505060408051878152602081018790526001600160a01b03808a16928b821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461242b828989898989612abe565b5050505050505050565b8261243e611ba0565b6001600160a01b0316816001600160a01b031614806124645750612464816107bf611ba0565b6124805760405162461bcd60e51b81526004016109a390613f7b565b6110fd848484612c19565b82612494611ba0565b6001600160a01b0316816001600160a01b031614806124ba57506124ba816107bf611ba0565b6124d65760405162461bcd60e51b81526004016109a390613f7b565b6110fd848484612e3f565b60006040518060800160405280604381526020016141916043913980516020918201208351848301516040808701518051908601209051612541950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600061256960045490565b60405161190160f01b6020820152602281019190915260428101839052606201612541565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106125cd5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106125f9576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061261757662386f26fc10000830492506010015b6305f5e100831061262f576305f5e100830492506008015b612710831061264357612710830492506004015b60648310612655576064830492506002015b600a83106108935760010192915050565b61266e6127c3565b6000612678611ba0565b90506126938160008761268a88612a73565b6111a388612a73565b61269d84846130ad565b6000848152600a602090815260408083206001600160a01b0389168452909152812080548592906126cf908490613a98565b90915550506000848152600b6020526040812080548592906126f2908490613a98565b90915550600090506127038561312b565b9050856001600160a01b0316816001600160a01b0316836001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62888860405161275d929190918252602082015260400190565b60405180910390a4610d81828288888888612abe565b600654600160a01b900460ff166111d95760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a3565b600654600160a01b900460ff16156111d95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a3565b6128186127c3565b81518351146128825760405162461bcd60e51b815260206004820152603060248201527f455243313135355472616461626c652362617463684d696e743a20494e56414c60448201526f09288be82a4a482b2a6be988a9c8ea8960831b60648201526084016109a3565b825160006128a585828461289857612898613d54565b602002602001015161312b565b905060006128b1611ba0565b905060005b83811015612a045760008782815181106128d2576128d2613d54565b6020026020010151905060008783815181106128f0576128f0613d54565b6020026020010151905061290482826130ad565b846001600160a01b03166129178361312b565b6001600160a01b0316146129935760405162461bcd60e51b815260206004820152603760248201527f455243313135355472616461626c652362617463684d696e743a204d554c544960448201527f504c455f4f524947494e535f4e4f545f414c4c4f57454400000000000000000060648201526084016109a3565b6000828152600a602090815260408083206001600160a01b038e168452909152812080548392906129c5908490613a98565b90915550506000828152600b6020526040812080548392906129e8908490613a98565b92505081905550505080806129fc90613d6a565b9150506128b6565b50866001600160a01b0316826001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051612a54929190613fcb565b60405180910390a4612a6a818389898989613136565b50505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612aad57612aad613d54565b602090810291909101015292915050565b6001600160a01b0384163b15610d815760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612b029089908990889088908890600401613ff0565b6020604051808303816000875af1925050508015612b3d575060408051601f3d908101601f19168201909252612b3a91810190614035565b60015b612be957612b49614052565b806308c379a003612b825750612b5d61406d565b80612b685750612b84565b8060405162461bcd60e51b81526004016109a391906132b5565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016109a3565b6001600160e01b0319811663f23a6e6160e01b14612a6a5760405162461bcd60e51b81526004016109a3906140f6565b612c216127c3565b6001600160a01b038316612c855760405162461bcd60e51b815260206004820152602560248201527f45524331313535235f6275726e3a204255524e5f46524f4d5f5a45524f5f4144604482015264445245535360d81b60648201526084016109a3565b60008111612ce15760405162461bcd60e51b815260206004820152602360248201527f45524331313535235f6275726e3a20414d4f554e545f4c4553535f5448414e5f6044820152624f4e4560e81b60648201526084016109a3565b6000612ceb611ba0565b9050612d1c81856000612cfd87612a73565b612d0687612a73565b5050604080516020810190915260009052505050565b6000838152600a602090815260408083206001600160a01b038816845290915290205482811015612d9d5760405162461bcd60e51b815260206004820152602560248201527f45524331313535235f6275726e3a20414d4f554e545f455843454544535f42416044820152644c414e434560d81b60648201526084016109a3565b612da78382613f32565b6000858152600a602090815260408083206001600160a01b038a168452825280832093909355868252600b90529081208054859290612de7908490613f32565b909155505060408051858152602081018590526000916001600160a01b0388811692908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b612e476127c3565b6001600160a01b038316612e9d5760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a204255524e5f46524f4d5f5a45524f5f414444524553530060448201526064016109a3565b8051825114612efa5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a204944535f414d4f554e54535f4c454e4754485f4d49534d604482015263082a886960e31b60648201526084016109a3565b6000612f04611ba0565b604080516020810190915260009052905060005b835181101561304e576000848281518110612f3557612f35613d54565b602002602001015190506000848381518110612f5357612f53613d54565b6020908102919091018101516000848152600a835260408082206001600160a01b038c168352909352919091205490915081811015612fe75760405162461bcd60e51b815260206004820152602a60248201527f45524331313535235f6275726e42617463683a20414d4f554e545f455843454560448201526944535f42414c414e434560b01b60648201526084016109a3565b612ff18282613f32565b6000848152600a602090815260408083206001600160a01b038d168452825280832093909355858252600b90529081208054849290613031908490613f32565b92505081905550505050808061304690613d6a565b915050612f18565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161309f929190613fcb565b60405180910390a450505050565b6130b682611b7e565b811115610ca95760405162461bcd60e51b815260206004820152603c60248201527f4173736574436f6e7472616374235f6265666f72654d696e743a205155414e5460448201527f4954595f455843454544535f544f4b454e5f535550504c595f4341500000000060648201526084016109a3565b600061089382611eed565b6001600160a01b0384163b15610d815760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061317a908990899088908890889060040161413e565b6020604051808303816000875af19250505080156131b5575060408051601f3d908101601f191682019092526131b291810190614035565b60015b6131c157612b49614052565b6001600160e01b0319811663bc197c8160e01b14612a6a5760405162461bcd60e51b81526004016109a3906140f6565b6001600160a01b038116811461182657600080fd5b6000806040838503121561321957600080fd5b8235613224816131f1565b946020939093013593505050565b6001600160e01b03198116811461182657600080fd5b60006020828403121561325a57600080fd5b813561175981613232565b60005b83811015613280578181015183820152602001613268565b50506000910152565b600081518084526132a1816020860160208601613265565b601f01601f19169290920160200192915050565b6020815260006117596020830184613289565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156132fd576132fd6132c8565b60405250565b601f8201601f191681016001600160401b0381118282101715613328576133286132c8565b6040525050565b60006001600160401b03821115613348576133486132c8565b50601f01601f191660200190565b600082601f83011261336757600080fd5b81356133728161332f565b60405161337f8282613303565b82815285602084870101111561339457600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156133ca57600080fd5b85356133d5816131f1565b945060208601356001600160401b038111156133f057600080fd5b6133fc88828901613356565b9450506040860135925060608601359150608086013560ff8116811461342157600080fd5b809150509295509295909350565b60006020828403121561344157600080fd5b5035919050565b60006020828403121561345a57600080fd5b81356001600160401b0381111561347057600080fd5b61088f84828501613356565b60006020828403121561348e57600080fd5b8135611759816131f1565b60006001600160401b038211156134b2576134b26132c8565b5060051b60200190565b600082601f8301126134cd57600080fd5b813560206134da82613499565b6040516134e78282613303565b83815260059390931b850182019282810191508684111561350757600080fd5b8286015b84811015613522578035835291830191830161350b565b509695505050505050565b600080600080600060a0868803121561354557600080fd5b8535613550816131f1565b94506020860135613560816131f1565b935060408601356001600160401b038082111561357c57600080fd5b61358889838a016134bc565b9450606088013591508082111561359e57600080fd5b6135aa89838a016134bc565b935060808801359150808211156135c057600080fd5b506135cd88828901613356565b9150509295509295909350565b600060208083850312156135ed57600080fd5b82356001600160401b0381111561360357600080fd5b8301601f8101851361361457600080fd5b803561361f81613499565b6040805161362d8382613303565b83815260069390931b840185019285810192508884111561364d57600080fd5b938501935b83851015610b8a5781858a03121561366a5760008081fd5b8151613675816132de565b8535815286860135613686816131f1565b8188015283529381019391850191613652565b600080604083850312156136ac57600080fd5b8235915060208301356001600160401b038111156136c957600080fd5b6136d585828601613356565b9150509250929050565b600080604083850312156136f257600080fd5b82356001600160401b038082111561370957600080fd5b818501915085601f83011261371d57600080fd5b8135602061372a82613499565b6040516137378282613303565b83815260059390931b850182019282810191508984111561375757600080fd5b948201945b8386101561377e57853561376f816131f1565b8252948201949082019061375c565b9650508601359250508082111561379457600080fd5b506136d5858286016134bc565b600081518084526020808501945080840160005b838110156137d1578151875295820195908201906001016137b5565b509495945050505050565b60208152600061175960208301846137a1565b6000806000806080858703121561380557600080fd5b8435613810816131f1565b9350602085013592506040850135915060608501356001600160401b0381111561383957600080fd5b61384587828801613356565b91505092959194509250565b6000806040838503121561386457600080fd5b823591506020830135613876816131f1565b809150509250929050565b6000806040838503121561389457600080fd5b823561389f816131f1565b91506020830135801515811461387657600080fd5b600080600080608085870312156138ca57600080fd5b84356138d5816131f1565b935060208501356001600160401b03808211156138f157600080fd5b6138fd888389016134bc565b9450604087013591508082111561391357600080fd5b61391f888389016134bc565b9350606087013591508082111561393557600080fd5b5061384587828801613356565b6000806040838503121561395557600080fd5b8235613960816131f1565b91506020830135613876816131f1565b600080600080600060a0868803121561398857600080fd5b8535613993816131f1565b945060208601356139a3816131f1565b9350604086013592506060860135915060808601356001600160401b038111156139cc57600080fd5b6135cd88828901613356565b6000806000606084860312156139ed57600080fd5b83356139f8816131f1565b95602085013595506040909401359392505050565b600080600060608486031215613a2257600080fd5b8335613a2d816131f1565b925060208401356001600160401b0380821115613a4957600080fd5b613a55878388016134bc565b93506040860135915080821115613a6b57600080fd5b50613a78868287016134bc565b9150509250925092565b634e487b7160e01b600052601160045260246000fd5b8082018082111561089357610893613a82565b600181811c90821680613abf57607f821691505b602082108103613adf57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135355472616461626c65236f6e6c794f776e65723a2043414c4c4560408201526d292fa4a9afa727aa2fa7aba722a960911b606082015260800190565b6001600160a01b03848116825283166020820152606060408201819052600090613b5f90830184613289565b95945050505050565b60008351613b7a818460208801613265565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b60008251613bb1818460208701613265565b9190910192915050565b6000808454613bc981613aab565b60018281168015613be15760018114613bf657613c25565b60ff1984168752821515830287019450613c25565b8860005260208060002060005b85811015613c1c5781548a820152908401908201613c03565b50505082870194505b50602f60f81b845286519250613c418382860160208a01613265565b919092010195945050505050565b601f82111561199957600081815260208120601f850160051c81016020861015613c765750805b601f850160051c820191505b81811015610d8157828155600101613c82565b81516001600160401b03811115613cae57613cae6132c8565b613cc281613cbc8454613aab565b84613c4f565b602080601f831160018114613cf75760008415613cdf5750858301515b600019600386901b1c1916600185901b178555610d81565b600085815260208120601f198616915b82811015613d2657888601518255948401946001909101908401613d07565b5085821015613d445787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600060018201613d7c57613d7c613a82565b5060010190565b600060208284031215613d9557600080fd5b81516001600160401b03811115613dab57600080fd5b8201601f81018413613dbc57600080fd5b8051613dc78161332f565b604051613dd48282613303565b828152866020848601011115613de957600080fd5b613dfa836020830160208701613265565b9695505050505050565b600060208284031215613e1657600080fd5b5051919050565b60208082526031908201527f4a6f796e41737365745368617265642363726561746f724f6e6c793a204f4e4c6040820152701657d0d491505513d497d0531313d5d151607a1b606082015260800190565b60208082526037908201527f4173736574436f6e7472616374236f6e6c79496d7065726d616e656e7455524960408201527f3a205552495f43414e4e4f545f42455f4348414e474544000000000000000000606082015260800190565b60208082526041908201527f4a6f796e4173736574536861726564236f6e6c7946756c6c546f6b656e4f776e60408201527f65723a204f4e4c595f46554c4c5f544f4b454e5f4f574e45525f414c4c4f57456060820152601160fa1b608082015260a00190565b8181038181111561089357610893613a82565b600060208284031215613f5757600080fd5b8151611759816131f1565b60ff818116838216019081111561089357610893613a82565b60208082526030908201527f455243313135355472616461626c65236f6e6c79417070726f7665643a20434160408201526f1313115497d393d517d0531313d5d15160821b606082015260800190565b604081526000613fde60408301856137a1565b8281036020840152613b5f81856137a1565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061402a90830184613289565b979650505050505050565b60006020828403121561404757600080fd5b815161175981613232565b600060033d1115611a045760046000803e5060005160e01c90565b600060443d101561407b5790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156140aa57505050505090565b82850191508151818111156140c25750505050505090565b843d87010160208285010111156140dc5750505050505090565b6140eb60208286010187613303565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061416a908301866137a1565b828103606084015261417c81866137a1565b90508281036080840152610b8a818561328956fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220187b65e70c940fc0deaa511a230c5b0697c33a7d203eb37bb8ef047fdc7b4fa364736f6c63430008120033454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c742900000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094a6f796e4173736574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094a6f796e417373657400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033687474703a2f2f6c6f63616c686f73743a333030302f746f6b656e2f6765742f6a6f796e2d61737365742d6d6574616461746100000000000000000000000000
Deployed Bytecode
0x6080604052600436106102715760003560e01c8063715018a61161014f578063a50aa5c3116100c1578063e985e9c51161007a578063e985e9c5146107a4578063f242432a146107c4578063f2fde38b146107e4578063f5298aca14610804578063f6eb127a14610824578063f923e8c31461084457600080fd5b8063a50aa5c3146106e3578063b48ab8b614610703578063bd85b03914610723578063c311c52314610750578063cd7c032614610764578063d26ea6c01461078457600080fd5b8063869f759411610113578063869f7594146106305780638da5cb5b1461065057806391686f531461066e57806395d89b411461068e5780639e037eea146106a3578063a22cb465146106c357600080fd5b8063715018a614610596578063731133e9146105ab57806373505d35146105cb5780638456cb59146105fb578063862440e21461061057600080fd5b80632eb2c2d6116101e85780634060b25e116101ac5780634060b25e146104955780634e1273f4146104c35780634f558e79146104f0578063510b51581461051f5780635b51acff146105575780635c975abb1461057757600080fd5b80632eb2c2d61461040d5780632f1c982c1461042d5780633408e4701461044d5780633588ad7c146104605780633f4ba83a1461048057600080fd5b80630e89341c1161023a5780630e89341c146103255780630f7e5970146103455780631e7d9dbb1461037257806320379ee5146103a257806324d88785146103b75780632d0335ab146103d757600080fd5b8062fdd58e1461027657806301ffc9a7146102a957806306fdde03146102d95780630bb2465a146102fb5780630c53c51c14610312575b600080fd5b34801561028257600080fd5b50610296610291366004613206565b610859565b6040519081526020015b60405180910390f35b3480156102b557600080fd5b506102c96102c4366004613248565b610899565b60405190151581526020016102a0565b3480156102e557600080fd5b506102ee6108e9565b6040516102a091906132b5565b34801561030757600080fd5b50610310610977565b005b6102ee6103203660046133b2565b6109be565b34801561033157600080fd5b506102ee61034036600461342f565b610b96565b34801561035157600080fd5b506102ee604051806040016040528060018152602001603160f81b81525081565b34801561037e57600080fd5b506102c961038d36600461342f565b6000908152600e602052604090205460ff1690565b3480156103ae57600080fd5b50600454610296565b3480156103c357600080fd5b506103106103d2366004613448565b610c76565b3480156103e357600080fd5b506102966103f236600461347c565b6001600160a01b031660009081526005602052604090205490565b34801561041957600080fd5b5061031061042836600461352d565b610cad565b34801561043957600080fd5b506103106104483660046135da565b610d89565b34801561045957600080fd5b5046610296565b34801561046c57600080fd5b5061031061047b366004613699565b611103565b34801561048c57600080fd5b506103106111aa565b3480156104a157600080fd5b506040805180820190915260058152640322e312e360dc1b60208201526102ee565b3480156104cf57600080fd5b506104e36104de3660046136df565b6111db565b6040516102a091906137dc565b3480156104fc57600080fd5b506102c961050b36600461342f565b6000908152600b6020526040902054151590565b34801561052b57600080fd5b5061053f61053a36600461342f565b611304565b6040516001600160a01b0390911681526020016102a0565b34801561056357600080fd5b5060105461053f906001600160a01b031681565b34801561058357600080fd5b50600654600160a01b900460ff166102c9565b3480156105a257600080fd5b50610310611346565b3480156105b757600080fd5b506103106105c63660046137ef565b611358565b3480156105d757600080fd5b506102c96105e636600461347c565b60116020526000908152604090205460ff1681565b34801561060757600080fd5b506103106113a0565b34801561061c57600080fd5b5061031061062b366004613699565b6113cf565b34801561063c57600080fd5b5061029661064b36600461342f565b61145b565b34801561065c57600080fd5b506006546001600160a01b031661053f565b34801561067a57600080fd5b50610310610689366004613851565b611466565b34801561069a57600080fd5b506102ee611554565b3480156106af57600080fd5b506103106106be36600461347c565b611561565b3480156106cf57600080fd5b506103106106de366004613881565b6115a9565b3480156106ef57600080fd5b506103106106fe36600461347c565b6115bb565b34801561070f57600080fd5b5061031061071e3660046138b4565b611606565b34801561072f57600080fd5b5061029661073e36600461342f565b6000908152600b602052604090205490565b34801561075c57600080fd5b5060016102c9565b34801561077057600080fd5b5060075461053f906001600160a01b031681565b34801561079057600080fd5b5061031061079f36600461347c565b6116cd565b3480156107b057600080fd5b506102c96107bf366004613942565b611716565b3480156107d057600080fd5b506103106107df366004613970565b611760565b3480156107f057600080fd5b506103106107ff36600461347c565b6117b0565b34801561081057600080fd5b5061031061081f3660046139d8565b611829565b34801561083057600080fd5b5061031061083f366004613a0d565b6118c0565b34801561085057600080fd5b506102ee61199e565b6000806108668484611ab7565b90506108728385611b4b565b61087c578061088f565b61088583611b7e565b61088f9082613a98565b9150505b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806108ca57506001600160e01b031982166303a24d0760e21b145b8061089357506301ffc9a760e01b6001600160e01b0319831614610893565b600880546108f690613aab565b80601f016020809104026020016040519081016040528092919081815260200182805461092290613aab565b801561096f5780601f106109445761010080835404028352916020019161096f565b820191906000526020600020905b81548152906001019060200180831161095257829003601f168201915b505050505081565b610987610982611ba0565b611baf565b6109ac5760405162461bcd60e51b81526004016109a390613ae5565b60405180910390fd5b601080546001600160a01b0319169055565b60408051606081810183526001600160a01b038816600081815260056020908152908590205484528301529181018690526109fc8782878787611bf8565b610a525760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084016109a3565b6001600160a01b0387166000908152600560205260408120805460019290610a7b908490613a98565b90915550506040517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b90610ab490899033908a90613b33565b60405180910390a1600080306001600160a01b0316888a604051602001610adc929190613b68565b60408051601f1981840301815290829052610af691613b9f565b6000604051808303816000865af19150503d8060008114610b33576040519150601f19603f3d011682016040523d82523d6000602084013e610b38565b606091505b509150915081610b8a5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c0000000060448201526064016109a3565b98975050505050505050565b6000818152600d6020526040812080546060929190610bb490613aab565b80601f0160208091040260200160405190810160405280929190818152602001828054610be090613aab565b8015610c2d5780601f10610c0257610100808354040283529160200191610c2d565b820191906000526020600020905b815481529060010190602001808311610c1057829003601f168201915b505050505090508051600014610c435792915050565b600c610c4e84611ce8565b604051602001610c5f929190613bbb565b604051602081830303815290604052915050919050565b610c81610982611ba0565b610c9d5760405162461bcd60e51b81526004016109a390613ae5565b600c610ca98282613c95565b5050565b8151835114610d245760405162461bcd60e51b815260206004820152603a60248201527f4173736574436f6e7472616374237361666542617463685472616e736665724660448201527f726f6d3a20494e56414c49445f4152524159535f4c454e47544800000000000060648201526084016109a3565b60005b8351811015610d8157610d6f8686868481518110610d4757610d47613d54565b6020026020010151868581518110610d6157610d61613d54565b602002602001015186611760565b80610d7981613d6a565b915050610d27565b505050505050565b610d94610982611ba0565b610db05760405162461bcd60e51b81526004016109a390613ae5565b6010546001600160a01b031680610e1b5760405162461bcd60e51b815260206004820152602960248201527f4a6f796e4173736574536861726564236d6967726174653a204d49475241544560448201526817d11254d05093115160ba1b60648201526084016109a3565b6000816001600160a01b031663f923e8c36040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e839190810190613d83565b905060005b83518110156110fd576000848281518110610ea557610ea5613d54565b60200260200101516000015190506000858381518110610ec757610ec7613d54565b602002602001015160200151905060006001600160a01b0316816001600160a01b031603610f515760405162461bcd60e51b815260206004820152603160248201527f4a6f796e4173736574536861726564236d6967726174653a205a45524f5f414460448201527011149154d4d7d393d517d0531313d5d151607a1b60648201526084016109a3565b604051627eeac760e11b81526001600160a01b038281166004830152602482018490526000919087169062fdd58e90604401602060405180830381865afa158015610fa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc49190613e04565b905080600003610fd6575050506110ed565b610ff182848360405180602001604052806000815250611d7a565b845160208601206040516303a24d0760e21b8152600481018590526001600160a01b03881690630e89341c90602401600060405180830381865afa15801561103d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110659190810190613d83565b80519060200120146110e9576040516303a24d0760e21b8152600481018490526110e99084906001600160a01b03891690630e89341c90602401600060405180830381865afa1580156110bc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110e49190810190613d83565b611d9a565b5050505b6110f681613d6a565b9050610e88565b50505050565b8161111581611110611ba0565b611b4b565b6111315760405162461bcd60e51b81526004016109a390613e1d565b6000838152600e6020526040902054839060ff16156111625760405162461bcd60e51b81526004016109a390613e6e565b8361117d61116e611ba0565b8261117884611e60565b611e7b565b6111995760405162461bcd60e51b81526004016109a390613ecb565b6111a38585611d9a565b5050505050565b6111b5610982611ba0565b6111d15760405162461bcd60e51b81526004016109a390613ae5565b6111d9611e92565b565b606081518351146112405760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016109a3565b600083516001600160401b0381111561125b5761125b6132c8565b604051908082528060200260200182016040528015611284578160200160208202803683370190505b50905060005b84518110156112fc576112cf8582815181106112a8576112a8613d54565b60200260200101518583815181106112c2576112c2613d54565b6020026020010151610859565b8282815181106112e1576112e1613d54565b60209081029190910101526112f581613d6a565b905061128a565b509392505050565b6000818152601260205260408120546001600160a01b03161561133d57506000908152601260205260409020546001600160a01b031690565b61089382611eed565b61134e611f07565b6111d96000611f80565b611360611fd2565b8261136d81611110611ba0565b6113895760405162461bcd60e51b81526004016109a390613e1d565b61139585858585611d7a565b506110fd6001600f55565b6113ab610982611ba0565b6113c75760405162461bcd60e51b81526004016109a390613ae5565b6111d961202b565b816113dc81611110611ba0565b6113f85760405162461bcd60e51b81526004016109a390613e1d565b6000838152600e6020526040902054839060ff16156114295760405162461bcd60e51b81526004016109a390613e6e565b8361143561116e611ba0565b6114515760405162461bcd60e51b81526004016109a390613ecb565b6111a3858561206f565b600061089382611e60565b8161147381611110611ba0565b61148f5760405162461bcd60e51b81526004016109a390613e1d565b6001600160a01b0382166114fa5760405162461bcd60e51b815260206004820152602c60248201527f4a6f796e41737365745368617265642373657443726561746f723a20494e564160448201526b2624a22fa0a2222922a9a99760a11b60648201526084016109a3565b60008381526012602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051909185917f39071c63e44267bfdefc7b625c0df99d3ce2e6ff98d9f5e9e8a7ab43cdf5000d9190a3505050565b600980546108f690613aab565b61156c610982611ba0565b6115885760405162461bcd60e51b81526004016109a390613ae5565b6001600160a01b03166000908152601160205260409020805460ff19169055565b610ca96115b4611ba0565b83836120b8565b6115c6610982611ba0565b6115e25760405162461bcd60e51b81526004016109a390613ae5565b6001600160a01b03166000908152601160205260409020805460ff19166001179055565b61160e611fd2565b60005b83518110156116b65761163f84828151811061162f5761162f613d54565b6020026020010151611110611ba0565b6116a45760405162461bcd60e51b815260206004820152603060248201527f4a6f796e4173736574536861726564235f62617463684d696e743a204f4e4c5960448201526f17d0d491505513d497d0531313d5d15160821b60648201526084016109a3565b806116ae81613d6a565b915050611611565b506116c384848484612198565b6110fd6001600f55565b6116d8610982611ba0565b6116f45760405162461bcd60e51b81526004016109a390613ae5565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600061172283836121ef565b1561172f57506001610893565b6001600160a01b0380841660009081526001602090815260408083209386168352929052205460ff165b9392505050565b600061176c8685611ab7565b9050828110156117a35761178b85856117858487613f32565b85611358565b801561179e5761179e8686868486612222565b610d81565b610d818686868686612222565b6117b8611f07565b6001600160a01b03811661181d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a3565b61182681611f80565b50565b828282611837838383611e7b565b6118b55760405162461bcd60e51b815260206004820152604360248201527f4173736574436f6e7472616374236f6e6c79546f6b656e416d6f756e744f776e60448201527f65643a204f4e4c595f544f4b454e5f414d4f554e545f4f574e45445f414c4c4f60648201526215d15160ea1b608482015260a4016109a3565b610d81868686612435565b60005b825181101561198d57611909848483815181106118e2576118e2613d54565b60200260200101518484815181106118fc576118fc613d54565b6020026020010151611e7b565b61197b5760405162461bcd60e51b815260206004820152603860248201527f4173736574436f6e74726163742362617463684275726e3a204f4e4c595f544f60448201527f4b454e5f414d4f554e545f4f574e45445f414c4c4f574544000000000000000060648201526084016109a3565b8061198581613d6a565b9150506118c3565b5061199983838361248b565b505050565b600c80546108f690613aab565b6000303303611a0157600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150611a049050565b50335b90565b6007546000906001600160a01b03163b611a2357506000610893565b60075460405163c455279160e01b81526001600160a01b03858116600483015291821691841690829063c455279190602401602060405180830381865afa158015611a72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a969190613f45565b6001600160a01b031614949350505050565b6001600160a01b03163b151590565b60006001600160a01b038316611b235760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084016109a3565b506000908152600a602090815260408083206001600160a01b03949094168352929052205490565b600080611b5784611304565b9050826001600160a01b0316816001600160a01b0316148061088f575061088f81846121ef565b6000818152600b6020526040812054611b968361145b565b6108939190613f32565b6000611baa6119ab565b905090565b6000816001600160a01b0316611bcd6006546001600160a01b031690565b6001600160a01b031614806108935750610893611bf26006546001600160a01b031690565b836121ef565b60006001600160a01b038616611c5e5760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201526424a3a722a960d91b60648201526084016109a3565b6001611c71611c6c876124e1565b61255e565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015611cbf573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60606000611cf58361258e565b60010190506000816001600160401b03811115611d1457611d146132c8565b6040519080825280601f01601f191660200182016040528015611d3e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611d4857509392505050565b611d8684848484612666565b6001815111156110fd576110fd83826113cf565b6000815111611e015760405162461bcd60e51b815260206004820152602d60248201527f4173736574436f6e7472616374237365745065726d616e656e745552493a204f60448201526c4e4c595f56414c49445f55524960981b60648201526084016109a3565b6000828152600e60205260409020805460ff19166001179055611e24828261206f565b817fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b5565720782604051611e5491906132b5565b60405180910390a25050565b6000611e73600165010000000000613f32565b909116919050565b600081611e888585610859565b1015949350505050565b611e9a612773565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611ed0611ba0565b6040516001600160a01b03909116815260200160405180910390a1565b6000611efb60286038613f62565b60ff169190911c919050565b611f0f611ba0565b6001600160a01b0316611f2a6006546001600160a01b031690565b6001600160a01b0316146111d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a3565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600f54036120245760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a3565b6002600f55565b6120336127c3565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ed0611ba0565b6000828152600d602052604090206120878282613c95565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b82604051611e5491906132b5565b816001600160a01b0316836001600160a01b03160361212b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016109a3565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121a484848484612810565b6001815111156110fd5760005b83518110156111a3576121dd8482815181106121cf576121cf613d54565b6020026020010151836113cf565b806121e781613d6a565b9150506121b1565b6001600160a01b03811660009081526011602052604081205460ff161561221857506001610893565b6117598383611a07565b61222a6127c3565b84612233611ba0565b6001600160a01b0316816001600160a01b031614806122595750612259816107bf611ba0565b6122755760405162461bcd60e51b81526004016109a390613f7b565b6001600160a01b0385166122d95760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016109a3565b60006122e3611ba0565b90506122fd8188886122f489612a73565b6111a389612a73565b6000858152600a602090815260408083206001600160a01b038b168452909152902054848110156123835760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016109a3565b61238d8582613f32565b6000878152600a602090815260408083206001600160a01b038d811685529252808320939093558916815290812080548792906123cb908490613a98565b909155505060408051878152602081018790526001600160a01b03808a16928b821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461242b828989898989612abe565b5050505050505050565b8261243e611ba0565b6001600160a01b0316816001600160a01b031614806124645750612464816107bf611ba0565b6124805760405162461bcd60e51b81526004016109a390613f7b565b6110fd848484612c19565b82612494611ba0565b6001600160a01b0316816001600160a01b031614806124ba57506124ba816107bf611ba0565b6124d65760405162461bcd60e51b81526004016109a390613f7b565b6110fd848484612e3f565b60006040518060800160405280604381526020016141916043913980516020918201208351848301516040808701518051908601209051612541950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600061256960045490565b60405161190160f01b6020820152602281019190915260428101839052606201612541565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106125cd5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106125f9576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061261757662386f26fc10000830492506010015b6305f5e100831061262f576305f5e100830492506008015b612710831061264357612710830492506004015b60648310612655576064830492506002015b600a83106108935760010192915050565b61266e6127c3565b6000612678611ba0565b90506126938160008761268a88612a73565b6111a388612a73565b61269d84846130ad565b6000848152600a602090815260408083206001600160a01b0389168452909152812080548592906126cf908490613a98565b90915550506000848152600b6020526040812080548592906126f2908490613a98565b90915550600090506127038561312b565b9050856001600160a01b0316816001600160a01b0316836001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62888860405161275d929190918252602082015260400190565b60405180910390a4610d81828288888888612abe565b600654600160a01b900460ff166111d95760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a3565b600654600160a01b900460ff16156111d95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a3565b6128186127c3565b81518351146128825760405162461bcd60e51b815260206004820152603060248201527f455243313135355472616461626c652362617463684d696e743a20494e56414c60448201526f09288be82a4a482b2a6be988a9c8ea8960831b60648201526084016109a3565b825160006128a585828461289857612898613d54565b602002602001015161312b565b905060006128b1611ba0565b905060005b83811015612a045760008782815181106128d2576128d2613d54565b6020026020010151905060008783815181106128f0576128f0613d54565b6020026020010151905061290482826130ad565b846001600160a01b03166129178361312b565b6001600160a01b0316146129935760405162461bcd60e51b815260206004820152603760248201527f455243313135355472616461626c652362617463684d696e743a204d554c544960448201527f504c455f4f524947494e535f4e4f545f414c4c4f57454400000000000000000060648201526084016109a3565b6000828152600a602090815260408083206001600160a01b038e168452909152812080548392906129c5908490613a98565b90915550506000828152600b6020526040812080548392906129e8908490613a98565b92505081905550505080806129fc90613d6a565b9150506128b6565b50866001600160a01b0316826001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051612a54929190613fcb565b60405180910390a4612a6a818389898989613136565b50505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612aad57612aad613d54565b602090810291909101015292915050565b6001600160a01b0384163b15610d815760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612b029089908990889088908890600401613ff0565b6020604051808303816000875af1925050508015612b3d575060408051601f3d908101601f19168201909252612b3a91810190614035565b60015b612be957612b49614052565b806308c379a003612b825750612b5d61406d565b80612b685750612b84565b8060405162461bcd60e51b81526004016109a391906132b5565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016109a3565b6001600160e01b0319811663f23a6e6160e01b14612a6a5760405162461bcd60e51b81526004016109a3906140f6565b612c216127c3565b6001600160a01b038316612c855760405162461bcd60e51b815260206004820152602560248201527f45524331313535235f6275726e3a204255524e5f46524f4d5f5a45524f5f4144604482015264445245535360d81b60648201526084016109a3565b60008111612ce15760405162461bcd60e51b815260206004820152602360248201527f45524331313535235f6275726e3a20414d4f554e545f4c4553535f5448414e5f6044820152624f4e4560e81b60648201526084016109a3565b6000612ceb611ba0565b9050612d1c81856000612cfd87612a73565b612d0687612a73565b5050604080516020810190915260009052505050565b6000838152600a602090815260408083206001600160a01b038816845290915290205482811015612d9d5760405162461bcd60e51b815260206004820152602560248201527f45524331313535235f6275726e3a20414d4f554e545f455843454544535f42416044820152644c414e434560d81b60648201526084016109a3565b612da78382613f32565b6000858152600a602090815260408083206001600160a01b038a168452825280832093909355868252600b90529081208054859290612de7908490613f32565b909155505060408051858152602081018590526000916001600160a01b0388811692908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b612e476127c3565b6001600160a01b038316612e9d5760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a204255524e5f46524f4d5f5a45524f5f414444524553530060448201526064016109a3565b8051825114612efa5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a204944535f414d4f554e54535f4c454e4754485f4d49534d604482015263082a886960e31b60648201526084016109a3565b6000612f04611ba0565b604080516020810190915260009052905060005b835181101561304e576000848281518110612f3557612f35613d54565b602002602001015190506000848381518110612f5357612f53613d54565b6020908102919091018101516000848152600a835260408082206001600160a01b038c168352909352919091205490915081811015612fe75760405162461bcd60e51b815260206004820152602a60248201527f45524331313535235f6275726e42617463683a20414d4f554e545f455843454560448201526944535f42414c414e434560b01b60648201526084016109a3565b612ff18282613f32565b6000848152600a602090815260408083206001600160a01b038d168452825280832093909355858252600b90529081208054849290613031908490613f32565b92505081905550505050808061304690613d6a565b915050612f18565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161309f929190613fcb565b60405180910390a450505050565b6130b682611b7e565b811115610ca95760405162461bcd60e51b815260206004820152603c60248201527f4173736574436f6e7472616374235f6265666f72654d696e743a205155414e5460448201527f4954595f455843454544535f544f4b454e5f535550504c595f4341500000000060648201526084016109a3565b600061089382611eed565b6001600160a01b0384163b15610d815760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061317a908990899088908890889060040161413e565b6020604051808303816000875af19250505080156131b5575060408051601f3d908101601f191682019092526131b291810190614035565b60015b6131c157612b49614052565b6001600160e01b0319811663bc197c8160e01b14612a6a5760405162461bcd60e51b81526004016109a3906140f6565b6001600160a01b038116811461182657600080fd5b6000806040838503121561321957600080fd5b8235613224816131f1565b946020939093013593505050565b6001600160e01b03198116811461182657600080fd5b60006020828403121561325a57600080fd5b813561175981613232565b60005b83811015613280578181015183820152602001613268565b50506000910152565b600081518084526132a1816020860160208601613265565b601f01601f19169290920160200192915050565b6020815260006117596020830184613289565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156132fd576132fd6132c8565b60405250565b601f8201601f191681016001600160401b0381118282101715613328576133286132c8565b6040525050565b60006001600160401b03821115613348576133486132c8565b50601f01601f191660200190565b600082601f83011261336757600080fd5b81356133728161332f565b60405161337f8282613303565b82815285602084870101111561339457600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156133ca57600080fd5b85356133d5816131f1565b945060208601356001600160401b038111156133f057600080fd5b6133fc88828901613356565b9450506040860135925060608601359150608086013560ff8116811461342157600080fd5b809150509295509295909350565b60006020828403121561344157600080fd5b5035919050565b60006020828403121561345a57600080fd5b81356001600160401b0381111561347057600080fd5b61088f84828501613356565b60006020828403121561348e57600080fd5b8135611759816131f1565b60006001600160401b038211156134b2576134b26132c8565b5060051b60200190565b600082601f8301126134cd57600080fd5b813560206134da82613499565b6040516134e78282613303565b83815260059390931b850182019282810191508684111561350757600080fd5b8286015b84811015613522578035835291830191830161350b565b509695505050505050565b600080600080600060a0868803121561354557600080fd5b8535613550816131f1565b94506020860135613560816131f1565b935060408601356001600160401b038082111561357c57600080fd5b61358889838a016134bc565b9450606088013591508082111561359e57600080fd5b6135aa89838a016134bc565b935060808801359150808211156135c057600080fd5b506135cd88828901613356565b9150509295509295909350565b600060208083850312156135ed57600080fd5b82356001600160401b0381111561360357600080fd5b8301601f8101851361361457600080fd5b803561361f81613499565b6040805161362d8382613303565b83815260069390931b840185019285810192508884111561364d57600080fd5b938501935b83851015610b8a5781858a03121561366a5760008081fd5b8151613675816132de565b8535815286860135613686816131f1565b8188015283529381019391850191613652565b600080604083850312156136ac57600080fd5b8235915060208301356001600160401b038111156136c957600080fd5b6136d585828601613356565b9150509250929050565b600080604083850312156136f257600080fd5b82356001600160401b038082111561370957600080fd5b818501915085601f83011261371d57600080fd5b8135602061372a82613499565b6040516137378282613303565b83815260059390931b850182019282810191508984111561375757600080fd5b948201945b8386101561377e57853561376f816131f1565b8252948201949082019061375c565b9650508601359250508082111561379457600080fd5b506136d5858286016134bc565b600081518084526020808501945080840160005b838110156137d1578151875295820195908201906001016137b5565b509495945050505050565b60208152600061175960208301846137a1565b6000806000806080858703121561380557600080fd5b8435613810816131f1565b9350602085013592506040850135915060608501356001600160401b0381111561383957600080fd5b61384587828801613356565b91505092959194509250565b6000806040838503121561386457600080fd5b823591506020830135613876816131f1565b809150509250929050565b6000806040838503121561389457600080fd5b823561389f816131f1565b91506020830135801515811461387657600080fd5b600080600080608085870312156138ca57600080fd5b84356138d5816131f1565b935060208501356001600160401b03808211156138f157600080fd5b6138fd888389016134bc565b9450604087013591508082111561391357600080fd5b61391f888389016134bc565b9350606087013591508082111561393557600080fd5b5061384587828801613356565b6000806040838503121561395557600080fd5b8235613960816131f1565b91506020830135613876816131f1565b600080600080600060a0868803121561398857600080fd5b8535613993816131f1565b945060208601356139a3816131f1565b9350604086013592506060860135915060808601356001600160401b038111156139cc57600080fd5b6135cd88828901613356565b6000806000606084860312156139ed57600080fd5b83356139f8816131f1565b95602085013595506040909401359392505050565b600080600060608486031215613a2257600080fd5b8335613a2d816131f1565b925060208401356001600160401b0380821115613a4957600080fd5b613a55878388016134bc565b93506040860135915080821115613a6b57600080fd5b50613a78868287016134bc565b9150509250925092565b634e487b7160e01b600052601160045260246000fd5b8082018082111561089357610893613a82565b600181811c90821680613abf57607f821691505b602082108103613adf57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135355472616461626c65236f6e6c794f776e65723a2043414c4c4560408201526d292fa4a9afa727aa2fa7aba722a960911b606082015260800190565b6001600160a01b03848116825283166020820152606060408201819052600090613b5f90830184613289565b95945050505050565b60008351613b7a818460208801613265565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b60008251613bb1818460208701613265565b9190910192915050565b6000808454613bc981613aab565b60018281168015613be15760018114613bf657613c25565b60ff1984168752821515830287019450613c25565b8860005260208060002060005b85811015613c1c5781548a820152908401908201613c03565b50505082870194505b50602f60f81b845286519250613c418382860160208a01613265565b919092010195945050505050565b601f82111561199957600081815260208120601f850160051c81016020861015613c765750805b601f850160051c820191505b81811015610d8157828155600101613c82565b81516001600160401b03811115613cae57613cae6132c8565b613cc281613cbc8454613aab565b84613c4f565b602080601f831160018114613cf75760008415613cdf5750858301515b600019600386901b1c1916600185901b178555610d81565b600085815260208120601f198616915b82811015613d2657888601518255948401946001909101908401613d07565b5085821015613d445787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600060018201613d7c57613d7c613a82565b5060010190565b600060208284031215613d9557600080fd5b81516001600160401b03811115613dab57600080fd5b8201601f81018413613dbc57600080fd5b8051613dc78161332f565b604051613dd48282613303565b828152866020848601011115613de957600080fd5b613dfa836020830160208701613265565b9695505050505050565b600060208284031215613e1657600080fd5b5051919050565b60208082526031908201527f4a6f796e41737365745368617265642363726561746f724f6e6c793a204f4e4c6040820152701657d0d491505513d497d0531313d5d151607a1b606082015260800190565b60208082526037908201527f4173736574436f6e7472616374236f6e6c79496d7065726d616e656e7455524960408201527f3a205552495f43414e4e4f545f42455f4348414e474544000000000000000000606082015260800190565b60208082526041908201527f4a6f796e4173736574536861726564236f6e6c7946756c6c546f6b656e4f776e60408201527f65723a204f4e4c595f46554c4c5f544f4b454e5f4f574e45525f414c4c4f57456060820152601160fa1b608082015260a00190565b8181038181111561089357610893613a82565b600060208284031215613f5757600080fd5b8151611759816131f1565b60ff818116838216019081111561089357610893613a82565b60208082526030908201527f455243313135355472616461626c65236f6e6c79417070726f7665643a20434160408201526f1313115497d393d517d0531313d5d15160821b606082015260800190565b604081526000613fde60408301856137a1565b8281036020840152613b5f81856137a1565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061402a90830184613289565b979650505050505050565b60006020828403121561404757600080fd5b815161175981613232565b600060033d1115611a045760046000803e5060005160e01c90565b600060443d101561407b5790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156140aa57505050505090565b82850191508151818111156140c25750505050505090565b843d87010160208285010111156140dc5750505050505090565b6140eb60208286010187613303565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061416a908301866137a1565b828103606084015261417c81866137a1565b90508281036080840152610b8a818561328956fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220187b65e70c940fc0deaa511a230c5b0697c33a7d203eb37bb8ef047fdc7b4fa364736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094a6f796e4173736574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094a6f796e417373657400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033687474703a2f2f6c6f63616c686f73743a333030302f746f6b656e2f6765742f6a6f796e2d61737365742d6d6574616461746100000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): JoynAsset
Arg [1] : _symbol (string): JoynAsset
Arg [2] : _proxyRegistryAddress (address): 0x0000000000000000000000000000000000000000
Arg [3] : _templateURI (string): http://localhost:3000/token/get/joyn-asset-metadata
Arg [4] : _migrationAddress (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [6] : 4a6f796e41737365740000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [8] : 4a6f796e41737365740000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000033
Arg [10] : 687474703a2f2f6c6f63616c686f73743a333030302f746f6b656e2f6765742f
Arg [11] : 6a6f796e2d61737365742d6d6574616461746100000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.