State bridge between the WorldID Ethereum mainnet deployment and Linea. The spec can be found in
docs/spec.md
.
The addresses of the contract deployments for production and staging can be found in
docs/deployments.md
.
This repository implements a World ID state bridge specifically for Linea. For context, the original World ID state bridge supports Polygon PoS and OP stack chains (Optimism and Base), which can be found here. Additionally, there's a standalone bridge similar to this one for Scroll, available here.
This repository uses Bun as a dependency manager, script execution environment and so on. To install Bun, refer to its webpage. Other commands listed below assume you have Bun installed.
Run bun doc
to build and deploy a simple documentation webpage on localhost:3000. Uses
forge doc
under the hood and sources information
from the world-id-state-bridge
contracts NatSpec
documentation.
This is a list of the most frequently needed commands.
bun install
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Generate test coverage and output result to the terminal:
$ bun run test:coverage
Format the contracts with forge fmt
and the rest of the files (.js, .md) with Prettier:
bun run format
Get a gas report:
bun run snapshot
Run gas benchmarks on the tests:
bun run bench
Lint the contracts:
$ bun run lint
Run the tests:
$ forge test
To deploy the contracts to the testnet:
$ bun run deploy:testnet
To run the root propagator on testnet:
$ bun run propagator:testnet
You can read more about the root propagator here.
We welcome contributions to improve and expand the functionality of the Worldcoin state bridge for Linea. Please feel free to open issues or submit pull requests.
This repo uses code from the Worldcoin State Bridge for Polygon and Optimism, which can be found here.
This repo uses Paul Razvan Berg's foundry template: A Foundry-based template for developing Solidity smart contracts, with sensible defaults.