diff --git a/ethers-contract/ethers-contract-abigen/src/multi.rs b/ethers-contract/ethers-contract-abigen/src/multi.rs index 08722463f..0b8be08f0 100644 --- a/ethers-contract/ethers-contract-abigen/src/multi.rs +++ b/ethers-contract/ethers-contract-abigen/src/multi.rs @@ -333,7 +333,12 @@ impl MultiExpansionResult { None }; - MultiBindingsInner { root, bindings, shared_types } + MultiBindingsInner { + root, + bindings, + shared_types, + dependencies: vec![String::from(r#"serde = "1.0.188""#)], + } } } @@ -581,6 +586,8 @@ struct MultiBindingsInner { bindings: BTreeMap, /// contains the content of the shared types if any shared_types: Option, + /// Dependencies other than `ethers-rs` to add to the `Cargo.toml` for bindings generated as a crate. + dependencies: Vec, } // deref allows for inspection without modification @@ -611,6 +618,9 @@ impl MultiBindingsInner { writeln!(toml)?; writeln!(toml, "[dependencies]")?; writeln!(toml, r#"{crate_version}"#)?; + for dependency in self.dependencies.clone() { + writeln!(toml, "{}", dependency)?; + } Ok(toml) }