Core smart contracts for the Velodrome Superchain. This includes the Superchain specific contracts (message passing, xERC20, etc) as well as the base v2 contracts.
For information on specific contracts, see SPECIFICATION.md.
. Integrators should
refer to the integrators section below.
This repository depends on:
node v20 (recommend managing node versions using nvm) foundry yarn
To install & run:
yarn install
forge b
forge t -vv
This repository uses forge fmt
to format code and bulloak for test layouts.
Populate foundry.toml
with the environment variables required for RPC and contract verification.
Run the following commands to check that the CreateX factory has the correct code. See here for more information. This is now done in the script, but feel free to check.
[[ $(cast keccak $(cast code 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed --rpc-url {RPC_URL})) == "0xbd8a7ea8cfca7b4e5f5041d7d4b17bc317c5ce42cfbc42066a00cf26b43eb53f" ]] && echo "Hash Matches" || echo "Hash Does Not Match"
Deploy Root contracts first:
forge script script/deployParameters/optimism/DeployRootBase.s.sol:DeployRootBase --slow --rpc-url optimism -vvvv
forge script script/deployParameters/optimism/DeployRootBase.s.sol:DeployRootBase --slow --rpc-url optimism --broadcast --verify -vvvv
Deploy Leaf contracts next:
Replace leaf
with the chain you are deploying to.
forge script script/deployParameters/leaf/DeployBase.s.sol:DeployBase --slow --rpc-url leaf -vvvv
forge script script/deployParameters/leaf/DeployBase.s.sol:DeployBase --slow --rpc-url leaf --broadcast --verify -vvvv
If there is a verification failure, simply remove --broadcast
and add --resume
.
For verifications, fill out the verifier config in foundry.toml
.
For blockscout verifications, append --verifier blockscout
after --verify
The xERC20 implementation in this repository has been modified lightly from the moonwell xERC20 implementation to support native Superchain interop in the future.
This project follows the Apache Foundation guideline for licensing. See LICENSE and NOTICE files.
Chain | Addresses |
---|---|
Arbitrum | Addresses |
Base | Addresses |
Bob | Addresses |
Celo | Addresses |
Fraxtal | Addresses |
Ink | Addresses |
Lisk | Addresses |
Mantle | Addresses |
Metal | Addresses |
Mode | Addresses |
Optimism | Addresses |
Polygon | Addresses |
Soneium | Addresses |
Superseed | Addresses |
Unichain | Addresses |
Worldchain | Addresses |
Optimism contains the root deployment contracts, and these factory addresses are used by all leaf chains.