1use clap::{Parser, ValueHint};
2use eyre::Result;
3use foundry_cli::opts::EtherscanOpts;
4use std::path::PathBuf;
5
6const DEFAULT_CRATE_NAME: &str = "foundry-contracts";
7const DEFAULT_CRATE_VERSION: &str = "0.0.1";
8
9#[derive(Clone, Debug, Parser)]
11pub struct BindArgs {
12 path_or_address: String,
16
17 #[arg(
19 short,
20 long,
21 value_hint = ValueHint::DirPath,
22 value_name = "PATH"
23 )]
24 pub output_dir: Option<PathBuf>,
25
26 #[arg(
31 long,
32 default_value = DEFAULT_CRATE_NAME,
33 value_name = "NAME"
34 )]
35 crate_name: String,
36
37 #[arg(
42 long,
43 default_value = DEFAULT_CRATE_VERSION,
44 value_name = "VERSION"
45 )]
46 crate_version: String,
47
48 #[arg(long)]
50 separate_files: bool,
51
52 #[command(flatten)]
53 etherscan: EtherscanOpts,
54}
55
56impl BindArgs {
57 pub async fn run(self) -> Result<()> {
58 Err(eyre::eyre!(
59 "`cast bind` has been removed.\n\
60 Please use `cast source` to create a Forge project from a block explorer source\n\
61 and `forge bind` to generate the bindings to it instead."
62 ))
63 }
64}