Call any TapeOut circuit from Solidity, by name.
Name the pins once. Get a typed library and its tests.
- Circuits checked live
- 9
- Less gas when compiled
- 53–198×
- Tests passing
- 104
- 1
Read a live circuit
Enter its processor and id. Pinout reads the gates from X Layer.
- 2
Name the pins
Group bits into numbers and flags, and try values as you go.
- 3
Generate + test
Download the Solidity and a Foundry test that runs against mainnet.
Live on X Layer mainnet
Our rate limiter is circuit #1023. A deployed vault uses it to allow each owner 3 withdrawals an hour.
Load circuit 1023 in the generator| Circuit #1023 | 0xae8543…002cb5 |
|---|---|
| Vault | 0xf6e38a…1be4c7 |
| Processor 222 | 0x60918C…8405D6 |
Gas per call
Live mode calls the circuit. Compiled mode runs a Solidity copy of its gates.
| Circuit | Live | Compiled | Less gas |
|---|---|---|---|
| Seven-segment decoder | 242,893 | 4,528 | 54× |
| 8 × 8-bit multiplier | 1,509,389 | 25,236 | 60× |
| 16-bit adder | 1,054,725 | 20,043 | 53× |
| Rate limiter | 92,404 | 1,304 | 71× |
| Counter with memory | 95,243 | 480 | 198× |
Each bar is the live call. The bright part is compiled mode. Measured at X Layer block 77,588,977.
Before and after
bytes memory y =
cpu.eval(13, hex"b0045901");
// y is hex"090600". Now unpack it.uint24 sum = Adder.eval(
Adder.Inputs({a: 1200, b: 345})
).sum; // 1545