![mypic](https://private-user-images.githubusercontent.com/84364476/241598524-37b040a5-6eef-41b2-8de5-ada1533ad855.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzMjQxMDAsIm5iZiI6MTcxODMyMzgwMCwicGF0aCI6Ii84NDM2NDQ3Ni8yNDE1OTg1MjQtMzdiMDQwYTUtNmVlZi00MWIyLThkZTUtYWRhMTUzM2FkODU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE0VDAwMTAwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0Mjc4YmRhNzMxZTkwMzUxODUyNjYxYzJmNjY4NzhiYTJjNmM4ZGJhNWJiODEzODAxMTQ0OGQyYzg2OGNhNjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Fv5STx9UG4yfvwzkeJYsIWGFXU5FxxA2HfryaspI5A0)
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 use
Install necessary dependencies:
npm install
Compile contracts to create typechain files:
npm run compile
Run the tests
npm run test
Deploy System
npx hardhat node
Deploy the contracts
npx hardhat deploy --network baseSepolia
Deploy project contracts, verify on Etherscan, and register project on registry
npx hardhat DeployMetta --network baseSepolia
npx hardhat DeployTackLineTorn --network baseSepolia
npx hardhat DeployOneRing --network baseSepolia
Project 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/description
npm run EscapifySolidity -- projectConfigs/metta/metadata.json
npm run EscapifySolidity -- projectConfigs/metta/script
npx hardhat coverage