Skip to content

State bridge between the WorldID Ethereum mainnet deployment and WorldID supported networks

License

Notifications You must be signed in to change notification settings

Justice-Orogun/world-id-state-bridge

 
 

Repository files navigation

world-id-state-bridge

spec

Description

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

Supported networks

Currently, the supported networks are Polygon PoS (for backwards compatibility) and Optimism. The next iteration of the bridge will most-likely be based on storage proofs and will support most EVM networks off the get-go, with other networks pending storage proof verifier and Semaphore verifier implementations and deployments.

Documentation

Run make 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

Build

Build the contracts:

make build

Clean

Delete the build artifacts and cache directories:

make clean

Coverage

Get a test coverage report:

make coverage

Format

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

make format

Gas Usage

Get a gas report:

make snapshot
make bench

Lint

Lint the contracts:

make lint

Test

Run the tests:

make test

Environment

Clone .env.example to .env, fill the environment variables and source .env before running any scripts. Beware that there is a different Etherscan API key for every single network that we are deploying a contract onto (Ethereum, Polygon and Optimism- mainnet/testnet).

Deploy

Deploy the WorldID state bridge and all its components to Ethereum mainnet using the CLI tool.

Integration with full system:

  1. Deploy world-id-contracts
  2. Get deployment address for WorldIDIdentityManager
  3. Deploy world-id-state-bridge by running make deploy (requires 2.)
  4. Get deployment address for StateBridge
  5. Call setStateBridge on WorldIDIdentityManager with the output from 4.
  6. Start inserting identities and monitor PolygonWorldID and OpWorldID for root updates (using signup-sequencer)
  7. Try and create a proof and call verifyProof on OpWorldID or PolygonWorldID to check whether everything works.

Note: Remember to call all functions that change state on these contracts via the owner address, which is the deployer address by default.

Testnet

Deploy the WorldID state bridge and all its components to the Goerli testnet.

Integration with full system:

  1. Deploy world-id-contracts
  2. Get deployment address for WorldIDIdentityManager
  3. Deploy world-id-state-bridge by running make deploy-testnet (requires 2.)
  4. Get deployment address for StateBridge
  5. Call setStateBridge on WorldIDIdentityManager with the output from 4.
  6. Start inserting identities and monitor PolygonWorldID and OpWorldID for root updates (using signup-sequencer)
  7. Try and create a proof and call verifyProof on OpWorldID or PolygonWorldID to check whether everything works.

Note: Remember to call all functions that change state on these contracts via the owner address, which is the deployer address by default.

Mock

Deploy the WorldID state bridge and a mock WorldID identity manager to the Goerli testnet for integration tests.

make mock

Credits

This repo uses Paul Razvan Berg's foundry template: A Foundry-based template for developing Solidity smart contracts, with sensible defaults.

About

State bridge between the WorldID Ethereum mainnet deployment and WorldID supported networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 83.3%
  • JavaScript 15.4%
  • Makefile 1.3%