Repository navigation
L1 Bridge Contracts
Amp edited this page Nov 18, 2026
·
1 revision
contracts/ · Foundry project, Solidity 0.8.30, EVM prague · the Ethereum L1 custody and bridge contract of CHAIN mode
The L1 contract of CHAIN mode. It covers spec 09 §6 (custody and the bridge), the L1 side of §7 (forced inclusion), REQ-CHN-6 and B-CHN-4 (the escapeClaim gas report). The README says: "spec/11-build.md §1.2 gives Solidity no place in the tree, so the Foundry project lives in contracts/ at the repository root." VyrnBridge is immutable: no proxy, no admin, no upgrade (09 §6.1).
- 09 §6.1–§6.7: deposits, posts, veto, claims, pause and unpause, signer rotation, escape
- 09 §6.2: the withdrawal tree (keccak256, OpenZeppelin
StandardMerkleTree) - 09 §9.3: BLAKE3 SMT verification for
escapeClaim - 09 §7: the escape hatch only. The contract has no forced-inclusion entry point
- 09 §2.2: roles and keys (5 bridge keys, 4 of 5 needed; 5 guardian keys, any one may veto or pause)
| Path | What |
|---|---|
| src/IVyrnBridge.sol | The ABI: structs, events, errors, functions |
| src/VyrnBridge.sol | The contract |
| src/SmtVerifier.sol, src/Smt.sol | BLAKE3 SMT verifier, deployed by the bridge's constructor |
| src/Blake3.sol, src/SmtEmpty.sol | Generated by script/gen_blake3.py and script/gen_smt.py
|
| test/ |
VyrnBridge.t.sol, Escape.t.sol, Vectors.t.sol, Smt.t.sol, Blake3.t.sol
|
| vectors/ |
blake3.json, eip712.json, smt.json, wdtree.json, computed without the contract (eth-account, cast, @openzeppelin/merkle-tree, Python blake3) |
Implemented
- Every path in the README's behaviour table has code and tests: deposit, post, veto, re-propose, claim with the 24 h cap, pause, unpause, rotation, escape,
escapeClaim,refundDeposit. - Tests: 40
test*functions.VyrnBridge.t.solhas 21,Escape.t.sol8,Vectors.t.sol5,Smt.t.sol4 andBlake3.t.sol2. Fuzz runs: 256 by default and 128 in theciprofile (foundry.toml). - CI job
contractsrunsforge fmt --check,forge build --sizesandFOUNDRY_PROFILE=ci forge test --gas-report. - The README lists six decisions "where the spec is silent or differs". For example:
escapeClaimtakes the AccountLeaf as well as the BalanceLeaf, andUnpause(uint64 pauseNo)is a message type 09 does not name. Another: the SMT verifier is a separate contract because the bridge with BLAKE3 inlined is over the EIP-170 limit. The README also proposes the SMT leaf encoding, which 09 §9.3 does not fix, and "which thevyrn-chaincrate must use or replace through the spec".
-
Crate-vyrn-chain checks itself against
contracts/vectors/intests/vectors.rs. That crate builds posts and checks signatures, but has no L1 deposit attestation (09 §6.3) yet.
- Code: contracts/, contracts/README.md
- Spec: Spec-09-Chain, Spec-02-Requirements, Spec-11-Build
- Related: CI-Gates-and-Releases, Crate-vyrn-epoch
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.