Create ERC1155 Mints. Creators can call the createMint
function on the NFTMint
contract. They pass an array of
editions with attributes and an assigned percent chance. Buyers can order
mints and specify a number they wish to buy.
A trusted party calls the fillOrders
which fills pending orders. This is required to ensure safe randomness is
achieved.
After the mint, creators maintain control over the ERC1155 contract and can set the name, image, description, and royalty info freely.
Important Note: When filling orders, if the safe transfer of the ERC1155 fails, the order is marked as complete--the buyer does not receive the NFT or a refund. We check if a buyer can receive ERC1155s in the order function but this is not foolproof.
This is a list of the most frequently needed commands.
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Compile the contracts:
$ forge build
Get a test coverage report:
$ forge coverage
Deploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
For this script to work, you need to have a MNEMONIC
environment variable set to a valid
BIP39 mnemonic.
For instructions on how to deploy to a testnet or mainnet, check out the Solidity Scripting tutorial.
Format the contracts:
$ forge fmt
Get a gas report:
$ forge test --gas-report
Lint the contracts:
$ bun run lint
Run the tests:
$ forge test
Generate test coverage and output result to the terminal:
$ bun run test:coverage
Generate test coverage with lcov report (you'll have to open the ./coverage/index.html
file in your browser, to do so
simply copy paste the path):
$ bun run test:coverage:report
- abigger87/femplate
- cleanunicorn/ethereum-smartcontract-template
- foundry-rs/forge-template
- FrankieIsLost/forge-template
This project is licensed under MIT.