Skip to content

Commit ed3284e

Browse files
Stumbleclaude
andauthored
build: strip CBOR metadata footer for deterministic bytecode (#106)
Set `bytecode_hash = "none"` in foundry.toml so emitted bytecode no longer contains the appended CBOR metadata block (IPFS source hash + solc version marker). The IPFS hash covers source paths and dependency layout, so the same source produced different bytes across clones — this churn polluted genesis.json regenerations without changing any runtime behavior. The `solc = "0.8.30"` pin above is what actually fixes the compiler version; the in-bytecode version marker was redundant artifact. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6d0cc1d commit ed3284e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

foundry.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ out = "out"
66
test = "test"
77
libs = ["lib"]
88
solc = "0.8.30"
9+
# Strip the CBOR metadata footer (IPFS source hash + solc version marker) from
10+
# emitted bytecode so genesis-baked contracts are byte-identical across clones,
11+
# dependency layouts, and machines. Compiler pin above is what's load-bearing;
12+
# the in-bytecode version marker is just an artifact.
13+
bytecode_hash = "none"
914
cache = true
1015
cache_path = 'cache'
1116
optimizer = true

0 commit comments

Comments
 (0)