TapeFoundry Docs
Docs menu

How a card is made

Three contracts, three signatures. Each step does one thing, and none of them is custodial.

A card is not minted in one call. It is assembled: parts are bought, burned into a circuit, and then numbered. The three steps are separate because they touch three different contracts with three different jobs.

Step 1 — buy the parts

mint(uint256 transistorId, uint256 amount)
value = amount × 0.0000234 + 0.0001 BNB

This transfers the gates to your wallet. Nothing is burned yet, and no card exists.

Step 2 — tape out

tapeout(bytes netlist, uint32 nIn, uint32 nOut)
value = 0.0002 BNB exactly

The calldata contains the full netlist. For a 46-gate adder that is 322 bytes; for a 2,118-gate multiplier it is 14,826 bytes. The contract decodes the gates, counts them, burns that many from your balance, and stores the netlist under a new token id.

After this step you own a card, but it has no edition number. It is a circuit with a token id and a gate count.

Step 3 — stamp the edition

claim(uint16 epoch, uint8 drawingId, address cpu, uint256 circuitId)

The registry hashes the stored netlist, compares it with the drawing registered for this foundry, and issues the next number for that drawing. The drawing's maximum is enforced here: if all numbers are issued, the call reverts.

Why three transactions

They are three contracts, and each does one job. A single button would require a router that takes custody of your funds between steps. We chose the extra signature.

What each step costs

StepValueGas (observed)Produces
Mint partsgates × 0.0000234 + 0.0001~60k–200k, scales with amountERC-1155 gates
Tape out0.0002~330k–400k, scales with netlistERC-721 circuit + netlist on chain
Claim edition0~88kA number in the registry

Gas varies with network conditions and netlist size. It is paid to BNB Chain, not to the foundry.

Failure modes

Order matters. Claim reads the circuit's netlist. A circuit that was never taped out cannot be claimed, and a claim cannot be front-run by another drawing.