Skip to content

About

ERC-721 NFT collection where squids breed on-chain, mixing parent DNA. Ported from ink! to Solidity for Polygon/OpenSea.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Squid Breeding NFT

An ERC-721 collection where squids are bred, not just minted. Two parent squids combine their DNA on-chain to produce a child with mixed traits, a higher generation number, and a breeding cooldown.

Originally written in ink! (Rust, for Polkadot/Substrate), then ported to Solidity so the NFTs work on EVM chains and marketplaces like OpenSea.

How it works

  • Mint — createSquid(dna) creates a generation-0 squid for a flat MINT_FEE.
  • Breed — breed(momId, dadId) mixes the parents' DNA (mom's top digits + dad's bottom digits, plus a small mutation), sets the child's generation to max(parents) + 1, and puts both parents on a 60-second cooldown. Caller must own both parents.
  • Ownership & transfers — handled by ERC-721 itself (ownerOf, transferFrom).
  • Metadata — tokenURI returns fully on-chain base64-encoded JSON with DNA and generation traits. No external hosting, no IPFS pinning.

The DNA mutation uses block.timestamp for entropy, which is predictable by validators. That's fine for a learning project, but it is not secure randomness — don't reuse this pattern where the outcome has real value at stake.

Development

Built with Foundry.

forge build
forge test

Deploying

export POLYGON_RPC_URL="<your mainnet RPC endpoint>"

forge script script/DeploySquidBreeding.s.sol \
  --rpc-url polygon \
  --private-key <your-key> \
  --broadcast \
  --legacy \
  --with-gas-price 25000000000

Swap --rpc-url polygon for polygon_amoy (and set POLYGON_AMOY_RPC_URL) to deploy to the Amoy testnet first.

Note that some public Polygon RPC endpoints enforce a minimum gas price — 25 gwei worked at time of writing. --with-gas-price is what actually sets the broadcast price; the plain --gas-price flag only configures the local simulation.

Deployments

Network Address
Polygon Amoy (testnet) 0x49a621d513f7e772dde9ebbcc22900da8405ce3d

License

MIT

About

ERC-721 NFT collection where squids breed on-chain, mixing parent DNA. Ported from ink! to Solidity for Polygon/OpenSea.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages