|
| 1 | +# EV Deployer |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +## Building |
| 6 | + |
| 7 | +```bash |
| 8 | +just build-deployer |
| 9 | +``` |
| 10 | + |
| 11 | +The binary is output to `target/release/ev-deployer`. |
| 12 | + |
| 13 | +## Configuration |
| 14 | + |
| 15 | +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. |
| 16 | + |
| 17 | +```toml |
| 18 | +[chain] |
| 19 | +chain_id = 1234 |
| 20 | + |
| 21 | +[contracts.admin_proxy] |
| 22 | +address = "0x000000000000000000000000000000000000Ad00" |
| 23 | +owner = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" |
| 24 | +``` |
| 25 | + |
| 26 | +### Config reference |
| 27 | + |
| 28 | +#### `[chain]` |
| 29 | + |
| 30 | +| Field | Type | Description | |
| 31 | +|------------|------|-------------| |
| 32 | +| `chain_id` | u64 | Chain ID | |
| 33 | + |
| 34 | +#### `[contracts.admin_proxy]` |
| 35 | + |
| 36 | +| Field | Type | Description | |
| 37 | +|-----------|---------|---------------------------| |
| 38 | +| `address` | address | Address to deploy at | |
| 39 | +| `owner` | address | Owner (must not be zero) | |
| 40 | + |
| 41 | +## Usage |
| 42 | + |
| 43 | +### Generate a starter config |
| 44 | + |
| 45 | +```bash |
| 46 | +ev-deployer init --output deploy.toml |
| 47 | +``` |
| 48 | + |
| 49 | +This creates a TOML config template with all supported contracts commented out and documented. |
| 50 | + |
| 51 | +### Generate genesis alloc |
| 52 | + |
| 53 | +Print alloc JSON to stdout: |
| 54 | + |
| 55 | +```bash |
| 56 | +ev-deployer genesis --config deploy.toml |
| 57 | +``` |
| 58 | + |
| 59 | +Write to a file: |
| 60 | + |
| 61 | +```bash |
| 62 | +ev-deployer genesis --config deploy.toml --output alloc.json |
| 63 | +``` |
| 64 | + |
| 65 | +### Merge into an existing genesis file |
| 66 | + |
| 67 | +Insert the generated entries into an existing `genesis.json`. The merged result is written to `--output` (or stdout if `--output` is omitted): |
| 68 | + |
| 69 | +```bash |
| 70 | +ev-deployer genesis --config deploy.toml --merge-into genesis.json --output genesis-out.json |
| 71 | +``` |
| 72 | + |
| 73 | +If an address already exists in the genesis, the command fails. Use `--force` to overwrite: |
| 74 | + |
| 75 | +```bash |
| 76 | +ev-deployer genesis --config deploy.toml --merge-into genesis.json --output genesis-out.json --force |
| 77 | +``` |
| 78 | + |
| 79 | +### Export address manifest |
| 80 | + |
| 81 | +Write a JSON mapping of contract names to their configured addresses: |
| 82 | + |
| 83 | +```bash |
| 84 | +ev-deployer genesis --config deploy.toml --addresses-out addresses.json |
| 85 | +``` |
| 86 | + |
| 87 | +Output: |
| 88 | + |
| 89 | +```json |
| 90 | +{ |
| 91 | + "admin_proxy": "0x000000000000000000000000000000000000Ad00" |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +### Look up a contract address |
| 96 | + |
| 97 | +```bash |
| 98 | +ev-deployer compute-address --config deploy.toml --contract admin_proxy |
| 99 | +``` |
| 100 | + |
| 101 | +## Contracts |
| 102 | + |
| 103 | +| Contract | Description | |
| 104 | +|----------------|-----------------------------------------------------| |
| 105 | +| `admin_proxy` | Proxy contract with owner-based access control | |
| 106 | + |
| 107 | +Runtime bytecodes are embedded in the binary — no external toolchain is needed at deploy time. |
| 108 | + |
| 109 | +## Testing |
| 110 | + |
| 111 | +```bash |
| 112 | +just test-deployer |
| 113 | +``` |
0 commit comments