File size: 72,779 Bytes
f998fcd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
{
"language": "Solidity",
"sources": {
"contracts/ChAOS.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.17;\n\n// @title: ChAOS\n// @creator: Dana Taylor\n// @author: @pepperonick, with help from @andrewjiang\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// //\n// 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000OO000OOOOOOOOOO0000000 //\n// 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000OO000OOOOOOOOOOOOO0000 //\n// 000000000000000000000000000000000000000OOOkkOOOkkkOO000000000000000000000000000000000000000000OO000OOOOOOOOOOOOO0000 //\n// 0000000000000000000000000000000000O000Oxool::cc;;:clldxkO000000000000000000000000000000O000000OO000OOOOOOOOOOOOO0000 //\n// 00000000000000000000000000000000000OOOkl;;'. ..........,:ok00O00O00000000000000000000000000000OO000OOOOOOOOOOOOOO000 //\n// 000000000000000000000000000000000OOOOkxc... .'ldk00000000000000000000000000000000OO000OOOOOOOOOOOOOOOOO //\n// 00000000000000000000000O0000000OOkdl:;,.. ..;xOO00000000000000000000000000000OO000OOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000OOOOxlc;..... .... .:kOO00000000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000O00Ox:'''...... ..;lddoc;,... .cO0000OO0000000000OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000000x;.;c,.... ...;ok00OOxdl:'. .'dOOO00000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000O0Oc'co:'... .'ck00KK0Okxoc,. .ckOOO00000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000k;;l'..... .:x0K0kdllc:;,. .;xOOO00000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000k:,'. ..:xOxlc:;,,,'.. 'dkkOO0000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000Ol'... ..:lxkddxdc:cl:.. .ckOO00000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000OOo,... .:ddkkddkOkxdo;. ...'ldk0000000000000000000OOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000Okl;,'. .,coddoccxkxoc;.. .. .,ok00OO00000OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000Okdc,... . .:ooooloxxo:;'.. . .;dOO0OO00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000kdc,.... .,:cldollol:;,. ...;xOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000kl;;;,'.. .;loddlloc;,. . .'.;kOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000x;,:;,;'. .coddoc:,.. . .'.;kOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000Okl:lodo;. .'''....... .'..:kOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000OOOxxkkl'. .',,,,;;'. ...'oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000OO0OOOkc. .,;:ccc:'. .,oxkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000000OOx:'. .';:cll:'. .:odxkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000OOOkl,.. .,;:clc'. .,ldxkkkkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000000kc:,. .:::cc;... .'codxkOOkkxdkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000000kddc. .;lcc:,.... .coddxkOOkkdoldOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 00000000000000000000000000000OOko;. ':lc;,'.....,cloxkO00Oxdl:cxOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000000000kxl,.. .;c::,. ..';clloxkO00Oxdoc;lkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 0000000000000000000000000000000OOd:'. .;ll:'. .';coolodkO00Okdol:cxOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000000000000kl;. ..,,,,''...,lodc. .';:looddxkO0Okxdl:cxOkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000000000000kl,. .;ldxxxddolc;,:odd;....':lodxkkOOOkxdoc:dOkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO //\n// 000000000000000000000000000000000k:'.'lxkkkkkxxdddoc:coo:',;,..;:ldxkkOOkxdoc:okkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO0 //\n// 000000000000000000000000000000000kc,;okO0KK0Oxdddollc:cc;;lol:'.';oxkkOOkxdoc:okkkkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOO00 //\n// 000000000000000000000000000000000kccoxk0000Okxxxdollccc:;:oddo;';:ldxkkkxxdl::oOkkkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOO000 //\n// 000000000000000000000000000000000xodxxk000Okxxxxdoolccccc::lloc;:cldxkkkxddl::dOkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOO00000 //\n// 0000000000000000000000000000000K0xodxxkOOkkkkkxddoollccccc:;;:::ccldxkkkxdol:;dOkOOOOOOOOOOOOOOOOOOOOOOOOOOOO0000000 //\n// 000000000000000000KKK0000000000KOdoddxxxxxkkkxdooolllllllcc::;;;::coxkkkkxol:;oOOOOOOOOOOOOOOOOOOOOOOOOOOOO000000000 //\n// 000000000000000000KKKKK00000000KOdoxdoddxxxxxxolcclllllllcccc::;,,;oxkkkkxol:;oOOOOOOOOOOOOOOOOOOOOOOOOOO00000000000 //\n// 0000000000000000000KKKK00000000KOdoxxdddddddddol:::cloollccccc::;,,lkkOOkxolc:okOOOOOOOOOOOOOOOOOOOOOOOO000000000000 //\n// 00000000000000000KKKKKKK0000000KOooxxdooddoooooolc:::loollccccc::;;lkOOkkdolc;lkOOOOOOOOOOOOOOOOOOOOOO00000000000000 //\n// 000000000000KKKKKKKKK0000000000Kkooddolooooooooolll:;:lollccccc::::okOkkxdolc;lkOkkkOOOOOOOOOOOOOOOOOO00000000000000 //\n// 000KKK00KKKKKKKKKKKKK00000000000kooddl::loooooooolllc::lolcccccc:::okkkxxdolc;;lkkkkkkOOOOOOOOOOOOOOO000000000000000 //\n// 00KKKK0KKKKKKKKKKKKKKKKK00000000kooool;':looooooolllc:;collccccc:::lxkkxdoolc:,;dOkkkkOOOOOOOOOOOOOOOOOO000000000000 //\n// 00KKKKKKKKKKKKKKKKKKKKKK00000000koloooc,,cllooooollllc::lolllccc::;cdxxxdollc:,,okkkkkkOOOOOOOOOOOOOO000000000000000 //\n// 0KKKKKKKKKKKKKKKKKKKKKKKK0000000Odloodol;:lllloollllcc:;collllccc:;:oxxxdolcc;''cxkkkkkOOOOOOOOOOOO00000000000000000 //\n// KKKKKKKKKKKKKKKKKKKKKKKKKKK000000kolooddlcclllooolllcc:;:lllllccc:;:oxxxdolc:;'';dkkkkkOkOOOOOOOO0000000000000000000 //\n// KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK0K0xloodddoccllloollcc::,;cllllccc:;:odxdoolc:,'',lkOkkOOOOOOOOOO00000000000000000000 //\n// KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK0xllodddoc::cllllcc::,,:llccccccclodddolc:;,''';dOOkOOOOOOOOOO00000000000000000000 //\n// KKKKKKKKKKKKKKKKKKKKKKKKKKKKKK000OOxlloodxddc;;clllc::;,,;ccccccloodddoolcc;,''',,lkkOOOkOOOOOOOO0000000000000000000 //\n// KKKKKKKKKKKKKKKKKKKKKKKKKK00Okxdolcc::cloddddl;:clcc:;;,',:::cloddxddolcc::;,'',,,lkOOOOOOOOOOOOO0000000000000000KKK //\n// KKKKKKKKKKKKKKKKKKKK00OOkkxdollcccccc::cclodddolcc::;;,,',clooddxxdolcc::;,,'',,,;oOOOOOOOOOOOOOOO0000000000000000KK //\n// KKKKKKKKKKKKKKK00OOkkxxddooollcccccccccc:cloddxxoc;,,,,;coxxxxxddolcc::;;,,,,,,,,cxOOOkOOOOOOOOOO000000000000000000K //\n// KKKKKKKKKKKK00Okxxxdddxxddoolcccccccccccc::coddxxdl;;codxkxxddollcc:;,,,,,,,,,,,:dkkOOOOOOOOOOOOO0000000000000000000 //\n// KKKKKKKKKKK0kxxkkxxdddxxxdolc:::::::::::::;;codxxxddxxkxxdoollcc::,''''',,,,,,,:dkOOOOOOOOOOOOOOO0000000000000000000 //\n// KKKKKKKKKK0xdkOOOkxddxxxdoc::::::::ccccc:::;;coxxxkkxddoollcc:;,'......'''''',:dkkOkkkkOOOOOOOO000000000000000000000 //\n// KKKKKKKKKKOxxkO00kkkxxxkxxdooooooooooooooloodxxxxxdoollcc:;,'.. .......',cdkkkkkOOOOOOOO000000000000000000000000 //\n// KKKKKKKKKKOxkkO00000Okkkkkxxxddddddddddxxxxxxxdoollcc:;,,'........ ...,:cclloxkkOOOOOOO00000000000000000000000000 //\n// KKKKKKKKKKOxxkkOO000OOkkxxdddxxxxkkkkkkkxdddollcc:;;,;;:::cc:;'''''....,;cloodooodxkOOOO000000000000000000000KKKKKKK //\n// KKKKKKKKKKKOxxkkkkkkkxxdoolloxkxxkkkkxddoolllc:;,,;:lodxddoool:;;ccllccccclddxxxxdxkkOOOOO00000000000000000KKKKKKKKK //\n// KKKKXXXXKKXK0kxxdxxxxdddddxxkxxxxxxxdoollccc:;;;;:coxxxxddoc:cll::loddddddddxkkkkkOOOOOOOOOOkkO00000000000KKKKKKKKKK //\n// XXXXXXXXXXXXKK0Okdoooodxxxxxdxxdddoollc:::::::::ccclooodoloolc;cc:coddxxkxxxxkkOOOO0000OOOOOOOkOO00000000KKKKKKKKKKK //\n// XXXXXXXXXXXXKKKK0kxdodddoodddddooollc::::::ccccc::::colcoocldo:',:;:cllllooodddxxxxxkkxxxxxddxkkkOkO0000KKKKKKKKKKKK //\n// XXXXXXXXXXKKKK00OOkxxdllloooollllc;'.',;::ccllllllllldo::o:,;:c;;clldddddddddddddoooooolllllcclloxkxxO00KKKKKKKKKKKK //\n// XXXXXXXXXKK0000000OOkxddolllcclc:;,,;clodxkkkkkkOOkkkkkxdddoodddxkOOOOOOOOOOOOOOOOOOOOkkkkxxxxddodxdok0KKKKKKKKKKKKK //\n// XXXXXXXKKK00000000OOOOOkkkkkkkkxxxkkkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO000KKKK0000OOOOOOkkO0KKKKKKKKKKKKKK //\n// XXXXXXXKKKK00000000OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO000KKKKKKKKKKK000000KKKKKKKKKKKKKKKK //\n// XXXXXXXXKKKK000000000OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO0000KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK //\n// //\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nimport '@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol';\nimport '@manifoldxyz/creator-core-solidity/contracts/core/IERC721CreatorCore.sol';\nimport '@manifoldxyz/creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol';\n\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\nimport '@openzeppelin/contracts/utils/Strings.sol';\nimport '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';\nimport '@openzeppelin/contracts/utils/introspection/ERC165.sol';\nimport '@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol';\n\ncontract ChAOS is AdminControl, ICreatorExtensionTokenURI {\n enum ContractStatus {\n Paused,\n Premint,\n Public,\n Closed\n }\n\n using Strings for uint256;\n\n ContractStatus public contractStatus = ContractStatus.Paused;\n address private _creator;\n address private _writerAddress;\n uint256 public _price;\n bytes32 public _merkleRoot;\n uint256 public _maxPremintPerWallet = 2;\n uint256 public _maxMintPerTransaction = 2;\n bool public _isRevealed = false;\n string public _prerevealImageURI;\n string public _prerevealAnimatedURI;\n uint256 public totalSupply = 0;\n string private baseURI;\n uint16 public _maxSupply = 1000;\n\n // Used to make sure wallet gets at most 2 mints during premint\n mapping(address => uint256) public addressToMint;\n\n constructor(\n address creator,\n uint256 price,\n address writerAddress,\n string memory prerevealImageURI,\n string memory prerevealAnimatedURI\n ) {\n _creator = creator;\n _price = price;\n _writerAddress = writerAddress;\n _prerevealImageURI = prerevealImageURI;\n _prerevealAnimatedURI = prerevealAnimatedURI;\n }\n\n modifier callerIsUser() {\n require(tx.origin == msg.sender, 'The caller is another contract');\n _;\n }\n\n function configure(address creator) public adminRequired {\n _creator = creator;\n }\n\n function setContractStatus(ContractStatus status) public adminRequired {\n contractStatus = status;\n }\n\n function setMaxSupply(uint16 maxSupply) public adminRequired {\n _maxSupply = maxSupply;\n }\n\n function setPrerevealImageURI(string calldata prerevealImageURI)\n public\n adminRequired\n {\n _prerevealImageURI = prerevealImageURI;\n }\n\n function setPrerevealAnimatedURI(string calldata prerevealAnimatedURI)\n public\n adminRequired\n {\n _prerevealAnimatedURI = prerevealAnimatedURI;\n }\n\n function setIsRevealed(bool isRevealed) public adminRequired {\n _isRevealed = isRevealed;\n }\n\n modifier isPaused() {\n require(\n contractStatus == ContractStatus.Paused,\n 'Contract cannot be in premint or open for minting'\n );\n _;\n }\n\n modifier isPublic() {\n require(\n contractStatus == ContractStatus.Public,\n 'Contract must be open for minting'\n );\n _;\n }\n\n modifier isPublicOrPremint() {\n require(\n contractStatus == ContractStatus.Public ||\n contractStatus == ContractStatus.Premint,\n 'Contract must be open for premint or public mint'\n );\n _;\n }\n\n modifier withRightQuantities(uint256 quantity) {\n require(\n quantity <= _maxMintPerTransaction,\n string(\n abi.encodePacked(\n 'Cannot mint more than ',\n Strings.toString(_maxMintPerTransaction),\n ' per transaction'\n )\n )\n );\n require(\n quantity + totalSupply <= _maxSupply,\n 'Cannot mint more than max supply'\n );\n _;\n }\n\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AdminControl, IERC165)\n returns (bool)\n {\n return\n interfaceId == type(ICreatorExtensionTokenURI).interfaceId ||\n AdminControl.supportsInterface(interfaceId) ||\n super.supportsInterface(interfaceId);\n }\n\n function canPremint(address account, bytes32[] calldata proof)\n public\n view\n returns (bool)\n {\n return\n MerkleProof.verify(proof, _merkleRoot, generateMerkleLeaf(account));\n }\n\n function premint(uint256 quantity, bytes32[] calldata proof)\n public\n payable\n isPublicOrPremint\n withRightQuantities(quantity)\n {\n require(canPremint(msg.sender, proof), 'Failed to verify wallet');\n\n require(\n addressToMint[msg.sender] + quantity <= _maxPremintPerWallet,\n string.concat(\n 'Cannot premint more than ',\n Strings.toString(_maxPremintPerWallet),\n ' per wallet'\n )\n );\n\n require(msg.value == _price * quantity, 'Wrong quantity of ETH sent');\n\n IERC721CreatorCore(_creator).mintExtensionBatch(\n msg.sender,\n uint16(quantity)\n );\n\n totalSupply += quantity;\n addressToMint[msg.sender] += quantity;\n }\n\n function mint(uint256 quantity)\n public\n payable\n callerIsUser\n isPublic\n withRightQuantities(quantity)\n {\n require(msg.value == _price * quantity, 'Wrong quantity of ETH sent');\n\n IERC721CreatorCore(_creator).mintExtensionBatch(\n msg.sender,\n uint16(quantity)\n );\n\n totalSupply += quantity;\n }\n\n function setPrice(uint256 price) public adminRequired {\n _price = price;\n }\n\n function setMaxPremintPerWallet(uint256 max) public adminRequired {\n _maxPremintPerWallet = max;\n }\n\n function setMaxMintPerTransaction(uint256 max) public adminRequired {\n _maxMintPerTransaction = max;\n }\n\n function generateMerkleLeaf(address account)\n private\n pure\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(account));\n }\n\n function setMerkleRoot(bytes32 merkleRoot) public adminRequired {\n _merkleRoot = merkleRoot;\n }\n\n function setBaseURI(string memory _baseURI) public adminRequired {\n baseURI = _baseURI;\n }\n\n function tokenURI(address creator, uint256 tokenId)\n public\n view\n override\n returns (string memory)\n {\n require(creator == _creator, 'Invalid token');\n require(tokenId <= totalSupply, 'Token does not exist yet');\n\n if (!_isRevealed) {\n return\n string.concat(\n 'data:application/json;utf8,',\n '{\"name\":\"ChAOS #',\n tokenId.toString(),\n '\",',\n '\"created_by\":\"Dana Taylor\",',\n '\"description\":\"Chaos & Couture is a tell-all by Dana Taylor of over a decade worth of stories, challenges, and triumphs as a model in the highest spheres of the fashion industry. Her art is a testament of truth, self-exploration & personal growth. With a unique sense of creativity, Dana has taken her darkest hour and made a shining beacon of light. This collection is an inspiration to believe that you can be more than one thing in this life.\\\\n\\\\nArtist: Dana Taylor\",',\n '\"image\":\"',\n _prerevealImageURI,\n '\",\"image_url\":\"',\n _prerevealImageURI,\n '\",\"animation_url\":\"',\n _prerevealAnimatedURI,\n '\"}'\n );\n } else {\n return\n bytes(baseURI).length > 0\n ? string.concat(baseURI, tokenId.toString(), '.json')\n : '';\n }\n }\n\n function setWriterAddress(address writerAddress) public adminRequired {\n require(writerAddress != address(0), 'Writer address cannot be 0x0');\n _writerAddress = writerAddress;\n }\n\n function withdraw(address to, uint256 amount) public onlyOwner {\n uint256 balance = address(this).balance;\n require(balance >= amount, 'Cannot withdraw more than balance');\n\n address creator = payable(to);\n address writer = payable(_writerAddress);\n\n bool success;\n\n (success, ) = creator.call{value: ((amount * 900) / 1000)}('');\n require(success, 'Transaction Unsuccessful');\n\n (success, ) = writer.call{value: ((amount * 100) / 1000)}('');\n require(success, 'Transaction Unsuccessful');\n }\n}\n"
},
"@openzeppelin/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"@manifoldxyz/creator-core-solidity/contracts/core/IERC721CreatorCore.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"./ICreatorCore.sol\";\n\n/**\n * @dev Core ERC721 creator interface\n */\ninterface IERC721CreatorCore is ICreatorCore {\n\n /**\n * @dev mint a token with no extension. Can only be called by an admin.\n * Returns tokenId minted\n */\n function mintBase(address to) external returns (uint256);\n\n /**\n * @dev mint a token with no extension. Can only be called by an admin.\n * Returns tokenId minted\n */\n function mintBase(address to, string calldata uri) external returns (uint256);\n\n /**\n * @dev batch mint a token with no extension. Can only be called by an admin.\n * Returns tokenId minted\n */\n function mintBaseBatch(address to, uint16 count) external returns (uint256[] memory);\n\n /**\n * @dev batch mint a token with no extension. Can only be called by an admin.\n * Returns tokenId minted\n */\n function mintBaseBatch(address to, string[] calldata uris) external returns (uint256[] memory);\n\n /**\n * @dev mint a token. Can only be called by a registered extension.\n * Returns tokenId minted\n */\n function mintExtension(address to) external returns (uint256);\n\n /**\n * @dev mint a token. Can only be called by a registered extension.\n * Returns tokenId minted\n */\n function mintExtension(address to, string calldata uri) external returns (uint256);\n\n /**\n * @dev batch mint a token. Can only be called by a registered extension.\n * Returns tokenIds minted\n */\n function mintExtensionBatch(address to, uint16 count) external returns (uint256[] memory);\n\n /**\n * @dev batch mint a token. Can only be called by a registered extension.\n * Returns tokenId minted\n */\n function mintExtensionBatch(address to, string[] calldata uris) external returns (uint256[] memory);\n\n /**\n * @dev burn a token. Can only be called by token owner or approved address.\n * On burn, calls back to the registered extension's onBurn method\n */\n function burn(uint256 tokenId) external;\n\n}"
},
"@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./IAdminControl.sol\";\n\nabstract contract AdminControl is Ownable, IAdminControl, ERC165 {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // Track registered admins\n EnumerableSet.AddressSet private _admins;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IAdminControl).interfaceId\n || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Only allows approved admins to call the specified function\n */\n modifier adminRequired() {\n require(owner() == msg.sender || _admins.contains(msg.sender), \"AdminControl: Must be owner or admin\");\n _;\n } \n\n /**\n * @dev See {IAdminControl-getAdmins}.\n */\n function getAdmins() external view override returns (address[] memory admins) {\n admins = new address[](_admins.length());\n for (uint i = 0; i < _admins.length(); i++) {\n admins[i] = _admins.at(i);\n }\n return admins;\n }\n\n /**\n * @dev See {IAdminControl-approveAdmin}.\n */\n function approveAdmin(address admin) external override onlyOwner {\n if (!_admins.contains(admin)) {\n emit AdminApproved(admin, msg.sender);\n _admins.add(admin);\n }\n }\n\n /**\n * @dev See {IAdminControl-revokeAdmin}.\n */\n function revokeAdmin(address admin) external override onlyOwner {\n if (_admins.contains(admin)) {\n emit AdminRevoked(admin, msg.sender);\n _admins.remove(admin);\n }\n }\n\n /**\n * @dev See {IAdminControl-isAdmin}.\n */\n function isAdmin(address admin) public override view returns (bool) {\n return (owner() == admin || _admins.contains(admin));\n }\n\n}"
},
"@manifoldxyz/creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @dev Implement this if you want your extension to have overloadable URI's\n */\ninterface ICreatorExtensionTokenURI is IERC165 {\n\n /**\n * Get the uri for a given creator/tokenId\n */\n function tokenURI(address creator, uint256 tokenId) external view returns (string memory);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721Upgradeable is IERC165Upgradeable {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The proofs can be generated using the JavaScript library\n * https://github.com/miguelmota/merkletreejs[merkletreejs].\n * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n *\n * See `test/utils/cryptography/MerkleProof.test.js` for some examples.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(\n bytes32[] memory proof,\n bytes32 root,\n bytes32 leaf\n ) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Calldata version of {verify}\n *\n * _Available since v4.7._\n */\n function verifyCalldata(\n bytes32[] calldata proof,\n bytes32 root,\n bytes32 leaf\n ) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Calldata version of {processProof}\n *\n * _Available since v4.7._\n */\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n *\n * _Available since v4.7._\n */\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Calldata version of {multiProofVerify}\n *\n * _Available since v4.7._\n */\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,\n * consuming from one or the other at each step according to the instructions given by\n * `proofFlags`.\n *\n * _Available since v4.7._\n */\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proof.length - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value for the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n return hashes[totalHashes - 1];\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proof.length - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value for the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n return hashes[totalHashes - 1];\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@manifoldxyz/creator-core-solidity/contracts/core/ICreatorCore.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @dev Core creator interface\n */\ninterface ICreatorCore is IERC165 {\n\n event ExtensionRegistered(address indexed extension, address indexed sender);\n event ExtensionUnregistered(address indexed extension, address indexed sender);\n event ExtensionBlacklisted(address indexed extension, address indexed sender);\n event MintPermissionsUpdated(address indexed extension, address indexed permissions, address indexed sender);\n event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints);\n event DefaultRoyaltiesUpdated(address payable[] receivers, uint256[] basisPoints);\n event ExtensionRoyaltiesUpdated(address indexed extension, address payable[] receivers, uint256[] basisPoints);\n event ExtensionApproveTransferUpdated(address indexed extension, bool enabled);\n\n /**\n * @dev gets address of all extensions\n */\n function getExtensions() external view returns (address[] memory);\n\n /**\n * @dev add an extension. Can only be called by contract owner or admin.\n * extension address must point to a contract implementing ICreatorExtension.\n * Returns True if newly added, False if already added.\n */\n function registerExtension(address extension, string calldata baseURI) external;\n\n /**\n * @dev add an extension. Can only be called by contract owner or admin.\n * extension address must point to a contract implementing ICreatorExtension.\n * Returns True if newly added, False if already added.\n */\n function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external;\n\n /**\n * @dev add an extension. Can only be called by contract owner or admin.\n * Returns True if removed, False if already removed.\n */\n function unregisterExtension(address extension) external;\n\n /**\n * @dev blacklist an extension. Can only be called by contract owner or admin.\n * This function will destroy all ability to reference the metadata of any tokens created\n * by the specified extension. It will also unregister the extension if needed.\n * Returns True if removed, False if already removed.\n */\n function blacklistExtension(address extension) external;\n\n /**\n * @dev set the baseTokenURI of an extension. Can only be called by extension.\n */\n function setBaseTokenURIExtension(string calldata uri) external;\n\n /**\n * @dev set the baseTokenURI of an extension. Can only be called by extension.\n * For tokens with no uri configured, tokenURI will return \"uri+tokenId\"\n */\n function setBaseTokenURIExtension(string calldata uri, bool identical) external;\n\n /**\n * @dev set the common prefix of an extension. Can only be called by extension.\n * If configured, and a token has a uri set, tokenURI will return \"prefixURI+tokenURI\"\n * Useful if you want to use ipfs/arweave\n */\n function setTokenURIPrefixExtension(string calldata prefix) external;\n\n /**\n * @dev set the tokenURI of a token extension. Can only be called by extension that minted token.\n */\n function setTokenURIExtension(uint256 tokenId, string calldata uri) external;\n\n /**\n * @dev set the tokenURI of a token extension for multiple tokens. Can only be called by extension that minted token.\n */\n function setTokenURIExtension(uint256[] memory tokenId, string[] calldata uri) external;\n\n /**\n * @dev set the baseTokenURI for tokens with no extension. Can only be called by owner/admin.\n * For tokens with no uri configured, tokenURI will return \"uri+tokenId\"\n */\n function setBaseTokenURI(string calldata uri) external;\n\n /**\n * @dev set the common prefix for tokens with no extension. Can only be called by owner/admin.\n * If configured, and a token has a uri set, tokenURI will return \"prefixURI+tokenURI\"\n * Useful if you want to use ipfs/arweave\n */\n function setTokenURIPrefix(string calldata prefix) external;\n\n /**\n * @dev set the tokenURI of a token with no extension. Can only be called by owner/admin.\n */\n function setTokenURI(uint256 tokenId, string calldata uri) external;\n\n /**\n * @dev set the tokenURI of multiple tokens with no extension. Can only be called by owner/admin.\n */\n function setTokenURI(uint256[] memory tokenIds, string[] calldata uris) external;\n\n /**\n * @dev set a permissions contract for an extension. Used to control minting.\n */\n function setMintPermissions(address extension, address permissions) external;\n\n /**\n * @dev Configure so transfers of tokens created by the caller (must be extension) gets approval\n * from the extension before transferring\n */\n function setApproveTransferExtension(bool enabled) external;\n\n /**\n * @dev get the extension of a given token\n */\n function tokenExtension(uint256 tokenId) external view returns (address);\n\n /**\n * @dev Set default royalties\n */\n function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external;\n\n /**\n * @dev Set royalties of a token\n */\n function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external;\n\n /**\n * @dev Set royalties of an extension\n */\n function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external;\n\n /**\n * @dev Get royalites of a token. Returns list of receivers and basisPoints\n */\n function getRoyalties(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);\n \n // Royalty support for various other standards\n function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory);\n function getFeeBps(uint256 tokenId) external view returns (uint[] memory);\n function getFees(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);\n function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256);\n\n}\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@manifoldxyz/libraries-solidity/contracts/access/IAdminControl.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface for admin control\n */\ninterface IAdminControl is IERC165 {\n\n event AdminApproved(address indexed account, address indexed sender);\n event AdminRevoked(address indexed account, address indexed sender);\n\n /**\n * @dev gets address of all admins\n */\n function getAdmins() external view returns (address[] memory);\n\n /**\n * @dev add an admin. Can only be called by contract owner.\n */\n function approveAdmin(address admin) external;\n\n /**\n * @dev remove an admin. Can only be called by contract owner.\n */\n function revokeAdmin(address admin) external;\n\n /**\n * @dev checks whether or not given address is an admin\n * Returns True if they are\n */\n function isAdmin(address admin) external view returns (bool);\n\n}"
},
"@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n return _values(set._inner);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
} |