CheapNFT
CheapNFT copied to clipboard
Mint a 1 of 1 NFT with its own contract for ~90k gas.
SingleNFTFactory
Mint a 1 of 1 NFT with its own contract for ~90k gas.
Deployed to Ethereum mainnet: https://etherscan.io/address/0xc88891560074f477590b7f6109fe62cb26159469#writeContract
Also on Polygon (sooo cheap): https://polygonscan.com/address/0x4ad315ea13517a71880ff8c1a58ab8ed73c6c541#writeContract
Note, you need to turn all strings into bytes before writing. This site can help just make sure to remove the spaces and add 0x.
This was done to avoid doing string manipulation on-chain.
Gas savings
In general there are many gas saving strategies used here. Please read through the commits to see how we shaved off so much gas.
Inspired by:
- https://twitter.com/alcuadrado/status/1484333520071708672
- https://gist.github.com/z0r0z/ea0b752aa9537070b0d61f8a74d5c10c
- https://github.com/ZeframLou/vested-erc20
Local development
This project uses Foundry as the development framework.
This project is based on Zefram's template.
Dependencies
make update
Compilation
make build
Testing
make test