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.
Integration with full system:
- Deploy
world-id-contracts
- Get deployment address for
WorldIDIdentityManager
- Deploy
world-id-state-bridge
by runningmake deploy
(requires 2.) - Get deployment address for
StateBridge
- Call
setStateBridge
onWorldIDIdentityManager
with the output from 4. - Start inserting identities and monitor
PolygonWorldID
andOpWorldID
for root updates (usingsignup-sequencer
) - Try and create a proof and call
verifyProof
onOpWorldID
orPolygonWorldID
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.
Deploy the WorldID state bridge and all its components to the Goerli testnet.
Integration with full system:
- Deploy
world-id-contracts
- Get deployment address for
WorldIDIdentityManager
- Deploy
world-id-state-bridge
by runningmake deploy-testnet
(requires 2.) - Get deployment address for
StateBridge
- Call
setStateBridge
onWorldIDIdentityManager
with the output from 4. - Start inserting identities and monitor
PolygonWorldID
andOpWorldID
for root updates (usingsignup-sequencer
) - Try and create a proof and call
verifyProof
onOpWorldID
orPolygonWorldID
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.
Deploy the WorldID state bridge and a mock WorldID identity manager to the Goerli testnet for integration tests.
make mock
This repo uses Paul Razvan Berg's foundry template: A Foundry-based template for developing Solidity smart contracts, with sensible defaults.