State bridge between the WorldID Ethereum mainnet deployment and WorldID supported networks. The spec
can be found in docs/spec.md
.
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.
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.
Build the contracts:
make build
Delete the build artifacts and cache directories:
make clean
Get a test coverage report:
make coverage
Format the contracts with forge fmt
and the rest of the files (.js, .md) with Prettier:
make format
Get a gas report:
make snapshot
make bench
Lint the contracts:
make lint
Run the tests:
make test
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 the WorldID state bridge and all its components to Ethereum mainnet using the CLI tool.
make deploy
Integration with full system:
- Download
world-id-contracts
make deploy
- follow the CLI interface for the deployment script and select Ethereum mainnet as the target deployment network, and
input the deployment address of
StateBridge
when prompted.
Deploy the WorldID state bridge and all its components to the Goerli testnet.
make deploy-testnet
Integration with full system:
- Download
world-id-contracts
make deploy
- follow the CLI interface for the deployment script and select Goerli as the target deployment network, and input the
deployment address of
StateBridge
when prompted.
Deploy the WorldID state bridge and a mock WorldID identity manager to the Goerli testnet for integration tests.
make mock
make integration
This repo uses Paul Razvan Berg's foundry template: A Foundry-based template for developing Solidity smart contracts, with sensible defaults.