├── .eslintrc.js ├── .github └── workflows │ ├── ci.yml │ ├── pages.yml │ └── site.yml ├── .gitignore ├── .npmrc ├── .nvmrc ├── README.md ├── apps └── react-app │ ├── .env.example │ ├── .eslintignore │ ├── .eslintrc │ ├── .gitignore │ ├── .prettierrc │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── __mocks__ │ └── next │ │ └── router.ts │ ├── commitlint.config.js │ ├── jest.config.js │ ├── jest.setup.js │ ├── lint-staged.config.js │ ├── netlify.toml │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.js │ ├── src │ ├── components │ │ ├── App │ │ │ ├── AppColorMode.tsx │ │ │ └── AppLogo.tsx │ │ ├── Component.tsx │ │ ├── FormMintExample.tsx │ │ ├── IsMounted.tsx │ │ ├── Layout │ │ │ └── Menu │ │ │ │ └── MenuItemSidebar.tsx │ │ └── ModuleComponentPreview.tsx │ ├── pages │ │ ├── _app.tsx │ │ ├── _document.tsx │ │ └── index.tsx │ ├── styles │ │ └── global.css │ ├── templates │ │ ├── Main.tsx │ │ └── Meta.tsx │ └── utils │ │ ├── AppConfig.ts │ │ └── constants.ts │ ├── tailwind.config.js │ └── tsconfig.json ├── contracts ├── erc721k-core-sol │ ├── .env.example │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── .nvmrc │ ├── .prettierignore │ ├── .prettierrc │ ├── .solcover.js │ ├── .solhint.json │ ├── README.md │ ├── contracts │ │ ├── ERC721K.sol │ │ ├── ERC721Storage.sol │ │ ├── Solbase │ │ │ ├── auth │ │ │ │ ├── Auth.sol │ │ │ │ ├── Owned.sol │ │ │ │ ├── OwnedRoles.sol │ │ │ │ ├── OwnedThreeStep.sol │ │ │ │ └── authorities │ │ │ │ │ ├── MultiRolesAuthority.sol │ │ │ │ │ └── RolesAuthority.sol │ │ │ ├── mixins │ │ │ │ └── ERC4626.sol │ │ │ ├── tokens │ │ │ │ ├── ERC1155 │ │ │ │ │ ├── ERC1155.sol │ │ │ │ │ └── extensions │ │ │ │ │ │ └── ERC1155Permit.sol │ │ │ │ ├── ERC20 │ │ │ │ │ ├── ERC20.sol │ │ │ │ │ └── extensions │ │ │ │ │ │ ├── ERC20Permit.sol │ │ │ │ │ │ └── ERC20Votes.sol │ │ │ │ ├── ERC721 │ │ │ │ │ ├── ERC721.sol │ │ │ │ │ └── extensions │ │ │ │ │ │ └── ERC721Permit.sol │ │ │ │ └── WETH.sol │ │ │ └── utils │ │ │ │ ├── Base64.sol │ │ │ │ ├── Bytes32AddressLib.sol │ │ │ │ ├── CREATE3.sol │ │ │ │ ├── Clone.sol │ │ │ │ ├── ECDSA.sol │ │ │ │ ├── EIP712.sol │ │ │ │ ├── ERC165.sol │ │ │ │ ├── FixedPointMath.sol │ │ │ │ ├── FixedPointMathLib.sol │ │ │ │ ├── LibBit.sol │ │ │ │ ├── LibBitmap.sol │ │ │ │ ├── LibBytemap.sol │ │ │ │ ├── LibClone.sol │ │ │ │ ├── LibERC165.sol │ │ │ │ ├── LibRLP.sol │ │ │ │ ├── LibSort.sol │ │ │ │ ├── LibString.sol │ │ │ │ ├── MerkleProofLib.sol │ │ │ │ ├── Multicallable.sol │ │ │ │ ├── Permit.sol │ │ │ │ ├── ReentrancyGuard.sol │ │ │ │ ├── SSTORE2.sol │ │ │ │ ├── SafeCastLib.sol │ │ │ │ ├── SafeMulticallable.sol │ │ │ │ ├── SafeTransfer.sol │ │ │ │ ├── SafeTransferLib.sol │ │ │ │ ├── SelfPermit.sol │ │ │ │ ├── SignatureCheckerLib.sol │ │ │ │ └── SignedWadMath.sol │ │ ├── interfaces │ │ │ ├── IERC721KImage.sol │ │ │ ├── IERC721KTraits.sol │ │ │ └── IStream.sol │ │ └── mocks │ │ │ ├── MockERC721K.sol │ │ │ └── MockERC721Storage.sol │ ├── hardhat.config.ts │ ├── hardhat.network.ts │ ├── package.json │ ├── scripts │ │ ├── verify.js │ │ └── watch.js │ ├── templates │ │ └── contract.hbs │ ├── test │ │ ├── ERC721K.test.ts │ │ └── ERC721Storage.test.ts │ └── tsconfig.json ├── erc721k-periphery-sol │ ├── .env.example │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── .nvmrc │ ├── .prettierignore │ ├── .prettierrc │ ├── .solcover.js │ ├── .solhint.json │ ├── README.md │ ├── contracts │ │ ├── interfaces │ │ │ ├── IDataStream.sol │ │ │ ├── IERC712KTraits.sol │ │ │ ├── IERC721KRender.sol │ │ │ ├── IMetaFetch.sol │ │ │ ├── ISVGModule.sol │ │ │ ├── ISVGRender.sol │ │ │ └── ITraitsFetch.sol │ │ ├── libraries │ │ │ └── BytesLib.sol │ │ └── svg │ │ │ ├── SVGColor.sol │ │ │ ├── SVGLibrary.sol │ │ │ ├── SVGRegistry.sol │ │ │ ├── svg.sol │ │ │ └── svgUtils.sol │ ├── deploy │ │ ├── 00_fork.ts │ │ ├── 00_mainnet.ts │ │ ├── 01_nounders-testnet.ts │ │ ├── 01_nounders.ts │ │ └── 02_wolf.ts │ ├── hardhat.config.ts │ ├── hardhat.network.ts │ ├── hardhat.tasks.ts │ ├── package.json │ ├── scripts │ │ ├── verify.js │ │ └── watch.js │ ├── templates │ │ └── contract.hbs │ ├── test │ │ └── ENouns.test.ts │ └── tsconfig.json └── erc721k-streams-sol │ ├── .env.example │ ├── .github │ └── workflows │ │ └── main.yml │ ├── .gitignore │ ├── .nvmrc │ ├── .prettierignore │ ├── .prettierrc │ ├── .solcover.js │ ├── .solhint.json │ ├── README.md │ ├── contracts │ ├── StreamENS.sol │ ├── examples │ │ └── TraitsStreamENS.sol │ ├── interfaces │ │ ├── ENS │ │ │ ├── ENS.sol │ │ │ ├── IDefaultReverseResolver.sol │ │ │ ├── IENSReverseRecords.sol │ │ │ ├── IReverseRegistrar.sol │ │ │ └── ITextResolver.sol │ │ ├── IERC721KTraits.sol │ │ └── IStream.sol │ └── libraries │ │ ├── BytesUtils.sol │ │ └── NameEncoder.sol │ ├── deploy │ ├── 00_fork.ts │ ├── 00_mainnet.ts │ ├── 01_nounders-testnet.ts │ ├── 01_nounders.ts │ └── 02_wolf.ts │ ├── deployments │ ├── ethereumTestnet │ │ ├── .chainId │ │ ├── ENounders.json │ │ └── solcInputs │ │ │ ├── 822ba7c0d02b7bb0b80f0a4288c75fb3.json │ │ │ └── 8f7e8aae4a8b51c633a3584a1f777ab6.json │ └── mainnet │ │ ├── .chainId │ │ ├── ChaosWolf.json │ │ ├── ENounders.json │ │ ├── ENouns.json │ │ ├── ENounsRender.json │ │ ├── ENounsStorage.json │ │ ├── ENounsTraits.json │ │ ├── StreamENS.json │ │ └── solcInputs │ │ ├── 40f1c0327ee837585f8bb45da65c77a2.json │ │ ├── 9ff91e743f89171638eb63f409bd4bb1.json │ │ ├── c54821c4ea64c17e33947bfda0420f57.json │ │ └── cde2d96bc0aa20383f5e601d5edfa2b9.json │ ├── hardhat.config.ts │ ├── hardhat.network.ts │ ├── hardhat.tasks.ts │ ├── package.json │ ├── scripts │ ├── verify.js │ └── watch.js │ ├── templates │ └── contract.hbs │ ├── test │ └── ENouns.test.ts │ └── tsconfig.json ├── package.json ├── packages └── deployments │ ├── .env.example │ ├── .github │ └── workflows │ │ ├── main.yml │ │ └── size.yml │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── abis │ ├── @erc721k │ │ ├── core-sol │ │ │ └── contracts │ │ │ │ ├── ERC721K.sol │ │ │ │ └── ERC721K.json │ │ │ │ ├── ERC721Storage.sol │ │ │ │ └── ERC721Storage.json │ │ │ │ ├── examples │ │ │ │ ├── Example.sol │ │ │ │ │ └── Example.json │ │ │ │ ├── ExampleRender.sol │ │ │ │ │ └── ExampleRender.json │ │ │ │ ├── ExampleStorage.sol │ │ │ │ │ └── ExampleStorage.json │ │ │ │ ├── ExampleSvgModule.sol │ │ │ │ │ └── ExampleSvgModule.json │ │ │ │ └── ExampleTraits.sol │ │ │ │ │ └── ExampleTraits.json │ │ │ │ └── interfaces │ │ │ │ ├── IERC721KImage.sol │ │ │ │ └── IERC721KImage.json │ │ │ │ ├── IERC721KTraits.sol │ │ │ │ └── IERC721KTraits.json │ │ │ │ └── IStream.sol │ │ │ │ └── IStream.json │ │ └── periphery-sol │ │ │ └── contracts │ │ │ ├── interfaces │ │ │ └── ISVGModule.sol │ │ │ │ └── ISVGModule.json │ │ │ └── svg │ │ │ ├── SVGColor.sol │ │ │ └── SVGColor.json │ │ │ ├── SVGLibrary.sol │ │ │ └── SVGLibrary.json │ │ │ ├── SVGRegistry.sol │ │ │ └── SVGRegistry.json │ │ │ └── svg.sol │ │ │ └── svg.json │ └── @openzeppelin │ │ └── contracts │ │ ├── access │ │ └── Ownable.sol │ │ │ └── Ownable.json │ │ ├── token │ │ └── ERC721 │ │ │ ├── ERC721.sol │ │ │ └── ERC721.json │ │ │ ├── IERC721.sol │ │ │ └── IERC721.json │ │ │ ├── IERC721Receiver.sol │ │ │ └── IERC721Receiver.json │ │ │ └── extensions │ │ │ └── IERC721Metadata.sol │ │ │ └── IERC721Metadata.json │ │ └── utils │ │ └── introspection │ │ ├── ERC165.sol │ │ └── ERC165.json │ │ └── IERC165.sol │ │ └── IERC165.json │ ├── artifacts │ ├── @erc721k │ │ ├── core-sol │ │ │ └── contracts │ │ │ │ ├── ERC721K.sol │ │ │ │ ├── ERC721K.dbg.json │ │ │ │ └── ERC721K.json │ │ │ │ ├── ERC721Storage.sol │ │ │ │ ├── ERC721Storage.dbg.json │ │ │ │ └── ERC721Storage.json │ │ │ │ ├── examples │ │ │ │ ├── Example.sol │ │ │ │ │ ├── Example.dbg.json │ │ │ │ │ └── Example.json │ │ │ │ ├── ExampleRender.sol │ │ │ │ │ ├── ExampleRender.dbg.json │ │ │ │ │ └── ExampleRender.json │ │ │ │ ├── ExampleStorage.sol │ │ │ │ │ ├── ExampleStorage.dbg.json │ │ │ │ │ └── ExampleStorage.json │ │ │ │ ├── ExampleSvgModule.sol │ │ │ │ │ ├── ExampleSvgModule.dbg.json │ │ │ │ │ └── ExampleSvgModule.json │ │ │ │ └── ExampleTraits.sol │ │ │ │ │ ├── ExampleTraits.dbg.json │ │ │ │ │ └── ExampleTraits.json │ │ │ │ └── interfaces │ │ │ │ ├── IERC721KImage.sol │ │ │ │ ├── IERC721KImage.dbg.json │ │ │ │ └── IERC721KImage.json │ │ │ │ ├── IERC721KTraits.sol │ │ │ │ ├── IERC721KTraits.dbg.json │ │ │ │ └── IERC721KTraits.json │ │ │ │ └── IStream.sol │ │ │ │ ├── IStream.dbg.json │ │ │ │ └── IStream.json │ │ └── periphery-sol │ │ │ └── contracts │ │ │ ├── interfaces │ │ │ └── ISVGModule.sol │ │ │ │ ├── ISVGModule.dbg.json │ │ │ │ └── ISVGModule.json │ │ │ └── svg │ │ │ ├── SVGColor.sol │ │ │ ├── SVGColor.dbg.json │ │ │ └── SVGColor.json │ │ │ ├── SVGLibrary.sol │ │ │ ├── SVGLibrary.dbg.json │ │ │ └── SVGLibrary.json │ │ │ ├── SVGRegistry.sol │ │ │ ├── SVGRegistry.dbg.json │ │ │ └── SVGRegistry.json │ │ │ ├── svg.sol │ │ │ ├── svg.dbg.json │ │ │ └── svg.json │ │ │ └── svgUtils.sol │ │ │ ├── svgUtils.dbg.json │ │ │ └── svgUtils.json │ ├── @openzeppelin │ │ └── contracts │ │ │ ├── access │ │ │ └── Ownable.sol │ │ │ │ ├── Ownable.dbg.json │ │ │ │ └── Ownable.json │ │ │ ├── token │ │ │ └── ERC721 │ │ │ │ ├── ERC721.sol │ │ │ │ ├── ERC721.dbg.json │ │ │ │ └── ERC721.json │ │ │ │ ├── IERC721.sol │ │ │ │ ├── IERC721.dbg.json │ │ │ │ └── IERC721.json │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ ├── IERC721Receiver.dbg.json │ │ │ │ └── IERC721Receiver.json │ │ │ │ └── extensions │ │ │ │ └── IERC721Metadata.sol │ │ │ │ ├── IERC721Metadata.dbg.json │ │ │ │ └── IERC721Metadata.json │ │ │ └── utils │ │ │ ├── Address.sol │ │ │ ├── Address.dbg.json │ │ │ └── Address.json │ │ │ ├── Context.sol │ │ │ ├── Context.dbg.json │ │ │ └── Context.json │ │ │ ├── Strings.sol │ │ │ ├── Strings.dbg.json │ │ │ └── Strings.json │ │ │ └── introspection │ │ │ ├── ERC165.sol │ │ │ ├── ERC165.dbg.json │ │ │ └── ERC165.json │ │ │ └── IERC165.sol │ │ │ ├── IERC165.dbg.json │ │ │ └── IERC165.json │ ├── base64-sol │ │ └── base64.sol │ │ │ ├── Base64.dbg.json │ │ │ └── Base64.json │ ├── build-info │ │ └── dc0e2f0cbe87895980d32999fbbb5858.json │ └── hardhat │ │ └── console.sol │ │ ├── console.dbg.json │ │ └── console.json │ ├── cache │ ├── hardhat-network-fork │ │ └── network-1 │ │ │ ├── request-0cecae94efddfd91b3074d4b60785ae5.json │ │ │ ├── request-0ff288f4ee81aa260d92551ce62b9feb.json │ │ │ ├── request-10dcdb2f9d5424ab43ba1efc25118af4.json │ │ │ ├── request-12e433d5978c495c9a6085961fe14cbc.json │ │ │ ├── request-1386ca0a255e1229e67326a30bbdd853.json │ │ │ ├── request-169edcb881d46442e5243a45c4c8c4d9.json │ │ │ ├── request-1cc225ee2244e7fc3805e1211ea8d175.json │ │ │ ├── request-248d9cd6ef8df5676d5273b785772fd0.json │ │ │ ├── request-2fafdbd7f17b0646684dc0735cd0483e.json │ │ │ ├── request-3f6dd7c474456840b3f24afe160fa086.json │ │ │ ├── request-4a711468947047e9bee2f9cb7ddd722e.json │ │ │ ├── request-500e05bf4fcf8dec9094d483a0f1fcb9.json │ │ │ ├── request-5351f194dd6d5d4929d669ab506d067d.json │ │ │ ├── request-55788175055576d016fc10bc610de9c2.json │ │ │ ├── request-56ecc5358ede4b1880d9c7e1b6f3f34a.json │ │ │ ├── request-5888f5746ba686631176cce269635f78.json │ │ │ ├── request-5a5b1e5de3397dcb22f6951dcfb44362.json │ │ │ ├── request-6333b48e8cd5593d7ab606304ce38ec9.json │ │ │ ├── request-7b525a5395730a999d14e0383cf5716b.json │ │ │ ├── request-7b9b5b872e171b87a61e53ad0dd77558.json │ │ │ ├── request-7bd3a3f8ede5aba84d4bc18715b0ade9.json │ │ │ ├── request-88d141b2b9dcd79aa97c504cd9882541.json │ │ │ ├── request-89fe504bd80e28b73ab3d02b0b68ab0c.json │ │ │ ├── request-8cfb146b8b50eff9d1f35adb477ec5c8.json │ │ │ ├── request-963be5d351e181d11419aca1a1d2abec.json │ │ │ ├── request-984364b542a7e2351f5ecb272910ccb4.json │ │ │ ├── request-9d0a088c6c03618de60de9d1a21d36af.json │ │ │ ├── request-b3dd84c7d6c755d6c8e2f3dbe32f4a34.json │ │ │ ├── request-d008d2118f5a7e1daa5f065a59078d7c.json │ │ │ ├── request-d64119c68c680252086d9e9b4cee7e2f.json │ │ │ ├── request-db913a77758f6838e3d7513d163dda26.json │ │ │ ├── request-e2ce5c7bed8ca3a674eed368ac881c4e.json │ │ │ ├── request-ecda6eb0c53c50a62ce5728bc58588a6.json │ │ │ ├── request-f00819cc3b7769f617efdb93a2636349.json │ │ │ ├── request-f4c261b29d82f8911814552a29f2940a.json │ │ │ └── request-fdf2138a858da5041aa8c2f0abd6bc72.json │ └── solidity-files-cache.json │ ├── deploy │ ├── 00_core.ts │ └── 01_example.ts │ ├── deployments │ └── localhost │ │ ├── .chainId │ │ ├── Example.json │ │ ├── ExampleRender.json │ │ ├── ExampleStorage.json │ │ ├── ExampleSvgModule.json │ │ ├── ExampleTraits.json │ │ ├── SVGColor.json │ │ ├── SVGLibrary.json │ │ ├── SVGRegistry.json │ │ ├── solcInputs │ │ └── bf4d5602c5fbb53fc064060f0a53a702.json │ │ ├── svg.json │ │ └── svgUtils.json │ ├── hardhat.config.ts │ ├── hardhat.network.ts │ ├── package.json │ ├── src │ └── index.tsx │ ├── svg │ ├── pixel │ │ ├── body-accessory-unicron.ts │ │ ├── body-pooly-wings.ts │ │ ├── head-accessory-snorkel-blue.ts │ │ └── head-pooly-cooly.ts │ └── svg_0.ts │ ├── test │ └── blah.test.tsx │ ├── tsconfig.json │ └── types │ ├── ERC165.ts │ ├── ERC721.ts │ ├── ERC721K.ts │ ├── ERC721Storage.ts │ ├── Example.ts │ ├── ExampleRender.ts │ ├── ExampleStorage.ts │ ├── ExampleSvgModule.ts │ ├── ExampleTraits.ts │ ├── IERC165.ts │ ├── IERC20.ts │ ├── IERC721.ts │ ├── IERC721KImage.ts │ ├── IERC721KTraits.ts │ ├── IERC721Metadata.ts │ ├── IERC721Receiver.ts │ ├── ISVGModule.ts │ ├── ISVGRender.ts │ ├── IStream.ts │ ├── ITraitsFetch.ts │ ├── IWETH.ts │ ├── Ownable.ts │ ├── PoolyChibi.ts │ ├── PoolyChibiRender.ts │ ├── PoolyChibiStorage.ts │ ├── PoolyChibiSvgModule.ts │ ├── PoolyChibiTraits.ts │ ├── PoolyMinter.ts │ ├── PoolyMorph.ts │ ├── PoolyMorphRender.ts │ ├── PoolyNFT.ts │ ├── PoolyPixelRender.ts │ ├── PoolyPixelStorage.ts │ ├── PoolyPixelSvgModule.ts │ ├── PoolyPixelTraits.ts │ ├── SVGColor.ts │ ├── SVGLibrary.ts │ ├── SVGRegistry.ts │ ├── Svg.ts │ ├── common.ts │ ├── factories │ ├── ERC165__factory.ts │ ├── ERC721K__factory.ts │ ├── ERC721Storage__factory.ts │ ├── ERC721__factory.ts │ ├── ExampleRender__factory.ts │ ├── ExampleStorage__factory.ts │ ├── ExampleSvgModule__factory.ts │ ├── ExampleTraits__factory.ts │ ├── Example__factory.ts │ ├── IERC165__factory.ts │ ├── IERC20__factory.ts │ ├── IERC721KImage__factory.ts │ ├── IERC721KTraits__factory.ts │ ├── IERC721Metadata__factory.ts │ ├── IERC721Receiver__factory.ts │ ├── IERC721__factory.ts │ ├── ISVGModule__factory.ts │ ├── ISVGRender__factory.ts │ ├── IStream__factory.ts │ ├── ITraitsFetch__factory.ts │ ├── IWETH__factory.ts │ ├── Ownable__factory.ts │ ├── PoolyChibiRender__factory.ts │ ├── PoolyChibiStorage__factory.ts │ ├── PoolyChibiSvgModule__factory.ts │ ├── PoolyChibiTraits__factory.ts │ ├── PoolyChibi__factory.ts │ ├── PoolyMinter__factory.ts │ ├── PoolyMorphRender__factory.ts │ ├── PoolyMorph__factory.ts │ ├── PoolyNFT__factory.ts │ ├── PoolyPixelRender__factory.ts │ ├── PoolyPixelStorage__factory.ts │ ├── PoolyPixelSvgModule__factory.ts │ ├── PoolyPixelTraits__factory.ts │ ├── SVGColor__factory.ts │ ├── SVGLibrary__factory.ts │ ├── SVGRegistry__factory.ts │ └── Svg__factory.ts │ └── index.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── turbo.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | // This tells ESLint to load the config from the package `eslint-config-custom` 4 | extends: ["custom"], 5 | settings: { 6 | next: { 7 | rootDir: ["apps/*/"], 8 | }, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | pull_request: 7 | types: [opened, synchronize] 8 | 9 | jobs: 10 | build: 11 | name: Build and Test 12 | timeout-minutes: 15 13 | runs-on: ${{ matrix.os }} 14 | # To use Remote Caching, uncomment the next lines and follow the steps below. 15 | # env: 16 | # TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} 17 | # TURBO_TEAM: ${{ secrets.TURBO_TEAM }} 18 | strategy: 19 | matrix: 20 | os: [macOS-latest] 21 | 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v3 25 | 26 | - name: Install Node.js 27 | uses: actions/setup-node@v3 28 | with: 29 | node-version: 16 30 | 31 | - uses: pnpm/action-setup@v2.0.1 32 | name: Install pnpm 33 | id: pnpm-install 34 | with: 35 | version: 7 36 | run_install: false 37 | 38 | - name: Get pnpm store directory 39 | id: pnpm-cache 40 | run: | 41 | echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" 42 | 43 | - uses: actions/cache@v3 44 | name: Setup pnpm cache 45 | with: 46 | path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} 47 | key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} 48 | restore-keys: | 49 | ${{ runner.os }}-pnpm-store- 50 | 51 | - name: Install dependencies 52 | run: pnpm install --no-frozen-lockfile 53 | 54 | - name: Build 55 | run: yarn build 56 | -------------------------------------------------------------------------------- /.github/workflows/site.yml: -------------------------------------------------------------------------------- 1 | name: Site 2 | on: 3 | push: 4 | branches: ["main"] 5 | pull_request: 6 | types: [closed] 7 | jobs: 8 | build_and_lint: 9 | runs-on: macOS-latest 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v3 13 | 14 | - name: Install Node.js 15 | uses: actions/setup-node@v3 16 | with: 17 | node-version: 16 18 | 19 | - uses: pnpm/action-setup@v2.0.1 20 | name: Install pnpm 21 | id: pnpm-install 22 | with: 23 | version: 7 24 | run_install: false 25 | 26 | - name: Get pnpm store directory 27 | id: pnpm-cache 28 | run: | 29 | echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" 30 | 31 | - uses: actions/cache@v3 32 | name: Setup pnpm cache 33 | with: 34 | path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} 35 | key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} 36 | restore-keys: | 37 | ${{ runner.os }}-pnpm-store- 38 | 39 | - name: Install dependencies 40 | run: pnpm install --no-frozen-lockfile 41 | 42 | - name: Compile 43 | run: pnpm compile 44 | continue-on-error: false 45 | 46 | - name: Build 💻 47 | run: pnpm build:prd 48 | continue-on-error: false 49 | 50 | - name: Deploy 🚀 51 | uses: JamesIves/github-pages-deploy-action@4.1.4 52 | with: 53 | branch: gh-pages 54 | folder: apps/react-app/out 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_STORE 3 | /.yarn/* 4 | !/.yarn/releases 5 | !/.yarn/plugins 6 | !/.yarn/sdks 7 | 8 | 9 | # dependencies 10 | node_modules 11 | .pnp 12 | .pnp.js 13 | 14 | # testing 15 | coverage 16 | 17 | # next.js 18 | .next/ 19 | out/ 20 | build 21 | 22 | # misc 23 | .DS_Store 24 | *.pem 25 | public/ 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # local env files 34 | .env 35 | .env.local 36 | .env.development.local 37 | .env.test.local 38 | .env.production.local 39 | 40 | # turbo 41 | .turbo 42 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers=true 2 | strict-peer-dependencies=false -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16.10.0 2 | -------------------------------------------------------------------------------- /apps/react-app/.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_ENABLE_TESTNETS=true -------------------------------------------------------------------------------- /apps/react-app/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out 3 | -------------------------------------------------------------------------------- /apps/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next 13 | /out 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | Thumbs.db 22 | 23 | # debug 24 | npm-debug.log* 25 | pnpm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # dotenv local files 30 | .env 31 | 32 | # local folder 33 | local 34 | 35 | # vercel 36 | .vercel 37 | -------------------------------------------------------------------------------- /apps/react-app/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2 3 | } 4 | -------------------------------------------------------------------------------- /apps/react-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "mikestead.dotenv", 6 | "csstools.postcss", 7 | "bradlc.vscode-tailwindcss", 8 | "Orta.vscode-jest" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apps/react-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Next: Chrome", 11 | "url": "http://localhost:3000", 12 | "webRoot": "${workspaceFolder}" 13 | }, 14 | { 15 | "type": "node", 16 | "request": "launch", 17 | "name": "Next: Node", 18 | "program": "${workspaceFolder}/node_modules/.bin/next", 19 | "args": ["dev"], 20 | "autoAttachChildProcesses": true, 21 | "skipFiles": ["/**"], 22 | "console": "integratedTerminal" 23 | } 24 | ], 25 | "compounds": [ 26 | { 27 | "name": "Next: Full", 28 | "configurations": ["Next: Node", "Next: Chrome"] 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /apps/react-app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "editor.detectIndentation": false, 4 | "search.exclude": { 5 | "package-lock.json": true 6 | }, 7 | "editor.defaultFormatter": "dbaeumer.vscode-eslint", 8 | "editor.formatOnSave": true, 9 | "editor.codeActionsOnSave": [ 10 | "source.addMissingImports", 11 | "source.fixAll.eslint" 12 | ], 13 | "eslint.validate": ["typescript", "javascript", "javascriptreact"], 14 | "jest.autoRun": { 15 | "watch": true, // Start the jest with the watch flag 16 | "onStartup": ["all-tests"] // Run all tests upon project launch 17 | }, 18 | "jest.showCoverageOnLoad": true, // Show code coverage when the project is launched 19 | "jest.showTerminalOnLaunch": false, // Don't automatically open test explorer terminal on launch 20 | // Multiple language settings for json and jsonc files 21 | "[json][jsonc]": { 22 | "editor.formatOnSave": true, 23 | "editor.defaultFormatter": "esbenp.prettier-vscode" 24 | }, 25 | "jest.jestCommandLine": "jest", 26 | "[typescriptreact]": { 27 | "editor.defaultFormatter": "esbenp.prettier-vscode" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /apps/react-app/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Project wide type checking with TypeScript", 8 | "type": "npm", 9 | "script": "check-types", 10 | "problemMatcher": ["$tsc"], 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | }, 15 | "presentation": { 16 | "clear": true, 17 | "reveal": "never" 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /apps/react-app/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ## 1.1.0 (2022-04-25) 6 | 7 | ### Features 8 | 9 | - add commitlint with config-conventional ([97a9ac7](https://github.com/ixartz/Next-js-Boilerplate/commit/97a9ac7dbbca3f8d4fad22a9e4a481c029cd2cb5)) 10 | 11 | ### Bug Fixes 12 | 13 | - add missing files for commitzen ([018ba8b](https://github.com/ixartz/Next-js-Boilerplate/commit/018ba8bde81b0f6cc60230fe4668b149ac3b2e6a)) 14 | - update package-lock.json ([fba016d](https://github.com/ixartz/Next-js-Boilerplate/commit/fba016dec202d5748e30804b1bf50e30c00ef120)) 15 | -------------------------------------------------------------------------------- /apps/react-app/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Remi W. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /apps/react-app/__mocks__/next/router.ts: -------------------------------------------------------------------------------- 1 | // The easiest solution to mock `next/router`: https://github.com/vercel/next.js/issues/7479 2 | export const useRouter = () => { 3 | return { 4 | basePath: ".", 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /apps/react-app/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /apps/react-app/jest.config.js: -------------------------------------------------------------------------------- 1 | const nextJest = require('next/jest'); 2 | 3 | const createJestConfig = nextJest({ 4 | // Provide the path to your Next.js app to load next.config.js and .env files in your test environment 5 | dir: './', 6 | }); 7 | 8 | const customJestConfig = { 9 | moduleNameMapper: { 10 | // Handle module aliases (this will be automatically configured for you soon) 11 | '^@/(.*)$': '/src/$1', 12 | 13 | '^@/public/(.*)$': '/public/$1', 14 | }, 15 | setupFilesAfterEnv: ['./jest.setup.js'], 16 | clearMocks: true, 17 | collectCoverage: true, 18 | collectCoverageFrom: [ 19 | './src/**/*.{js,jsx,ts,tsx}', 20 | '!./src/**/_*.{js,jsx,ts,tsx}', 21 | '!**/*.d.ts', 22 | '!**/node_modules/**', 23 | ], 24 | coverageThreshold: { 25 | global: { 26 | branches: 80, 27 | functions: 80, 28 | lines: 80, 29 | statements: 80, 30 | }, 31 | }, 32 | testEnvironment: 'jest-environment-jsdom', 33 | }; 34 | 35 | module.exports = createJestConfig(customJestConfig); 36 | -------------------------------------------------------------------------------- /apps/react-app/jest.setup.js: -------------------------------------------------------------------------------- 1 | // Optional: configure or set up a testing framework before each test. 2 | // If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js` 3 | import '@testing-library/jest-dom/extend-expect'; 4 | -------------------------------------------------------------------------------- /apps/react-app/lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '*.{js,jsx,ts,tsx}': ['eslint --fix', 'eslint'], 3 | '**/*.ts?(x)': () => 'npm run check-types', 4 | '*.json': ['prettier --write'], 5 | }; 6 | -------------------------------------------------------------------------------- /apps/react-app/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "out" 3 | command = "npm run build-prod" 4 | 5 | [build.environment] 6 | NETLIFY_NEXT_PLUGIN_SKIP = "true" 7 | -------------------------------------------------------------------------------- /apps/react-app/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /apps/react-app/next.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | const withBundleAnalyzer = require('@next/bundle-analyzer')({ 3 | enabled: process.env.ANALYZE === 'true', 4 | }); 5 | 6 | module.exports = withBundleAnalyzer({ 7 | assetPrefix: '/', 8 | basePath: '', 9 | trailingSlash: true, 10 | reactStrictMode: true, 11 | poweredByHeader: false, 12 | typescript: { 13 | ignoreBuildErrors: true, 14 | }, 15 | publicRuntimeConfig: { 16 | NODE_ENV: process.env.ENV || "development", 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /apps/react-app/postcss.config.js: -------------------------------------------------------------------------------- 1 | // Please do not use the array form (like ['tailwindcss', 'postcss-preset-env']) 2 | // it will create an unexpected error: Invalid PostCSS Plugin found: [0] 3 | 4 | module.exports = { 5 | plugins: { 6 | tailwindcss: {}, 7 | autoprefixer: {}, 8 | ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}), 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /apps/react-app/src/components/App/AppColorMode.tsx: -------------------------------------------------------------------------------- 1 | import classNames from "classnames"; 2 | import * as React from "react"; 3 | import { useEffect } from "react"; 4 | 5 | interface AppColorModeProps { 6 | className?: string; 7 | } 8 | 9 | export const AppColorMode = ({ className }: AppColorModeProps) => { 10 | const classes = classNames(className, "toggle-theme color-mode cursor-pointer"); 11 | const [mode, setMode] = React.useState<"light" | "dark">("light"); 12 | const [ defaultChecked, setDefaultChecked ] = React.useState(false) 13 | useEffect(() => { 14 | // On page load or when changing themes, best to add inline in `head` to avoid FOUC 15 | if ( 16 | localStorage.theme === "dark" || 17 | (!("theme" in localStorage) && 18 | window.matchMedia("(prefers-color-scheme: dark)").matches) 19 | ) { 20 | document.documentElement.classList.add("dark"); 21 | document.documentElement.classList.remove("light"); 22 | setMode("dark"); 23 | setDefaultChecked(true); 24 | } else { 25 | document.documentElement.classList.add("light"); 26 | document.documentElement.classList.remove("dark"); 27 | setMode("light"); 28 | setDefaultChecked(false); 29 | } 30 | }, []); 31 | 32 | const handleToogle = (_e: any) => { 33 | document.documentElement.classList.toggle("dark"); 34 | setMode(mode === "dark" ? "light" : "dark"); 35 | }; 36 | 37 | return ( 38 |
39 | 53 |
54 | ); 55 | }; 56 | 57 | export default AppColorMode; 58 | -------------------------------------------------------------------------------- /apps/react-app/src/components/App/AppLogo.tsx: -------------------------------------------------------------------------------- 1 | import classNames from "classnames"; 2 | import Link from "next/link"; 3 | 4 | import { AppConfig } from "@/utils/AppConfig"; 5 | 6 | interface AppLogoProps { 7 | className?: string; 8 | defaultStyle?: boolean; 9 | } 10 | 11 | export const AppLogo = ({ className, defaultStyle }: AppLogoProps) => { 12 | const classesBase = classNames( 13 | "flex items-center justify-between cursor-pointer " 14 | ); 15 | const styleName = classNames( 16 | className, 17 | "app-logo", 18 | "font-semibold text-sm hover:opacity-70", 19 | { 20 | "text-purple-600 hover:text-purple-700": defaultStyle, 21 | } 22 | ); 23 | return ( 24 | 25 | 26 | {AppConfig.emoji} 27 | {AppConfig.title} 28 | 29 | 30 | ); 31 | }; 32 | 33 | export default AppLogo; 34 | -------------------------------------------------------------------------------- /apps/react-app/src/components/Component.tsx: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import React, { ReactElement, ReactNode } from "react"; 3 | 4 | export function isClassComponent(component: unknown) { 5 | return ( 6 | typeof component === "function" && 7 | !!component.prototype && 8 | component.prototype.isReactComponent 9 | ); 10 | } 11 | 12 | export function isFunctionComponent(component: any) { 13 | return ( 14 | typeof component === "function" && 15 | String(component).includes("return React.createElement") 16 | ); 17 | } 18 | 19 | export function isInlineFunctionComponent(component: any) { 20 | return typeof component === "function"; 21 | } 22 | 23 | export function isReactComponent(component: any) { 24 | return !!( 25 | isClassComponent(component) || 26 | isFunctionComponent(component) || 27 | isInlineFunctionComponent(component) 28 | ); 29 | } 30 | 31 | export function isElement(element) { 32 | return React.isValidElement(element); 33 | } 34 | 35 | export function isDOMTypeElement(element) { 36 | return isElement(element) && typeof element.type === "string"; 37 | } 38 | 39 | export function isCompositeTypeElement(element) { 40 | return isElement(element) && typeof element.type === "export function"; 41 | } 42 | 43 | export const Component = ( 44 | component: ReactElement | ReactNode, 45 | props: any 46 | ): React.ReactNode => { 47 | return isReactComponent(component) ? ( 48 | React.createElement(component, props) 49 | ) : isElement(component) ? ( 50 | React.cloneElement(component, props) 51 | ) : ( 52 | <> 53 | ); 54 | }; 55 | 56 | export default Component; 57 | -------------------------------------------------------------------------------- /apps/react-app/src/components/IsMounted.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import classNames from "classnames"; 3 | 4 | interface IsMountedProps { 5 | className?: string; 6 | children: React.ReactNode; 7 | } 8 | 9 | export const IsMounted = ({ className, children }: IsMountedProps) => { 10 | const containerClassName = classNames(className, "IsMounted"); 11 | const [isMounted, setIsMounted] = React.useState(); 12 | React.useEffect(() => { 13 | setIsMounted(true); 14 | }, []); 15 | 16 | return
{isMounted && children}
; 17 | }; 18 | 19 | export default IsMounted; 20 | -------------------------------------------------------------------------------- /apps/react-app/src/components/Layout/Menu/MenuItemSidebar.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react"; 2 | 3 | import classnames from "classnames"; 4 | import Link from "next/link"; 5 | import { useRouter } from "next/router"; 6 | 7 | interface IMenuItemSidebar { 8 | label: string; 9 | href: string; 10 | image?: ReactNode; 11 | labelStyle?: string; 12 | iconStyle?: string; 13 | defaultStyle?: boolean; 14 | } 15 | 16 | export const MenuItemSidebar = ({ 17 | label, 18 | href, 19 | image, 20 | labelStyle, 21 | iconStyle, 22 | }: IMenuItemSidebar) => { 23 | const router = useRouter(); 24 | const isMatch = router.pathname.match(href); 25 | const isExactMatch = isMatch ? isMatch[0] === router.pathname : false; 26 | const styleItem = classnames("items-center cursor-pointer px-3 py-0"); 27 | const styleBase = classnames("flex items-center justify-between"); 28 | 29 | const styleLabel = classnames( 30 | "text-baseline uppercases py-2 block", 31 | labelStyle, 32 | { 33 | "text-sky-500 hover:text-sky-600": isExactMatch, 34 | "text-blueGray-700 hover:text-blueGray-500": !isExactMatch, 35 | } 36 | ); 37 | 38 | const styleIcon = classnames("mr-0 text-sms", iconStyle, { 39 | "opacity-75": isExactMatch, 40 | "text-blueGray-300": !isExactMatch, 41 | }); 42 | 43 | return ( 44 |
  • 45 | 46 | 47 | {label}{" "} 48 | {image} 49 | 50 | 51 |
  • 52 | ); 53 | }; 54 | 55 | export default MenuItemSidebar; 56 | -------------------------------------------------------------------------------- /apps/react-app/src/components/ModuleComponentPreview.tsx: -------------------------------------------------------------------------------- 1 | import classNames from "classnames"; 2 | import * as React from "react"; 3 | 4 | interface ModuleComponentPreviewProps { 5 | className?: string; 6 | title?: string; 7 | code?: React.ReactNode; 8 | url?: string; 9 | } 10 | 11 | export const ModuleComponentPreview = ({ 12 | className, 13 | title, 14 | code, 15 | url, 16 | }: ModuleComponentPreviewProps) => { 17 | const containerClassName = classNames( 18 | className, 19 | "ModuleComponentPreview", 20 | "card" 21 | ); 22 | return ( 23 |
    24 |
    25 |

    {title}

    26 | 27 | View Code 28 | 29 |
    30 |
    31 | 32 |
    {code}
    33 |
    34 |
    35 | ); 36 | }; 37 | 38 | export default ModuleComponentPreview; 39 | -------------------------------------------------------------------------------- /apps/react-app/src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import "../styles/global.css"; 2 | import "@rainbow-me/rainbowkit/styles.css"; 3 | import { 4 | connectorsForWallets, 5 | getDefaultWallets, 6 | RainbowKitProvider, 7 | wallet, 8 | } from "@rainbow-me/rainbowkit"; 9 | import type { AppProps } from "next/app"; 10 | import { chain, configureChains, createClient, WagmiConfig } from "wagmi"; 11 | import { alchemyProvider } from "wagmi/providers/alchemy"; 12 | import { publicProvider } from "wagmi/providers/public"; 13 | import IsMounted from "@/components/IsMounted"; 14 | import { AppConfig } from "@/utils/AppConfig"; 15 | import { ModalProvider } from "react-modal-hook"; 16 | import { 17 | ALCHEMY_ID, 18 | ENABLE_TESTNETS, 19 | FORKING_ENABLED, 20 | } from "@/utils/constants"; 21 | import { jsonRpcProvider } from "wagmi/providers/jsonRpc"; 22 | 23 | console.log(FORKING_ENABLED); 24 | const { chains, provider, webSocketProvider } = configureChains( 25 | [ 26 | chain.mainnet, 27 | chain.optimism, 28 | chain.polygon, 29 | chain.arbitrum, 30 | ...(ENABLE_TESTNETS === "true" 31 | ? [chain.hardhat, chain.goerli, chain.kovan, chain.rinkeby, chain.ropsten] 32 | : []), 33 | ], 34 | true 35 | ? [ 36 | jsonRpcProvider({ 37 | priority: 0, 38 | rpc: () => ({ 39 | http: "http://127.0.0.1:8545", 40 | }), 41 | }), 42 | publicProvider(), 43 | ] 44 | : [publicProvider()] 45 | ); 46 | 47 | const { wallets } = getDefaultWallets({ 48 | appName: AppConfig.title, 49 | chains, 50 | }); 51 | 52 | const dappInfo = { 53 | appName: AppConfig.title, 54 | }; 55 | 56 | const connectors = connectorsForWallets([ 57 | ...wallets, 58 | { 59 | groupName: "Other", 60 | wallets: [ 61 | wallet.argent({ chains }), 62 | wallet.trust({ chains }), 63 | wallet.ledger({ chains }), 64 | ], 65 | }, 66 | ]); 67 | 68 | const wagmiClient = createClient({ 69 | autoConnect: true, 70 | connectors, 71 | provider, 72 | webSocketProvider, 73 | }); 74 | 75 | function MyApp({ Component, pageProps }: AppProps) { 76 | return ( 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | ); 87 | } 88 | 89 | export default MyApp; 90 | -------------------------------------------------------------------------------- /apps/react-app/src/pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import Document, { Head, Html, Main, NextScript } from "next/document"; 2 | 3 | import { AppConfig } from "@/utils/AppConfig"; 4 | 5 | // Need to create a custom _document because i18n support is not compatible with `next export`. 6 | class MyDocument extends Document { 7 | // eslint-disable-next-line class-methods-use-this 8 | render() { 9 | return ( 10 | 11 | 12 | 13 |
    14 | 15 | 16 | 17 | ); 18 | } 19 | } 20 | 21 | export default MyDocument; 22 | -------------------------------------------------------------------------------- /apps/react-app/src/templates/Main.tsx: -------------------------------------------------------------------------------- 1 | import type { ReactNode } from "react"; 2 | import { ConnectButton } from "@rainbow-me/rainbowkit"; 3 | import { AppColorMode } from "@/components/App/AppColorMode"; 4 | import { AppConfig } from "@/utils/AppConfig"; 5 | import AppLogo from "@/components/App/AppLogo"; 6 | 7 | type IMainProps = { 8 | meta: ReactNode; 9 | children: ReactNode; 10 | }; 11 | 12 | const Main = (props: IMainProps) => ( 13 |
    14 | {props.meta} 15 |
    16 |
    17 |
    18 | 19 |
    20 |
    21 | 22 |
    23 |
    24 | 25 |
    26 | {props.children} 27 |
    28 | 29 |
    30 |
    31 |
    32 | © Copyright {new Date().getFullYear()} {AppConfig.title} 33 |
    34 |
    35 | 36 |
    37 |
    38 |
    39 |
    40 |
    41 | ); 42 | 43 | export { Main }; 44 | -------------------------------------------------------------------------------- /apps/react-app/src/templates/Meta.tsx: -------------------------------------------------------------------------------- 1 | import Head from "next/head"; 2 | import { useRouter } from "next/router"; 3 | import { NextSeo } from "next-seo"; 4 | 5 | import { AppConfig } from "@/utils/AppConfig"; 6 | 7 | type IMetaProps = { 8 | title: string; 9 | description: string; 10 | canonical?: string; 11 | }; 12 | 13 | const Meta = (props: IMetaProps) => { 14 | const router = useRouter(); 15 | 16 | return ( 17 | <> 18 | 19 | 20 | 25 | 30 | 37 | 44 | 49 | 50 | 62 | 63 | ); 64 | }; 65 | 66 | export { Meta }; 67 | -------------------------------------------------------------------------------- /apps/react-app/src/utils/AppConfig.ts: -------------------------------------------------------------------------------- 1 | export const AppConfig = { 2 | emoji: "🎨 ", 3 | title: "ERC721K", 4 | site_name: "ERC721K - Dynamic Image and Traits", 5 | description: "Dynamic NFT Image and Traits", 6 | locale: "en", 7 | }; 8 | -------------------------------------------------------------------------------- /apps/react-app/src/utils/constants.ts: -------------------------------------------------------------------------------- 1 | import getConfig from "next/config"; 2 | const { publicRuntimeConfig } = getConfig(); 3 | export const NODE_ENV = publicRuntimeConfig.NODE_ENV || "development"; 4 | export const ALCHEMY_ID = process.env.NEXT_PUBLIC_ALCHEMY_ID; 5 | export const ENABLE_TESTNETS = process.env.NEXT_PUBLIC_ENABLE_TESTNETS; 6 | export const FORKING_ENABLED = process.env.NEXT_PUBLIC_FORKING_ENABLED; 7 | export default { 8 | NODE_ENV, 9 | ALCHEMY_ID, 10 | ENABLE_TESTNETS, 11 | FORKING_ENABLED 12 | }; 13 | -------------------------------------------------------------------------------- /apps/react-app/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | darkMode: 'class', 3 | content: ['./src/**/*.{js,ts,jsx,tsx}'], 4 | theme: { 5 | fontSize: { 6 | xs: '0.75rem', 7 | sm: '0.875rem', 8 | base: '1rem', 9 | lg: '1.125rem', 10 | xl: '1.25rem', 11 | '2xl': '1.5rem', 12 | '3xl': '1.875rem', 13 | '4xl': '2.25rem', 14 | '5xl': '3rem', 15 | '6xl': '4rem', 16 | '7xl': '5.5rem', 17 | '8xl': '6.8rem', 18 | '9xl': '4rem', 19 | }, 20 | extend: { 21 | colors: { 22 | gray: { 23 | 100: '#f7fafc', 24 | 200: '#edf2f7', 25 | 300: '#e2e8f0', 26 | 400: '#cbd5e0', 27 | 500: '#a0aec0', 28 | 600: '#718096', 29 | 700: '#4a5568', 30 | 800: '#2d3748', 31 | 900: '#1a202c', 32 | }, 33 | blue: { 34 | 100: '#ebf8ff', 35 | 200: '#bee3f8', 36 | 300: '#90cdf4', 37 | 400: '#63b3ed', 38 | 500: '#4299e1', 39 | 600: '#3182ce', 40 | 700: '#2b6cb0', 41 | 800: '#2c5282', 42 | 900: '#2a4365', 43 | }, 44 | }, 45 | }, 46 | }, 47 | plugins: [], 48 | }; 49 | -------------------------------------------------------------------------------- /apps/react-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "resolveJsonModule": true, 7 | "removeComments": true, 8 | "preserveConstEnums": true, 9 | "strict": true, 10 | "alwaysStrict": true, 11 | "strictNullChecks": true, 12 | "noUncheckedIndexedAccess": true, 13 | 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "allowUnreachableCode": false, 20 | "noFallthroughCasesInSwitch": true, 21 | 22 | "target": "es5", 23 | "outDir": "out", 24 | "declaration": true, 25 | "sourceMap": true, 26 | 27 | "esModuleInterop": true, 28 | "allowSyntheticDefaultImports": true, 29 | "allowJs": false, 30 | "skipLibCheck": true, 31 | "forceConsistentCasingInFileNames": true, 32 | 33 | "jsx": "preserve", 34 | "noEmit": true, 35 | "isolatedModules": true, 36 | "incremental": true, 37 | 38 | "baseUrl": ".", 39 | "paths": { 40 | "@/*": ["./src/*"], 41 | "@/public/*": ["./public/*"] 42 | } 43 | }, 44 | "exclude": ["./out/**/*", "./node_modules/**/*", "**/*.test.ts"], 45 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] 46 | } 47 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.env.example: -------------------------------------------------------------------------------- 1 | # Build Systems 2 | export FOUNDRY_ENABLED= 3 | 4 | # Accounts 5 | export TESTNET_PK_DEPLOYER='' 6 | export TESTNET_HDWALLET_MNEMONIC= 7 | export MAINNET_PK_DEPLOYER='' 8 | export MAINNET_HDWALLET_MNEMONIC= 9 | 10 | # Forking 11 | export FORK_BLOCK_NUMBER=15131000 12 | export HIDE_DEPLOY_LOG='false' 13 | 14 | # JSON-RPC Endpoints 15 | export ETHEREUM_MAINNET_RPC_URL='' 16 | export ETHEREUM_TESTNET_RPC_URL='' 17 | export POLYGON_MAINNET_RPC_URL='' 18 | export POLYGON_TESTNET_RPC_URL='' 19 | export OPTIMISM_MAINNET_RPC_URL='' 20 | export OPTIMISM_TESTNET_RPC_URL='' 21 | export ARCHIVE_NODE_RPC_URL='' 22 | 23 | # Verification 24 | export ETHERSCAN_API_KEY='' 25 | export POLYGONSCAN_API_KEY='' 26 | 27 | # APIs 28 | export REPORT_GAS='' 29 | export COINMARKETCAP_API_KEY='' -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Coveralls 2 | 3 | on: ["push", "pull_request"] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Use Node.js 16.9.0 11 | uses: actions/setup-node@v2 12 | with: 13 | node-version: 16.9.0 14 | - name: yarn, compile, hint, coverage 15 | run: | 16 | yarn 17 | yarn compile 18 | yarn hint 19 | yarn coverage 20 | - name: Coveralls 21 | uses: coverallsapp/github-action@master 22 | with: 23 | github-token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.gitignore: -------------------------------------------------------------------------------- 1 | /.yarn/* 2 | !/.yarn/releases 3 | !/.yarn/plugins 4 | !/.yarn/sdks 5 | 6 | # Swap the comments on the following lines if you don't wish to use zero-installs 7 | # Documentation here: https://yarnpkg.com/features/zero-installs 8 | #!/.yarn/cache 9 | /.pnp.* 10 | 11 | .envrc 12 | 13 | # deployments/localhost 14 | 15 | abis 16 | artifacts 17 | cache 18 | docs 19 | node_modules 20 | types 21 | 22 | # Solidity Coverage 23 | coverage 24 | coverage.json 25 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.nvmrc: -------------------------------------------------------------------------------- 1 | 16.10.0 2 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.prettierignore: -------------------------------------------------------------------------------- 1 | coverage 2 | types 3 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "overrides": [ 5 | { 6 | "files": "*.*.{ts,js}", 7 | "options": { 8 | "parser": "typescript", 9 | "trailingComma": "all", 10 | "arrowParens": "always", 11 | "singleQuote": true 12 | } 13 | }, 14 | { 15 | "files": "*.sol", 16 | "options": { 17 | "bracketSpacing": true, 18 | "explicitTypes": "always" 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | providerOptions: { 3 | network_id: 1337, 4 | _chainId: 1337, 5 | _chainIdRpc: 1337, 6 | }, 7 | skipFiles: ['external', 'test'], 8 | }; 9 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "plugins": [], 4 | "rules": { 5 | "func-order": "off", 6 | "mark-callable-contracts": "off", 7 | "no-empty-blocks": "off", 8 | "compiler-version": ["error", "0.8.15"], 9 | "private-vars-leading-underscore": "off", 10 | "code-complexity": "warn", 11 | "const-name-snakecase": "warn", 12 | "function-max-lines": "warn", 13 | "func-visibility": [ 14 | "warn", 15 | { 16 | "ignoreConstructors": true 17 | } 18 | ], 19 | "max-line-length": ["warn", 160], 20 | "avoid-suicide": "error", 21 | "avoid-sha3": "warn", 22 | "not-rely-on-time": "off", 23 | "reason-string": ["warn", { "maxLength": 64 }] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/README.md: -------------------------------------------------------------------------------- 1 | # ERC721K Core Smart Contracts 2 | 3 | ![TS](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555) 4 | [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](http://perso.crans.org/besson/LICENSE.html) 5 | 6 | # Installation 7 | 8 | Install the repo and dependencies by running: 9 | `yarn` 10 | 11 | ## Deployment 12 | 13 | These contracts can be deployed to a network by running: 14 | `yarn deploy ` 15 | 16 | ## Verification 17 | 18 | These contracts can be verified on Etherscan, or an Etherscan clone. 19 | `yarn etherscan-verify ` 20 | 21 | # Testing 22 | 23 | Run the unit tests locally with: 24 | `yarn test` 25 | 26 | ## Coverage 27 | 28 | Generate the test coverage report with: 29 | `yarn coverage` 30 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/auth/Owned.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Simple single owner authorization mixin. 5 | /// @author SolBase (https://github.com/Sol-DAO/solbase/blob/main/src/auth/Owned.sol) 6 | /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) 7 | abstract contract Owned { 8 | /// ----------------------------------------------------------------------- 9 | /// Events 10 | /// ----------------------------------------------------------------------- 11 | 12 | event OwnershipTransferred(address indexed user, address indexed newOwner); 13 | 14 | /// ----------------------------------------------------------------------- 15 | /// Custom Errors 16 | /// ----------------------------------------------------------------------- 17 | 18 | error Unauthorized(); 19 | 20 | /// ----------------------------------------------------------------------- 21 | /// Ownership Storage 22 | /// ----------------------------------------------------------------------- 23 | 24 | address public owner; 25 | 26 | modifier onlyOwner() virtual { 27 | if (msg.sender != owner) revert Unauthorized(); 28 | 29 | _; 30 | } 31 | 32 | /// ----------------------------------------------------------------------- 33 | /// Constructor 34 | /// ----------------------------------------------------------------------- 35 | 36 | constructor(address _owner) { 37 | owner = _owner; 38 | 39 | emit OwnershipTransferred(address(0), _owner); 40 | } 41 | 42 | /// ----------------------------------------------------------------------- 43 | /// Ownership Logic 44 | /// ----------------------------------------------------------------------- 45 | 46 | function transferOwnership(address newOwner) public payable virtual onlyOwner { 47 | owner = newOwner; 48 | 49 | emit OwnershipTransferred(msg.sender, newOwner); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/tokens/WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | import {ERC20} from "./ERC20/ERC20.sol"; 5 | import {SafeTransferLib} from "../utils/SafeTransferLib.sol"; 6 | 7 | /// @notice Minimalist and modern Wrapped Ether implementation. 8 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/tokens/WETH.sol) 9 | /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol) 10 | contract WETH is ERC20("Wrapped Ether", "WETH", 18) { 11 | using SafeTransferLib for address; 12 | 13 | event Deposit(address indexed from, uint256 amount); 14 | 15 | event Withdrawal(address indexed to, uint256 amount); 16 | 17 | function deposit() public payable virtual { 18 | _mint(msg.sender, msg.value); 19 | 20 | emit Deposit(msg.sender, msg.value); 21 | } 22 | 23 | function withdraw(uint256 amount) public virtual { 24 | _burn(msg.sender, amount); 25 | 26 | emit Withdrawal(msg.sender, amount); 27 | 28 | msg.sender.safeTransferETH(amount); 29 | } 30 | 31 | receive() external payable virtual { 32 | deposit(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/Bytes32AddressLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Library for converting between addresses and bytes32 values. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/Bytes32AddressLib.sol) 6 | /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Bytes32AddressLib.sol) 7 | library Bytes32AddressLib { 8 | function fromLast20Bytes(bytes32 bytesValue) internal pure returns (address) { 9 | return address(uint160(uint256(bytesValue))); 10 | } 11 | 12 | function fillLast12Bytes(address addressValue) internal pure returns (bytes32) { 13 | return bytes32(bytes20(addressValue)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/EIP712.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Gas-optimized implementation of EIP-712 domain separator and digest encoding. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/EIP712.sol) 6 | abstract contract EIP712 { 7 | /// ----------------------------------------------------------------------- 8 | /// Domain Constants 9 | /// ----------------------------------------------------------------------- 10 | 11 | /// @dev `keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")`. 12 | bytes32 internal constant DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f; 13 | 14 | bytes32 internal immutable HASHED_DOMAIN_NAME; 15 | 16 | bytes32 internal immutable HASHED_DOMAIN_VERSION; 17 | 18 | bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; 19 | 20 | uint256 internal immutable INITIAL_CHAIN_ID; 21 | 22 | /// ----------------------------------------------------------------------- 23 | /// Constructor 24 | /// ----------------------------------------------------------------------- 25 | 26 | constructor(string memory domainName, string memory version) { 27 | HASHED_DOMAIN_NAME = keccak256(bytes(domainName)); 28 | 29 | HASHED_DOMAIN_VERSION = keccak256(bytes(version)); 30 | 31 | INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); 32 | 33 | INITIAL_CHAIN_ID = block.chainid; 34 | } 35 | 36 | /// ----------------------------------------------------------------------- 37 | /// EIP-712 Logic 38 | /// ----------------------------------------------------------------------- 39 | 40 | function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { 41 | return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); 42 | } 43 | 44 | function computeDomainSeparator() internal view virtual returns (bytes32) { 45 | return 46 | keccak256( 47 | abi.encode(DOMAIN_TYPEHASH, HASHED_DOMAIN_NAME, HASHED_DOMAIN_VERSION, block.chainid, address(this)) 48 | ); 49 | } 50 | 51 | function computeDigest(bytes32 hashStruct) internal view virtual returns (bytes32) { 52 | return keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), hashStruct)); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/ERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Interface for contracts with ERC165 support. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/LibERC165.sol) 6 | abstract contract ERC165 { 7 | function supportsInterface(bytes4 interfaceId) external view virtual returns (bool); 8 | } 9 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/FixedPointMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Arithmetic free function collection with operations for fixed-point numbers. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/FixedPointMath.sol) 6 | /// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/FixedPointMathLib.sol) 7 | 8 | /// @dev The maximum possible integer. 9 | uint256 constant MAX_UINT256 = 2**256 - 1; 10 | 11 | /// @dev Returns `floor(x * y / denominator)`. 12 | /// Reverts if `x * y` overflows, or `denominator` is zero. 13 | function mulDivDown( 14 | uint256 x, 15 | uint256 y, 16 | uint256 denominator 17 | ) pure returns (uint256 z) { 18 | assembly { 19 | // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) 20 | if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { 21 | // Store the function selector of `MulDivFailed()`. 22 | mstore(0x00, 0xad251c27) 23 | // Revert with (offset, size). 24 | revert(0x1c, 0x04) 25 | } 26 | 27 | // Divide x * y by the denominator. 28 | z := div(mul(x, y), denominator) 29 | } 30 | } 31 | 32 | /// @dev Returns `ceil(x * y / denominator)`. 33 | /// Reverts if `x * y` overflows, or `denominator` is zero. 34 | function mulDivUp( 35 | uint256 x, 36 | uint256 y, 37 | uint256 denominator 38 | ) pure returns (uint256 z) { 39 | assembly { 40 | // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) 41 | if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { 42 | // Store the function selector of `MulDivFailed()`. 43 | mstore(0x00, 0xad251c27) 44 | // Revert with (offset, size). 45 | revert(0x1c, 0x04) 46 | } 47 | 48 | // If x * y modulo the denominator is strictly greater than 0, 49 | // 1 is added to round up the division of x * y by the denominator. 50 | z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator)) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/LibBytemap.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Efficient bytemap library for mapping integers to bytes. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/LibBytemap.sol) 6 | /// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBytemap.sol) 7 | library LibBytemap { 8 | struct Bytemap { 9 | mapping(uint256 => uint256) map; 10 | } 11 | 12 | function get(Bytemap storage bytemap, uint256 index) internal view returns (uint8 result) { 13 | assembly { 14 | mstore(0x20, bytemap.slot) 15 | mstore(0x00, shr(5, index)) 16 | result := byte(and(index, 0x1f), sload(keccak256(0x00, 0x20))) 17 | } 18 | } 19 | 20 | function set( 21 | Bytemap storage bytemap, 22 | uint256 index, 23 | uint8 value 24 | ) internal { 25 | assembly { 26 | mstore(0x20, bytemap.slot) 27 | mstore(0x00, shr(5, index)) 28 | let storageSlot := keccak256(0x00, 0x20) 29 | // Store the value into the 0x00 slot. 30 | mstore(0x00, sload(storageSlot)) 31 | // And abuse `mstore8` to directly set the byte. 32 | mstore8(and(index, 0x1f), value) 33 | sstore(storageSlot, mload(0x00)) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Signature permit interface for any EIP-2612 or Dai-style token. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/Permit.sol) 6 | abstract contract Permit { 7 | /// @notice Permit to spend tokens for EIP-2612 permit signatures. 8 | /// @param owner The address of the token holder. 9 | /// @param spender The address of the token permit holder. 10 | /// @param value The amount permitted to spend. 11 | /// @param deadline The unix timestamp before which permit must be spent. 12 | /// @param v Must produce valid secp256k1 signature from the `owner` along with `r` and `s`. 13 | /// @param r Must produce valid secp256k1 signature from the `owner` along with `v` and `s`. 14 | /// @param s Must produce valid secp256k1 signature from the `owner` along with `r` and `v`. 15 | function permit( 16 | address owner, 17 | address spender, 18 | uint256 value, 19 | uint256 deadline, 20 | uint8 v, 21 | bytes32 r, 22 | bytes32 s 23 | ) external virtual; 24 | 25 | /// @notice Permit to spend tokens for permit signatures that have the `allowed` parameter. 26 | /// @param owner The address of the token holder. 27 | /// @param spender The address of the token permit holder. 28 | /// @param nonce The current nonce of the `owner`. 29 | /// @param deadline The unix timestamp before which permit must be spent. 30 | /// @param allowed If true, `spender` will be given permission to spend `owner`'s tokens. 31 | /// @param v Must produce valid secp256k1 signature from the `owner` along with `r` and `s`. 32 | /// @param r Must produce valid secp256k1 signature from the `owner` along with `v` and `s`. 33 | /// @param s Must produce valid secp256k1 signature from the `owner` along with `r` and `v`. 34 | function permit( 35 | address owner, 36 | address spender, 37 | uint256 nonce, 38 | uint256 deadline, 39 | bool allowed, 40 | uint8 v, 41 | bytes32 r, 42 | bytes32 s 43 | ) external virtual; 44 | } 45 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/ReentrancyGuard.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Gas-optimized reentrancy protection for smart contracts. 5 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/ReentrancyGuard.sol) 6 | abstract contract ReentrancyGuard { 7 | error Reentrancy(); 8 | 9 | uint256 private locked = 1; 10 | 11 | modifier nonReentrant() virtual { 12 | if (locked == 2) revert Reentrancy(); 13 | 14 | locked = 2; 15 | 16 | _; 17 | 18 | locked = 1; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/SafeCastLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @notice Safe unsigned integer casting library that reverts on overflow. 5 | /// @author Solmate (https://github.com/Sol-DAO/solbase/blob/main/src/utils/SafeCastLib.sol) 6 | /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol) 7 | library SafeCastLib { 8 | error OverFlow(); 9 | 10 | function safeCastTo248(uint256 x) internal pure returns (uint248 y) { 11 | if (x >= (1 << 248)) revert OverFlow(); 12 | 13 | y = uint248(x); 14 | } 15 | 16 | function safeCastTo224(uint256 x) internal pure returns (uint224 y) { 17 | if (x >= (1 << 224)) revert OverFlow(); 18 | 19 | y = uint224(x); 20 | } 21 | 22 | function safeCastTo192(uint256 x) internal pure returns (uint192 y) { 23 | if (x >= (1 << 192)) revert OverFlow(); 24 | 25 | y = uint192(x); 26 | } 27 | 28 | function safeCastTo160(uint256 x) internal pure returns (uint160 y) { 29 | if (x >= (1 << 160)) revert OverFlow(); 30 | 31 | y = uint160(x); 32 | } 33 | 34 | function safeCastTo128(uint256 x) internal pure returns (uint128 y) { 35 | if (x >= (1 << 128)) revert OverFlow(); 36 | 37 | y = uint128(x); 38 | } 39 | 40 | function safeCastTo96(uint256 x) internal pure returns (uint96 y) { 41 | if (x >= (1 << 96)) revert OverFlow(); 42 | 43 | y = uint96(x); 44 | } 45 | 46 | function safeCastTo64(uint256 x) internal pure returns (uint64 y) { 47 | if (x >= (1 << 64)) revert OverFlow(); 48 | 49 | y = uint64(x); 50 | } 51 | 52 | function safeCastTo32(uint256 x) internal pure returns (uint32 y) { 53 | if (x >= (1 << 32)) revert OverFlow(); 54 | 55 | y = uint32(x); 56 | } 57 | 58 | function safeCastTo24(uint256 x) internal pure returns (uint24 y) { 59 | if (x >= (1 << 24)) revert OverFlow(); 60 | 61 | y = uint24(x); 62 | } 63 | 64 | function safeCastTo16(uint256 x) internal pure returns (uint16 y) { 65 | if (x >= (1 << 16)) revert OverFlow(); 66 | 67 | y = uint16(x); 68 | } 69 | 70 | function safeCastTo8(uint256 x) internal pure returns (uint8 y) { 71 | if (x >= (1 << 8)) revert OverFlow(); 72 | 73 | y = uint8(x); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/SelfPermit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | import {Permit} from "./Permit.sol"; 5 | 6 | /// @notice Signature permit helper for any EIP-2612 or Dai-style token. 7 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/SelfPermit.sol) 8 | /// @author Modified from Uniswap (https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/SelfPermit.sol) 9 | /// @dev These functions are expected to be embedded in multicall to allow EOAs to approve a contract and call a function 10 | /// that requires an approval in a single transaction. 11 | abstract contract SelfPermit { 12 | /// @notice Permits this contract to spend a given EIP-2612 `token` from `msg.sender`. 13 | /// @dev The `owner` is always `msg.sender` and the `spender` is always `address(this)`. 14 | /// @param token The address of the asset spent. 15 | /// @param value The amount permitted to spend. 16 | /// @param deadline The unix timestamp before which permit must be spent. 17 | /// @param v Must produce valid secp256k1 signature from the `msg.sender` along with `r` and `s`. 18 | /// @param r Must produce valid secp256k1 signature from the `msg.sender` along with `v` and `s`. 19 | /// @param s Must produce valid secp256k1 signature from the `msg.sender` along with `r` and `v`. 20 | function selfPermit( 21 | Permit token, 22 | uint256 value, 23 | uint256 deadline, 24 | uint8 v, 25 | bytes32 r, 26 | bytes32 s 27 | ) public virtual { 28 | token.permit(msg.sender, address(this), value, deadline, v, r, s); 29 | } 30 | 31 | /// @notice Permits this contract to spend a given Dai-style `token` from `msg.sender`. 32 | /// @dev The `owner` is always `msg.sender` and the `spender` is always `address(this)`. 33 | /// @param token The address of the asset spent. 34 | /// @param nonce The current nonce of the `owner`. 35 | /// @param deadline The unix timestamp before which permit must be spent. 36 | /// @param v Must produce valid secp256k1 signature from the `msg.sender` along with `r` and `s`. 37 | /// @param r Must produce valid secp256k1 signature from the `msg.sender` along with `v` and `s`. 38 | /// @param s Must produce valid secp256k1 signature from the `msg.sender` along with `r` and `v`. 39 | function selfPermitAllowed( 40 | Permit token, 41 | uint256 nonce, 42 | uint256 deadline, 43 | uint8 v, 44 | bytes32 r, 45 | bytes32 s 46 | ) public virtual { 47 | token.permit(msg.sender, address(this), nonce, deadline, true, v, r, s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/Solbase/utils/SignatureCheckerLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | import "./ECDSA.sol"; 5 | 6 | /// @notice Signature verification helper that supports both ECDSA signatures from EOAs 7 | /// and ERC1271 signatures from smart contract wallets like Argent and Gnosis safe. 8 | /// @author SolDAO (https://github.com/Sol-DAO/solbase/blob/main/src/utils/SignatureCheckerLib.sol) 9 | /// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/SignatureCheckerLib.sol) 10 | library SignatureCheckerLib { 11 | function isValidSignatureNow( 12 | address signer, 13 | bytes32 hash, 14 | bytes calldata signature 15 | ) internal view returns (bool isValid) { 16 | if (signer == address(0)) return false; 17 | 18 | if (ECDSA.recover(hash, signature) == signer) return true; 19 | 20 | assembly { 21 | // Load the free memory pointer. 22 | // Simply using the free memory usually costs less if many slots are needed. 23 | let m := mload(0x40) 24 | 25 | // Write the abi-encoded calldata into memory, beginning with the function selector. 26 | mstore(m, 0x1626ba7e) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`. 27 | mstore(add(m, 0x20), hash) 28 | mstore(add(m, 0x40), 0x40) // The offset of the `signature` in the calldata. 29 | // Copy the `signature` and its length over. 30 | calldatacopy(add(m, 0x60), sub(signature.offset, 0x20), 0x80) 31 | 32 | isValid := and( 33 | and( 34 | // Whether the returndata is the magic value `0x1626ba7e` (left-aligned). 35 | eq(mload(0x00), shl(224, mload(m))), 36 | // Whether the returndata is exactly 0x20 bytes (1 word) long . 37 | eq(returndatasize(), 0x20) 38 | ), 39 | // Whether the staticcall does not revert. 40 | // This must be placed at the end of the `and` clause, 41 | // as the arguments are evaluated from right to left. 42 | staticcall( 43 | gas(), // Remaining gas. 44 | signer, // The `signer` address. 45 | add(m, 0x1c), // Offset of calldata in memory. 46 | 0xc4, // Length of calldata in memory. 47 | 0x00, // Offset of returndata. 48 | 0x20 // Length of returndata to write. 49 | ) 50 | ) 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/interfaces/IERC721KImage.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IERC721KImage { 5 | function render(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/interfaces/IERC721KTraits.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IERC721KTraits { 5 | enum DisplayType { 6 | Base, 7 | Generic, 8 | BoostNumber, 9 | BoostPercent, 10 | Number, 11 | Date 12 | } 13 | 14 | function fetch(bytes memory input) external view returns (string memory); 15 | } 16 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/interfaces/IStream.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IStream { 5 | function count(address _address) external view returns (uint256); 6 | 7 | function getData(address _address) 8 | external 9 | view 10 | returns (string[] memory keys, string[] memory values); 11 | 12 | function getValue(address _address, string memory _key) external view returns (string memory); 13 | } 14 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/mocks/MockERC721K.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.15; 3 | 4 | import { ERC721K } from "../ERC721K.sol"; 5 | 6 | contract MockERC721K is ERC721K { 7 | constructor( 8 | string memory name, 9 | string memory symbol, 10 | address erc721Storage 11 | ) ERC721K(name, symbol, erc721Storage) {} 12 | 13 | function _tokenData(uint256) internal view virtual override returns (bytes memory, bytes memory) { 14 | bytes memory imageBytes; 15 | bytes memory traitsBytes; 16 | return (imageBytes, traitsBytes); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/contracts/mocks/MockERC721Storage.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.15; 3 | 4 | import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; 5 | import { ERC721Storage } from "../ERC721Storage.sol"; 6 | 7 | contract MockERC721Storage is ERC721Storage { 8 | constructor( 9 | address _svgRender_, 10 | address _traitsFetch_, 11 | ContractURI memory _contractURI_ 12 | ) ERC721Storage(_svgRender_, _traitsFetch_, _contractURI_) {} 13 | 14 | function _parseName(uint256 _tokenId) internal view override returns (string memory) { 15 | return string.concat("NFT #", Strings.toString(_tokenId)); 16 | } 17 | 18 | function _parseDescription(uint256 _tokenId) internal view override returns (string memory) { 19 | return string.concat("NFT Member #", Strings.toString(_tokenId)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/hardhat.config.ts: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import '@nomiclabs/hardhat-etherscan'; 3 | import '@typechain/hardhat'; 4 | import '@nomiclabs/hardhat-ethers'; 5 | import '@nomiclabs/hardhat-waffle'; 6 | import 'hardhat-dependency-compiler'; 7 | import 'hardhat-abi-exporter'; 8 | import 'hardhat-deploy'; 9 | import 'hardhat-deploy-ethers'; 10 | import 'hardhat-gas-reporter'; 11 | import 'solidity-coverage'; 12 | import { HardhatUserConfig } from 'hardhat/config'; 13 | import networks from './hardhat.network'; 14 | 15 | const optimizerEnabled = !process.env.OPTIMIZER_DISABLED; 16 | 17 | const config: HardhatUserConfig = { 18 | abiExporter: { 19 | path: './abis', 20 | runOnCompile: true, 21 | clear: true, 22 | flat: false, 23 | except: ['./abis/ERC20.sol', './abis/ERC721.sol'], 24 | }, 25 | typechain: { 26 | outDir: 'types', 27 | target: 'ethers-v5', 28 | }, 29 | etherscan: { 30 | apiKey: process.env.ETHERSCAN_API_KEY, 31 | }, 32 | gasReporter: { 33 | currency: 'USD', 34 | gasPrice: 100, 35 | enabled: process.env.REPORT_GAS ? true : false, 36 | coinmarketcap: process.env.COINMARKETCAP_API_KEY, 37 | maxMethodDiff: 10, 38 | }, 39 | mocha: { 40 | timeout: 30000, 41 | }, 42 | namedAccounts: { 43 | deployer: { 44 | default: 0, 45 | }, 46 | }, 47 | networks, 48 | solidity: { 49 | version: '0.8.15', 50 | settings: { 51 | optimizer: { 52 | enabled: optimizerEnabled, 53 | runs: 200, 54 | }, 55 | evmVersion: 'istanbul', 56 | }, 57 | }, 58 | dependencyCompiler: { 59 | paths: [ 60 | // '@erc721k/periphery-sol/contracts/svg/svg.sol', 61 | // '@erc721k/periphery-sol/contracts/svg/svgUtils.sol', 62 | // '@erc721k/periphery-sol/contracts/svg/SVGColor.sol', 63 | // '@erc721k/periphery-sol/contracts/svg/SVGLibrary.sol', 64 | // '@erc721k/periphery-sol/contracts/svg/SVGRegistry.sol', 65 | // '@erc721k/streams-sol/contracts/svg/SVGRegistry.sol', 66 | ], 67 | }, 68 | }; 69 | 70 | export default config; 71 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/scripts/watch.js: -------------------------------------------------------------------------------- 1 | const watch = require("node-watch"); 2 | const { exec } = require("child_process"); 3 | 4 | const run = () => { 5 | console.log("🛠 Compiling & Deploying..."); 6 | exec("yarn deploy", function (error, stdout, stderr) { 7 | console.log(stdout); 8 | if (error) console.log(error); 9 | if (stderr) console.log(stderr); 10 | }); 11 | }; 12 | 13 | console.log("🔬 Watching Contracts..."); 14 | watch("./contracts", { recursive: true }, function (evt, name) { 15 | console.log("%s changed.", name); 16 | run(); 17 | }); 18 | run(); 19 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/templates/contract.hbs: -------------------------------------------------------------------------------- 1 | {{{natspec.userdoc}}} 2 | {{{natspec.devdoc}}} 3 | 4 | {{#if structs}} 5 | ## Structs 6 | {{/if}} 7 | {{#each structs}} 8 | ### `{{name}}` 9 | {{#each members}} 10 | - {{type}} {{name}} 11 | {{/each}} 12 | {{/each}} 13 | 14 | {{#if enums}} 15 | ## Enums 16 | {{/if}} 17 | {{#each enums}} 18 | ### `{{name}}` 19 | All members: {{members}} 20 | {{#each members}} 21 | - {{.}} 22 | {{/each}} 23 | {{/each}} 24 | 25 | {{#if functions}} 26 | ## Functions 27 | {{/if}} 28 | {{#functions}} 29 | {{#unless (eq visibility "internal")}} 30 | ### {{name}} 31 | ```solidity 32 | function {{name}}( 33 | {{#natspec.params}} 34 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 35 | {{/natspec.params}} 36 | ) {{visibility}}{{#if outputs}} returns ({{outputs}}){{/if}} 37 | ``` 38 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 39 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 40 | {{#if natspec.params}} 41 | #### Parameters: 42 | | Name | Type | Description | 43 | | :--- | :--- | :------------------------------------------------------------------- | 44 | {{#natspec.params}} 45 | |`{{param}}` | {{#lookup ../args.types @index}}{{/lookup}} | {{ description }}{{/natspec.params}}{{/if}} 46 | {{#if natspec.returns}} 47 | #### Return Values: 48 | | Type | Description | 49 | | :------------ | :--------------------------------------------------------------------------- | 50 | {{#natspec.returns}} 51 | | {{#lookup ../outputs.types @index}}{{/lookup}} | {{param}} {{{description}}}{{/natspec.returns}}{{/if}} 52 | {{/unless}} 53 | {{/functions}} 54 | {{#if events}} 55 | ## Events 56 | {{/if}} 57 | {{#events}} 58 | ### {{name}} 59 | ```solidity 60 | event {{name}}( 61 | {{#natspec.params}} 62 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 63 | {{/natspec.params}} 64 | ) 65 | ``` 66 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 67 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 68 | {{#if natspec.params}} 69 | #### Parameters: 70 | | Name | Type | Description | 71 | | :----------------------------- | :------------ | :--------------------------------------------- | 72 | {{#natspec.params}} 73 | |`{{param}}`| {{#lookup ../args.types @index}}{{/lookup}} | {{{description}}}{{/natspec.params}}{{/if}} 74 | {{/events}} 75 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/test/ERC721K.test.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { artifacts, ethers } from 'hardhat'; 3 | import { constants, Contract, ContractFactory } from 'ethers'; 4 | import { deployMockContract, MockContract } from 'ethereum-waffle'; 5 | import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; 6 | 7 | const { getSigners, utils } = ethers; 8 | 9 | describe('ERC721K', () => { 10 | let wallet0: SignerWithAddress; 11 | let wallet1: SignerWithAddress; 12 | let wallet2: SignerWithAddress; 13 | // ======================================================== 14 | let MockERC721Storage: MockContract; 15 | // ======================================================== 16 | let ERC721K: Contract; 17 | let ERC721KFactory: ContractFactory; 18 | // ======================================================== 19 | const contactInformation = { 20 | name: 'ERC721Storage', 21 | description: 'ERC721Storage', 22 | image: 'image', 23 | externalLink: 'link', 24 | sellerFeeBasisPoints: '0', 25 | feeRecipient: '0x0000000000000000000000000000000000000000', 26 | }; 27 | 28 | before(async () => { 29 | [wallet0, wallet1, wallet2] = await getSigners(); 30 | ERC721KFactory = await ethers.getContractFactory('MockERC721K'); 31 | let ERC721StorageArtifact = await artifacts.readArtifact('MockERC721Storage'); 32 | MockERC721Storage = await deployMockContract(wallet1, ERC721StorageArtifact.abi); 33 | await MockERC721Storage.mock.constructContractURI.returns(contactInformation); 34 | }); 35 | 36 | beforeEach(async () => { 37 | ERC721K = await ERC721KFactory.deploy("Collectable", "NFT", MockERC721Storage.address); 38 | }); 39 | 40 | describe('tokenURI(uint256 tokenId)', () => { 41 | it('should SUCCEED', async () => {}); 42 | it('should FAIL', async () => {}); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/test/ERC721Storage.test.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { artifacts, ethers } from 'hardhat'; 3 | import { deployMockContract, MockContract } from 'ethereum-waffle'; 4 | import { constants, Contract, ContractFactory } from 'ethers'; 5 | import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; 6 | 7 | const { getSigners, utils } = ethers; 8 | 9 | describe('ERC721Storage', () => { 10 | let wallet0: SignerWithAddress; 11 | let wallet1: SignerWithAddress; 12 | let wallet2: SignerWithAddress; 13 | // ======================================================== 14 | let SvgRenderMock: MockContract; 15 | let TraitsFetchMock: MockContract; 16 | // ======================================================== 17 | let ERC721K: Contract; 18 | let ERC721KFactory: ContractFactory; 19 | let ERC721Storage: Contract; 20 | let ERC721StorageFactory: ContractFactory; 21 | // ======================================================== 22 | const contactInformation = { 23 | name: 'ERC721Storage', 24 | description: 'ERC721Storage', 25 | image: 'image', 26 | externalLink: 'link', 27 | sellerFeeBasisPoints: '0', 28 | feeRecipient: '0x0000000000000000000000000000000000000000', 29 | }; 30 | 31 | before(async () => { 32 | [wallet0, wallet1, wallet2] = await getSigners(); 33 | ERC721KFactory = await ethers.getContractFactory('MockERC721K'); 34 | ERC721StorageFactory = await ethers.getContractFactory('MockERC721Storage'); 35 | let SvgRenderMockArtifact = await artifacts.readArtifact('IERC721KImage'); 36 | let ITraitsMockArtifact = await artifacts.readArtifact('IERC721KTraits'); 37 | SvgRenderMock = await deployMockContract(wallet1, SvgRenderMockArtifact.abi); 38 | TraitsFetchMock = await deployMockContract(wallet1, ITraitsMockArtifact.abi); 39 | await SvgRenderMock.mock.render.returns('image'); 40 | await TraitsFetchMock.mock.fetch.returns('traits'); 41 | }); 42 | 43 | beforeEach(async () => { 44 | ERC721Storage = await ERC721StorageFactory.deploy( 45 | SvgRenderMock.address, 46 | TraitsFetchMock.address, 47 | contactInformation, 48 | ); 49 | ERC721K = await ERC721KFactory.deploy("Collectable", "NFT", ERC721Storage.address); 50 | }); 51 | 52 | describe('constructTokenURI(uint256,bytes,bytes)', () => { 53 | it('should SUCCEED', async () => {}); 54 | it('should FAIL', async () => {}); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /contracts/erc721k-core-sol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "moduleResolution": "node", 8 | "forceConsistentCasingInFileNames": true, 9 | "resolveJsonModule": true, 10 | }, 11 | "include": [ 12 | "hardhat.config.ts", 13 | "hardhat.network.ts", 14 | "./deploy", 15 | "./scripts", 16 | "./test", 17 | "types/**/*", 18 | "Constant.ts", 19 | "./typechain" 20 | , "utils/createTypedMessage.ts" 21 | ], 22 | "files": ["./hardhat.config.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.env.example: -------------------------------------------------------------------------------- 1 | # Build Systems 2 | export FOUNDRY_ENABLED= 3 | 4 | # Accounts 5 | export TESTNET_PK_DEPLOYER='' 6 | export TESTNET_HDWALLET_MNEMONIC= 7 | export MAINNET_PK_DEPLOYER='' 8 | export MAINNET_HDWALLET_MNEMONIC= 9 | 10 | # Forking 11 | export FORK_BLOCK_NUMBER=15131000 12 | export HIDE_DEPLOY_LOG='false' 13 | 14 | # JSON-RPC Endpoints 15 | export ETHEREUM_MAINNET_RPC_URL='' 16 | export ETHEREUM_TESTNET_RPC_URL='' 17 | export POLYGON_MAINNET_RPC_URL='' 18 | export POLYGON_TESTNET_RPC_URL='' 19 | export OPTIMISM_MAINNET_RPC_URL='' 20 | export OPTIMISM_TESTNET_RPC_URL='' 21 | export ARCHIVE_NODE_RPC_URL='' 22 | 23 | # Verification 24 | export ETHERSCAN_API_KEY='' 25 | export POLYGONSCAN_API_KEY='' 26 | 27 | # APIs 28 | export REPORT_GAS='' 29 | export COINMARKETCAP_API_KEY='' -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Coveralls 2 | 3 | on: ["push", "pull_request"] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Use Node.js 16.9.0 11 | uses: actions/setup-node@v2 12 | with: 13 | node-version: 16.9.0 14 | - name: yarn, compile, hint, coverage 15 | run: | 16 | yarn 17 | yarn compile 18 | yarn hint 19 | yarn coverage 20 | - name: Coveralls 21 | uses: coverallsapp/github-action@master 22 | with: 23 | github-token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.gitignore: -------------------------------------------------------------------------------- 1 | /.yarn/* 2 | !/.yarn/releases 3 | !/.yarn/plugins 4 | !/.yarn/sdks 5 | 6 | # Swap the comments on the following lines if you don't wish to use zero-installs 7 | # Documentation here: https://yarnpkg.com/features/zero-installs 8 | #!/.yarn/cache 9 | /.pnp.* 10 | 11 | .envrc 12 | 13 | # deployments/localhost 14 | 15 | abis 16 | artifacts 17 | cache 18 | docs 19 | node_modules 20 | types 21 | 22 | # Solidity Coverage 23 | coverage 24 | coverage.json 25 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.nvmrc: -------------------------------------------------------------------------------- 1 | 16.10.0 2 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.prettierignore: -------------------------------------------------------------------------------- 1 | coverage 2 | types 3 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "overrides": [ 5 | { 6 | "files": "*.*.{ts,js}", 7 | "options": { 8 | "parser": "typescript", 9 | "trailingComma": "all", 10 | "arrowParens": "always", 11 | "singleQuote": true 12 | } 13 | }, 14 | { 15 | "files": "*.sol", 16 | "options": { 17 | "bracketSpacing": true, 18 | "explicitTypes": "always" 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | providerOptions: { 3 | network_id: 1337, 4 | _chainId: 1337, 5 | _chainIdRpc: 1337, 6 | }, 7 | skipFiles: ['external', 'test'], 8 | }; 9 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "plugins": [], 4 | "rules": { 5 | "func-order": "off", 6 | "mark-callable-contracts": "off", 7 | "no-empty-blocks": "off", 8 | "compiler-version": ["error", "0.8.15"], 9 | "private-vars-leading-underscore": "off", 10 | "code-complexity": "warn", 11 | "const-name-snakecase": "warn", 12 | "function-max-lines": "warn", 13 | "func-visibility": [ 14 | "warn", 15 | { 16 | "ignoreConstructors": true 17 | } 18 | ], 19 | "max-line-length": ["warn", 160], 20 | "avoid-suicide": "error", 21 | "avoid-sha3": "warn", 22 | "not-rely-on-time": "off", 23 | "reason-string": ["warn", { "maxLength": 64 }] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/README.md: -------------------------------------------------------------------------------- 1 | # ERC721K Periphery Smart Contracts 2 | 3 | ![TS](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555) 4 | [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](http://perso.crans.org/besson/LICENSE.html) 5 | 6 | # Installation 7 | 8 | Install the repo and dependencies by running: 9 | `yarn` 10 | 11 | ## Deployment 12 | 13 | These contracts can be deployed to a network by running: 14 | `yarn deploy ` 15 | 16 | ## Verification 17 | 18 | These contracts can be verified on Etherscan, or an Etherscan clone. 19 | `yarn etherscan-verify ` 20 | 21 | # Testing 22 | 23 | Run the unit tests locally with: 24 | `yarn test` 25 | 26 | ## Coverage 27 | 28 | Generate the test coverage report with: 29 | `yarn coverage` 30 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/IDataStream.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IDataStream { 5 | function get(address[] calldata targets, bytes[] calldata data) 6 | external 7 | view 8 | returns (bytes memory value); 9 | } 10 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/IERC712KTraits.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IERC712KTraits { 5 | function generate(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/IERC721KRender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IERC721KRender { 5 | function render(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/IMetaFetch.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IMetaFetch { 5 | struct Metadata { 6 | string name; 7 | string description; 8 | string image; 9 | string image_data; 10 | string background_color; 11 | string animation_url; 12 | string external_url; 13 | string youtube_url; 14 | Trait[] attributes; 15 | } 16 | 17 | struct Core { 18 | string name; 19 | string description; 20 | string background_color; 21 | string animation_url; 22 | string external_url; 23 | string youtube_url; 24 | } 25 | 26 | struct Image { 27 | string image; 28 | string image_data; 29 | } 30 | 31 | struct Trait { 32 | string display_type; 33 | string trait_type; 34 | string value; 35 | } 36 | 37 | function get(uint256 tokenId) external view returns (Metadata memory meta); 38 | 39 | function data(uint256 tokenId) external view returns (Core memory core); 40 | 41 | function image(uint256 tokenId) external view returns (Image memory image); 42 | 43 | function traits(uint256 tokenId) external view returns (Trait[] memory traits); 44 | } 45 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/ISVGModule.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface ISVGModule { 5 | function decode(bytes memory input) external view returns (string memory); 6 | 7 | function getEncoding() external view returns (string memory); 8 | } 9 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/ISVGRender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface ISVGRender { 5 | function render(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/interfaces/ITraitsFetch.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface ITraitsFetch { 5 | function fetch(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/svg/SVGLibrary.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 5 | import { svg } from "./svg.sol"; 6 | import { svgUtils } from "./svgUtils.sol"; 7 | import { SVGColor } from "./SVGColor.sol"; 8 | 9 | contract SVGLibrary { 10 | address private _colors; 11 | 12 | bytes32 private immutable BUILD = keccak256("BUILD"); 13 | bytes32 private immutable COLOR = keccak256("COLOR"); 14 | bytes32 private immutable UTILS = keccak256("UTILS"); 15 | 16 | mapping(bytes32 => address) _modules; 17 | 18 | constructor(address _colors_) { 19 | _colors = _colors_; 20 | } 21 | 22 | function execute(bytes32 package, bytes calldata input) 23 | external 24 | view 25 | returns (string memory data) 26 | { 27 | if (_modules[package] != 0x0000000000000000000000000000000000000000) { 28 | (bool success, bytes memory data) = address(_modules[package]).staticcall(input); 29 | return string(data); 30 | } else if (package == BUILD) { 31 | (bool success, bytes memory data) = address(svg).staticcall(input); 32 | return string(data); 33 | } else if (package == COLOR) { 34 | (bool success, bytes memory data) = _colors.staticcall(input); 35 | return string(data); 36 | } else if (package == UTILS) { 37 | (bool success, bytes memory data) = address(svgUtils).staticcall(input); 38 | return string(data); 39 | } else { 40 | return string(data); 41 | revert("SVGLibrary:invalid-operation"); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/contracts/svg/SVGRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 5 | import { ISVGModule } from "../interfaces/ISVGModule.sol"; 6 | 7 | contract SVGRegistry is Ownable { 8 | mapping(bytes32 => address) private _modules; 9 | 10 | constructor() {} 11 | 12 | function fetch(bytes32 widgetId, bytes memory input) external view returns (string memory) { 13 | if (_modules[widgetId] != address(0)) { 14 | return ISVGModule(_modules[widgetId]).decode(input); 15 | } else { 16 | return ""; 17 | } 18 | } 19 | 20 | function getWidget(bytes32 widgetId) external view returns (address widget) { 21 | return _modules[widgetId]; 22 | } 23 | 24 | function setWidget(bytes32 widgetId, address widget) external onlyOwner { 25 | _modules[widgetId] = widget; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/deploy/00_fork.ts: -------------------------------------------------------------------------------- 1 | import { ethers } from "hardhat"; 2 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 3 | 4 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 5 | if (process.env.DEPLOY == "fork") { 6 | const { deployments, getNamedAccounts } = hardhat; 7 | 8 | const { deploy } = deployments; 9 | const { deployer } = await getNamedAccounts(); 10 | 11 | const nounsDescriptor = '0x0Cfdb3Ba1694c2bb2CFACB0339ad7b1Ae5932B63' 12 | const ensReverseRecord = '0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C' 13 | 14 | const ENounsRender = await deploy("ENounsRender", { 15 | contract: "ENounsRender", 16 | from: deployer, 17 | args: [nounsDescriptor, ensReverseRecord], 18 | skipIfAlreadyDeployed: true, 19 | log: true, 20 | }); 21 | 22 | const StreamENS = await deploy("StreamENS", { 23 | contract: "StreamENS", 24 | from: deployer, 25 | args: [], 26 | skipIfAlreadyDeployed: true, 27 | log: true, 28 | }); 29 | const ENounsTraits = await deploy("ENounsTraits", { 30 | contract: "ENounsTraits", 31 | from: deployer, 32 | args: [StreamENS.address], 33 | skipIfAlreadyDeployed: true, 34 | log: true, 35 | }); 36 | 37 | const contactInformation = { 38 | name: "eNouns", 39 | description: "PoolyDefender.", 40 | image: "https://ipfs.io/ipfs/QmR5suybqBDHkMB7fiXCjKuXEXwRPmJ8ExsRbPasxu36rm", 41 | externalLink: "https://enouns.art", 42 | sellerFeeBasisPoints: "0", 43 | feeRecipient: "0x0000000000000000000000000000000000000000", 44 | }; 45 | 46 | const ENounsStorage = await deploy("ENounsStorage", { 47 | contract: "ENounsStorage", 48 | from: deployer, 49 | args: [ENounsRender.address, ENounsTraits.address, contactInformation], 50 | skipIfAlreadyDeployed: true, 51 | log: true, 52 | }); 53 | 54 | await deploy("ENouns", { 55 | contract: "ENouns", 56 | from: deployer, 57 | args: ["Ethereum Nouns System", "eNouns", ENounsStorage.address, ensReverseRecord], 58 | skipIfAlreadyDeployed: true, 59 | log: true, 60 | }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/deploy/00_mainnet.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "mainnet") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const nounsDescriptor = '0x0Cfdb3Ba1694c2bb2CFACB0339ad7b1Ae5932B63' 11 | const ensReverseRecord = '0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C' 12 | 13 | const ENounsRender = await deploy("ENounsRender", { 14 | contract: "ENounsRender", 15 | from: deployer, 16 | args: [nounsDescriptor, ensReverseRecord], 17 | skipIfAlreadyDeployed: true, 18 | log: true, 19 | }); 20 | 21 | const StreamENS = await deploy("StreamENS", { 22 | contract: "StreamENS", 23 | from: deployer, 24 | args: [], 25 | skipIfAlreadyDeployed: true, 26 | log: true, 27 | }); 28 | const ENounsTraits = await deploy("ENounsTraits", { 29 | contract: "ENounsTraits", 30 | from: deployer, 31 | args: [StreamENS.address], 32 | skipIfAlreadyDeployed: true, 33 | log: true, 34 | }); 35 | 36 | const contactInformation = { 37 | name: "eNouns", 38 | description: "PoolyDefender.", 39 | image: "https://ipfs.io/ipfs/QmR5suybqBDHkMB7fiXCjKuXEXwRPmJ8ExsRbPasxu36rm", 40 | externalLink: "https://enouns.art", 41 | sellerFeeBasisPoints: "0", 42 | feeRecipient: "0x0000000000000000000000000000000000000000", 43 | }; 44 | 45 | const ENounsStorage = await deploy("ENounsStorage", { 46 | contract: "ENounsStorage", 47 | from: deployer, 48 | args: [ENounsRender.address, ENounsTraits.address, contactInformation], 49 | skipIfAlreadyDeployed: true, 50 | log: true, 51 | }); 52 | 53 | await deploy("ENouns", { 54 | contract: "ENouns", 55 | from: deployer, 56 | args: ["Ethereum Nouns System", "eNouns", ENounsStorage.address, ensReverseRecord], 57 | skipIfAlreadyDeployed: false, 58 | log: true, 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/deploy/01_nounders-testnet.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "nounders:testnet") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x9342d17D9161d642F73aE9Feebb627F46F1029C5' 11 | const name = 'enoeno' 12 | const symbol = 'ENO' 13 | const imageUrl = 'https://gateway.pinata.cloud/ipfs/QmcsfEQmRCg5bPVuYoSpGxjfQfn3iDxpg3eZLc1j3n5oTS' 14 | 15 | const contactInformation = { 16 | name: "enoeno", 17 | description: "enoeno.", 18 | image: "", 19 | externalLink: "https://kames.me", 20 | sellerFeeBasisPoints: "0", 21 | feeRecipient: "0x0000000000000000000000000000000000000000", 22 | }; 23 | 24 | const ENounsRender = await deploy("ENounders", { 25 | contract: "ENounders", 26 | from: deployer, 27 | args: [name, symbol, contactInformation, imageUrl, owner], 28 | skipIfAlreadyDeployed: false, 29 | log: true, 30 | }); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/deploy/01_nounders.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "nounders") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x761d584f1C2d43cBc3F42ECd739701a36dFFAa31' 11 | const name = 'Founding eNouners' 12 | const symbol = 'eNounders' 13 | const imageUrl = 'https://ipfs.io/ipfs/QmZutNBNqkK4sss3uqCpManf4R1ZKr2XJXJVca5UNxUdNn' 14 | 15 | const contactInformation = { 16 | name: "The Early Nounders", 17 | description: "Limited Edition 1/1 Founding eNouners Collectable.", 18 | image: "https://ipfs.io/ipfs/QmcFLwidGpXh2vX5d4Vr59wQfJqhj5iwR1icxV6q9m2ZJ1", 19 | externalLink: "https://enouns.art", 20 | sellerFeeBasisPoints: "0", 21 | feeRecipient: "0x0000000000000000000000000000000000000000", 22 | }; 23 | 24 | await deploy("ENounders", { 25 | contract: "ENounders", 26 | from: deployer, 27 | args: [name, symbol, contactInformation, imageUrl, owner], 28 | skipIfAlreadyDeployed: true, 29 | log: true, 30 | }); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/deploy/02_wolf.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "wolf") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x761d584f1C2d43cBc3F42ECd739701a36dFFAa31' 11 | 12 | const name = 'Wolf' 13 | const symbol = 'WOLF' 14 | const imageUrl = 'https://gateway.pinata.cloud/ipfs/QmPeCqsL9EpXCRGZqffLYio5uG8SvdEvAhAGgUk2R9gwBq' 15 | 16 | const contactInformation = { 17 | name: "Wolf Pack", 18 | description: "Unleash your inner chaos.", 19 | image: "https://gateway.pinata.cloud/ipfs/QmZ877R7oqj2sC8pvEgmBQzH7PFDcm91NQZuTyoF3XyXQ9", 20 | externalLink: "https://kames.me", 21 | sellerFeeBasisPoints: "0", 22 | feeRecipient: "0x0000000000000000000000000000000000000000", 23 | }; 24 | 25 | await deploy("ChaosWolf", { 26 | contract: "ChaosWolf", 27 | from: deployer, 28 | args: [name, symbol, contactInformation, imageUrl, owner], 29 | skipIfAlreadyDeployed: true, 30 | log: true, 31 | }); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/hardhat.config.ts: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import '@nomiclabs/hardhat-etherscan'; 3 | import '@typechain/hardhat'; 4 | import '@nomiclabs/hardhat-ethers'; 5 | import '@nomiclabs/hardhat-waffle'; 6 | import 'hardhat-dependency-compiler'; 7 | import 'hardhat-abi-exporter'; 8 | import 'hardhat-deploy'; 9 | import 'hardhat-deploy-ethers'; 10 | import 'hardhat-gas-reporter'; 11 | import 'solidity-coverage'; 12 | import { HardhatUserConfig } from 'hardhat/config'; 13 | import networks from './hardhat.network'; 14 | 15 | const optimizerEnabled = !process.env.OPTIMIZER_DISABLED; 16 | 17 | const config: HardhatUserConfig = { 18 | abiExporter: { 19 | path: './abis', 20 | runOnCompile: true, 21 | clear: true, 22 | flat: false, 23 | except: ['./abis/ERC20.sol', './abis/ERC721.sol'], 24 | }, 25 | typechain: { 26 | outDir: 'types', 27 | target: 'ethers-v5', 28 | }, 29 | dependencyCompiler: { 30 | paths: [ 31 | '@turbo-eth/solbase-sol/src/utils/Base64.sol', 32 | ], 33 | }, 34 | etherscan: { 35 | apiKey: process.env.ETHERSCAN_API_KEY, 36 | }, 37 | gasReporter: { 38 | currency: 'USD', 39 | gasPrice: 100, 40 | enabled: process.env.REPORT_GAS ? true : false, 41 | coinmarketcap: process.env.COINMARKETCAP_API_KEY, 42 | maxMethodDiff: 10, 43 | }, 44 | mocha: { 45 | timeout: 30000, 46 | }, 47 | namedAccounts: { 48 | deployer: { 49 | default: 0, 50 | }, 51 | }, 52 | networks, 53 | solidity: { 54 | version: '0.8.15', 55 | settings: { 56 | optimizer: { 57 | enabled: optimizerEnabled, 58 | runs: 200, 59 | }, 60 | evmVersion: 'istanbul', 61 | }, 62 | }, 63 | }; 64 | 65 | export default config; 66 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/hardhat.tasks.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | // import { ethers } from "hardhat"; 3 | // import { task } from "hardhat/config"; 4 | import terminalImage from 'terminal-image'; 5 | 6 | task('balance', "Prints an account's balance") 7 | .addParam('account', "The account's address") 8 | .setAction(async (taskArguments) => { 9 | const balance = await ethers.provider.getBalance(taskArguments.account); 10 | console.log(ethers.utils.formatEther(balance), 'ETH'); 11 | }); 12 | 13 | task('preview', 'Preview') 14 | .addParam('name', 'ENS domain') 15 | .setAction(async (taskArguments, { deployments }, runSuper) => { 16 | const EthereumNounSystem = await deployments.get('EthereumNounSystem'); 17 | const ens = await ethers.getContract('EthereumNounSystem', EthereumNounSystem.address); 18 | const preview = await ens.previewUsingName(taskArguments.name); 19 | console.log(preview); 20 | }); 21 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/scripts/watch.js: -------------------------------------------------------------------------------- 1 | const watch = require("node-watch"); 2 | const { exec } = require("child_process"); 3 | 4 | const run = () => { 5 | console.log("🛠 Compiling & Deploying..."); 6 | exec("yarn deploy", function (error, stdout, stderr) { 7 | console.log(stdout); 8 | if (error) console.log(error); 9 | if (stderr) console.log(stderr); 10 | }); 11 | }; 12 | 13 | console.log("🔬 Watching Contracts..."); 14 | watch("./contracts", { recursive: true }, function (evt, name) { 15 | console.log("%s changed.", name); 16 | run(); 17 | }); 18 | run(); 19 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/templates/contract.hbs: -------------------------------------------------------------------------------- 1 | {{{natspec.userdoc}}} 2 | {{{natspec.devdoc}}} 3 | 4 | {{#if structs}} 5 | ## Structs 6 | {{/if}} 7 | {{#each structs}} 8 | ### `{{name}}` 9 | {{#each members}} 10 | - {{type}} {{name}} 11 | {{/each}} 12 | {{/each}} 13 | 14 | {{#if enums}} 15 | ## Enums 16 | {{/if}} 17 | {{#each enums}} 18 | ### `{{name}}` 19 | All members: {{members}} 20 | {{#each members}} 21 | - {{.}} 22 | {{/each}} 23 | {{/each}} 24 | 25 | {{#if functions}} 26 | ## Functions 27 | {{/if}} 28 | {{#functions}} 29 | {{#unless (eq visibility "internal")}} 30 | ### {{name}} 31 | ```solidity 32 | function {{name}}( 33 | {{#natspec.params}} 34 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 35 | {{/natspec.params}} 36 | ) {{visibility}}{{#if outputs}} returns ({{outputs}}){{/if}} 37 | ``` 38 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 39 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 40 | {{#if natspec.params}} 41 | #### Parameters: 42 | | Name | Type | Description | 43 | | :--- | :--- | :------------------------------------------------------------------- | 44 | {{#natspec.params}} 45 | |`{{param}}` | {{#lookup ../args.types @index}}{{/lookup}} | {{ description }}{{/natspec.params}}{{/if}} 46 | {{#if natspec.returns}} 47 | #### Return Values: 48 | | Type | Description | 49 | | :------------ | :--------------------------------------------------------------------------- | 50 | {{#natspec.returns}} 51 | | {{#lookup ../outputs.types @index}}{{/lookup}} | {{param}} {{{description}}}{{/natspec.returns}}{{/if}} 52 | {{/unless}} 53 | {{/functions}} 54 | {{#if events}} 55 | ## Events 56 | {{/if}} 57 | {{#events}} 58 | ### {{name}} 59 | ```solidity 60 | event {{name}}( 61 | {{#natspec.params}} 62 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 63 | {{/natspec.params}} 64 | ) 65 | ``` 66 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 67 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 68 | {{#if natspec.params}} 69 | #### Parameters: 70 | | Name | Type | Description | 71 | | :----------------------------- | :------------ | :--------------------------------------------- | 72 | {{#natspec.params}} 73 | |`{{param}}`| {{#lookup ../args.types @index}}{{/lookup}} | {{{description}}}{{/natspec.params}}{{/if}} 74 | {{/events}} 75 | -------------------------------------------------------------------------------- /contracts/erc721k-periphery-sol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "moduleResolution": "node", 8 | "forceConsistentCasingInFileNames": true, 9 | "resolveJsonModule": true, 10 | }, 11 | "include": [ 12 | "hardhat.config.ts", 13 | "hardhat.network.ts", 14 | "./deploy", 15 | "./scripts", 16 | "./test", 17 | "types/**/*", 18 | "Constant.ts", 19 | "./typechain" 20 | , "utils/createTypedMessage.ts" 21 | ], 22 | "files": ["./hardhat.config.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.env.example: -------------------------------------------------------------------------------- 1 | # Build Systems 2 | export FOUNDRY_ENABLED= 3 | 4 | # Accounts 5 | export TESTNET_PK_DEPLOYER='' 6 | export TESTNET_HDWALLET_MNEMONIC= 7 | export MAINNET_PK_DEPLOYER='' 8 | export MAINNET_HDWALLET_MNEMONIC= 9 | 10 | # Forking 11 | export FORK_BLOCK_NUMBER=15131000 12 | export HIDE_DEPLOY_LOG='false' 13 | 14 | # JSON-RPC Endpoints 15 | export ETHEREUM_MAINNET_RPC_URL='' 16 | export ETHEREUM_TESTNET_RPC_URL='' 17 | export POLYGON_MAINNET_RPC_URL='' 18 | export POLYGON_TESTNET_RPC_URL='' 19 | export OPTIMISM_MAINNET_RPC_URL='' 20 | export OPTIMISM_TESTNET_RPC_URL='' 21 | export ARCHIVE_NODE_RPC_URL='' 22 | 23 | # Verification 24 | export ETHERSCAN_API_KEY='' 25 | export POLYGONSCAN_API_KEY='' 26 | 27 | # APIs 28 | export REPORT_GAS='' 29 | export COINMARKETCAP_API_KEY='' -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Coveralls 2 | 3 | on: ["push", "pull_request"] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Use Node.js 16.9.0 11 | uses: actions/setup-node@v2 12 | with: 13 | node-version: 16.9.0 14 | - name: yarn, compile, hint, coverage 15 | run: | 16 | yarn 17 | yarn compile 18 | yarn hint 19 | yarn coverage 20 | - name: Coveralls 21 | uses: coverallsapp/github-action@master 22 | with: 23 | github-token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.gitignore: -------------------------------------------------------------------------------- 1 | /.yarn/* 2 | !/.yarn/releases 3 | !/.yarn/plugins 4 | !/.yarn/sdks 5 | 6 | # Swap the comments on the following lines if you don't wish to use zero-installs 7 | # Documentation here: https://yarnpkg.com/features/zero-installs 8 | #!/.yarn/cache 9 | /.pnp.* 10 | 11 | .envrc 12 | 13 | # deployments/localhost 14 | 15 | abis 16 | artifacts 17 | cache 18 | docs 19 | node_modules 20 | types 21 | 22 | # Solidity Coverage 23 | coverage 24 | coverage.json 25 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.nvmrc: -------------------------------------------------------------------------------- 1 | 16.10.0 2 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.prettierignore: -------------------------------------------------------------------------------- 1 | coverage 2 | types 3 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "overrides": [ 5 | { 6 | "files": "*.*.{ts,js}", 7 | "options": { 8 | "parser": "typescript", 9 | "trailingComma": "all", 10 | "arrowParens": "always", 11 | "singleQuote": true 12 | } 13 | }, 14 | { 15 | "files": "*.sol", 16 | "options": { 17 | "bracketSpacing": true, 18 | "explicitTypes": "always" 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | providerOptions: { 3 | network_id: 1337, 4 | _chainId: 1337, 5 | _chainIdRpc: 1337, 6 | }, 7 | skipFiles: ['external', 'test'], 8 | }; 9 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "plugins": [], 4 | "rules": { 5 | "func-order": "off", 6 | "mark-callable-contracts": "off", 7 | "no-empty-blocks": "off", 8 | "compiler-version": ["error", "0.8.15"], 9 | "private-vars-leading-underscore": "off", 10 | "code-complexity": "warn", 11 | "const-name-snakecase": "warn", 12 | "function-max-lines": "warn", 13 | "func-visibility": [ 14 | "warn", 15 | { 16 | "ignoreConstructors": true 17 | } 18 | ], 19 | "max-line-length": ["warn", 160], 20 | "avoid-suicide": "error", 21 | "avoid-sha3": "warn", 22 | "not-rely-on-time": "off", 23 | "reason-string": ["warn", { "maxLength": 64 }] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/README.md: -------------------------------------------------------------------------------- 1 | # ERC721K Stream Smart Contracts 2 | 3 | ![TS](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555) 4 | [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](http://perso.crans.org/besson/LICENSE.html) 5 | 6 | # Installation 7 | 8 | Install the repo and dependencies by running: 9 | `yarn` 10 | 11 | ## Deployment 12 | 13 | These contracts can be deployed to a network by running: 14 | `yarn deploy ` 15 | 16 | ## Verification 17 | 18 | These contracts can be verified on Etherscan, or an Etherscan clone. 19 | `yarn etherscan-verify ` 20 | 21 | # Testing 22 | 23 | Run the unit tests locally with: 24 | `yarn test` 25 | 26 | ## Coverage 27 | 28 | Generate the test coverage report with: 29 | `yarn coverage` 30 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/ENS/ENS.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.8.4; 2 | 3 | interface ENS { 4 | // Logged when the owner of a node assigns a new owner to a subnode. 5 | event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); 6 | 7 | // Logged when the owner of a node transfers ownership to a new account. 8 | event Transfer(bytes32 indexed node, address owner); 9 | 10 | // Logged when the resolver for a node changes. 11 | event NewResolver(bytes32 indexed node, address resolver); 12 | 13 | // Logged when the TTL of a node changes 14 | event NewTTL(bytes32 indexed node, uint64 ttl); 15 | 16 | // Logged when an operator is added or removed. 17 | event ApprovalForAll( 18 | address indexed owner, 19 | address indexed operator, 20 | bool approved 21 | ); 22 | 23 | function setRecord( 24 | bytes32 node, 25 | address owner, 26 | address resolver, 27 | uint64 ttl 28 | ) external; 29 | 30 | function setSubnodeRecord( 31 | bytes32 node, 32 | bytes32 label, 33 | address owner, 34 | address resolver, 35 | uint64 ttl 36 | ) external; 37 | 38 | function setSubnodeOwner( 39 | bytes32 node, 40 | bytes32 label, 41 | address owner 42 | ) external returns (bytes32); 43 | 44 | function setResolver(bytes32 node, address resolver) external; 45 | 46 | function setOwner(bytes32 node, address owner) external; 47 | 48 | function setTTL(bytes32 node, uint64 ttl) external; 49 | 50 | function setApprovalForAll(address operator, bool approved) external; 51 | 52 | function owner(bytes32 node) external view returns (address); 53 | 54 | function resolver(bytes32 node) external view returns (address); 55 | 56 | function ttl(bytes32 node) external view returns (uint64); 57 | 58 | function recordExists(bytes32 node) external view returns (bool); 59 | 60 | function isApprovedForAll(address owner, address operator) 61 | external 62 | view 63 | returns (bool); 64 | } 65 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/ENS/IDefaultReverseResolver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.4; 3 | 4 | interface IDefaultReverseResolver { 5 | function name(bytes32 input) external view returns (string calldata); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/ENS/IENSReverseRecords.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity ^0.8.15; 4 | 5 | abstract contract IENSReverseRecords { 6 | function getNames(address[] calldata addresses) external view virtual returns (string[] memory r); 7 | } 8 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/ENS/IReverseRegistrar.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.8.4; 2 | 3 | interface IReverseRegistrar { 4 | function setDefaultResolver(address resolver) external; 5 | 6 | function claim(address owner) external returns (bytes32); 7 | 8 | function claimForAddr( 9 | address addr, 10 | address owner, 11 | address resolver 12 | ) external returns (bytes32); 13 | 14 | function claimWithResolver(address owner, address resolver) external returns (bytes32); 15 | 16 | function setName(string memory name) external returns (bytes32); 17 | 18 | function setNameForAddr( 19 | address addr, 20 | address owner, 21 | address resolver, 22 | string memory name 23 | ) external returns (bytes32); 24 | 25 | function node(address addr) external pure returns (bytes32); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/ENS/ITextResolver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.4; 3 | 4 | interface ITextResolver { 5 | event TextChanged(bytes32 indexed node, string indexed indexedKey, string key); 6 | 7 | /** 8 | * Returns the text data associated with an ENS node and key. 9 | * @param node The ENS node to query. 10 | * @param key The text data key to query. 11 | * @return The associated text data. 12 | */ 13 | function text(bytes32 node, string calldata key) external view returns (string memory); 14 | } 15 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/IERC721KTraits.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IERC721KTraits { 5 | function fetch(bytes memory input) external view returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/interfaces/IStream.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | interface IStream { 5 | function count(address _address) external view returns (uint256); 6 | 7 | function getData(address _address) 8 | external 9 | view 10 | returns (string[] memory keys, string[] memory values); 11 | 12 | function getValue(address _address, string memory _key) external view returns (string memory); 13 | } 14 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/libraries/BytesUtils.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.4; 3 | 4 | library BytesUtils { 5 | /* 6 | * @dev Returns the keccak-256 hash of a byte range. 7 | * @param self The byte string to hash. 8 | * @param offset The position to start hashing at. 9 | * @param len The number of bytes to hash. 10 | * @return The hash of the byte range. 11 | */ 12 | function keccak( 13 | bytes memory self, 14 | uint256 offset, 15 | uint256 len 16 | ) internal pure returns (bytes32 ret) { 17 | require(offset + len <= self.length); 18 | assembly { 19 | ret := keccak256(add(add(self, 32), offset), len) 20 | } 21 | } 22 | 23 | /** 24 | * @dev Returns the ENS namehash of a DNS-encoded name. 25 | * @param self The DNS-encoded name to hash. 26 | * @param offset The offset at which to start hashing. 27 | * @return The namehash of the name. 28 | */ 29 | function namehash(bytes memory self, uint256 offset) internal pure returns (bytes32) { 30 | (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset); 31 | if (labelhash == bytes32(0)) { 32 | require(offset == self.length - 1, "namehash: Junk at end of name"); 33 | return bytes32(0); 34 | } 35 | return keccak256(abi.encodePacked(namehash(self, newOffset), labelhash)); 36 | } 37 | 38 | /** 39 | * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label. 40 | * @param self The byte string to read a label from. 41 | * @param idx The index to read a label at. 42 | * @return labelhash The hash of the label at the specified index, or 0 if it is the last label. 43 | * @return newIdx The index of the start of the next label. 44 | */ 45 | function readLabel(bytes memory self, uint256 idx) 46 | internal 47 | pure 48 | returns (bytes32 labelhash, uint256 newIdx) 49 | { 50 | require(idx < self.length, "readLabel: Index out of bounds"); 51 | uint256 len = uint256(uint8(self[idx])); 52 | if (len > 0) { 53 | labelhash = keccak(self, idx + 1, len); 54 | } else { 55 | labelhash = bytes32(0); 56 | } 57 | newIdx = idx + len + 1; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/contracts/libraries/NameEncoder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.15; 3 | 4 | import "./BytesUtils.sol"; 5 | 6 | library NameEncoder { 7 | using BytesUtils for bytes; 8 | 9 | function dnsEncodeName(string memory name) 10 | internal 11 | pure 12 | returns (bytes memory dnsName, bytes32 node) 13 | { 14 | uint8 labelLength = 0; 15 | bytes memory bytesName = bytes(name); 16 | uint256 length = bytesName.length; 17 | dnsName = new bytes(length + 2); 18 | node = 0; 19 | if (length == 0) { 20 | dnsName[0] = 0; 21 | return (dnsName, node); 22 | } 23 | 24 | // use unchecked to save gas since we check for an underflow 25 | // and we check for the length before the loop 26 | unchecked { 27 | for (uint256 i = length - 1; i >= 0; i--) { 28 | if (bytesName[i] == ".") { 29 | dnsName[i + 1] = bytes1(labelLength); 30 | node = keccak256(abi.encodePacked(node, bytesName.keccak(i + 1, labelLength))); 31 | labelLength = 0; 32 | } else { 33 | labelLength += 1; 34 | dnsName[i + 1] = bytesName[i]; 35 | } 36 | if (i == 0) { 37 | break; 38 | } 39 | } 40 | } 41 | 42 | node = keccak256(abi.encodePacked(node, bytesName.keccak(0, labelLength))); 43 | 44 | dnsName[0] = bytes1(labelLength); 45 | return (dnsName, node); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deploy/00_fork.ts: -------------------------------------------------------------------------------- 1 | import { ethers } from "hardhat"; 2 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 3 | 4 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 5 | if (process.env.DEPLOY == "fork") { 6 | const { deployments, getNamedAccounts } = hardhat; 7 | 8 | const { deploy } = deployments; 9 | const { deployer } = await getNamedAccounts(); 10 | 11 | const nounsDescriptor = '0x0Cfdb3Ba1694c2bb2CFACB0339ad7b1Ae5932B63' 12 | const ensReverseRecord = '0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C' 13 | 14 | const ENounsRender = await deploy("ENounsRender", { 15 | contract: "ENounsRender", 16 | from: deployer, 17 | args: [nounsDescriptor, ensReverseRecord], 18 | skipIfAlreadyDeployed: true, 19 | log: true, 20 | }); 21 | 22 | const StreamENS = await deploy("StreamENS", { 23 | contract: "StreamENS", 24 | from: deployer, 25 | args: [], 26 | skipIfAlreadyDeployed: true, 27 | log: true, 28 | }); 29 | const ENounsTraits = await deploy("ENounsTraits", { 30 | contract: "ENounsTraits", 31 | from: deployer, 32 | args: [StreamENS.address], 33 | skipIfAlreadyDeployed: true, 34 | log: true, 35 | }); 36 | 37 | const contactInformation = { 38 | name: "eNouns", 39 | description: "PoolyDefender.", 40 | image: "https://ipfs.io/ipfs/QmR5suybqBDHkMB7fiXCjKuXEXwRPmJ8ExsRbPasxu36rm", 41 | externalLink: "https://enouns.art", 42 | sellerFeeBasisPoints: "0", 43 | feeRecipient: "0x0000000000000000000000000000000000000000", 44 | }; 45 | 46 | const ENounsStorage = await deploy("ENounsStorage", { 47 | contract: "ENounsStorage", 48 | from: deployer, 49 | args: [ENounsRender.address, ENounsTraits.address, contactInformation], 50 | skipIfAlreadyDeployed: true, 51 | log: true, 52 | }); 53 | 54 | await deploy("ENouns", { 55 | contract: "ENouns", 56 | from: deployer, 57 | args: ["Ethereum Nouns System", "eNouns", ENounsStorage.address, ensReverseRecord], 58 | skipIfAlreadyDeployed: true, 59 | log: true, 60 | }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deploy/00_mainnet.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "mainnet") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const nounsDescriptor = '0x0Cfdb3Ba1694c2bb2CFACB0339ad7b1Ae5932B63' 11 | const ensReverseRecord = '0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C' 12 | 13 | const ENounsRender = await deploy("ENounsRender", { 14 | contract: "ENounsRender", 15 | from: deployer, 16 | args: [nounsDescriptor, ensReverseRecord], 17 | skipIfAlreadyDeployed: true, 18 | log: true, 19 | }); 20 | 21 | const StreamENS = await deploy("StreamENS", { 22 | contract: "StreamENS", 23 | from: deployer, 24 | args: [], 25 | skipIfAlreadyDeployed: true, 26 | log: true, 27 | }); 28 | const ENounsTraits = await deploy("ENounsTraits", { 29 | contract: "ENounsTraits", 30 | from: deployer, 31 | args: [StreamENS.address], 32 | skipIfAlreadyDeployed: true, 33 | log: true, 34 | }); 35 | 36 | const contactInformation = { 37 | name: "eNouns", 38 | description: "PoolyDefender.", 39 | image: "https://ipfs.io/ipfs/QmR5suybqBDHkMB7fiXCjKuXEXwRPmJ8ExsRbPasxu36rm", 40 | externalLink: "https://enouns.art", 41 | sellerFeeBasisPoints: "0", 42 | feeRecipient: "0x0000000000000000000000000000000000000000", 43 | }; 44 | 45 | const ENounsStorage = await deploy("ENounsStorage", { 46 | contract: "ENounsStorage", 47 | from: deployer, 48 | args: [ENounsRender.address, ENounsTraits.address, contactInformation], 49 | skipIfAlreadyDeployed: true, 50 | log: true, 51 | }); 52 | 53 | await deploy("ENouns", { 54 | contract: "ENouns", 55 | from: deployer, 56 | args: ["Ethereum Nouns System", "eNouns", ENounsStorage.address, ensReverseRecord], 57 | skipIfAlreadyDeployed: false, 58 | log: true, 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deploy/01_nounders-testnet.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "nounders:testnet") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x9342d17D9161d642F73aE9Feebb627F46F1029C5' 11 | const name = 'enoeno' 12 | const symbol = 'ENO' 13 | const imageUrl = 'https://gateway.pinata.cloud/ipfs/QmcsfEQmRCg5bPVuYoSpGxjfQfn3iDxpg3eZLc1j3n5oTS' 14 | 15 | const contactInformation = { 16 | name: "enoeno", 17 | description: "enoeno.", 18 | image: "", 19 | externalLink: "https://kames.me", 20 | sellerFeeBasisPoints: "0", 21 | feeRecipient: "0x0000000000000000000000000000000000000000", 22 | }; 23 | 24 | const ENounsRender = await deploy("ENounders", { 25 | contract: "ENounders", 26 | from: deployer, 27 | args: [name, symbol, contactInformation, imageUrl, owner], 28 | skipIfAlreadyDeployed: false, 29 | log: true, 30 | }); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deploy/01_nounders.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "nounders") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x761d584f1C2d43cBc3F42ECd739701a36dFFAa31' 11 | const name = 'Founding eNouners' 12 | const symbol = 'eNounders' 13 | const imageUrl = 'https://ipfs.io/ipfs/QmZutNBNqkK4sss3uqCpManf4R1ZKr2XJXJVca5UNxUdNn' 14 | 15 | const contactInformation = { 16 | name: "The Early Nounders", 17 | description: "Limited Edition 1/1 Founding eNouners Collectable.", 18 | image: "https://ipfs.io/ipfs/QmcFLwidGpXh2vX5d4Vr59wQfJqhj5iwR1icxV6q9m2ZJ1", 19 | externalLink: "https://enouns.art", 20 | sellerFeeBasisPoints: "0", 21 | feeRecipient: "0x0000000000000000000000000000000000000000", 22 | }; 23 | 24 | await deploy("ENounders", { 25 | contract: "ENounders", 26 | from: deployer, 27 | args: [name, symbol, contactInformation, imageUrl, owner], 28 | skipIfAlreadyDeployed: true, 29 | log: true, 30 | }); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deploy/02_wolf.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | if (process.env.DEPLOY == "wolf") { 5 | const { deployments, getNamedAccounts } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const owner = '0x761d584f1C2d43cBc3F42ECd739701a36dFFAa31' 11 | 12 | const name = 'Wolf' 13 | const symbol = 'WOLF' 14 | const imageUrl = 'https://gateway.pinata.cloud/ipfs/QmPeCqsL9EpXCRGZqffLYio5uG8SvdEvAhAGgUk2R9gwBq' 15 | 16 | const contactInformation = { 17 | name: "Wolf Pack", 18 | description: "Unleash your inner chaos.", 19 | image: "https://gateway.pinata.cloud/ipfs/QmZ877R7oqj2sC8pvEgmBQzH7PFDcm91NQZuTyoF3XyXQ9", 20 | externalLink: "https://kames.me", 21 | sellerFeeBasisPoints: "0", 22 | feeRecipient: "0x0000000000000000000000000000000000000000", 23 | }; 24 | 25 | await deploy("ChaosWolf", { 26 | contract: "ChaosWolf", 27 | from: deployer, 28 | args: [name, symbol, contactInformation, imageUrl, owner], 29 | skipIfAlreadyDeployed: true, 30 | log: true, 31 | }); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deployments/ethereumTestnet/.chainId: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/deployments/mainnet/.chainId: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/hardhat.config.ts: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import '@nomiclabs/hardhat-etherscan'; 3 | import '@typechain/hardhat'; 4 | import '@nomiclabs/hardhat-ethers'; 5 | import '@nomiclabs/hardhat-waffle'; 6 | import 'hardhat-dependency-compiler'; 7 | import 'hardhat-abi-exporter'; 8 | import 'hardhat-deploy'; 9 | import 'hardhat-deploy-ethers'; 10 | import 'hardhat-gas-reporter'; 11 | import 'solidity-coverage'; 12 | import { HardhatUserConfig } from 'hardhat/config'; 13 | import networks from './hardhat.network'; 14 | 15 | const optimizerEnabled = !process.env.OPTIMIZER_DISABLED; 16 | 17 | const config: HardhatUserConfig = { 18 | abiExporter: { 19 | path: './abis', 20 | runOnCompile: true, 21 | clear: true, 22 | flat: false, 23 | except: ['./abis/ERC20.sol', './abis/ERC721.sol'], 24 | }, 25 | typechain: { 26 | outDir: 'types', 27 | target: 'ethers-v5', 28 | }, 29 | dependencyCompiler: { 30 | paths: [], 31 | }, 32 | etherscan: { 33 | apiKey: process.env.ETHERSCAN_API_KEY, 34 | }, 35 | gasReporter: { 36 | currency: 'USD', 37 | gasPrice: 100, 38 | enabled: process.env.REPORT_GAS ? true : false, 39 | coinmarketcap: process.env.COINMARKETCAP_API_KEY, 40 | maxMethodDiff: 10, 41 | }, 42 | mocha: { 43 | timeout: 30000, 44 | }, 45 | namedAccounts: { 46 | deployer: { 47 | default: 0, 48 | }, 49 | }, 50 | networks, 51 | solidity: { 52 | version: '0.8.15', 53 | settings: { 54 | optimizer: { 55 | enabled: optimizerEnabled, 56 | runs: 200, 57 | }, 58 | evmVersion: 'istanbul', 59 | }, 60 | }, 61 | }; 62 | 63 | export default config; 64 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/hardhat.tasks.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | // import { ethers } from "hardhat"; 3 | // import { task } from "hardhat/config"; 4 | import terminalImage from 'terminal-image'; 5 | 6 | task('balance', "Prints an account's balance") 7 | .addParam('account', "The account's address") 8 | .setAction(async (taskArguments) => { 9 | const balance = await ethers.provider.getBalance(taskArguments.account); 10 | console.log(ethers.utils.formatEther(balance), 'ETH'); 11 | }); 12 | 13 | task('preview', 'Preview') 14 | .addParam('name', 'ENS domain') 15 | .setAction(async (taskArguments, { deployments }, runSuper) => { 16 | const EthereumNounSystem = await deployments.get('EthereumNounSystem'); 17 | const ens = await ethers.getContract('EthereumNounSystem', EthereumNounSystem.address); 18 | const preview = await ens.previewUsingName(taskArguments.name); 19 | console.log(preview); 20 | }); 21 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/scripts/watch.js: -------------------------------------------------------------------------------- 1 | const watch = require("node-watch"); 2 | const { exec } = require("child_process"); 3 | 4 | const run = () => { 5 | console.log("🛠 Compiling & Deploying..."); 6 | exec("yarn deploy", function (error, stdout, stderr) { 7 | console.log(stdout); 8 | if (error) console.log(error); 9 | if (stderr) console.log(stderr); 10 | }); 11 | }; 12 | 13 | console.log("🔬 Watching Contracts..."); 14 | watch("./contracts", { recursive: true }, function (evt, name) { 15 | console.log("%s changed.", name); 16 | run(); 17 | }); 18 | run(); 19 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/templates/contract.hbs: -------------------------------------------------------------------------------- 1 | {{{natspec.userdoc}}} 2 | {{{natspec.devdoc}}} 3 | 4 | {{#if structs}} 5 | ## Structs 6 | {{/if}} 7 | {{#each structs}} 8 | ### `{{name}}` 9 | {{#each members}} 10 | - {{type}} {{name}} 11 | {{/each}} 12 | {{/each}} 13 | 14 | {{#if enums}} 15 | ## Enums 16 | {{/if}} 17 | {{#each enums}} 18 | ### `{{name}}` 19 | All members: {{members}} 20 | {{#each members}} 21 | - {{.}} 22 | {{/each}} 23 | {{/each}} 24 | 25 | {{#if functions}} 26 | ## Functions 27 | {{/if}} 28 | {{#functions}} 29 | {{#unless (eq visibility "internal")}} 30 | ### {{name}} 31 | ```solidity 32 | function {{name}}( 33 | {{#natspec.params}} 34 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 35 | {{/natspec.params}} 36 | ) {{visibility}}{{#if outputs}} returns ({{outputs}}){{/if}} 37 | ``` 38 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 39 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 40 | {{#if natspec.params}} 41 | #### Parameters: 42 | | Name | Type | Description | 43 | | :--- | :--- | :------------------------------------------------------------------- | 44 | {{#natspec.params}} 45 | |`{{param}}` | {{#lookup ../args.types @index}}{{/lookup}} | {{ description }}{{/natspec.params}}{{/if}} 46 | {{#if natspec.returns}} 47 | #### Return Values: 48 | | Type | Description | 49 | | :------------ | :--------------------------------------------------------------------------- | 50 | {{#natspec.returns}} 51 | | {{#lookup ../outputs.types @index}}{{/lookup}} | {{param}} {{{description}}}{{/natspec.returns}}{{/if}} 52 | {{/unless}} 53 | {{/functions}} 54 | {{#if events}} 55 | ## Events 56 | {{/if}} 57 | {{#events}} 58 | ### {{name}} 59 | ```solidity 60 | event {{name}}( 61 | {{#natspec.params}} 62 | {{#lookup ../args.types @index}}{{/lookup}} {{param}}{{#if @last}}{{else}},{{/if}} 63 | {{/natspec.params}} 64 | ) 65 | ``` 66 | {{#if natspec.userdoc}}{{natspec.userdoc}}{{/if}} 67 | {{#if natspec.devdoc}}{{natspec.devdoc}}{{/if}} 68 | {{#if natspec.params}} 69 | #### Parameters: 70 | | Name | Type | Description | 71 | | :----------------------------- | :------------ | :--------------------------------------------- | 72 | {{#natspec.params}} 73 | |`{{param}}`| {{#lookup ../args.types @index}}{{/lookup}} | {{{description}}}{{/natspec.params}}{{/if}} 74 | {{/events}} 75 | -------------------------------------------------------------------------------- /contracts/erc721k-streams-sol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "moduleResolution": "node", 8 | "forceConsistentCasingInFileNames": true, 9 | "resolveJsonModule": true, 10 | }, 11 | "include": [ 12 | "hardhat.config.ts", 13 | "hardhat.network.ts", 14 | "./deploy", 15 | "./scripts", 16 | "./test", 17 | "types/**/*", 18 | "Constant.ts", 19 | "./typechain" 20 | , "utils/createTypedMessage.ts" 21 | ], 22 | "files": ["./hardhat.config.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "turbo-eth", 3 | "version": "0.0.0-beta.1", 4 | "license": "MIT", 5 | "private": true, 6 | "workspaces": [ 7 | "apps/*", 8 | "contracts/*", 9 | "packages/*", 10 | "external/*" 11 | ], 12 | "pnpm": { 13 | "peerDependencyRules": { 14 | "allowedVersions": { 15 | "@rainbow-me/rainbowkit": "0.4.6", 16 | "react": "18.2.0", 17 | "react-dom": "18.2.0", 18 | "wagmi": "0.6.3" 19 | } 20 | } 21 | }, 22 | "scripts": { 23 | "build": "turbo run build", 24 | "build:prd": "turbo run build:prd", 25 | "compile": "turbo run compile", 26 | "dev": "turbo run dev --parallel", 27 | "lint": "turbo run lint", 28 | "format": "prettier --write \"**/*.{ts,tsx,md}\"", 29 | "chain": "turbo run chain", 30 | "lab": "turbo run lab", 31 | "lab:fork": "turbo run lab:fork", 32 | "clean": "turbo run clean" 33 | }, 34 | "dependencies": { 35 | "react": "18.2.0", 36 | "react-dom": "18.2.0" 37 | }, 38 | "devDependencies": { 39 | "prettier": "^2.6.2", 40 | "turbo": "latest" 41 | }, 42 | "engines": { 43 | "npm": ">=7.0.0", 44 | "node": ">=16.0.0" 45 | }, 46 | "packageManager": "pnpm@7.1.8" 47 | } 48 | -------------------------------------------------------------------------------- /packages/deployments/.env.example: -------------------------------------------------------------------------------- 1 | # Build Systems 2 | export FOUNDRY_ENABLED= 3 | 4 | # Accounts 5 | export TESTNET_PK_DEPLOYER='' 6 | export TESTNET_HDWALLET_MNEMONIC= 7 | export MAINNET_PK_DEPLOYER='' 8 | export MAINNET_HDWALLET_MNEMONIC= 9 | 10 | # Forking 11 | export FORK_BLOCK_NUMBER=15131000 12 | export HIDE_DEPLOY_LOG='false' 13 | 14 | # JSON-RPC Endpoints 15 | export ETHEREUM_MAINNET_RPC_URL='' 16 | export ETHEREUM_TESTNET_RPC_URL='' 17 | export POLYGON_MAINNET_RPC_URL='' 18 | export POLYGON_TESTNET_RPC_URL='' 19 | export OPTIMISM_MAINNET_RPC_URL='' 20 | export OPTIMISM_TESTNET_RPC_URL='' 21 | export ARCHIVE_NODE_RPC_URL='' 22 | 23 | # Verification 24 | export ETHERSCAN_API_KEY='' 25 | export POLYGONSCAN_API_KEY='' 26 | 27 | # APIs 28 | export REPORT_GAS='' 29 | export COINMARKETCAP_API_KEY='' -------------------------------------------------------------------------------- /packages/deployments/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push] 3 | jobs: 4 | build: 5 | name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} 6 | 7 | runs-on: ${{ matrix.os }} 8 | strategy: 9 | matrix: 10 | node: ['10.x', '12.x', '14.x'] 11 | os: [ubuntu-latest, windows-latest, macOS-latest] 12 | 13 | steps: 14 | - name: Checkout repo 15 | uses: actions/checkout@v2 16 | 17 | - name: Use Node ${{ matrix.node }} 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: ${{ matrix.node }} 21 | 22 | - name: Install deps and build (with cache) 23 | uses: bahmutov/npm-install@v1 24 | 25 | - name: Lint 26 | run: yarn lint 27 | 28 | - name: Test 29 | run: yarn test --ci --coverage --maxWorkers=2 30 | 31 | - name: Build 32 | run: yarn build 33 | -------------------------------------------------------------------------------- /packages/deployments/.github/workflows/size.yml: -------------------------------------------------------------------------------- 1 | name: size 2 | on: [pull_request] 3 | jobs: 4 | size: 5 | runs-on: ubuntu-latest 6 | env: 7 | CI_JOB_NUMBER: 1 8 | steps: 9 | - uses: actions/checkout@v1 10 | - uses: andresz1/size-limit-action@v1 11 | with: 12 | github_token: ${{ secrets.GITHUB_TOKEN }} 13 | -------------------------------------------------------------------------------- /packages/deployments/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | .cache 5 | dist 6 | .env -------------------------------------------------------------------------------- /packages/deployments/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 kames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/core-sol/contracts/examples/ExampleRender.sol/ExampleRender.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "_svgRegistry_", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "anonymous": false, 15 | "inputs": [ 16 | { 17 | "indexed": true, 18 | "internalType": "address", 19 | "name": "previousOwner", 20 | "type": "address" 21 | }, 22 | { 23 | "indexed": true, 24 | "internalType": "address", 25 | "name": "newOwner", 26 | "type": "address" 27 | } 28 | ], 29 | "name": "OwnershipTransferred", 30 | "type": "event" 31 | }, 32 | { 33 | "inputs": [], 34 | "name": "owner", 35 | "outputs": [ 36 | { 37 | "internalType": "address", 38 | "name": "", 39 | "type": "address" 40 | } 41 | ], 42 | "stateMutability": "view", 43 | "type": "function" 44 | }, 45 | { 46 | "inputs": [ 47 | { 48 | "internalType": "bytes", 49 | "name": "input", 50 | "type": "bytes" 51 | } 52 | ], 53 | "name": "render", 54 | "outputs": [ 55 | { 56 | "internalType": "string", 57 | "name": "", 58 | "type": "string" 59 | } 60 | ], 61 | "stateMutability": "view", 62 | "type": "function" 63 | }, 64 | { 65 | "inputs": [], 66 | "name": "renounceOwnership", 67 | "outputs": [], 68 | "stateMutability": "nonpayable", 69 | "type": "function" 70 | }, 71 | { 72 | "inputs": [ 73 | { 74 | "internalType": "address", 75 | "name": "newOwner", 76 | "type": "address" 77 | } 78 | ], 79 | "name": "transferOwnership", 80 | "outputs": [], 81 | "stateMutability": "nonpayable", 82 | "type": "function" 83 | } 84 | ] 85 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/core-sol/contracts/examples/ExampleTraits.sol/ExampleTraits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "stateMutability": "nonpayable", 5 | "type": "constructor" 6 | }, 7 | { 8 | "anonymous": false, 9 | "inputs": [ 10 | { 11 | "indexed": true, 12 | "internalType": "address", 13 | "name": "previousOwner", 14 | "type": "address" 15 | }, 16 | { 17 | "indexed": true, 18 | "internalType": "address", 19 | "name": "newOwner", 20 | "type": "address" 21 | } 22 | ], 23 | "name": "OwnershipTransferred", 24 | "type": "event" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "bytes", 30 | "name": "input", 31 | "type": "bytes" 32 | } 33 | ], 34 | "name": "fetch", 35 | "outputs": [ 36 | { 37 | "internalType": "string", 38 | "name": "", 39 | "type": "string" 40 | } 41 | ], 42 | "stateMutability": "view", 43 | "type": "function" 44 | }, 45 | { 46 | "inputs": [], 47 | "name": "owner", 48 | "outputs": [ 49 | { 50 | "internalType": "address", 51 | "name": "", 52 | "type": "address" 53 | } 54 | ], 55 | "stateMutability": "view", 56 | "type": "function" 57 | }, 58 | { 59 | "inputs": [], 60 | "name": "renounceOwnership", 61 | "outputs": [], 62 | "stateMutability": "nonpayable", 63 | "type": "function" 64 | }, 65 | { 66 | "inputs": [ 67 | { 68 | "internalType": "address", 69 | "name": "newOwner", 70 | "type": "address" 71 | } 72 | ], 73 | "name": "transferOwnership", 74 | "outputs": [], 75 | "stateMutability": "nonpayable", 76 | "type": "function" 77 | } 78 | ] 79 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/core-sol/contracts/interfaces/IERC721KImage.sol/IERC721KImage.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "input", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "render", 11 | "outputs": [ 12 | { 13 | "internalType": "string", 14 | "name": "", 15 | "type": "string" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/core-sol/contracts/interfaces/IERC721KTraits.sol/IERC721KTraits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "input", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "fetch", 11 | "outputs": [ 12 | { 13 | "internalType": "string", 14 | "name": "", 15 | "type": "string" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/core-sol/contracts/interfaces/IStream.sol/IStream.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "_address", 7 | "type": "address" 8 | } 9 | ], 10 | "name": "count", 11 | "outputs": [ 12 | { 13 | "internalType": "uint256", 14 | "name": "", 15 | "type": "uint256" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | }, 21 | { 22 | "inputs": [ 23 | { 24 | "internalType": "address", 25 | "name": "_address", 26 | "type": "address" 27 | } 28 | ], 29 | "name": "getData", 30 | "outputs": [ 31 | { 32 | "internalType": "string[]", 33 | "name": "keys", 34 | "type": "string[]" 35 | }, 36 | { 37 | "internalType": "string[]", 38 | "name": "values", 39 | "type": "string[]" 40 | } 41 | ], 42 | "stateMutability": "view", 43 | "type": "function" 44 | }, 45 | { 46 | "inputs": [ 47 | { 48 | "internalType": "address", 49 | "name": "_address", 50 | "type": "address" 51 | }, 52 | { 53 | "internalType": "string", 54 | "name": "_key", 55 | "type": "string" 56 | } 57 | ], 58 | "name": "getValue", 59 | "outputs": [ 60 | { 61 | "internalType": "string", 62 | "name": "", 63 | "type": "string" 64 | } 65 | ], 66 | "stateMutability": "view", 67 | "type": "function" 68 | } 69 | ] 70 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/periphery-sol/contracts/interfaces/ISVGModule.sol/ISVGModule.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getEncoding", 5 | "outputs": [ 6 | { 7 | "internalType": "string", 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [ 17 | { 18 | "internalType": "bytes", 19 | "name": "input", 20 | "type": "bytes" 21 | } 22 | ], 23 | "name": "render", 24 | "outputs": [ 25 | { 26 | "internalType": "string", 27 | "name": "", 28 | "type": "string" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/periphery-sol/contracts/svg/SVGLibrary.sol/SVGLibrary.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "_colors_", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "inputs": [ 15 | { 16 | "internalType": "bytes32", 17 | "name": "package", 18 | "type": "bytes32" 19 | }, 20 | { 21 | "internalType": "bytes", 22 | "name": "input", 23 | "type": "bytes" 24 | } 25 | ], 26 | "name": "execute", 27 | "outputs": [ 28 | { 29 | "internalType": "string", 30 | "name": "data", 31 | "type": "string" 32 | } 33 | ], 34 | "stateMutability": "view", 35 | "type": "function" 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /packages/deployments/abis/@erc721k/periphery-sol/contracts/svg/svg.sol/svg.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "_data", 7 | "type": "bytes" 8 | }, 9 | { 10 | "internalType": "uint256", 11 | "name": "_offset", 12 | "type": "uint256" 13 | } 14 | ], 15 | "name": "byte2uint8", 16 | "outputs": [ 17 | { 18 | "internalType": "uint8", 19 | "name": "", 20 | "type": "uint8" 21 | } 22 | ], 23 | "stateMutability": "pure", 24 | "type": "function" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "bytes", 30 | "name": "_data", 31 | "type": "bytes" 32 | }, 33 | { 34 | "internalType": "uint256", 35 | "name": "_offset", 36 | "type": "uint256" 37 | }, 38 | { 39 | "internalType": "uint256", 40 | "name": "_len", 41 | "type": "uint256" 42 | } 43 | ], 44 | "name": "stringifyIntSet", 45 | "outputs": [ 46 | { 47 | "internalType": "bytes", 48 | "name": "", 49 | "type": "bytes" 50 | } 51 | ], 52 | "stateMutability": "pure", 53 | "type": "function" 54 | } 55 | ] 56 | -------------------------------------------------------------------------------- /packages/deployments/abis/@openzeppelin/contracts/access/Ownable.sol/Ownable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "address", 8 | "name": "previousOwner", 9 | "type": "address" 10 | }, 11 | { 12 | "indexed": true, 13 | "internalType": "address", 14 | "name": "newOwner", 15 | "type": "address" 16 | } 17 | ], 18 | "name": "OwnershipTransferred", 19 | "type": "event" 20 | }, 21 | { 22 | "inputs": [], 23 | "name": "owner", 24 | "outputs": [ 25 | { 26 | "internalType": "address", 27 | "name": "", 28 | "type": "address" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "inputs": [], 36 | "name": "renounceOwnership", 37 | "outputs": [], 38 | "stateMutability": "nonpayable", 39 | "type": "function" 40 | }, 41 | { 42 | "inputs": [ 43 | { 44 | "internalType": "address", 45 | "name": "newOwner", 46 | "type": "address" 47 | } 48 | ], 49 | "name": "transferOwnership", 50 | "outputs": [], 51 | "stateMutability": "nonpayable", 52 | "type": "function" 53 | } 54 | ] 55 | -------------------------------------------------------------------------------- /packages/deployments/abis/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "operator", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "from", 12 | "type": "address" 13 | }, 14 | { 15 | "internalType": "uint256", 16 | "name": "tokenId", 17 | "type": "uint256" 18 | }, 19 | { 20 | "internalType": "bytes", 21 | "name": "data", 22 | "type": "bytes" 23 | } 24 | ], 25 | "name": "onERC721Received", 26 | "outputs": [ 27 | { 28 | "internalType": "bytes4", 29 | "name": "", 30 | "type": "bytes4" 31 | } 32 | ], 33 | "stateMutability": "nonpayable", 34 | "type": "function" 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /packages/deployments/abis/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes4", 6 | "name": "interfaceId", 7 | "type": "bytes4" 8 | } 9 | ], 10 | "name": "supportsInterface", 11 | "outputs": [ 12 | { 13 | "internalType": "bool", 14 | "name": "", 15 | "type": "bool" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/deployments/abis/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes4", 6 | "name": "interfaceId", 7 | "type": "bytes4" 8 | } 9 | ], 10 | "name": "supportsInterface", 11 | "outputs": [ 12 | { 13 | "internalType": "bool", 14 | "name": "", 15 | "type": "bool" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/ERC721K.sol/ERC721K.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/ERC721Storage.sol/ERC721Storage.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/examples/Example.sol/Example.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/examples/ExampleRender.sol/ExampleRender.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/examples/ExampleStorage.sol/ExampleStorage.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/examples/ExampleSvgModule.sol/ExampleSvgModule.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/examples/ExampleTraits.sol/ExampleTraits.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IERC721KImage.sol/IERC721KImage.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IERC721KImage.sol/IERC721KImage.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "IERC721KImage", 4 | "sourceName": "@erc721k/core-sol/contracts/interfaces/IERC721KImage.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "bytes", 10 | "name": "input", 11 | "type": "bytes" 12 | } 13 | ], 14 | "name": "render", 15 | "outputs": [ 16 | { 17 | "internalType": "string", 18 | "name": "", 19 | "type": "string" 20 | } 21 | ], 22 | "stateMutability": "view", 23 | "type": "function" 24 | } 25 | ], 26 | "bytecode": "0x", 27 | "deployedBytecode": "0x", 28 | "linkReferences": {}, 29 | "deployedLinkReferences": {} 30 | } 31 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IERC721KTraits.sol/IERC721KTraits.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IERC721KTraits.sol/IERC721KTraits.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "IERC721KTraits", 4 | "sourceName": "@erc721k/core-sol/contracts/interfaces/IERC721KTraits.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "bytes", 10 | "name": "input", 11 | "type": "bytes" 12 | } 13 | ], 14 | "name": "fetch", 15 | "outputs": [ 16 | { 17 | "internalType": "string", 18 | "name": "", 19 | "type": "string" 20 | } 21 | ], 22 | "stateMutability": "view", 23 | "type": "function" 24 | } 25 | ], 26 | "bytecode": "0x", 27 | "deployedBytecode": "0x", 28 | "linkReferences": {}, 29 | "deployedLinkReferences": {} 30 | } 31 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IStream.sol/IStream.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/core-sol/contracts/interfaces/IStream.sol/IStream.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "IStream", 4 | "sourceName": "@erc721k/core-sol/contracts/interfaces/IStream.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "address", 10 | "name": "_address", 11 | "type": "address" 12 | } 13 | ], 14 | "name": "count", 15 | "outputs": [ 16 | { 17 | "internalType": "uint256", 18 | "name": "", 19 | "type": "uint256" 20 | } 21 | ], 22 | "stateMutability": "view", 23 | "type": "function" 24 | }, 25 | { 26 | "inputs": [ 27 | { 28 | "internalType": "address", 29 | "name": "_address", 30 | "type": "address" 31 | } 32 | ], 33 | "name": "getData", 34 | "outputs": [ 35 | { 36 | "internalType": "string[]", 37 | "name": "keys", 38 | "type": "string[]" 39 | }, 40 | { 41 | "internalType": "string[]", 42 | "name": "values", 43 | "type": "string[]" 44 | } 45 | ], 46 | "stateMutability": "view", 47 | "type": "function" 48 | }, 49 | { 50 | "inputs": [ 51 | { 52 | "internalType": "address", 53 | "name": "_address", 54 | "type": "address" 55 | }, 56 | { 57 | "internalType": "string", 58 | "name": "_key", 59 | "type": "string" 60 | } 61 | ], 62 | "name": "getValue", 63 | "outputs": [ 64 | { 65 | "internalType": "string", 66 | "name": "", 67 | "type": "string" 68 | } 69 | ], 70 | "stateMutability": "view", 71 | "type": "function" 72 | } 73 | ], 74 | "bytecode": "0x", 75 | "deployedBytecode": "0x", 76 | "linkReferences": {}, 77 | "deployedLinkReferences": {} 78 | } 79 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/interfaces/ISVGModule.sol/ISVGModule.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/interfaces/ISVGModule.sol/ISVGModule.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "ISVGModule", 4 | "sourceName": "@erc721k/periphery-sol/contracts/interfaces/ISVGModule.sol", 5 | "abi": [ 6 | { 7 | "inputs": [], 8 | "name": "getEncoding", 9 | "outputs": [ 10 | { 11 | "internalType": "string", 12 | "name": "", 13 | "type": "string" 14 | } 15 | ], 16 | "stateMutability": "view", 17 | "type": "function" 18 | }, 19 | { 20 | "inputs": [ 21 | { 22 | "internalType": "bytes", 23 | "name": "input", 24 | "type": "bytes" 25 | } 26 | ], 27 | "name": "render", 28 | "outputs": [ 29 | { 30 | "internalType": "string", 31 | "name": "", 32 | "type": "string" 33 | } 34 | ], 35 | "stateMutability": "view", 36 | "type": "function" 37 | } 38 | ], 39 | "bytecode": "0x", 40 | "deployedBytecode": "0x", 41 | "linkReferences": {}, 42 | "deployedLinkReferences": {} 43 | } 44 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/SVGColor.sol/SVGColor.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/SVGLibrary.sol/SVGLibrary.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/SVGRegistry.sol/SVGRegistry.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/svg.sol/svg.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/svgUtils.sol/svgUtils.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@erc721k/periphery-sol/contracts/svg/svgUtils.sol/svgUtils.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "svgUtils", 4 | "sourceName": "@erc721k/periphery-sol/contracts/svg/svgUtils.sol", 5 | "abi": [], 6 | "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212202d021cb334edf7689c958b3ea4de66abf729ef88e8caa9d74097e479aa1bd8e764736f6c634300080f0033", 7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212202d021cb334edf7689c958b3ea4de66abf729ef88e8caa9d74097e479aa1bd8e764736f6c634300080f0033", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Ownable", 4 | "sourceName": "@openzeppelin/contracts/access/Ownable.sol", 5 | "abi": [ 6 | { 7 | "anonymous": false, 8 | "inputs": [ 9 | { 10 | "indexed": true, 11 | "internalType": "address", 12 | "name": "previousOwner", 13 | "type": "address" 14 | }, 15 | { 16 | "indexed": true, 17 | "internalType": "address", 18 | "name": "newOwner", 19 | "type": "address" 20 | } 21 | ], 22 | "name": "OwnershipTransferred", 23 | "type": "event" 24 | }, 25 | { 26 | "inputs": [], 27 | "name": "owner", 28 | "outputs": [ 29 | { 30 | "internalType": "address", 31 | "name": "", 32 | "type": "address" 33 | } 34 | ], 35 | "stateMutability": "view", 36 | "type": "function" 37 | }, 38 | { 39 | "inputs": [], 40 | "name": "renounceOwnership", 41 | "outputs": [], 42 | "stateMutability": "nonpayable", 43 | "type": "function" 44 | }, 45 | { 46 | "inputs": [ 47 | { 48 | "internalType": "address", 49 | "name": "newOwner", 50 | "type": "address" 51 | } 52 | ], 53 | "name": "transferOwnership", 54 | "outputs": [], 55 | "stateMutability": "nonpayable", 56 | "type": "function" 57 | } 58 | ], 59 | "bytecode": "0x", 60 | "deployedBytecode": "0x", 61 | "linkReferences": {}, 62 | "deployedLinkReferences": {} 63 | } 64 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "IERC721Receiver", 4 | "sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "address", 10 | "name": "operator", 11 | "type": "address" 12 | }, 13 | { 14 | "internalType": "address", 15 | "name": "from", 16 | "type": "address" 17 | }, 18 | { 19 | "internalType": "uint256", 20 | "name": "tokenId", 21 | "type": "uint256" 22 | }, 23 | { 24 | "internalType": "bytes", 25 | "name": "data", 26 | "type": "bytes" 27 | } 28 | ], 29 | "name": "onERC721Received", 30 | "outputs": [ 31 | { 32 | "internalType": "bytes4", 33 | "name": "", 34 | "type": "bytes4" 35 | } 36 | ], 37 | "stateMutability": "nonpayable", 38 | "type": "function" 39 | } 40 | ], 41 | "bytecode": "0x", 42 | "deployedBytecode": "0x", 43 | "linkReferences": {}, 44 | "deployedLinkReferences": {} 45 | } 46 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Address", 4 | "sourceName": "@openzeppelin/contracts/utils/Address.sol", 5 | "abi": [], 6 | "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c3efec27d274b7de027d245b25aefc1a04ee54200dbc2e3a19b6e93be29b61fe64736f6c634300080f0033", 7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c3efec27d274b7de027d245b25aefc1a04ee54200dbc2e3a19b6e93be29b61fe64736f6c634300080f0033", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Context", 4 | "sourceName": "@openzeppelin/contracts/utils/Context.sol", 5 | "abi": [], 6 | "bytecode": "0x", 7 | "deployedBytecode": "0x", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Strings", 4 | "sourceName": "@openzeppelin/contracts/utils/Strings.sol", 5 | "abi": [], 6 | "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf2cdea94020979a509efb26c0406c1458dfd5d8e850cfdd84e5f7ef395e69f464736f6c634300080f0033", 7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf2cdea94020979a509efb26c0406c1458dfd5d8e850cfdd84e5f7ef395e69f464736f6c634300080f0033", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "ERC165", 4 | "sourceName": "@openzeppelin/contracts/utils/introspection/ERC165.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "bytes4", 10 | "name": "interfaceId", 11 | "type": "bytes4" 12 | } 13 | ], 14 | "name": "supportsInterface", 15 | "outputs": [ 16 | { 17 | "internalType": "bool", 18 | "name": "", 19 | "type": "bool" 20 | } 21 | ], 22 | "stateMutability": "view", 23 | "type": "function" 24 | } 25 | ], 26 | "bytecode": "0x", 27 | "deployedBytecode": "0x", 28 | "linkReferences": {}, 29 | "deployedLinkReferences": {} 30 | } 31 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../../../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "IERC165", 4 | "sourceName": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 5 | "abi": [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "bytes4", 10 | "name": "interfaceId", 11 | "type": "bytes4" 12 | } 13 | ], 14 | "name": "supportsInterface", 15 | "outputs": [ 16 | { 17 | "internalType": "bool", 18 | "name": "", 19 | "type": "bool" 20 | } 21 | ], 22 | "stateMutability": "view", 23 | "type": "function" 24 | } 25 | ], 26 | "bytecode": "0x", 27 | "deployedBytecode": "0x", 28 | "linkReferences": {}, 29 | "deployedLinkReferences": {} 30 | } 31 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/base64-sol/base64.sol/Base64.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/base64-sol/base64.sol/Base64.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Base64", 4 | "sourceName": "base64-sol/base64.sol", 5 | "abi": [], 6 | "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220457015c01ca0a0301163af6ee9db1d0d0eb701cb9279e76f075b85da9720c88d64736f6c634300080f0033", 7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220457015c01ca0a0301163af6ee9db1d0d0eb701cb9279e76f075b85da9720c88d64736f6c634300080f0033", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/hardhat/console.sol/console.dbg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-dbg-1", 3 | "buildInfo": "../../build-info/dc0e2f0cbe87895980d32999fbbb5858.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/deployments/artifacts/hardhat/console.sol/console.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "console", 4 | "sourceName": "hardhat/console.sol", 5 | "abi": [], 6 | "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203d5b9dbec86b644d8deca0ee8c76dce395fe32c55de8598f59ead68898a0cfb164736f6c634300080f0033", 7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203d5b9dbec86b644d8deca0ee8c76dce395fe32c55de8598f59ead68898a0cfb164736f6c634300080f0033", 8 | "linkReferences": {}, 9 | "deployedLinkReferences": {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-0cecae94efddfd91b3074d4b60785ae5.json: -------------------------------------------------------------------------------- 1 | "0x3" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-0ff288f4ee81aa260d92551ce62b9feb.json: -------------------------------------------------------------------------------- 1 | "0xb" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-10dcdb2f9d5424ab43ba1efc25118af4.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-12e433d5978c495c9a6085961fe14cbc.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-1386ca0a255e1229e67326a30bbdd853.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-169edcb881d46442e5243a45c4c8c4d9.json: -------------------------------------------------------------------------------- 1 | "0x5" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-1cc225ee2244e7fc3805e1211ea8d175.json: -------------------------------------------------------------------------------- 1 | "0x105" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-248d9cd6ef8df5676d5273b785772fd0.json: -------------------------------------------------------------------------------- 1 | "0x3" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-2fafdbd7f17b0646684dc0735cd0483e.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-3f6dd7c474456840b3f24afe160fa086.json: -------------------------------------------------------------------------------- 1 | "0x46" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-4a711468947047e9bee2f9cb7ddd722e.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-500e05bf4fcf8dec9094d483a0f1fcb9.json: -------------------------------------------------------------------------------- 1 | "0x3" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-5351f194dd6d5d4929d669ab506d067d.json: -------------------------------------------------------------------------------- 1 | "0x7" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-55788175055576d016fc10bc610de9c2.json: -------------------------------------------------------------------------------- 1 | "0x8" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-5888f5746ba686631176cce269635f78.json: -------------------------------------------------------------------------------- 1 | "0x4" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-5a5b1e5de3397dcb22f6951dcfb44362.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-6333b48e8cd5593d7ab606304ce38ec9.json: -------------------------------------------------------------------------------- 1 | "0x1" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-7b525a5395730a999d14e0383cf5716b.json: -------------------------------------------------------------------------------- 1 | "0x2" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-7b9b5b872e171b87a61e53ad0dd77558.json: -------------------------------------------------------------------------------- 1 | ["0x","0x6f","0x524db1728ecf5f0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-7bd3a3f8ede5aba84d4bc18715b0ade9.json: -------------------------------------------------------------------------------- 1 | "0x0" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-88d141b2b9dcd79aa97c504cd9882541.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-89fe504bd80e28b73ab3d02b0b68ab0c.json: -------------------------------------------------------------------------------- 1 | "0x5" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-8cfb146b8b50eff9d1f35adb477ec5c8.json: -------------------------------------------------------------------------------- 1 | "0x21" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-963be5d351e181d11419aca1a1d2abec.json: -------------------------------------------------------------------------------- 1 | "0xc" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-984364b542a7e2351f5ecb272910ccb4.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-9d0a088c6c03618de60de9d1a21d36af.json: -------------------------------------------------------------------------------- 1 | "0x9" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-b3dd84c7d6c755d6c8e2f3dbe32f4a34.json: -------------------------------------------------------------------------------- 1 | "0x0" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-d008d2118f5a7e1daa5f065a59078d7c.json: -------------------------------------------------------------------------------- 1 | "0xc" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-d64119c68c680252086d9e9b4cee7e2f.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-e2ce5c7bed8ca3a674eed368ac881c4e.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-ecda6eb0c53c50a62ce5728bc58588a6.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-f00819cc3b7769f617efdb93a2636349.json: -------------------------------------------------------------------------------- 1 | "0x6" 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-f4c261b29d82f8911814552a29f2940a.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/cache/hardhat-network-fork/network-1/request-fdf2138a858da5041aa8c2f0abd6bc72.json: -------------------------------------------------------------------------------- 1 | ["0x","0x0","0x0"] 2 | -------------------------------------------------------------------------------- /packages/deployments/deploy/00_core.ts: -------------------------------------------------------------------------------- 1 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 2 | 3 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 4 | const { deployments, getNamedAccounts } = hardhat; 5 | 6 | const { deploy } = deployments; 7 | const { deployer } = await getNamedAccounts(); 8 | 9 | const svg = await deploy("svg", { 10 | contract: "svg", 11 | from: deployer, 12 | args: [], 13 | skipIfAlreadyDeployed: true, 14 | log: true, 15 | }); 16 | 17 | const svgUtils = await deploy("svgUtils", { 18 | contract: "svgUtils", 19 | from: deployer, 20 | args: [], 21 | skipIfAlreadyDeployed: true, 22 | log: true, 23 | }); 24 | 25 | const SVGColor = await deploy("SVGColor", { 26 | contract: "SVGColor", 27 | from: deployer, 28 | args: [], 29 | skipIfAlreadyDeployed: true, 30 | log: true, 31 | }); 32 | 33 | const SVGLibrary = await deploy("SVGLibrary", { 34 | contract: "SVGLibrary", 35 | from: deployer, 36 | libraries: { 37 | svg: svg.address, 38 | svgUtils: svgUtils.address 39 | }, 40 | args: [SVGColor.address], 41 | skipIfAlreadyDeployed: true, 42 | log: true, 43 | }); 44 | 45 | await deploy("SVGRegistry", { 46 | contract: "SVGRegistry", 47 | from: deployer, 48 | args: [], 49 | skipIfAlreadyDeployed: true, 50 | log: true, 51 | }); 52 | } 53 | -------------------------------------------------------------------------------- /packages/deployments/deploy/01_example.ts: -------------------------------------------------------------------------------- 1 | import { utils } from "ethers"; 2 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 3 | import svg from '../svg/svg_0' 4 | export default async function deploy(hardhat: HardhatRuntimeEnvironment) { 5 | const { deployments, getNamedAccounts, ethers } = hardhat; 6 | 7 | const { deploy } = deployments; 8 | const { deployer } = await getNamedAccounts(); 9 | 10 | const SVGRegistry = await deployments.get("SVGRegistry"); 11 | const SVGLibrary = await deployments.get("SVGLibrary"); 12 | 13 | const svgRegistry = await ethers.getContractAt("SVGRegistry", SVGRegistry.address); 14 | 15 | const svg_keys = [0,1,2,3,4] 16 | const svg_values = ["🐺", "🦜", "🦊", "🐙"] 17 | 18 | const ExampleSvgModule = await deploy("ExampleSvgModule", { 19 | contract: "ExampleSvgModule", 20 | from: deployer, 21 | args: [svg_keys, svg_values], 22 | skipIfAlreadyDeployed: false, 23 | log: true, 24 | }); 25 | 26 | await svgRegistry.setWidget("0x464f554e44455200000000000000000000000000000000000000000000000000", ExampleSvgModule.address); 27 | 28 | const ExampleRender = await deploy("ExampleRender", { 29 | contract: "ExampleRender", 30 | from: deployer, 31 | args: [SVGRegistry.address], 32 | skipIfAlreadyDeployed: false, 33 | log: true, 34 | }); 35 | 36 | const ExampleTraits = await deploy("ExampleTraits", { 37 | contract: "ExampleTraits", 38 | from: deployer, 39 | args: [], 40 | skipIfAlreadyDeployed: false, 41 | log: true, 42 | }); 43 | 44 | const contactInformation = { 45 | name: "Example", 46 | description: "Example.", 47 | image: "https://ipfs.io/ipfs/QmR5suybqBDHkMB7fiXCjKuXEXwRPmJ8ExsRbPasxu36rm", 48 | externalLink: "https://Example.art", 49 | sellerFeeBasisPoints: "0", 50 | feeRecipient: "0x0000000000000000000000000000000000000000", 51 | }; 52 | 53 | const ExampleStorage = await deploy("ExampleStorage", { 54 | contract: "ExampleStorage", 55 | from: deployer, 56 | args: [ExampleRender.address, ExampleTraits.address, contactInformation], 57 | skipIfAlreadyDeployed: false, 58 | log: true, 59 | }); 60 | 61 | await deploy("Example", { 62 | contract: "Example", 63 | from: deployer, 64 | args: ["Pooly Chibi", "BIRBI", ExampleStorage.address], 65 | skipIfAlreadyDeployed: false, 66 | log: true, 67 | }); 68 | 69 | } 70 | -------------------------------------------------------------------------------- /packages/deployments/deployments/localhost/.chainId: -------------------------------------------------------------------------------- 1 | 31337 -------------------------------------------------------------------------------- /packages/deployments/src/index.tsx: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | 3 | import ExampleMainnet from '../deployments/localhost/Example.json'; 4 | import ExampleTestnet from '../deployments/localhost/Example.json'; 5 | import ExampleLocalhost from '../deployments/localhost/Example.json'; 6 | 7 | function useNetworkContract(network: string, contract: string) { 8 | 9 | switch (network) { 10 | case 'mainnet': 11 | switch (contract) { 12 | case 'Example': 13 | return ExampleMainnet 14 | default: 15 | throw new Error(`Unknown contract ${contract}`); 16 | } 17 | case 'testnet': 18 | switch (contract) { 19 | case 'Example': 20 | return ExampleTestnet 21 | default: 22 | throw new Error(`Unknown contract ${contract}`); 23 | } 24 | case 'localhost': 25 | switch (contract) { 26 | case 'Example': 27 | return ExampleLocalhost 28 | default: 29 | throw new Error(`Unknown contract ${contract}`); 30 | } 31 | default: 32 | break; 33 | } 34 | 35 | } 36 | 37 | export { useNetworkContract } -------------------------------------------------------------------------------- /packages/deployments/test/blah.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as ReactDOM from 'react-dom'; 3 | import { Thing } from '../src'; 4 | 5 | describe('it', () => { 6 | it('renders without crashing', () => { 7 | const div = document.createElement('div'); 8 | ReactDOM.render(, div); 9 | ReactDOM.unmountComponentAtNode(div); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/deployments/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "ESNext", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "moduleResolution": "node", 8 | "forceConsistentCasingInFileNames": true, 9 | "resolveJsonModule": true, 10 | }, 11 | "include": [ 12 | "hardhat.config.ts", 13 | "hardhat.network.ts", 14 | "./deploy", 15 | "./scripts", 16 | "./test", 17 | "types/**/*", 18 | "Constant.ts", 19 | "./typechain" 20 | , "utils/createTypedMessage.ts" 21 | , "svg" ], 22 | "files": ["./hardhat.config.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /packages/deployments/types/IERC721KImage.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import { 5 | BaseContract, 6 | BigNumber, 7 | BytesLike, 8 | CallOverrides, 9 | PopulatedTransaction, 10 | Signer, 11 | utils, 12 | } from "ethers"; 13 | import { FunctionFragment, Result } from "@ethersproject/abi"; 14 | import { Listener, Provider } from "@ethersproject/providers"; 15 | import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; 16 | 17 | export interface IERC721KImageInterface extends utils.Interface { 18 | contractName: "IERC721KImage"; 19 | functions: { 20 | "render(bytes)": FunctionFragment; 21 | }; 22 | 23 | encodeFunctionData(functionFragment: "render", values: [BytesLike]): string; 24 | 25 | decodeFunctionResult(functionFragment: "render", data: BytesLike): Result; 26 | 27 | events: {}; 28 | } 29 | 30 | export interface IERC721KImage extends BaseContract { 31 | contractName: "IERC721KImage"; 32 | connect(signerOrProvider: Signer | Provider | string): this; 33 | attach(addressOrName: string): this; 34 | deployed(): Promise; 35 | 36 | interface: IERC721KImageInterface; 37 | 38 | queryFilter( 39 | event: TypedEventFilter, 40 | fromBlockOrBlockhash?: string | number | undefined, 41 | toBlock?: string | number | undefined 42 | ): Promise>; 43 | 44 | listeners( 45 | eventFilter?: TypedEventFilter 46 | ): Array>; 47 | listeners(eventName?: string): Array; 48 | removeAllListeners( 49 | eventFilter: TypedEventFilter 50 | ): this; 51 | removeAllListeners(eventName?: string): this; 52 | off: OnEvent; 53 | on: OnEvent; 54 | once: OnEvent; 55 | removeListener: OnEvent; 56 | 57 | functions: { 58 | render(input: BytesLike, overrides?: CallOverrides): Promise<[string]>; 59 | }; 60 | 61 | render(input: BytesLike, overrides?: CallOverrides): Promise; 62 | 63 | callStatic: { 64 | render(input: BytesLike, overrides?: CallOverrides): Promise; 65 | }; 66 | 67 | filters: {}; 68 | 69 | estimateGas: { 70 | render(input: BytesLike, overrides?: CallOverrides): Promise; 71 | }; 72 | 73 | populateTransaction: { 74 | render( 75 | input: BytesLike, 76 | overrides?: CallOverrides 77 | ): Promise; 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /packages/deployments/types/IERC721KTraits.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import { 5 | BaseContract, 6 | BigNumber, 7 | BytesLike, 8 | CallOverrides, 9 | PopulatedTransaction, 10 | Signer, 11 | utils, 12 | } from "ethers"; 13 | import { FunctionFragment, Result } from "@ethersproject/abi"; 14 | import { Listener, Provider } from "@ethersproject/providers"; 15 | import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; 16 | 17 | export interface IERC721KTraitsInterface extends utils.Interface { 18 | contractName: "IERC721KTraits"; 19 | functions: { 20 | "fetch(bytes)": FunctionFragment; 21 | }; 22 | 23 | encodeFunctionData(functionFragment: "fetch", values: [BytesLike]): string; 24 | 25 | decodeFunctionResult(functionFragment: "fetch", data: BytesLike): Result; 26 | 27 | events: {}; 28 | } 29 | 30 | export interface IERC721KTraits extends BaseContract { 31 | contractName: "IERC721KTraits"; 32 | connect(signerOrProvider: Signer | Provider | string): this; 33 | attach(addressOrName: string): this; 34 | deployed(): Promise; 35 | 36 | interface: IERC721KTraitsInterface; 37 | 38 | queryFilter( 39 | event: TypedEventFilter, 40 | fromBlockOrBlockhash?: string | number | undefined, 41 | toBlock?: string | number | undefined 42 | ): Promise>; 43 | 44 | listeners( 45 | eventFilter?: TypedEventFilter 46 | ): Array>; 47 | listeners(eventName?: string): Array; 48 | removeAllListeners( 49 | eventFilter: TypedEventFilter 50 | ): this; 51 | removeAllListeners(eventName?: string): this; 52 | off: OnEvent; 53 | on: OnEvent; 54 | once: OnEvent; 55 | removeListener: OnEvent; 56 | 57 | functions: { 58 | fetch(input: BytesLike, overrides?: CallOverrides): Promise<[string]>; 59 | }; 60 | 61 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 62 | 63 | callStatic: { 64 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 65 | }; 66 | 67 | filters: {}; 68 | 69 | estimateGas: { 70 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 71 | }; 72 | 73 | populateTransaction: { 74 | fetch( 75 | input: BytesLike, 76 | overrides?: CallOverrides 77 | ): Promise; 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /packages/deployments/types/ISVGRender.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import { 5 | BaseContract, 6 | BigNumber, 7 | BytesLike, 8 | CallOverrides, 9 | PopulatedTransaction, 10 | Signer, 11 | utils, 12 | } from "ethers"; 13 | import { FunctionFragment, Result } from "@ethersproject/abi"; 14 | import { Listener, Provider } from "@ethersproject/providers"; 15 | import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; 16 | 17 | export interface ISVGRenderInterface extends utils.Interface { 18 | contractName: "ISVGRender"; 19 | functions: { 20 | "render(bytes)": FunctionFragment; 21 | }; 22 | 23 | encodeFunctionData(functionFragment: "render", values: [BytesLike]): string; 24 | 25 | decodeFunctionResult(functionFragment: "render", data: BytesLike): Result; 26 | 27 | events: {}; 28 | } 29 | 30 | export interface ISVGRender extends BaseContract { 31 | contractName: "ISVGRender"; 32 | connect(signerOrProvider: Signer | Provider | string): this; 33 | attach(addressOrName: string): this; 34 | deployed(): Promise; 35 | 36 | interface: ISVGRenderInterface; 37 | 38 | queryFilter( 39 | event: TypedEventFilter, 40 | fromBlockOrBlockhash?: string | number | undefined, 41 | toBlock?: string | number | undefined 42 | ): Promise>; 43 | 44 | listeners( 45 | eventFilter?: TypedEventFilter 46 | ): Array>; 47 | listeners(eventName?: string): Array; 48 | removeAllListeners( 49 | eventFilter: TypedEventFilter 50 | ): this; 51 | removeAllListeners(eventName?: string): this; 52 | off: OnEvent; 53 | on: OnEvent; 54 | once: OnEvent; 55 | removeListener: OnEvent; 56 | 57 | functions: { 58 | render(input: BytesLike, overrides?: CallOverrides): Promise<[string]>; 59 | }; 60 | 61 | render(input: BytesLike, overrides?: CallOverrides): Promise; 62 | 63 | callStatic: { 64 | render(input: BytesLike, overrides?: CallOverrides): Promise; 65 | }; 66 | 67 | filters: {}; 68 | 69 | estimateGas: { 70 | render(input: BytesLike, overrides?: CallOverrides): Promise; 71 | }; 72 | 73 | populateTransaction: { 74 | render( 75 | input: BytesLike, 76 | overrides?: CallOverrides 77 | ): Promise; 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /packages/deployments/types/ITraitsFetch.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import { 5 | BaseContract, 6 | BigNumber, 7 | BytesLike, 8 | CallOverrides, 9 | PopulatedTransaction, 10 | Signer, 11 | utils, 12 | } from "ethers"; 13 | import { FunctionFragment, Result } from "@ethersproject/abi"; 14 | import { Listener, Provider } from "@ethersproject/providers"; 15 | import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; 16 | 17 | export interface ITraitsFetchInterface extends utils.Interface { 18 | contractName: "ITraitsFetch"; 19 | functions: { 20 | "fetch(bytes)": FunctionFragment; 21 | }; 22 | 23 | encodeFunctionData(functionFragment: "fetch", values: [BytesLike]): string; 24 | 25 | decodeFunctionResult(functionFragment: "fetch", data: BytesLike): Result; 26 | 27 | events: {}; 28 | } 29 | 30 | export interface ITraitsFetch extends BaseContract { 31 | contractName: "ITraitsFetch"; 32 | connect(signerOrProvider: Signer | Provider | string): this; 33 | attach(addressOrName: string): this; 34 | deployed(): Promise; 35 | 36 | interface: ITraitsFetchInterface; 37 | 38 | queryFilter( 39 | event: TypedEventFilter, 40 | fromBlockOrBlockhash?: string | number | undefined, 41 | toBlock?: string | number | undefined 42 | ): Promise>; 43 | 44 | listeners( 45 | eventFilter?: TypedEventFilter 46 | ): Array>; 47 | listeners(eventName?: string): Array; 48 | removeAllListeners( 49 | eventFilter: TypedEventFilter 50 | ): this; 51 | removeAllListeners(eventName?: string): this; 52 | off: OnEvent; 53 | on: OnEvent; 54 | once: OnEvent; 55 | removeListener: OnEvent; 56 | 57 | functions: { 58 | fetch(input: BytesLike, overrides?: CallOverrides): Promise<[string]>; 59 | }; 60 | 61 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 62 | 63 | callStatic: { 64 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 65 | }; 66 | 67 | filters: {}; 68 | 69 | estimateGas: { 70 | fetch(input: BytesLike, overrides?: CallOverrides): Promise; 71 | }; 72 | 73 | populateTransaction: { 74 | fetch( 75 | input: BytesLike, 76 | overrides?: CallOverrides 77 | ): Promise; 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /packages/deployments/types/common.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { Listener } from "@ethersproject/providers"; 5 | import type { Event, EventFilter } from "ethers"; 6 | 7 | export interface TypedEvent< 8 | TArgsArray extends Array = any, 9 | TArgsObject = any 10 | > extends Event { 11 | args: TArgsArray & TArgsObject; 12 | } 13 | 14 | export interface TypedEventFilter<_TEvent extends TypedEvent> 15 | extends EventFilter {} 16 | 17 | export interface TypedListener { 18 | (...listenerArg: [...__TypechainArgsArray, TEvent]): void; 19 | } 20 | 21 | type __TypechainArgsArray = T extends TypedEvent ? U : never; 22 | 23 | export interface OnEvent { 24 | ( 25 | eventFilter: TypedEventFilter, 26 | listener: TypedListener 27 | ): TRes; 28 | (eventName: string, listener: Listener): TRes; 29 | } 30 | 31 | export type MinEthersFactory = { 32 | deploy(...a: ARGS[]): Promise; 33 | }; 34 | 35 | export type GetContractTypeFromFactory = F extends MinEthersFactory< 36 | infer C, 37 | any 38 | > 39 | ? C 40 | : never; 41 | 42 | export type GetARGsTypeFromFactory = F extends MinEthersFactory 43 | ? Parameters 44 | : never; 45 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/ERC165__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { ERC165, ERC165Interface } from "../ERC165"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes4", 14 | name: "interfaceId", 15 | type: "bytes4", 16 | }, 17 | ], 18 | name: "supportsInterface", 19 | outputs: [ 20 | { 21 | internalType: "bool", 22 | name: "", 23 | type: "bool", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ]; 30 | 31 | export class ERC165__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): ERC165Interface { 34 | return new utils.Interface(_abi) as ERC165Interface; 35 | } 36 | static connect(address: string, signerOrProvider: Signer | Provider): ERC165 { 37 | return new Contract(address, _abi, signerOrProvider) as ERC165; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IERC165__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { IERC165, IERC165Interface } from "../IERC165"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes4", 14 | name: "interfaceId", 15 | type: "bytes4", 16 | }, 17 | ], 18 | name: "supportsInterface", 19 | outputs: [ 20 | { 21 | internalType: "bool", 22 | name: "", 23 | type: "bool", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ]; 30 | 31 | export class IERC165__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): IERC165Interface { 34 | return new utils.Interface(_abi) as IERC165Interface; 35 | } 36 | static connect( 37 | address: string, 38 | signerOrProvider: Signer | Provider 39 | ): IERC165 { 40 | return new Contract(address, _abi, signerOrProvider) as IERC165; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IERC721KImage__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { IERC721KImage, IERC721KImageInterface } from "../IERC721KImage"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes", 14 | name: "input", 15 | type: "bytes", 16 | }, 17 | ], 18 | name: "render", 19 | outputs: [ 20 | { 21 | internalType: "string", 22 | name: "", 23 | type: "string", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ]; 30 | 31 | export class IERC721KImage__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): IERC721KImageInterface { 34 | return new utils.Interface(_abi) as IERC721KImageInterface; 35 | } 36 | static connect( 37 | address: string, 38 | signerOrProvider: Signer | Provider 39 | ): IERC721KImage { 40 | return new Contract(address, _abi, signerOrProvider) as IERC721KImage; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IERC721KTraits__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IERC721KTraits, 9 | IERC721KTraitsInterface, 10 | } from "../IERC721KTraits"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "bytes", 17 | name: "input", 18 | type: "bytes", 19 | }, 20 | ], 21 | name: "fetch", 22 | outputs: [ 23 | { 24 | internalType: "string", 25 | name: "", 26 | type: "string", 27 | }, 28 | ], 29 | stateMutability: "view", 30 | type: "function", 31 | }, 32 | ]; 33 | 34 | export class IERC721KTraits__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): IERC721KTraitsInterface { 37 | return new utils.Interface(_abi) as IERC721KTraitsInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): IERC721KTraits { 43 | return new Contract(address, _abi, signerOrProvider) as IERC721KTraits; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IERC721Receiver__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IERC721Receiver, 9 | IERC721ReceiverInterface, 10 | } from "../IERC721Receiver"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "address", 17 | name: "operator", 18 | type: "address", 19 | }, 20 | { 21 | internalType: "address", 22 | name: "from", 23 | type: "address", 24 | }, 25 | { 26 | internalType: "uint256", 27 | name: "tokenId", 28 | type: "uint256", 29 | }, 30 | { 31 | internalType: "bytes", 32 | name: "data", 33 | type: "bytes", 34 | }, 35 | ], 36 | name: "onERC721Received", 37 | outputs: [ 38 | { 39 | internalType: "bytes4", 40 | name: "", 41 | type: "bytes4", 42 | }, 43 | ], 44 | stateMutability: "nonpayable", 45 | type: "function", 46 | }, 47 | ]; 48 | 49 | export class IERC721Receiver__factory { 50 | static readonly abi = _abi; 51 | static createInterface(): IERC721ReceiverInterface { 52 | return new utils.Interface(_abi) as IERC721ReceiverInterface; 53 | } 54 | static connect( 55 | address: string, 56 | signerOrProvider: Signer | Provider 57 | ): IERC721Receiver { 58 | return new Contract(address, _abi, signerOrProvider) as IERC721Receiver; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/ISVGModule__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { ISVGModule, ISVGModuleInterface } from "../ISVGModule"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "getEncoding", 13 | outputs: [ 14 | { 15 | internalType: "string", 16 | name: "", 17 | type: "string", 18 | }, 19 | ], 20 | stateMutability: "view", 21 | type: "function", 22 | }, 23 | { 24 | inputs: [ 25 | { 26 | internalType: "bytes", 27 | name: "input", 28 | type: "bytes", 29 | }, 30 | ], 31 | name: "render", 32 | outputs: [ 33 | { 34 | internalType: "string", 35 | name: "", 36 | type: "string", 37 | }, 38 | ], 39 | stateMutability: "view", 40 | type: "function", 41 | }, 42 | ]; 43 | 44 | export class ISVGModule__factory { 45 | static readonly abi = _abi; 46 | static createInterface(): ISVGModuleInterface { 47 | return new utils.Interface(_abi) as ISVGModuleInterface; 48 | } 49 | static connect( 50 | address: string, 51 | signerOrProvider: Signer | Provider 52 | ): ISVGModule { 53 | return new Contract(address, _abi, signerOrProvider) as ISVGModule; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/ISVGRender__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { ISVGRender, ISVGRenderInterface } from "../ISVGRender"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes", 14 | name: "input", 15 | type: "bytes", 16 | }, 17 | ], 18 | name: "render", 19 | outputs: [ 20 | { 21 | internalType: "string", 22 | name: "", 23 | type: "string", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ]; 30 | 31 | export class ISVGRender__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): ISVGRenderInterface { 34 | return new utils.Interface(_abi) as ISVGRenderInterface; 35 | } 36 | static connect( 37 | address: string, 38 | signerOrProvider: Signer | Provider 39 | ): ISVGRender { 40 | return new Contract(address, _abi, signerOrProvider) as ISVGRender; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IStream__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { IStream, IStreamInterface } from "../IStream"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "address", 14 | name: "_address", 15 | type: "address", 16 | }, 17 | ], 18 | name: "count", 19 | outputs: [ 20 | { 21 | internalType: "uint256", 22 | name: "", 23 | type: "uint256", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | { 30 | inputs: [ 31 | { 32 | internalType: "address", 33 | name: "_address", 34 | type: "address", 35 | }, 36 | ], 37 | name: "getData", 38 | outputs: [ 39 | { 40 | internalType: "string[]", 41 | name: "keys", 42 | type: "string[]", 43 | }, 44 | { 45 | internalType: "string[]", 46 | name: "values", 47 | type: "string[]", 48 | }, 49 | ], 50 | stateMutability: "view", 51 | type: "function", 52 | }, 53 | { 54 | inputs: [ 55 | { 56 | internalType: "address", 57 | name: "_address", 58 | type: "address", 59 | }, 60 | { 61 | internalType: "string", 62 | name: "_key", 63 | type: "string", 64 | }, 65 | ], 66 | name: "getValue", 67 | outputs: [ 68 | { 69 | internalType: "string", 70 | name: "", 71 | type: "string", 72 | }, 73 | ], 74 | stateMutability: "view", 75 | type: "function", 76 | }, 77 | ]; 78 | 79 | export class IStream__factory { 80 | static readonly abi = _abi; 81 | static createInterface(): IStreamInterface { 82 | return new utils.Interface(_abi) as IStreamInterface; 83 | } 84 | static connect( 85 | address: string, 86 | signerOrProvider: Signer | Provider 87 | ): IStream { 88 | return new Contract(address, _abi, signerOrProvider) as IStream; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/ITraitsFetch__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { ITraitsFetch, ITraitsFetchInterface } from "../ITraitsFetch"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes", 14 | name: "input", 15 | type: "bytes", 16 | }, 17 | ], 18 | name: "fetch", 19 | outputs: [ 20 | { 21 | internalType: "string", 22 | name: "", 23 | type: "string", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ]; 30 | 31 | export class ITraitsFetch__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): ITraitsFetchInterface { 34 | return new utils.Interface(_abi) as ITraitsFetchInterface; 35 | } 36 | static connect( 37 | address: string, 38 | signerOrProvider: Signer | Provider 39 | ): ITraitsFetch { 40 | return new Contract(address, _abi, signerOrProvider) as ITraitsFetch; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/IWETH__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { IWETH, IWETHInterface } from "../IWETH"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "deposit", 13 | outputs: [], 14 | stateMutability: "payable", 15 | type: "function", 16 | }, 17 | { 18 | inputs: [ 19 | { 20 | internalType: "address", 21 | name: "to", 22 | type: "address", 23 | }, 24 | { 25 | internalType: "uint256", 26 | name: "value", 27 | type: "uint256", 28 | }, 29 | ], 30 | name: "transfer", 31 | outputs: [ 32 | { 33 | internalType: "bool", 34 | name: "", 35 | type: "bool", 36 | }, 37 | ], 38 | stateMutability: "nonpayable", 39 | type: "function", 40 | }, 41 | { 42 | inputs: [ 43 | { 44 | internalType: "uint256", 45 | name: "wad", 46 | type: "uint256", 47 | }, 48 | ], 49 | name: "withdraw", 50 | outputs: [], 51 | stateMutability: "nonpayable", 52 | type: "function", 53 | }, 54 | ]; 55 | 56 | export class IWETH__factory { 57 | static readonly abi = _abi; 58 | static createInterface(): IWETHInterface { 59 | return new utils.Interface(_abi) as IWETHInterface; 60 | } 61 | static connect(address: string, signerOrProvider: Signer | Provider): IWETH { 62 | return new Contract(address, _abi, signerOrProvider) as IWETH; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /packages/deployments/types/factories/Ownable__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { Ownable, OwnableInterface } from "../Ownable"; 8 | 9 | const _abi = [ 10 | { 11 | anonymous: false, 12 | inputs: [ 13 | { 14 | indexed: true, 15 | internalType: "address", 16 | name: "previousOwner", 17 | type: "address", 18 | }, 19 | { 20 | indexed: true, 21 | internalType: "address", 22 | name: "newOwner", 23 | type: "address", 24 | }, 25 | ], 26 | name: "OwnershipTransferred", 27 | type: "event", 28 | }, 29 | { 30 | inputs: [], 31 | name: "owner", 32 | outputs: [ 33 | { 34 | internalType: "address", 35 | name: "", 36 | type: "address", 37 | }, 38 | ], 39 | stateMutability: "view", 40 | type: "function", 41 | }, 42 | { 43 | inputs: [], 44 | name: "renounceOwnership", 45 | outputs: [], 46 | stateMutability: "nonpayable", 47 | type: "function", 48 | }, 49 | { 50 | inputs: [ 51 | { 52 | internalType: "address", 53 | name: "newOwner", 54 | type: "address", 55 | }, 56 | ], 57 | name: "transferOwnership", 58 | outputs: [], 59 | stateMutability: "nonpayable", 60 | type: "function", 61 | }, 62 | ]; 63 | 64 | export class Ownable__factory { 65 | static readonly abi = _abi; 66 | static createInterface(): OwnableInterface { 67 | return new utils.Interface(_abi) as OwnableInterface; 68 | } 69 | static connect( 70 | address: string, 71 | signerOrProvider: Signer | Provider 72 | ): Ownable { 73 | return new Contract(address, _abi, signerOrProvider) as Ownable; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "apps/*" 3 | - "contracts/*" 4 | - "packages/*" 5 | - "external/*" 6 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turborepo.org/schema.json", 3 | "globalDependencies": [".env.*", "$ALCHEMY_KEY"], 4 | "pipeline": { 5 | "chain": { 6 | "dependsOn": ["^chain"], 7 | "outputs": [""], 8 | "inputs": ["contracts/**/*.sol"] 9 | }, 10 | "chain:fork": { 11 | "dependsOn": ["^chain:fork"], 12 | "outputs": [""], 13 | "inputs": ["contracts/**/*.sol"] 14 | }, 15 | "compile": { 16 | "dependsOn": ["^compile"], 17 | "outputs": [""], 18 | "inputs": ["contracts/**/*.sol"] 19 | }, 20 | "chain:deployment": { 21 | "dependsOn": ["^chain:deployment"], 22 | "outputs": [""], 23 | "inputs": ["contracts/**/*.sol"] 24 | }, 25 | "dev": { 26 | "outputs": [""] 27 | }, 28 | "dev:fork": { 29 | "outputs": [""] 30 | }, 31 | "lint": { 32 | "outputs": [""] 33 | }, 34 | "watch": { 35 | "dependsOn": ["^watch"] 36 | }, 37 | "build": { 38 | "dependsOn": ["^build"] 39 | }, 40 | "build:prd": { 41 | "dependsOn": ["^build:prd"], 42 | "outputs": [".next", "out"] 43 | }, 44 | "clean": { 45 | "dependsOn": ["^clean"] 46 | }, 47 | "lab": { 48 | "dependsOn": [ 49 | "@erc721k/deployments#chain:deployment", 50 | "^watch", 51 | "@erc721k/demo-react-app#dev" 52 | ], 53 | "outputs": [""] 54 | }, 55 | "lab:fork": { 56 | "dependsOn": [ 57 | "^watch", 58 | "@erc721k/deployments#chain:fork", 59 | "@erc721k/demo-react-app#dev:fork" 60 | ] 61 | } 62 | } 63 | } 64 | --------------------------------------------------------------------------------