ZeroXBridge
Deployment tooling for the L1 (Solidity) and L2 (Cairo) contracts, MMR index fixes in the Cairo bridge contract, and a Starknet burn-event fetcher in the Rust sequencer.
- Period: 2025
- Role: Contributor
- Languages: TypeScript, Cairo, Rust
- Built with: Starknet, Foundry
- Repository: Explore-Beyond-Innovations/ZeroXBridge_Contracts
What ZeroXBridge is
A cross-chain liquidity bridge design: lock assets on Ethereum and mint a pegged token on Starknet, using zero-knowledge proofs (per its README). It has Solidity contracts for the Ethereum side, Cairo contracts for Starknet, and a Rust sequencer that watches both chains. The contracts exist only as testnet deployments.
What I did
I contributed to a team project, so most of the code is other people's. Mine is:
- L1 deployment script (TypeScript). It deploys the Ethereum contracts through
forge scriptin dependency order, skips what is already deployed, and saves its state after every step so a failed run can resume. - L2 deployment script (TypeScript, starknet.js). It declares and deploys the Cairo contracts, recovers when a class is already declared, and sets up the links between the contracts. I ran it on Starknet Sepolia in June 2025.
- A fix to the Merkle mountain range (MMR) indexing in the Cairo bridge contract: how a commitment's leaf index and the peaks are stored, with tests. Follow-up commits by other contributors changed the final index formula, so I do not claim the finished math.
- A Starknet burn-event fetcher in the Rust sequencer. It reads burn events page by page and keeps its place in a Postgres table, so a restart resumes where it stopped.
The excerpts here are pinned to the commits where those files were mine, because later commits by others reworked two of them.
Status
Sepolia testnet only, with no real activity on chain.
Deployed contracts
Testnets only. Each address opens on its block explorer.
| Network | Contract | Address | Read-only calls |
|---|---|---|---|
| Ethereum Sepolia | ZeroXBridgeL1 | 0x3f39…A60D | owner(), proofRegistry(), tvl() |
| Ethereum Sepolia | ProofRegistry | 0x2763…6b15 | none listed |
| Ethereum Sepolia | MerkleManager | 0x923a…2BAF | getRootHash(), getElementsCount() |
| Ethereum Sepolia | MerkleStateManager | 0xA04f…Cef2 | depositRoot(), withdrawalRoot() |
| Starknet Sepolia | ProofRegistry (L2) | 0x2d55…0c65 | none listed |
| Starknet Sepolia | L2Oracle | 0x5527…5c39 | none listed |
| Starknet Sepolia | xZBERC20 | 0x4a01…b602 | none listed |
| Starknet Sepolia | ZeroXBridgeL2 | 0x63ec…a127 | none listed |
- ZeroXBridgeL1 (Ethereum Sepolia): From my L1 deployment run, June 2025.
- ProofRegistry (Ethereum Sepolia): From my L1 deployment run.
- MerkleManager (Ethereum Sepolia): From my L1 deployment run.
- MerkleStateManager (Ethereum Sepolia): From my L1 deployment run. Its source was later removed from the main branch.
- ProofRegistry (L2) (Starknet Sepolia): From my L2 deployment run, June 2025.
- L2Oracle (Starknet Sepolia): From my L2 deployment run.
- xZBERC20 (Starknet Sepolia): From my L2 deployment run.
- ZeroXBridgeL2 (Starknet Sepolia): From my L2 deployment run.
In the terminal, cast call --list lists every function that can be called live against these contracts.
Merged pull requests
- Explore-Beyond-Innovations/ZeroXBridge_Contracts#104: Close #102 (merged 2025-08-24)
- Explore-Beyond-Innovations/ZeroXBridge_Contracts#99: feat: added l1 deployment [issue #80] (merged 2025-06-30)
- Explore-Beyond-Innovations/ZeroXBridge_Contracts#96: feat: added deployment script [issue #81] (merged 2025-06-30)
- Explore-Beyond-Innovations/ZeroXBridge_Sequencer#30: Feat: implement Starknet L2 burn event fetcher with last block index … (merged 2025-05-06)