Skip to content

Commit 70111fd

Browse files
committed
feat(ev-deployer): add init command to generate starter config
Generates a TOML config template with all supported contracts commented out and documented.
1 parent 93b3eaa commit 70111fd

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EV Deployer configuration
2+
# See: bin/ev-deployer/README.md
3+
4+
[chain]
5+
# The chain ID for the target network.
6+
chain_id = 0
7+
8+
# ── Contracts ────────────────────────────────────────────
9+
# Uncomment and configure the contracts you want to include
10+
# in the genesis alloc.
11+
12+
# AdminProxy: transparent proxy with owner-based access control.
13+
# The owner address is stored in slot 0.
14+
# [contracts.admin_proxy]
15+
# address = "0x000000000000000000000000000000000000Ad00"
16+
# owner = "0x..."

bin/ev-deployer/src/main.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ enum Command {
4343
#[arg(long)]
4444
addresses_out: Option<PathBuf>,
4545
},
46+
/// Generate a starter config file with all supported contracts commented out.
47+
Init {
48+
/// Write config to this file instead of stdout.
49+
#[arg(long)]
50+
output: Option<PathBuf>,
51+
},
4652
/// Compute the address for a configured contract.
4753
ComputeAddress {
4854
/// Path to the deploy TOML config.
@@ -90,6 +96,16 @@ fn main() -> eyre::Result<()> {
9096
eprintln!("Wrote address manifest to {}", addr_path.display());
9197
}
9298
}
99+
Command::Init { output } => {
100+
let template = include_str!("init_template.toml");
101+
102+
if let Some(ref out_path) = output {
103+
std::fs::write(out_path, template)?;
104+
eprintln!("Wrote config to {}", out_path.display());
105+
} else {
106+
print!("{template}");
107+
}
108+
}
93109
Command::ComputeAddress {
94110
config: config_path,
95111
contract,

0 commit comments

Comments
 (0)