C0LLBACK
c0llback/nft-utils

A grab-bag of modular Solidity contracts for NFT development. Not a framework — copy the files you need, inherit them in your collection, deploy it yourself. No external dependencies.

soliditynfterc721eip-2981chainlink-vrfgas-optimizationtoolkitethereum
Solidity ^0.8.9License MITNetwork Ethereum38 files
Solidity 80.1%Markdown 18.8%Text 1.1%
c0llbackb8e0a14feat: batch-mint base + on-chain SVG/trait generators, per-folder READMEsOct 19, 2021
README.md

nft-utils

Solidity License Dependencies Setup

A grab-bag of modular Solidity contracts for NFT development. Not a framework — just files you copy. Download the folder, drop the pieces you need into contracts/, inherit them in your collection, and deploy it yourself.

What this is (and isn't)

  • Not a framework — there's no base you're forced to extend, no build step, no package. Copy the .sol files you want, delete the rest.
  • Not opinionated — works with Hardhat, Foundry or Truffle, and alongside OpenZeppelin or standalone.
  • No external dependencies — every file compiles on its own (the kit ships its own BatchMint721, Base64, etc.).
  • Not deployed by me — you keep full control: your keys, your constructor args, your chain.

How to use

1. Download the folder from the site
2. Copy the files you want into contracts/
3. Inherit the modules in your own collection
4. Deploy it yourself
import "./nft-utils/minting/MerkleWhitelist.sol";
import "./nft-utils/reveal/DelayedReveal.sol";
 
contract MyCollection is ERC721, MerkleWhitelist, DelayedReveal {
// only your collection-specific logic
function _handleMint(address to, uint256 qty) internal override {
for (uint256 i; i < qty; ) { _safeMint(to, _next++); unchecked { ++i; } }
}
function tokenURI(uint256 id) public view override returns (string memory) {
return _revealURI(id);
}
}

The one seam: _handleMint

Minting modules validate their policy then call _handleMint(to, quantity). You implement it once — wire it to your ERC721's mint (OZ _safeMint loop, ERC721A batch _mint, or this kit's BatchMint721, which implements it for you). See minting/MintHook.sol.

The other seam: transfer hooks

Transfer-restriction modules (NFTStaking, SoulboundToken, NFTRental, RoyaltyEnforcer) expose internal checkers you call from your _beforeTokenTransfer. You stay in control of order and composition.

Contents

FolderModules
minting/MerkleWhitelist · BatchMint721 · StagesMintManager · DutchAuction · CommitRevealMint
reveal/DelayedReveal · VRFReveal · ProgressiveReveal
royalties/EIP2981Royalty · RoyaltySplitter · RoyaltyEnforcer
utility/NFTStaking · NFTRental · SoulboundToken · BurnToUpgrade · TokenGate
onchain/SVGGenerator · TraitGenerator · Base64
security/MintRateLimiter · ReentrancyGuardNFT · NFTFloorOracle

Each folder has its own README.md documenting every file's parameters, entrypoints, events and gotchas. Runnable integrations live in examples/: ExampleCollection, ExampleDutchAuction, ExampleOnchainArt, ExampleSoulbound.

Every contract ships with NatSpec, events on each state change, custom errors (cheaper than string reverts on 0.8), and unchecked only where overflow is impossible.

Conventions

  • Solidity ^0.8.9 — built-in overflow checks (no SafeMath), custom errors,

unchecked for hot loops.

  • Admin is yours. Setters are internal and prefixed _; wrap them with

whatever access control you use (Ownable, AccessControl, a timelock). The kit never ships an owner you can't change.

  • Standalone first. Modules avoid imports across categories where possible;

a few share MintHook / interfaces, noted at the top of each file.

A note on standards & era

Built for the late-2021 NFT stack. Two forward-looking touches: VRFReveal targets Chainlink VRF v1 (the v2 subscription model landed in 2022), and SoulboundToken exposes the EIP-5192 surface that was only just emerging — the non-transferability works regardless. See each file's header for details.

Security

None of this is audited. It's a study/utility kit published for review. Read the code, test it, and get an audit before mainnet with real value. Per-module caveats (advisory royalties, trusted oracle updater, pseudo-random traits, …) are documented in the folder READMEs.

License

MIT © 2021 c0llback — copy freely.

← Back to index© 2020 c0llbackMIT