A helper cli for deploying contracts using CREATE2 for multi-chain. This tool utilizes 0age's Create2Factory Contract to pre-compute deterministic contract addresses based on salt values before deploy.
Install from source:
cargo install --path .
❯ create2deploy -h
Usage: create2deploy [OPTIONS] --calldata <CALLDATA>
Options:
-c, --calldata <CALLDATA> Path to calldata JSON file path
--contract <CONTRACT> Optional contract address to override the default CREATE2 factory
-h, --help Print help
-V, --version Print version
- Create a
meta.json
file with your deployment parameters:
{
"rpc_urls": [
"target-chain-rpc-url-1",
"target-chain-rpc-url-2",
...
],
"salt": "0x..",
"initCode": "deadbeaf.."
}
- Set your
PRIVATE_KEY
environment variable before running the tool.
❯ create2deploy -c meta.json
🔍 Target chain's rpc url: https://sepolia.base.org
👀 target address: 0xc8c8c8c8421e85597881ae753d040449e81e528a
Is this the target address you want? (y/n):
y
🚀 safeCreate2 transaction: TransactionReceipt {
// ... transaction details ...
}
🔍 Target chain's rpc url: https://sepolia.optimism.io
👀 target address: 0xc8c8c8c8421e85597881ae753d040449e81e528a
Is this the target address you want? (y/n):
y
🚀 safeCreate2 transaction: TransactionReceipt {
// ... transaction details ...
}
🎉 Deployed all target contracts using CREATE2