Skip to content

A helper cli for deploying contracts using CREATE2 for multi-chain

License

Notifications You must be signed in to change notification settings

rkdud007/create2deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create2Deploy

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.

Installation

Install from source:

cargo install --path .

Usage

Command Line Interface

❯ 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

Configuration

  1. 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.."
}
  1. Set your PRIVATE_KEY environment variable before running the tool.

Example

❯ 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

About

A helper cli for deploying contracts using CREATE2 for multi-chain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages