kfastov / worldcoin-bridge-linea

World ID state bridge for Linea
MIT License
6 stars 24 forks source link

worldcoin-bridge-linea

spec

Description

State bridge between the WorldID Ethereum mainnet deployment and Linea. The spec can be found in docs/spec.md.

Deployments

The addresses of the contract deployments for production and staging can be found in docs/deployments.md.

Supported Networks

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.

Prerequisites

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.

Documentation

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.

Usage

This is a list of the most frequently needed commands.

Install Dependencies

bun install

Build

Build the contracts:

$ forge build

Clean

Delete the build artifacts and cache directories:

$ forge clean

Coverage

Generate test coverage and output result to the terminal:

$ bun run test:coverage

Format

Format the contracts with forge fmt and the rest of the files (.js, .md) with Prettier:

bun run format

Gas Usage

Get a gas report:

bun run snapshot

Run gas benchmarks on the tests:

bun run bench

Lint

Lint the contracts:

$ bun run lint

Test

Run the tests:

$ forge test

Deploy

To deploy the contracts to the testnet:

$ bun run deploy:testnet

Run Root Propagator

To run the root propagator on testnet:

$ bun run propagator:testnet

You can read more about the root propagator here.

Contributing

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.

Credits

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.