Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89eccaa
feat: add ev-deployer CLI for genesis contract allocation
randygrok Mar 13, 2026
0c8f54e
test: add bytecode verification tests for ev-deployer contracts
randygrok Mar 13, 2026
2ba2b80
docs: add ev-deployer README with config and usage guide
randygrok Mar 13, 2026
a540858
fix(ci): serialize bytecode verification tests to avoid solc race con…
randygrok Mar 13, 2026
b9e2670
style: apply cargo fmt to ev-deployer
randygrok Mar 13, 2026
18ed817
ci(ev-deployer): split workflow into separate bytecode and unit test …
randygrok Mar 13, 2026
f7d0e71
style: fix fmt and clippy lint errors in ev-deployer
randygrok Mar 16, 2026
e5f4eb9
Merge branch 'main' into ev-deployer-part1-core
randygrok Mar 18, 2026
be1b241
Merge remote-tracking branch 'origin/main' into ev-deployer-part1-core
randygrok Mar 19, 2026
7e19222
ci(ev-deployer): add e2e genesis test to CI workflow
randygrok Mar 19, 2026
aeffc0d
fix(ev-deployer): address PR review feedback
jgimeno Mar 19, 2026
e8a39f8
refactor(ev-deployer): remove FeeVault contract from part 1
randygrok Mar 24, 2026
089ef22
refactor(ev-deployer): remove AdminProxy contract from part 1
randygrok Mar 24, 2026
6b85563
Revert "refactor(ev-deployer): remove AdminProxy contract from part 1"
randygrok Mar 24, 2026
93b3eaa
fix(ev-deployer): make [contracts] section optional in config
randygrok Mar 24, 2026
70111fd
feat(ev-deployer): add init command to generate starter config
randygrok Mar 24, 2026
fa0e71f
fix(ev-deployer): clean up command ordering and stale fee_vault refer…
randygrok Mar 24, 2026
1acd3c8
docs(ev-deployer): document init command in README
randygrok Mar 24, 2026
65bbf9e
fix(ev-deployer): normalize alloc keys for collision detection
randygrok Mar 24, 2026
08c9eb4
style(ev-deployer): fix fmt and clippy lint in genesis.rs
randygrok Mar 25, 2026
98a4600
Merge branch 'main' into ev-deployer-part1-core
randygrok Mar 26, 2026
6da798a
Merge branch 'main' into ev-deployer-part1-core
randygrok Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ev_deployer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: EV Deployer CI

on:
push:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ev_deployer.yml'
- 'contracts/src/**'
- 'contracts/foundry.toml'
- 'bin/ev-deployer/**'
pull_request:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ev_deployer.yml'
- 'contracts/src/**'
- 'contracts/foundry.toml'
- 'bin/ev-deployer/**'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
verify-bytecodes:
name: EV Deployer bytecode verification
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run bytecode verification tests
run: cargo test -p ev-deployer -- --ignored --test-threads=1

unit-tests:
name: EV Deployer unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Run unit tests
run: cargo test -p ev-deployer

e2e-genesis:
name: EV Deployer e2e genesis test
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run e2e genesis test
run: bash bin/ev-deployer/tests/e2e_genesis.sh
73 changes: 68 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"bin/ev-deployer",
"bin/ev-dev",
"bin/ev-reth",
"crates/common",
Expand Down
23 changes: 23 additions & 0 deletions bin/ev-deployer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "ev-deployer"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true

[dependencies]
alloy-primitives = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["derive", "env"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
toml = "0.8"
eyre = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }

[lints]
workspace = true
113 changes: 113 additions & 0 deletions bin/ev-deployer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# EV Deployer

CLI tool for generating genesis alloc entries for ev-reth contracts. It reads a declarative TOML config and produces the JSON needed to embed contracts into a chain's genesis state.

## Building

```bash
just build-deployer
```

The binary is output to `target/release/ev-deployer`.

## Configuration

EV Deployer uses a TOML config file to define what contracts to include and how to configure them. See [`examples/devnet.toml`](examples/devnet.toml) for a complete example.

```toml
[chain]
chain_id = 1234

[contracts.admin_proxy]
address = "0x000000000000000000000000000000000000Ad00"
owner = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
```

### Config reference

#### `[chain]`

| Field | Type | Description |
|------------|------|-------------|
| `chain_id` | u64 | Chain ID |

#### `[contracts.admin_proxy]`

| Field | Type | Description |
|-----------|---------|---------------------------|
| `address` | address | Address to deploy at |
| `owner` | address | Owner (must not be zero) |

## Usage

### Generate a starter config

```bash
ev-deployer init --output deploy.toml
```

This creates a TOML config template with all supported contracts commented out and documented.

### Generate genesis alloc

Print alloc JSON to stdout:

```bash
ev-deployer genesis --config deploy.toml
```

Write to a file:

```bash
ev-deployer genesis --config deploy.toml --output alloc.json
```

### Merge into an existing genesis file

Insert the generated entries into an existing `genesis.json`. The merged result is written to `--output` (or stdout if `--output` is omitted):

```bash
ev-deployer genesis --config deploy.toml --merge-into genesis.json --output genesis-out.json
```

If an address already exists in the genesis, the command fails. Use `--force` to overwrite:

```bash
ev-deployer genesis --config deploy.toml --merge-into genesis.json --output genesis-out.json --force
```

### Export address manifest

Write a JSON mapping of contract names to their configured addresses:

```bash
ev-deployer genesis --config deploy.toml --addresses-out addresses.json
```

Output:

```json
{
"admin_proxy": "0x000000000000000000000000000000000000Ad00"
}
```

### Look up a contract address

```bash
ev-deployer compute-address --config deploy.toml --contract admin_proxy
```

## Contracts

| Contract | Description |
|----------------|-----------------------------------------------------|
| `admin_proxy` | Proxy contract with owner-based access control |

Runtime bytecodes are embedded in the binary — no external toolchain is needed at deploy time.

## Testing

```bash
just test-deployer
```
6 changes: 6 additions & 0 deletions bin/ev-deployer/examples/devnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[chain]
chain_id = 1234

[contracts.admin_proxy]
address = "0x000000000000000000000000000000000000Ad00"
owner = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
Loading
Loading