This repository will contain the code for the Worldcoin state bridge, specifically designed for the Linea blockchain. The bridge facilitates state synchronization between the WorldID Ethereum mainnet deployment and the Linea network.
The addresses of the contract deployments for production and staging will be available in docs/deployments.md.
This is a list of the most frequently needed commands.
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Compile the contracts:
$ forge build
Get a test coverage report:
$ forge coverage
Deploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
For this script to work, you need to have a MNEMONIC
environment variable set to a valid
BIP39 mnemonic.
For instructions on how to deploy to a testnet or mainnet, check out the Solidity Scripting tutorial.
Format the contracts:
$ forge fmt
Get a gas report:
$ forge test --gas-report
Lint the contracts:
$ bun run lint
Run the tests:
$ forge test
Generate test coverage and output result to the terminal:
$ bun run test:coverage
Generate test coverage with lcov report (you'll have to open the ./coverage/index.html
file in your browser, to do so
simply copy paste the path):
$ bun run test:coverage:report
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.