The intrinsic.art NFT platform enables artists to define generative traits as fungible tokens (ERC-1155), and collectors to combine their favorite traits to purchase a unique, customized artwork (ERC-721). The smart contracts consist of three primary contracts which are outlined below.
The Artwork contract implements the ERC-721 standard for representing the Artwork NFTs, and an instance is deployed per art project. These artwork tokens contain the underlying trait tokens which define the appearance of the generative art output. This contract stores the javascript generative art scripts that render the artwork in a web browser. This contract includes functions for creating these artwork tokens using trait tokens, and for decomposing the artwork into its corresponding traits.
The Traits contract implements the ERC-1155 standard for representing the Trait NFTs, and an instance is deployed per art project. These trait tokens contain a human readable name string that describes the trait, and also a value string that is injected into the generative art javascript code as an input to define the appearance of the artwork. This contract also includes functionality for a Dutch Auction, which is the mechanism used for the primary sales of the trait tokens.
The Project Registry contract records the Artwork and Trait contract addresses that have been deployed for each new art project.
Clone the repository:
git clone ...Lookup the recommended Node version to use in the .nvmrc file and install and use the correct version:
nvm install
nvm useInstall necessary dependencies:
npm installCompile contracts to create typechain files:
npm run compileRun the tests
npm run testDeploy System
npx hardhat nodeDeploy the contracts
npx hardhat deploy --network baseSepoliaDeploy project contracts, verify on Etherscan, and register project on registry
npx hardhat DeployMetta --network baseSepolia
npx hardhat DeployTackLineTorn --network baseSepolia
npx hardhat DeployOneRing --network baseSepoliaProject scripts and descriptions are stored in the bytecode of string storage smart contracts to save on deployment gas.
The escapify script can be used to escape quotes, newlines, and backslashes:
npm run EscapifyJSON -- projectConfigs/metta/descriptionnpm run EscapifySolidity -- projectConfigs/metta/metadata.jsonnpm run EscapifySolidity -- projectConfigs/metta/scriptnpx hardhat coverage