Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
NFT
Overview
Max Total Supply
0 A0K1
Holders
2,098
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 A0K1Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
A0K1Passport
Compiler Version
v0.8.7+commit.e28d00a7
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.0; /// @artist: Steve Aoki /// @title: A0K1 Passport /// @author: manifold.xyz ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMW0ddxXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNWMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMM0' lNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;cKMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMNc .kWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. '0MMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMWx. ,c. ;KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. '0MMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMK, .kXc oWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. ,KMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMNl cNMO' .OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. ;OWMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMO. '0WWNo. :XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. 'xNMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMX: .dNkoXK; .dWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. .oXMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMWd. :XK;.oNk. ,0MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd:. .:0WMWOkXMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMM0' .kNo 'ONl lNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. ,kNMW0c.,0MMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMNc lNO. cX0' .kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. .dXMW0c. '0MMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMWx. ,0X: .xNd. ;KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKx:. .cKWW0l. cXMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMK, .xNd. .. ,KX: oWMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd:. ;OWWKl. .;kXMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMNl :X0' lk' lNO. .OMMMMMMMMMMMMMMMMMMMMMMMMWKd;. 'xNWKo. .cONNXWMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMk. .ONc ,KWd. .kNl :XMMMMMMMMMMMMMMMMMMMMWKd:. .lKWKo. 'o0NXx;:KMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMX: oWKl;:kWMXo;:xWK, .dWMMMMMMMMMMMMMMMWKdl;. .:0WXd' ,dXNOl. '0MMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMO. .OMWNNNWMMMWNNNMWl :NMMMMMMMMMMMMMMMK; ,xNXd' .:kXKd;. .cXMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMX: lNKc',xWMXl',xW0, .xWMMMMMMMMMMMMMMM0' .oXXx' .cOXOc. .,o0NMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMO. .kNl '0Wo .ONl cXMMMMMMMMMMMMMMMM0' .c0Xx, 'o00d,. .,o0NMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMWo :XK, cx' oNk. 'OMMMMMMMMMMMMMMMMM0' ,kKx, ,x0kc. .,oONMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMK; .dNx. . ;KX; .dWMMMMMMMMMMMMMMMMM0' .d0k;..:xOd,. .,oONMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMk. '0Xc .kNo. ;XMMMMMMMMMMMMMMMMMM0' .lOk;..lkxc. .,o0NMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMNl cN0' lNO' .kMMMMMMMMMMMMMMMMMMM0' ;kx:.'oxo,..,lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMM0, .kNd. ,0Xc lNMMMMMMMMMMMMMMMMMMM0' 'dx:.;odc..,lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMWx. ;KX:.dWx. ,KMMMMMMMMMMMMMMMMMMMM0' .ld:,:ol,.,lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMX: oNOxXK, .xWMMMMMMMMMMMMMMMMMMMM0' .;oc;:c:',lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMO. 'OWWNo cXMMMMMMMMMMMMMMMMMMMMM0' 'cc:::;:lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMWo cXMO. '0MMMMMMMMMMMMMMMMMMMMMM0' .;c:;:coONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMK; .xX: .dWMMMMMMMMMMMMMMMMMMMMMM0' .,:::ldONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMWk. ':. ;XMMMMMMMMMMMMMMMMMMMMMMM0' .;clx0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMNl .kMMMMMMMMMMMMMMMMMMMMMMMM0'..,ok0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMM0, lNMMMMMMMMMMMMMMMMMMMMMMMMKdx0KNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMWKxxkXMMMMMMMMMMMMMMMMMMMMMMMMMMWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM // // // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./IA0K1Passport.sol"; contract A0K1Passport is ReentrancyGuard, AdminControl, ERC721, IA0K1Passport { using Strings for uint256; address private immutable _creditsAddress; // Supplementary metadata contract locations MetadataContract[] private _metadataContracts; // Pass count uint256 private _passCount; // Array of number of credits required per level (0 indexed, so 0 = level 1) uint16[] private _levelCredits; // Mapping of token to current level mapping(uint256 => uint8) private _tokenLevel; bool public redemptionEnabled; string private _prefixURI; uint256 private _royaltyBps; address payable private _royaltyRecipient; bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6; bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a; bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584; constructor(address creditsAddress) ERC721("A0K1", "A0K1") { _creditsAddress = creditsAddress; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AdminControl, ERC721, IERC165) returns (bool) { return interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC1155Receiver).interfaceId || ERC721.supportsInterface(interfaceId) || AdminControl.supportsInterface(interfaceId) || interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE || interfaceId == _INTERFACE_ID_ROYALTIES_EIP2981 || interfaceId == _INTERFACE_ID_ROYALTIES_RARIBLE; } /** * @dev Mint a pass */ function _mintPass(address recipient, uint8 level) private { _passCount++; _mint(recipient, _passCount); _tokenLevel[_passCount] = level; emit TokenLevel(_passCount, level); } /** * @dev Upgrade a pass */ function _upgradePass(uint256 tokenId, uint8 level) private { _tokenLevel[tokenId] = level; emit TokenLevel(tokenId, level); } /** * @dev See {IA0K1Passport-enableRedemption}. */ function enableRedemption() external override adminRequired { redemptionEnabled = true; emit Activate(); } /** * @dev See {IA0K1Passport-disableRedemption}. */ function disableRedemption() external override adminRequired { redemptionEnabled = false; emit Deactivate(); } /** * @dev See {IA0K1Passport-getLevelCredits}. */ function getLevelCredits() external view override returns(uint16[] memory) { return _levelCredits; } /** * @dev See {IA0K1Passport-setLevels}. */ function setLevelCredits(uint16[] memory levelCredits) external override adminRequired { _levelCredits = levelCredits; } /** * @dev See {IA0K1Passport-getMetadataContracts}. */ function getMetadataContracts() external view override returns(MetadataContract[] memory) { return _metadataContracts; } /** * @dev See {IA0K1Passport-setMetadataContracts}. */ function setMetadataContracts(MetadataContract[] calldata metadataContracts) external override adminRequired { // Shrink array if necessary if (metadataContracts.length < _metadataContracts.length) { for (uint i = 0; i < _metadataContracts.length-metadataContracts.length; i++) { _metadataContracts.pop(); } } for (uint i = 0; i < metadataContracts.length; i++) { MetadataContract memory metadataContract = metadataContracts[i]; if (i < _metadataContracts.length) { MetadataContract storage _metadataContract = _metadataContracts[i]; _metadataContract.category = metadataContract.category; _metadataContract.chainId = metadataContract.chainId; _metadataContract.contractAddress = metadataContract.contractAddress; } else { _metadataContracts.push(metadataContract); } } } /** * @dev See {IA0K1Passport-recoverERC721}. */ function recoverERC721(address tokenAddress, uint256 tokenId, address destination) external override adminRequired { IERC721(tokenAddress).transferFrom(address(this), destination, tokenId); } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address from, uint256 id, uint256 value, bytes calldata data ) external override nonReentrant returns(bytes4) { _onERC1155Received(from, id, value, data); return this.onERC1155Received.selector; } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override nonReentrant returns(bytes4) { require(ids.length == 1 && ids.length == values.length, "Invalid input"); _onERC1155Received(from, ids[0], values[0], data); return this.onERC1155BatchReceived.selector; } function _onERC1155Received(address from, uint256 id, uint256 value, bytes calldata data) private { require(redemptionEnabled, "Redemption inactive"); require(msg.sender == _creditsAddress && id == 1, "Invalid NFT"); uint8 action; uint8 level; uint256 tokenId; if (data.length == 64) { (action, level) = abi.decode(data, (uint8, uint8)); require(level > 0 && _levelCredits.length >= level, "Invalid request"); uint8 levelIndex = level-1; require(_levelCredits[levelIndex] > 0 && _levelCredits[levelIndex] == value, "Invalid request"); } else if (data.length == 96) { (action, level, tokenId) = abi.decode(data, (uint8, uint8, uint256)); require(ownerOf(tokenId) == from, "Must be owner of token"); uint8 currentLevel = _tokenLevel[tokenId]; require(level > 0 && _levelCredits.length >= level && currentLevel > 0 && level > currentLevel, "Invalid request"); uint16 creditsRequired = _levelCredits[level - 1] - _levelCredits[currentLevel - 1]; require(creditsRequired > 0 && creditsRequired == value, "Invalid request"); } else { revert("Invalid data"); } // Burn it try IA0K1Credits(msg.sender).burn(address(this), uint16(value)) { } catch (bytes memory) { revert("Burn failure"); } if (action == 0) { _mintPass(from, level); } else if (action == 1) { _upgradePass(tokenId, level); } } /** * @dev See {IA0K1Passport-mergePasses}. */ function mergePasses(uint256 tokenId, uint8 newLevel, uint256[] calldata mergeTokenIds) external override { require(msg.sender == ownerOf(tokenId), "Must be token owner"); require(newLevel <= _levelCredits.length, "Invalid level"); require(_tokenLevel[tokenId]+1 == newLevel, "Can only upgrade one level at a time"); uint16 mergeCredits = 0; uint8 newLevelIndex = newLevel-1; for (uint i = 0; i < mergeTokenIds.length; i++) { uint256 mergeTokenId = mergeTokenIds[i]; require(mergeTokenId != tokenId, "Cannot have duplicate tokens"); for (uint j = 0; j < mergeTokenIds.length; j++) { require(i == j || mergeTokenId != mergeTokenIds[j], "Cannot have duplicate tokens"); } require(msg.sender == ownerOf(mergeTokenId), "Must be token owner"); mergeCredits += _levelCredits[_tokenLevel[mergeTokenId]-1]; } require(_levelCredits[newLevelIndex]-_levelCredits[newLevelIndex-1] == mergeCredits, "Invalid merge request"); for (uint i = 0; i < mergeTokenIds.length; i++) { _burn(mergeTokenIds[i]); } _upgradePass(tokenId, _tokenLevel[tokenId]+1); } /** * @dev See {IA0K1Passport-tokenLevel}. */ function tokenLevel(uint256 tokenId) public view override returns(uint8) { require(_exists(tokenId), "ERC721: URI query for nonexistent token"); return _tokenLevel[tokenId]; } /** * @dev See {IA0K1Passport-setPrefixURI}. */ function setPrefixURI(string calldata uri) external override adminRequired { _prefixURI = uri; } function tokenURI(uint256 tokenId) public view override returns(string memory) { require(_exists(tokenId), "ERC721: URI query for nonexistent token"); return string(abi.encodePacked(_prefixURI, tokenId.toString())); } /** * @dev See {IA0K1Passport-updateRoyalties}. */ function updateRoyalties(address payable recipient, uint256 bps) external override adminRequired { _royaltyRecipient = recipient; _royaltyBps = bps; } /** * ROYALTY FUNCTIONS */ function getRoyalties(uint256) external view override returns (address payable[] memory recipients, uint256[] memory bps) { if (_royaltyRecipient != address(0x0)) { recipients = new address payable[](1); recipients[0] = _royaltyRecipient; bps = new uint256[](1); bps[0] = _royaltyBps; } return (recipients, bps); } function getFeeRecipients(uint256) external view override returns (address payable[] memory recipients) { if (_royaltyRecipient != address(0x0)) { recipients = new address payable[](1); recipients[0] = _royaltyRecipient; } return recipients; } function getFeeBps(uint256) external view override returns (uint[] memory bps) { if (_royaltyRecipient != address(0x0)) { bps = new uint256[](1); bps[0] = _royaltyBps; } return bps; } function royaltyInfo(uint256, uint256 value) external view override returns (address, uint256) { return (_royaltyRecipient, value*_royaltyBps/10000); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; /** * A0K1Passport Interface */ interface IA0K1Passport is IERC1155Receiver { event Activate(); event Deactivate(); event TokenLevel(uint256 tokenId, uint8 level); struct MetadataContract { uint32 category; uint64 chainId; address contractAddress; } /** * @dev Enable token redemption period */ function enableRedemption() external; /** * @dev Disable token redemption period */ function disableRedemption() external; /** * @dev Get credits required for each level */ function getLevelCredits() external view returns(uint16[] memory); /** * @dev Set credits required for each level */ function setLevelCredits(uint16[] calldata levelCredits) external; /** * @dev Get supplementary metadata contract addresses */ function getMetadataContracts() external view returns(MetadataContract[] memory); /** * @dev Set supplementary metadata contract addresses */ function setMetadataContracts(MetadataContract[] calldata metadataContracts) external; /** * @dev Recover any 721's accidentally sent in. */ function recoverERC721(address tokenAddress, uint256 tokenId, address destination) external; /** * @dev Merge passes */ function mergePasses(uint256 tokenId, uint8 newLevel, uint256[] calldata mergeTokenIds) external; /** * @dev Get a token's level */ function tokenLevel(uint256 tokenId) external view returns(uint8); /** * @dev Set the image base uri (prefix) */ function setPrefixURI(string calldata uri) external; /** * @dev Update royalties */ function updateRoyalties(address payable recipient, uint256 bps) external; /** * ROYALTY FUNCTIONS */ function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps); function getFeeRecipients(uint256) external view returns (address payable[] memory recipients); function getFeeBps(uint256) external view returns (uint[] memory bps); function royaltyInfo(uint256, uint256 value) external view returns (address, uint256); } interface IA0K1Credits { function burn(address from, uint16 amount) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 be 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/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IAdminControl.sol"; abstract contract AdminControl is Ownable, IAdminControl, ERC165 { using EnumerableSet for EnumerableSet.AddressSet; // Track registered admins EnumerableSet.AddressSet private _admins; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IAdminControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Only allows approved admins to call the specified function */ modifier adminRequired() { require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin"); _; } /** * @dev See {IAdminControl-getAdmins}. */ function getAdmins() external view override returns (address[] memory admins) { admins = new address[](_admins.length()); for (uint i = 0; i < _admins.length(); i++) { admins[i] = _admins.at(i); } return admins; } /** * @dev See {IAdminControl-approveAdmin}. */ function approveAdmin(address admin) external override onlyOwner { if (!_admins.contains(admin)) { emit AdminApproved(admin, msg.sender); _admins.add(admin); } } /** * @dev See {IAdminControl-revokeAdmin}. */ function revokeAdmin(address admin) external override onlyOwner { if (_admins.contains(admin)) { emit AdminRevoked(admin, msg.sender); _admins.remove(admin); } } /** * @dev See {IAdminControl-isAdmin}. */ function isAdmin(address admin) public override view returns (bool) { return (owner() == admin || _admins.contains(admin)); } }
// 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 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/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev 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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface for admin control */ interface IAdminControl is IERC165 { event AdminApproved(address indexed account, address indexed sender); event AdminRevoked(address indexed account, address indexed sender); /** * @dev gets address of all admins */ function getAdmins() external view returns (address[] memory); /** * @dev add an admin. Can only be called by contract owner. */ function approveAdmin(address admin) external; /** * @dev remove an admin. Can only be called by contract owner. */ function revokeAdmin(address admin) external; /** * @dev checks whether or not given address is an admin * Returns True if they are */ function isAdmin(address admin) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"creditsAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"Activate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"Deactivate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"level","type":"uint8"}],"name":"TokenLevel","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"recipients","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLevelCredits","outputs":[{"internalType":"uint16[]","name":"","type":"uint16[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMetadataContracts","outputs":[{"components":[{"internalType":"uint32","name":"category","type":"uint32"},{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct IA0K1Passport.MetadataContract[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8","name":"newLevel","type":"uint8"},{"internalType":"uint256[]","name":"mergeTokenIds","type":"uint256[]"}],"name":"mergePasses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"destination","type":"address"}],"name":"recoverERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"levelCredits","type":"uint16[]"}],"name":"setLevelCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"category","type":"uint32"},{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct IA0K1Passport.MetadataContract[]","name":"metadataContracts","type":"tuple[]"}],"name":"setMetadataContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setPrefixURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenLevel","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"}],"name":"updateRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162003c8b38038062003c8b8339810160408190526200003491620001ae565b60408051808201825260048082526341304b3160e01b60208084018290528451808601909552918452908301526001600055906200007233620000b6565b81516200008790600490602085019062000108565b5080516200009d90600590602084019062000108565b50505060601b6001600160601b0319166080526200021d565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200011690620001e0565b90600052602060002090601f0160209004810192826200013a576000855562000185565b82601f106200015557805160ff191683800117855562000185565b8280016001018555821562000185579182015b828111156200018557825182559160200191906001019062000168565b506200019392915062000197565b5090565b5b8082111562000193576000815560010162000198565b600060208284031215620001c157600080fd5b81516001600160a01b0381168114620001d957600080fd5b9392505050565b600181811c90821680620001f557607f821691505b602082108114156200021757634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c613a4f6200023c60003960006120a40152613a4f6000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063715018a611610130578063b9c4d9fb116100b8578063dd08b5c91161007c578063dd08b5c914610538578063e985e9c514610540578063f0e9fcd114610553578063f23a6e6114610566578063f2fde38b1461057957600080fd5b8063b9c4d9fb146104a5578063bb3bafd6146104c5578063bc197c81146104e6578063c87b56dd14610512578063d2da63b41461052557600080fd5b8063a22cb465116100ff578063a22cb4651461043a578063ab8ece8b1461044d578063b234de8214610472578063b2c94ee61461047f578063b88d4fde1461049257600080fd5b8063715018a6146104045780638da5cb5b1461040c578063942d8d3c1461041d57806395d89b411461043257600080fd5b80632a55205a116101be5780635c391efb116101825780635c391efb146103975780636352211e146103aa5780636c2f5acd146103bd5780636d73e669146103d057806370a08231146103e357600080fd5b80632a55205a146103225780632d3456701461035457806331ae450b1461036757806342842e0e1461037c5780634721ed6f1461038f57600080fd5b8063095ea7b311610205578063095ea7b3146102b45780630ebd4c7f146102c757806316eeaaa4146102e757806323b872dd146102fc57806324d7806c1461030f57600080fd5b806301247e331461023757806301ffc9a71461024c57806306fdde0314610274578063081812fc14610289575b600080fd5b61024a61024536600461300d565b61058c565b005b61025f61025a36600461313f565b6107bc565b60405190151581526020015b60405180910390f35b61027c610862565b60405161026b9190613628565b61029c610297366004613240565b6108f4565b6040516001600160a01b03909116815260200161026b565b61024a6102c2366004612cf6565b610989565b6102da6102d5366004613240565b610a9a565b60405161026b9190613615565b6102ef610af6565b60405161026b9190613568565b61024a61030a366004612e19565b610b84565b61025f61031d366004612cd9565b610bb5565b610335610330366004613259565b610bee565b604080516001600160a01b03909316835260208301919091520161026b565b61024a610362366004612cd9565b610c29565b61036f610ca9565b60405161026b91906134e3565b61024a61038a366004612e19565b610d57565b61024a610d72565b61024a6103a5366004613081565b610df4565b61029c6103b8366004613240565b610e51565b61024a6103cb366004612cf6565b610ec8565b61024a6103de366004612cd9565b610f38565b6103f66103f1366004612cd9565b610fb2565b60405190815260200161026b565b61024a611039565b6001546001600160a01b031661029c565b61042561106f565b60405161026b91906135d9565b61027c6110ee565b61024a610448366004612f98565b6110fd565b61046061045b366004613240565b611108565b60405160ff909116815260200161026b565b600e5461025f9060ff1681565b61024a61048d366004613179565b611152565b61024a6104a0366004612e5a565b6111a8565b6104b86104b3366004613240565b6111e0565b60405161026b9190613530565b6104d86104d3366004613240565b611259565b60405161026b929190613543565b6104f96104f4366004612d5b565b61130d565b6040516001600160e01b0319909116815260200161026b565b61027c610520366004613240565b61140b565b61024a61053336600461327b565b611474565b61024a6118cb565b61025f61054e366004612d22565b61194a565b61024a610561366004612fcb565b611978565b6104f9610574366004612f1d565b611a2f565b61024a610587366004612cd9565b611aae565b3361059f6001546001600160a01b031690565b6001600160a01b031614806105ba57506105ba600233611b46565b6105df5760405162461bcd60e51b81526004016105d69061373c565b60405180910390fd5b600a5481101561063e5760005b600a546105fa9083906138b0565b81101561063c57600a805480610612576106126139ac565b6000828152602081208201600019908101919091550190558061063481613951565b9150506105ec565b505b60005b818110156107b757600083838381811061065d5761065d6139c2565b90506060020180360381019061067391906131ba565b600a5490915082101561070b576000600a8381548110610695576106956139c2565b60009182526020918290208451910180549285015160408601516001600160a01b0316600160601b026bffffffffffffffffffffffff6001600160401b03909216640100000000026bffffffffffffffffffffffff1990951663ffffffff909416939093179390931792909216179055506107a4565b600a805460018101825560009190915281517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89091018054602084015160408501516001600160a01b0316600160601b026bffffffffffffffffffffffff6001600160401b03909216640100000000026bffffffffffffffffffffffff1990931663ffffffff9095169490941791909117169190911790555b50806107af81613951565b915050610641565b505050565b60006001600160e01b03198216630a85bd0160e11b14806107ed57506001600160e01b03198216630271189760e51b145b806107fc57506107fc82611b6b565b8061080b575061080b82611ba7565b8061082657506001600160e01b03198216635d9dd7eb60e11b145b8061084157506001600160e01b0319821663152a902d60e11b145b8061085c57506001600160e01b03198216632dde656160e21b145b92915050565b60606004805461087190613916565b80601f016020809104026020016040519081016040528092919081815260200182805461089d90613916565b80156108ea5780601f106108bf576101008083540402835291602001916108ea565b820191906000526020600020905b8154815290600101906020018083116108cd57829003601f168201915b5050505050905090565b6000818152600660205260408120546001600160a01b031661096d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105d6565b506000908152600860205260409020546001600160a01b031690565b600061099482610e51565b9050806001600160a01b0316836001600160a01b03161415610a025760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105d6565b336001600160a01b0382161480610a1e5750610a1e813361194a565b610a905760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105d6565b6107b78383611bdc565b6011546060906001600160a01b031615610af157604080516001808252818301909252906020808301908036833701905050905060105481600081518110610ae457610ae46139c2565b6020026020010181815250505b919050565b6060600a805480602002602001604051908101604052809291908181526020016000905b82821015610b7b576000848152602090819020604080516060810182529185015463ffffffff8116835264010000000081046001600160401b031683850152600160601b90046001600160a01b031690820152825260019092019101610b1a565b50505050905090565b610b8e3382611c4a565b610baa5760405162461bcd60e51b81526004016105d6906136eb565b6107b7838383611d21565b6000816001600160a01b0316610bd36001546001600160a01b031690565b6001600160a01b0316148061085c575061085c600283611b46565b60115460105460009182916001600160a01b039091169061271090610c13908661386e565b610c1d919061385a565b915091505b9250929050565b6001546001600160a01b03163314610c535760405162461bcd60e51b81526004016105d6906136b6565b610c5e600282611b46565b15610ca65760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610ca4600282611ebd565b505b50565b6060610cb56002611ed2565b6001600160401b03811115610ccc57610ccc6139d8565b604051908082528060200260200182016040528015610cf5578160200160208202803683370190505b50905060005b610d056002611ed2565b811015610d5357610d17600282611edc565b828281518110610d2957610d296139c2565b6001600160a01b039092166020928302919091019091015280610d4b81613951565b915050610cfb565b5090565b6107b7838383604051806020016040528060008152506111a8565b33610d856001546001600160a01b031690565b6001600160a01b03161480610da05750610da0600233611b46565b610dbc5760405162461bcd60e51b81526004016105d69061373c565b600e805460ff191660011790556040517f59d3ce47d6ad6c6003cef97d136155b29d88653eb355c8bed6e03fbf694570ca90600090a1565b33610e076001546001600160a01b031690565b6001600160a01b03161480610e225750610e22600233611b46565b610e3e5760405162461bcd60e51b81526004016105d69061373c565b8051610ca490600c906020840190612b15565b6000818152600660205260408120546001600160a01b03168061085c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105d6565b33610edb6001546001600160a01b031690565b6001600160a01b03161480610ef65750610ef6600233611b46565b610f125760405162461bcd60e51b81526004016105d69061373c565b601180546001600160a01b0319166001600160a01b039390931692909217909155601055565b6001546001600160a01b03163314610f625760405162461bcd60e51b81526004016105d6906136b6565b610f6d600282611b46565b610ca65760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610ca4600282611ee8565b60006001600160a01b03821661101d5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105d6565b506001600160a01b031660009081526007602052604090205490565b6001546001600160a01b031633146110635760405162461bcd60e51b81526004016105d6906136b6565b61106d6000611efd565b565b6060600c8054806020026020016040519081016040528092919081815260200182805480156108ea57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116110ac5790505050505050905090565b60606005805461087190613916565b610ca4338383611f4f565b6000818152600660205260408120546001600160a01b031661113c5760405162461bcd60e51b81526004016105d690613780565b506000908152600d602052604090205460ff1690565b336111656001546001600160a01b031690565b6001600160a01b031614806111805750611180600233611b46565b61119c5760405162461bcd60e51b81526004016105d69061373c565b6107b7600f8383612bba565b6111b23383611c4a565b6111ce5760405162461bcd60e51b81526004016105d6906136eb565b6111da8484848461201e565b50505050565b6011546060906001600160a01b031615610af1576040805160018082528183019092529060208083019080368337505060115482519293506001600160a01b031691839150600090611234576112346139c2565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b60115460609081906001600160a01b031615611308576040805160018082528183019092529060208083019080368337505060115482519294506001600160a01b0316918491506000906112af576112af6139c2565b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509050601054816000815181106112fb576112fb6139c2565b6020026020010181815250505b915091565b6000600260005414156113625760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d6565b600260005560018614801561137657508584145b6113b25760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b60448201526064016105d6565b6113f188888860008181106113c9576113c96139c2565b90506020020135878760008181106113e3576113e36139c2565b905060200201358686612051565b5063bc197c8160e01b600160005598975050505050505050565b6000818152600660205260409020546060906001600160a01b03166114425760405162461bcd60e51b81526004016105d690613780565b600f61144d836124e8565b60405160200161145e9291906133ff565b6040516020818303038152906040529050919050565b61147d84610e51565b6001600160a01b0316336001600160a01b0316146114d35760405162461bcd60e51b815260206004820152601360248201527226bab9ba103132903a37b5b2b71037bbb732b960691b60448201526064016105d6565b600c5460ff841611156115185760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081b195d995b609a1b60448201526064016105d6565b6000848152600d602052604090205460ff8085169161153991166001613835565b60ff16146115955760405162461bcd60e51b8152602060048201526024808201527f43616e206f6e6c792075706772616465206f6e65206c6576656c20617420612060448201526374696d6560e01b60648201526084016105d6565b6000806115a36001866138c7565b905060005b838110156117855760008585838181106115c4576115c46139c2565b9050602002013590508781141561161d5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742068617665206475706c696361746520746f6b656e730000000060448201526064016105d6565b60005b858110156116ac578083148061164e5750868682818110611643576116436139c2565b905060200201358214155b61169a5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742068617665206475706c696361746520746f6b656e730000000060448201526064016105d6565b806116a481613951565b915050611620565b506116b681610e51565b6001600160a01b0316336001600160a01b03161461170c5760405162461bcd60e51b815260206004820152601360248201527226bab9ba103132903a37b5b2b71037bbb732b960691b60448201526064016105d6565b6000818152600d6020526040902054600c9061172d9060019060ff166138c7565b60ff1681548110611740576117406139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff168461176f91906137f7565b935050808061177d90613951565b9150506115a8565b5061ffff8216600c6117986001846138c7565b60ff16815481106117ab576117ab6139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600c8360ff16815481106117e5576117e56139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611813919061388d565b61ffff161461185c5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b595c99d9481c995c5d595cdd605a1b60448201526064016105d6565b60005b8381101561189a5761188885858381811061187c5761187c6139c2565b905060200201356125e5565b8061189281613951565b91505061185f565b506000868152600d60205260409020546118c39087906118be9060ff166001613835565b612681565b505050505050565b336118de6001546001600160a01b031690565b6001600160a01b031614806118f957506118f9600233611b46565b6119155760405162461bcd60e51b81526004016105d69061373c565b600e805460ff191690556040517fc2a8834045efeaf0b37df1cf2e5979bff82a0c7f93c99b649a004940ef3cda4590600090a1565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b3361198b6001546001600160a01b031690565b6001600160a01b031614806119a657506119a6600233611b46565b6119c25760405162461bcd60e51b81526004016105d69061373c565b6040516323b872dd60e01b81523060048201526001600160a01b038281166024830152604482018490528416906323b872dd90606401600060405180830381600087803b158015611a1257600080fd5b505af1158015611a26573d6000803e3d6000fd5b50505050505050565b600060026000541415611a845760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d6565b6002600055611a968686868686612051565b5063f23a6e6160e01b60016000559695505050505050565b6001546001600160a01b03163314611ad85760405162461bcd60e51b81526004016105d6906136b6565b6001600160a01b038116611b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d6565b610ca681611efd565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60006001600160e01b031982166380ac58cd60e01b1480611b9c57506001600160e01b03198216635b5e139f60e01b145b8061085c575061085c825b60006001600160e01b03198216632a9f3abf60e11b148061085c57506301ffc9a760e01b6001600160e01b031983161461085c565b600081815260086020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c1182610e51565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600660205260408120546001600160a01b0316611cc35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105d6565b6000611cce83610e51565b9050806001600160a01b0316846001600160a01b03161480611d095750836001600160a01b0316611cfe846108f4565b6001600160a01b0316145b80611d195750611d19818561194a565b949350505050565b826001600160a01b0316611d3482610e51565b6001600160a01b031614611d985760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105d6565b6001600160a01b038216611dfa5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105d6565b611e05600082611bdc565b6001600160a01b0383166000908152600760205260408120805460019290611e2e9084906138b0565b90915550506001600160a01b0382166000908152600760205260408120805460019290611e5c90849061381d565b909155505060008181526006602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000611b64836001600160a01b0384166126dc565b600061085c825490565b6000611b6483836127cf565b6000611b64836001600160a01b0384166127f9565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611fb15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105d6565b6001600160a01b03838116600081815260096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612029848484611d21565b61203584848484612848565b6111da5760405162461bcd60e51b81526004016105d690613664565b600e5460ff166120995760405162461bcd60e51b8152602060048201526013602482015272526564656d7074696f6e20696e61637469766560681b60448201526064016105d6565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156120d15750836001145b61210b5760405162461bcd60e51b815260206004820152600b60248201526a125b9d985b1a590813919560aa1b60448201526064016105d6565b60008080604084141561220a57612124848601866132d4565b909350915060ff8216158015906121405750600c5460ff831611155b61215c5760405162461bcd60e51b81526004016105d69061363b565b60006121696001846138c7565b90506000600c8260ff1681548110612183576121836139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff161180156121e8575086600c8260ff16815481106121c4576121c46139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff16145b6122045760405162461bcd60e51b81526004016105d69061363b565b506123f3565b60608414156123bc5761221f84860186613307565b919450925090506001600160a01b03881661223982610e51565b6001600160a01b0316146122885760405162461bcd60e51b815260206004820152601660248201527526bab9ba1031329037bbb732b91037b3103a37b5b2b760511b60448201526064016105d6565b6000818152600d602052604090205460ff908116908316158015906122b25750600c5460ff841611155b80156122c1575060008160ff16115b80156122d257508060ff168360ff16115b6122ee5760405162461bcd60e51b81526004016105d69061363b565b6000600c6122fd6001846138c7565b60ff1681548110612310576123106139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff16600c61233f6001876138c7565b60ff1681548110612352576123526139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16612380919061388d565b905060008161ffff161180156123995750878161ffff16145b6123b55760405162461bcd60e51b81526004016105d69061363b565b50506123f3565b60405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206461746160a01b60448201526064016105d6565b60405163d55f2d9d60e01b815230600482015261ffff87166024820152339063d55f2d9d90604401600060405180830381600087803b15801561243557600080fd5b505af1925050508015612446575060015b6124b1573d808015612474576040519150601f19603f3d011682016040523d82523d6000602084013e612479565b606091505b5060405162461bcd60e51b815260206004820152600c60248201526b4275726e206661696c75726560a01b60448201526064016105d6565b60ff83166124c8576124c38883612955565b6124de565b8260ff16600114156124de576124de8183612681565b5050505050505050565b60608161250c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612536578061252081613951565b915061252f9050600a8361385a565b9150612510565b6000816001600160401b03811115612550576125506139d8565b6040519080825280601f01601f19166020018201604052801561257a576020820181803683370190505b5090505b8415611d195761258f6001836138b0565b915061259c600a8661396c565b6125a790603061381d565b60f81b8183815181106125bc576125bc6139c2565b60200101906001600160f81b031916908160001a9053506125de600a8661385a565b945061257e565b60006125f082610e51565b90506125fd600083611bdc565b6001600160a01b03811660009081526007602052604081208054600192906126269084906138b0565b909155505060008281526006602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4610ca4565b6000828152600d6020908152604091829020805460ff191660ff85169081179091558251858152918201527fc5c7f0a486ea466bf8955dd7e7d12faffbd2fcf783846aee0e3120e99be2d86b91015b60405180910390a15050565b600081815260018301602052604081205480156127c55760006127006001836138b0565b8554909150600090612714906001906138b0565b9050818114612779576000866000018281548110612734576127346139c2565b9060005260206000200154905080876000018481548110612757576127576139c2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061278a5761278a6139ac565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061085c565b600091505061085c565b60008260000182815481106127e6576127e66139c2565b9060005260206000200154905092915050565b60008181526001830160205260408120546128405750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561085c565b50600061085c565b60006001600160a01b0384163b1561294a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061288c9033908990889088906004016134a6565b602060405180830381600087803b1580156128a657600080fd5b505af19250505080156128d6575060408051601f3d908101601f191682019092526128d39181019061315c565b60015b612930573d808015612904576040519150601f19603f3d011682016040523d82523d6000602084013e612909565b606091505b5080516129285760405162461bcd60e51b81526004016105d690613664565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611d19565b506001949350505050565b600b805490600061296583613951565b919050555061297682600b546129d2565b600b80546000908152600d6020908152604091829020805460ff191660ff861690811790915592548251908152908101929092527fc5c7f0a486ea466bf8955dd7e7d12faffbd2fcf783846aee0e3120e99be2d86b91016126d0565b6001600160a01b038216612a285760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105d6565b6000818152600660205260409020546001600160a01b031615612a8d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105d6565b6001600160a01b0382166000908152600760205260408120805460019290612ab690849061381d565b909155505060008181526006602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610ca4565b82805482825590600052602060002090600f01601090048101928215612bae5791602002820160005b83821115612b7e57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302612b3e565b8015612bac5782816101000a81549061ffff0219169055600201602081600101049283019260010302612b7e565b505b50610d53929150612c2e565b828054612bc690613916565b90600052602060002090601f016020900481019282612be85760008555612bae565b82601f10612c015782800160ff19823516178555612bae565b82800160010185558215612bae579182015b82811115612bae578235825591602001919060010190612c13565b5b80821115610d535760008155600101612c2f565b60008083601f840112612c5557600080fd5b5081356001600160401b03811115612c6c57600080fd5b6020830191508360208260051b8501011115610c2257600080fd5b60008083601f840112612c9957600080fd5b5081356001600160401b03811115612cb057600080fd5b602083019150836020828501011115610c2257600080fd5b803560ff81168114610af157600080fd5b600060208284031215612ceb57600080fd5b8135611b64816139ee565b60008060408385031215612d0957600080fd5b8235612d14816139ee565b946020939093013593505050565b60008060408385031215612d3557600080fd5b8235612d40816139ee565b91506020830135612d50816139ee565b809150509250929050565b60008060008060008060008060a0898b031215612d7757600080fd5b8835612d82816139ee565b97506020890135612d92816139ee565b965060408901356001600160401b0380821115612dae57600080fd5b612dba8c838d01612c43565b909850965060608b0135915080821115612dd357600080fd5b612ddf8c838d01612c43565b909650945060808b0135915080821115612df857600080fd5b50612e058b828c01612c87565b999c989b5096995094979396929594505050565b600080600060608486031215612e2e57600080fd5b8335612e39816139ee565b92506020840135612e49816139ee565b929592945050506040919091013590565b60008060008060808587031215612e7057600080fd5b8435612e7b816139ee565b9350602085810135612e8c816139ee565b93506040860135925060608601356001600160401b0380821115612eaf57600080fd5b818801915088601f830112612ec357600080fd5b813581811115612ed557612ed56139d8565b612ee7601f8201601f191685016137c7565b91508082528984828501011115612efd57600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060008060008060a08789031215612f3657600080fd5b8635612f41816139ee565b95506020870135612f51816139ee565b9450604087013593506060870135925060808701356001600160401b03811115612f7a57600080fd5b612f8689828a01612c87565b979a9699509497509295939492505050565b60008060408385031215612fab57600080fd5b8235612fb6816139ee565b915060208301358015158114612d5057600080fd5b600080600060608486031215612fe057600080fd5b8335612feb816139ee565b9250602084013591506040840135613002816139ee565b809150509250925092565b6000806020838503121561302057600080fd5b82356001600160401b038082111561303757600080fd5b818501915085601f83011261304b57600080fd5b81358181111561305a57600080fd5b86602060608302850101111561306f57600080fd5b60209290920196919550909350505050565b6000602080838503121561309457600080fd5b82356001600160401b03808211156130ab57600080fd5b818501915085601f8301126130bf57600080fd5b8135818111156130d1576130d16139d8565b8060051b91506130e28483016137c7565b8181528481019084860184860187018a10156130fd57600080fd5b600095508594505b8385101561313257803561ffff8116811461311e578687fd5b835260019490940193918601918601613105565b5098975050505050505050565b60006020828403121561315157600080fd5b8135611b6481613a03565b60006020828403121561316e57600080fd5b8151611b6481613a03565b6000806020838503121561318c57600080fd5b82356001600160401b038111156131a257600080fd5b6131ae85828601612c87565b90969095509350505050565b6000606082840312156131cc57600080fd5b604051606081016001600160401b0382821081831117156131ef576131ef6139d8565b816040528435915063ffffffff8216821461320957600080fd5b908252602084013590808216821461322057600080fd5b5060208201526040830135613234816139ee565b60408201529392505050565b60006020828403121561325257600080fd5b5035919050565b6000806040838503121561326c57600080fd5b50508035926020909101359150565b6000806000806060858703121561329157600080fd5b843593506132a160208601612cc8565b925060408501356001600160401b038111156132bc57600080fd5b6132c887828801612c43565b95989497509550505050565b600080604083850312156132e757600080fd5b6132f083612cc8565b91506132fe60208401612cc8565b90509250929050565b60008060006060848603121561331c57600080fd5b61332584612cc8565b925061333360208501612cc8565b9150604084013590509250925092565b600081518084526020808501945080840160005b8381101561337c5781516001600160a01b031687529582019590820190600101613357565b509495945050505050565b600081518084526020808501945080840160005b8381101561337c5781518752958201959082019060010161339b565b600081518084526133cf8160208601602086016138ea565b601f01601f19169290920160200192915050565b600081516133f58185602086016138ea565b9290920192915050565b600080845481600182811c91508083168061341b57607f831692505b602080841082141561343b57634e487b7160e01b86526022600452602486fd5b81801561344f57600181146134605761348d565b60ff1986168952848901965061348d565b60008b81526020902060005b868110156134855781548b82015290850190830161346c565b505084890196505b50505050505061349d81856133e3565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134d9908301846133b7565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156135245783516001600160a01b0316835292840192918401916001016134ff565b50909695505050505050565b602081526000611b646020830184613343565b6040815260006135566040830185613343565b828103602084015261349d8185613387565b602080825282518282018190526000919060409081850190868401855b828110156135cc578151805163ffffffff168552868101516001600160401b0316878601528501516001600160a01b03168585015260609093019290850190600101613585565b5091979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561352457835161ffff16835292840192918401916001016135f5565b602081526000611b646020830184613387565b602081526000611b6460208301846133b7565b6020808252600f908201526e125b9d985b1a59081c995c5d595cdd608a1b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b60208082526027908201527f4552433732313a2055524920717565727920666f72206e6f6e6578697374656e6040820152663a103a37b5b2b760c91b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156137ef576137ef6139d8565b604052919050565b600061ffff80831681851680830382111561381457613814613980565b01949350505050565b6000821982111561383057613830613980565b500190565b600060ff821660ff84168060ff0382111561385257613852613980565b019392505050565b60008261386957613869613996565b500490565b600081600019048311821515161561388857613888613980565b500290565b600061ffff838116908316818110156138a8576138a8613980565b039392505050565b6000828210156138c2576138c2613980565b500390565b600060ff821660ff8416808210156138e1576138e1613980565b90039392505050565b60005b838110156139055781810151838201526020016138ed565b838111156111da5750506000910152565b600181811c9082168061392a57607f821691505b6020821081141561394b57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561396557613965613980565b5060010190565b60008261397b5761397b613996565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ca657600080fd5b6001600160e01b031981168114610ca657600080fdfea2646970667358221220a76c1e24b22d0c6d2ed4392853e4939d219b783afd53835213f5f11314597f6e64736f6c63430008070033000000000000000000000000e4462eb568e2dfbb5b0ca2d3dbb1a35c9aa98aad
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063715018a611610130578063b9c4d9fb116100b8578063dd08b5c91161007c578063dd08b5c914610538578063e985e9c514610540578063f0e9fcd114610553578063f23a6e6114610566578063f2fde38b1461057957600080fd5b8063b9c4d9fb146104a5578063bb3bafd6146104c5578063bc197c81146104e6578063c87b56dd14610512578063d2da63b41461052557600080fd5b8063a22cb465116100ff578063a22cb4651461043a578063ab8ece8b1461044d578063b234de8214610472578063b2c94ee61461047f578063b88d4fde1461049257600080fd5b8063715018a6146104045780638da5cb5b1461040c578063942d8d3c1461041d57806395d89b411461043257600080fd5b80632a55205a116101be5780635c391efb116101825780635c391efb146103975780636352211e146103aa5780636c2f5acd146103bd5780636d73e669146103d057806370a08231146103e357600080fd5b80632a55205a146103225780632d3456701461035457806331ae450b1461036757806342842e0e1461037c5780634721ed6f1461038f57600080fd5b8063095ea7b311610205578063095ea7b3146102b45780630ebd4c7f146102c757806316eeaaa4146102e757806323b872dd146102fc57806324d7806c1461030f57600080fd5b806301247e331461023757806301ffc9a71461024c57806306fdde0314610274578063081812fc14610289575b600080fd5b61024a61024536600461300d565b61058c565b005b61025f61025a36600461313f565b6107bc565b60405190151581526020015b60405180910390f35b61027c610862565b60405161026b9190613628565b61029c610297366004613240565b6108f4565b6040516001600160a01b03909116815260200161026b565b61024a6102c2366004612cf6565b610989565b6102da6102d5366004613240565b610a9a565b60405161026b9190613615565b6102ef610af6565b60405161026b9190613568565b61024a61030a366004612e19565b610b84565b61025f61031d366004612cd9565b610bb5565b610335610330366004613259565b610bee565b604080516001600160a01b03909316835260208301919091520161026b565b61024a610362366004612cd9565b610c29565b61036f610ca9565b60405161026b91906134e3565b61024a61038a366004612e19565b610d57565b61024a610d72565b61024a6103a5366004613081565b610df4565b61029c6103b8366004613240565b610e51565b61024a6103cb366004612cf6565b610ec8565b61024a6103de366004612cd9565b610f38565b6103f66103f1366004612cd9565b610fb2565b60405190815260200161026b565b61024a611039565b6001546001600160a01b031661029c565b61042561106f565b60405161026b91906135d9565b61027c6110ee565b61024a610448366004612f98565b6110fd565b61046061045b366004613240565b611108565b60405160ff909116815260200161026b565b600e5461025f9060ff1681565b61024a61048d366004613179565b611152565b61024a6104a0366004612e5a565b6111a8565b6104b86104b3366004613240565b6111e0565b60405161026b9190613530565b6104d86104d3366004613240565b611259565b60405161026b929190613543565b6104f96104f4366004612d5b565b61130d565b6040516001600160e01b0319909116815260200161026b565b61027c610520366004613240565b61140b565b61024a61053336600461327b565b611474565b61024a6118cb565b61025f61054e366004612d22565b61194a565b61024a610561366004612fcb565b611978565b6104f9610574366004612f1d565b611a2f565b61024a610587366004612cd9565b611aae565b3361059f6001546001600160a01b031690565b6001600160a01b031614806105ba57506105ba600233611b46565b6105df5760405162461bcd60e51b81526004016105d69061373c565b60405180910390fd5b600a5481101561063e5760005b600a546105fa9083906138b0565b81101561063c57600a805480610612576106126139ac565b6000828152602081208201600019908101919091550190558061063481613951565b9150506105ec565b505b60005b818110156107b757600083838381811061065d5761065d6139c2565b90506060020180360381019061067391906131ba565b600a5490915082101561070b576000600a8381548110610695576106956139c2565b60009182526020918290208451910180549285015160408601516001600160a01b0316600160601b026bffffffffffffffffffffffff6001600160401b03909216640100000000026bffffffffffffffffffffffff1990951663ffffffff909416939093179390931792909216179055506107a4565b600a805460018101825560009190915281517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89091018054602084015160408501516001600160a01b0316600160601b026bffffffffffffffffffffffff6001600160401b03909216640100000000026bffffffffffffffffffffffff1990931663ffffffff9095169490941791909117169190911790555b50806107af81613951565b915050610641565b505050565b60006001600160e01b03198216630a85bd0160e11b14806107ed57506001600160e01b03198216630271189760e51b145b806107fc57506107fc82611b6b565b8061080b575061080b82611ba7565b8061082657506001600160e01b03198216635d9dd7eb60e11b145b8061084157506001600160e01b0319821663152a902d60e11b145b8061085c57506001600160e01b03198216632dde656160e21b145b92915050565b60606004805461087190613916565b80601f016020809104026020016040519081016040528092919081815260200182805461089d90613916565b80156108ea5780601f106108bf576101008083540402835291602001916108ea565b820191906000526020600020905b8154815290600101906020018083116108cd57829003601f168201915b5050505050905090565b6000818152600660205260408120546001600160a01b031661096d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105d6565b506000908152600860205260409020546001600160a01b031690565b600061099482610e51565b9050806001600160a01b0316836001600160a01b03161415610a025760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105d6565b336001600160a01b0382161480610a1e5750610a1e813361194a565b610a905760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105d6565b6107b78383611bdc565b6011546060906001600160a01b031615610af157604080516001808252818301909252906020808301908036833701905050905060105481600081518110610ae457610ae46139c2565b6020026020010181815250505b919050565b6060600a805480602002602001604051908101604052809291908181526020016000905b82821015610b7b576000848152602090819020604080516060810182529185015463ffffffff8116835264010000000081046001600160401b031683850152600160601b90046001600160a01b031690820152825260019092019101610b1a565b50505050905090565b610b8e3382611c4a565b610baa5760405162461bcd60e51b81526004016105d6906136eb565b6107b7838383611d21565b6000816001600160a01b0316610bd36001546001600160a01b031690565b6001600160a01b0316148061085c575061085c600283611b46565b60115460105460009182916001600160a01b039091169061271090610c13908661386e565b610c1d919061385a565b915091505b9250929050565b6001546001600160a01b03163314610c535760405162461bcd60e51b81526004016105d6906136b6565b610c5e600282611b46565b15610ca65760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610ca4600282611ebd565b505b50565b6060610cb56002611ed2565b6001600160401b03811115610ccc57610ccc6139d8565b604051908082528060200260200182016040528015610cf5578160200160208202803683370190505b50905060005b610d056002611ed2565b811015610d5357610d17600282611edc565b828281518110610d2957610d296139c2565b6001600160a01b039092166020928302919091019091015280610d4b81613951565b915050610cfb565b5090565b6107b7838383604051806020016040528060008152506111a8565b33610d856001546001600160a01b031690565b6001600160a01b03161480610da05750610da0600233611b46565b610dbc5760405162461bcd60e51b81526004016105d69061373c565b600e805460ff191660011790556040517f59d3ce47d6ad6c6003cef97d136155b29d88653eb355c8bed6e03fbf694570ca90600090a1565b33610e076001546001600160a01b031690565b6001600160a01b03161480610e225750610e22600233611b46565b610e3e5760405162461bcd60e51b81526004016105d69061373c565b8051610ca490600c906020840190612b15565b6000818152600660205260408120546001600160a01b03168061085c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105d6565b33610edb6001546001600160a01b031690565b6001600160a01b03161480610ef65750610ef6600233611b46565b610f125760405162461bcd60e51b81526004016105d69061373c565b601180546001600160a01b0319166001600160a01b039390931692909217909155601055565b6001546001600160a01b03163314610f625760405162461bcd60e51b81526004016105d6906136b6565b610f6d600282611b46565b610ca65760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610ca4600282611ee8565b60006001600160a01b03821661101d5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105d6565b506001600160a01b031660009081526007602052604090205490565b6001546001600160a01b031633146110635760405162461bcd60e51b81526004016105d6906136b6565b61106d6000611efd565b565b6060600c8054806020026020016040519081016040528092919081815260200182805480156108ea57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116110ac5790505050505050905090565b60606005805461087190613916565b610ca4338383611f4f565b6000818152600660205260408120546001600160a01b031661113c5760405162461bcd60e51b81526004016105d690613780565b506000908152600d602052604090205460ff1690565b336111656001546001600160a01b031690565b6001600160a01b031614806111805750611180600233611b46565b61119c5760405162461bcd60e51b81526004016105d69061373c565b6107b7600f8383612bba565b6111b23383611c4a565b6111ce5760405162461bcd60e51b81526004016105d6906136eb565b6111da8484848461201e565b50505050565b6011546060906001600160a01b031615610af1576040805160018082528183019092529060208083019080368337505060115482519293506001600160a01b031691839150600090611234576112346139c2565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b60115460609081906001600160a01b031615611308576040805160018082528183019092529060208083019080368337505060115482519294506001600160a01b0316918491506000906112af576112af6139c2565b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509050601054816000815181106112fb576112fb6139c2565b6020026020010181815250505b915091565b6000600260005414156113625760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d6565b600260005560018614801561137657508584145b6113b25760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b60448201526064016105d6565b6113f188888860008181106113c9576113c96139c2565b90506020020135878760008181106113e3576113e36139c2565b905060200201358686612051565b5063bc197c8160e01b600160005598975050505050505050565b6000818152600660205260409020546060906001600160a01b03166114425760405162461bcd60e51b81526004016105d690613780565b600f61144d836124e8565b60405160200161145e9291906133ff565b6040516020818303038152906040529050919050565b61147d84610e51565b6001600160a01b0316336001600160a01b0316146114d35760405162461bcd60e51b815260206004820152601360248201527226bab9ba103132903a37b5b2b71037bbb732b960691b60448201526064016105d6565b600c5460ff841611156115185760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081b195d995b609a1b60448201526064016105d6565b6000848152600d602052604090205460ff8085169161153991166001613835565b60ff16146115955760405162461bcd60e51b8152602060048201526024808201527f43616e206f6e6c792075706772616465206f6e65206c6576656c20617420612060448201526374696d6560e01b60648201526084016105d6565b6000806115a36001866138c7565b905060005b838110156117855760008585838181106115c4576115c46139c2565b9050602002013590508781141561161d5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742068617665206475706c696361746520746f6b656e730000000060448201526064016105d6565b60005b858110156116ac578083148061164e5750868682818110611643576116436139c2565b905060200201358214155b61169a5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742068617665206475706c696361746520746f6b656e730000000060448201526064016105d6565b806116a481613951565b915050611620565b506116b681610e51565b6001600160a01b0316336001600160a01b03161461170c5760405162461bcd60e51b815260206004820152601360248201527226bab9ba103132903a37b5b2b71037bbb732b960691b60448201526064016105d6565b6000818152600d6020526040902054600c9061172d9060019060ff166138c7565b60ff1681548110611740576117406139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff168461176f91906137f7565b935050808061177d90613951565b9150506115a8565b5061ffff8216600c6117986001846138c7565b60ff16815481106117ab576117ab6139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600c8360ff16815481106117e5576117e56139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611813919061388d565b61ffff161461185c5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b595c99d9481c995c5d595cdd605a1b60448201526064016105d6565b60005b8381101561189a5761188885858381811061187c5761187c6139c2565b905060200201356125e5565b8061189281613951565b91505061185f565b506000868152600d60205260409020546118c39087906118be9060ff166001613835565b612681565b505050505050565b336118de6001546001600160a01b031690565b6001600160a01b031614806118f957506118f9600233611b46565b6119155760405162461bcd60e51b81526004016105d69061373c565b600e805460ff191690556040517fc2a8834045efeaf0b37df1cf2e5979bff82a0c7f93c99b649a004940ef3cda4590600090a1565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b3361198b6001546001600160a01b031690565b6001600160a01b031614806119a657506119a6600233611b46565b6119c25760405162461bcd60e51b81526004016105d69061373c565b6040516323b872dd60e01b81523060048201526001600160a01b038281166024830152604482018490528416906323b872dd90606401600060405180830381600087803b158015611a1257600080fd5b505af1158015611a26573d6000803e3d6000fd5b50505050505050565b600060026000541415611a845760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d6565b6002600055611a968686868686612051565b5063f23a6e6160e01b60016000559695505050505050565b6001546001600160a01b03163314611ad85760405162461bcd60e51b81526004016105d6906136b6565b6001600160a01b038116611b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d6565b610ca681611efd565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60006001600160e01b031982166380ac58cd60e01b1480611b9c57506001600160e01b03198216635b5e139f60e01b145b8061085c575061085c825b60006001600160e01b03198216632a9f3abf60e11b148061085c57506301ffc9a760e01b6001600160e01b031983161461085c565b600081815260086020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c1182610e51565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600660205260408120546001600160a01b0316611cc35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105d6565b6000611cce83610e51565b9050806001600160a01b0316846001600160a01b03161480611d095750836001600160a01b0316611cfe846108f4565b6001600160a01b0316145b80611d195750611d19818561194a565b949350505050565b826001600160a01b0316611d3482610e51565b6001600160a01b031614611d985760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105d6565b6001600160a01b038216611dfa5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105d6565b611e05600082611bdc565b6001600160a01b0383166000908152600760205260408120805460019290611e2e9084906138b0565b90915550506001600160a01b0382166000908152600760205260408120805460019290611e5c90849061381d565b909155505060008181526006602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000611b64836001600160a01b0384166126dc565b600061085c825490565b6000611b6483836127cf565b6000611b64836001600160a01b0384166127f9565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611fb15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105d6565b6001600160a01b03838116600081815260096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612029848484611d21565b61203584848484612848565b6111da5760405162461bcd60e51b81526004016105d690613664565b600e5460ff166120995760405162461bcd60e51b8152602060048201526013602482015272526564656d7074696f6e20696e61637469766560681b60448201526064016105d6565b336001600160a01b037f000000000000000000000000e4462eb568e2dfbb5b0ca2d3dbb1a35c9aa98aad161480156120d15750836001145b61210b5760405162461bcd60e51b815260206004820152600b60248201526a125b9d985b1a590813919560aa1b60448201526064016105d6565b60008080604084141561220a57612124848601866132d4565b909350915060ff8216158015906121405750600c5460ff831611155b61215c5760405162461bcd60e51b81526004016105d69061363b565b60006121696001846138c7565b90506000600c8260ff1681548110612183576121836139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff161180156121e8575086600c8260ff16815481106121c4576121c46139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff16145b6122045760405162461bcd60e51b81526004016105d69061363b565b506123f3565b60608414156123bc5761221f84860186613307565b919450925090506001600160a01b03881661223982610e51565b6001600160a01b0316146122885760405162461bcd60e51b815260206004820152601660248201527526bab9ba1031329037bbb732b91037b3103a37b5b2b760511b60448201526064016105d6565b6000818152600d602052604090205460ff908116908316158015906122b25750600c5460ff841611155b80156122c1575060008160ff16115b80156122d257508060ff168360ff16115b6122ee5760405162461bcd60e51b81526004016105d69061363b565b6000600c6122fd6001846138c7565b60ff1681548110612310576123106139c2565b60009182526020909120601082040154600f9091166002026101000a900461ffff16600c61233f6001876138c7565b60ff1681548110612352576123526139c2565b90600052602060002090601091828204019190066002029054906101000a900461ffff16612380919061388d565b905060008161ffff161180156123995750878161ffff16145b6123b55760405162461bcd60e51b81526004016105d69061363b565b50506123f3565b60405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206461746160a01b60448201526064016105d6565b60405163d55f2d9d60e01b815230600482015261ffff87166024820152339063d55f2d9d90604401600060405180830381600087803b15801561243557600080fd5b505af1925050508015612446575060015b6124b1573d808015612474576040519150601f19603f3d011682016040523d82523d6000602084013e612479565b606091505b5060405162461bcd60e51b815260206004820152600c60248201526b4275726e206661696c75726560a01b60448201526064016105d6565b60ff83166124c8576124c38883612955565b6124de565b8260ff16600114156124de576124de8183612681565b5050505050505050565b60608161250c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612536578061252081613951565b915061252f9050600a8361385a565b9150612510565b6000816001600160401b03811115612550576125506139d8565b6040519080825280601f01601f19166020018201604052801561257a576020820181803683370190505b5090505b8415611d195761258f6001836138b0565b915061259c600a8661396c565b6125a790603061381d565b60f81b8183815181106125bc576125bc6139c2565b60200101906001600160f81b031916908160001a9053506125de600a8661385a565b945061257e565b60006125f082610e51565b90506125fd600083611bdc565b6001600160a01b03811660009081526007602052604081208054600192906126269084906138b0565b909155505060008281526006602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4610ca4565b6000828152600d6020908152604091829020805460ff191660ff85169081179091558251858152918201527fc5c7f0a486ea466bf8955dd7e7d12faffbd2fcf783846aee0e3120e99be2d86b91015b60405180910390a15050565b600081815260018301602052604081205480156127c55760006127006001836138b0565b8554909150600090612714906001906138b0565b9050818114612779576000866000018281548110612734576127346139c2565b9060005260206000200154905080876000018481548110612757576127576139c2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061278a5761278a6139ac565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061085c565b600091505061085c565b60008260000182815481106127e6576127e66139c2565b9060005260206000200154905092915050565b60008181526001830160205260408120546128405750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561085c565b50600061085c565b60006001600160a01b0384163b1561294a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061288c9033908990889088906004016134a6565b602060405180830381600087803b1580156128a657600080fd5b505af19250505080156128d6575060408051601f3d908101601f191682019092526128d39181019061315c565b60015b612930573d808015612904576040519150601f19603f3d011682016040523d82523d6000602084013e612909565b606091505b5080516129285760405162461bcd60e51b81526004016105d690613664565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611d19565b506001949350505050565b600b805490600061296583613951565b919050555061297682600b546129d2565b600b80546000908152600d6020908152604091829020805460ff191660ff861690811790915592548251908152908101929092527fc5c7f0a486ea466bf8955dd7e7d12faffbd2fcf783846aee0e3120e99be2d86b91016126d0565b6001600160a01b038216612a285760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105d6565b6000818152600660205260409020546001600160a01b031615612a8d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105d6565b6001600160a01b0382166000908152600760205260408120805460019290612ab690849061381d565b909155505060008181526006602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610ca4565b82805482825590600052602060002090600f01601090048101928215612bae5791602002820160005b83821115612b7e57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302612b3e565b8015612bac5782816101000a81549061ffff0219169055600201602081600101049283019260010302612b7e565b505b50610d53929150612c2e565b828054612bc690613916565b90600052602060002090601f016020900481019282612be85760008555612bae565b82601f10612c015782800160ff19823516178555612bae565b82800160010185558215612bae579182015b82811115612bae578235825591602001919060010190612c13565b5b80821115610d535760008155600101612c2f565b60008083601f840112612c5557600080fd5b5081356001600160401b03811115612c6c57600080fd5b6020830191508360208260051b8501011115610c2257600080fd5b60008083601f840112612c9957600080fd5b5081356001600160401b03811115612cb057600080fd5b602083019150836020828501011115610c2257600080fd5b803560ff81168114610af157600080fd5b600060208284031215612ceb57600080fd5b8135611b64816139ee565b60008060408385031215612d0957600080fd5b8235612d14816139ee565b946020939093013593505050565b60008060408385031215612d3557600080fd5b8235612d40816139ee565b91506020830135612d50816139ee565b809150509250929050565b60008060008060008060008060a0898b031215612d7757600080fd5b8835612d82816139ee565b97506020890135612d92816139ee565b965060408901356001600160401b0380821115612dae57600080fd5b612dba8c838d01612c43565b909850965060608b0135915080821115612dd357600080fd5b612ddf8c838d01612c43565b909650945060808b0135915080821115612df857600080fd5b50612e058b828c01612c87565b999c989b5096995094979396929594505050565b600080600060608486031215612e2e57600080fd5b8335612e39816139ee565b92506020840135612e49816139ee565b929592945050506040919091013590565b60008060008060808587031215612e7057600080fd5b8435612e7b816139ee565b9350602085810135612e8c816139ee565b93506040860135925060608601356001600160401b0380821115612eaf57600080fd5b818801915088601f830112612ec357600080fd5b813581811115612ed557612ed56139d8565b612ee7601f8201601f191685016137c7565b91508082528984828501011115612efd57600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060008060008060a08789031215612f3657600080fd5b8635612f41816139ee565b95506020870135612f51816139ee565b9450604087013593506060870135925060808701356001600160401b03811115612f7a57600080fd5b612f8689828a01612c87565b979a9699509497509295939492505050565b60008060408385031215612fab57600080fd5b8235612fb6816139ee565b915060208301358015158114612d5057600080fd5b600080600060608486031215612fe057600080fd5b8335612feb816139ee565b9250602084013591506040840135613002816139ee565b809150509250925092565b6000806020838503121561302057600080fd5b82356001600160401b038082111561303757600080fd5b818501915085601f83011261304b57600080fd5b81358181111561305a57600080fd5b86602060608302850101111561306f57600080fd5b60209290920196919550909350505050565b6000602080838503121561309457600080fd5b82356001600160401b03808211156130ab57600080fd5b818501915085601f8301126130bf57600080fd5b8135818111156130d1576130d16139d8565b8060051b91506130e28483016137c7565b8181528481019084860184860187018a10156130fd57600080fd5b600095508594505b8385101561313257803561ffff8116811461311e578687fd5b835260019490940193918601918601613105565b5098975050505050505050565b60006020828403121561315157600080fd5b8135611b6481613a03565b60006020828403121561316e57600080fd5b8151611b6481613a03565b6000806020838503121561318c57600080fd5b82356001600160401b038111156131a257600080fd5b6131ae85828601612c87565b90969095509350505050565b6000606082840312156131cc57600080fd5b604051606081016001600160401b0382821081831117156131ef576131ef6139d8565b816040528435915063ffffffff8216821461320957600080fd5b908252602084013590808216821461322057600080fd5b5060208201526040830135613234816139ee565b60408201529392505050565b60006020828403121561325257600080fd5b5035919050565b6000806040838503121561326c57600080fd5b50508035926020909101359150565b6000806000806060858703121561329157600080fd5b843593506132a160208601612cc8565b925060408501356001600160401b038111156132bc57600080fd5b6132c887828801612c43565b95989497509550505050565b600080604083850312156132e757600080fd5b6132f083612cc8565b91506132fe60208401612cc8565b90509250929050565b60008060006060848603121561331c57600080fd5b61332584612cc8565b925061333360208501612cc8565b9150604084013590509250925092565b600081518084526020808501945080840160005b8381101561337c5781516001600160a01b031687529582019590820190600101613357565b509495945050505050565b600081518084526020808501945080840160005b8381101561337c5781518752958201959082019060010161339b565b600081518084526133cf8160208601602086016138ea565b601f01601f19169290920160200192915050565b600081516133f58185602086016138ea565b9290920192915050565b600080845481600182811c91508083168061341b57607f831692505b602080841082141561343b57634e487b7160e01b86526022600452602486fd5b81801561344f57600181146134605761348d565b60ff1986168952848901965061348d565b60008b81526020902060005b868110156134855781548b82015290850190830161346c565b505084890196505b50505050505061349d81856133e3565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134d9908301846133b7565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156135245783516001600160a01b0316835292840192918401916001016134ff565b50909695505050505050565b602081526000611b646020830184613343565b6040815260006135566040830185613343565b828103602084015261349d8185613387565b602080825282518282018190526000919060409081850190868401855b828110156135cc578151805163ffffffff168552868101516001600160401b0316878601528501516001600160a01b03168585015260609093019290850190600101613585565b5091979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561352457835161ffff16835292840192918401916001016135f5565b602081526000611b646020830184613387565b602081526000611b6460208301846133b7565b6020808252600f908201526e125b9d985b1a59081c995c5d595cdd608a1b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b60208082526027908201527f4552433732313a2055524920717565727920666f72206e6f6e6578697374656e6040820152663a103a37b5b2b760c91b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156137ef576137ef6139d8565b604052919050565b600061ffff80831681851680830382111561381457613814613980565b01949350505050565b6000821982111561383057613830613980565b500190565b600060ff821660ff84168060ff0382111561385257613852613980565b019392505050565b60008261386957613869613996565b500490565b600081600019048311821515161561388857613888613980565b500290565b600061ffff838116908316818110156138a8576138a8613980565b039392505050565b6000828210156138c2576138c2613980565b500390565b600060ff821660ff8416808210156138e1576138e1613980565b90039392505050565b60005b838110156139055781810151838201526020016138ed565b838111156111da5750506000910152565b600181811c9082168061392a57607f821691505b6020821081141561394b57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561396557613965613980565b5060010190565b60008261397b5761397b613996565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ca657600080fd5b6001600160e01b031981168114610ca657600080fdfea2646970667358221220a76c1e24b22d0c6d2ed4392853e4939d219b783afd53835213f5f11314597f6e64736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e4462eb568e2dfbb5b0ca2d3dbb1a35c9aa98aad
-----Decoded View---------------
Arg [0] : creditsAddress (address): 0xe4462eb568E2DFbb5b0cA2D3DbB1A35C9Aa98aad
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e4462eb568e2dfbb5b0ca2d3dbb1a35c9aa98aad
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.