parent
bc89878e92
commit
520645c48b
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
|
|
||||||
|
* Allow configuring the optimizer & passing arbitrary arguments to solc [#427](https://github.com/gakonst/ethers-rs/pull/427)
|
||||||
|
|
||||||
### 0.5.2
|
### 0.5.2
|
||||||
* Correctly RLP Encode transactions as received from the mempool ([#415](https://github.com/gakonst/ethers-rs/pull/415))
|
* Correctly RLP Encode transactions as received from the mempool ([#415](https://github.com/gakonst/ethers-rs/pull/415))
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,22 @@ impl Solc {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the optimizer runs (default = 200). None indicates no optimization
|
/// Sets the optimizer runs (default = 200). None indicates no optimization
|
||||||
|
///
|
||||||
|
/// ```rust,no_run
|
||||||
|
/// use ethers_core::utils::Solc;
|
||||||
|
///
|
||||||
|
/// // No optimization
|
||||||
|
/// let contracts = Solc::new("./contracts/*")
|
||||||
|
/// .optimizer(None)
|
||||||
|
/// .build().unwrap();
|
||||||
|
///
|
||||||
|
/// // Some(200) is default, optimizer on with 200 runs
|
||||||
|
/// // .arg() allows passing arbitrary args to solc command
|
||||||
|
/// let optimized_contracts = Solc::new("./contracts/*")
|
||||||
|
/// .optimizer(Some(200))
|
||||||
|
/// .arg("--metadata-hash=none")
|
||||||
|
/// .build().unwrap();
|
||||||
|
/// ```
|
||||||
pub fn optimizer(mut self, runs: Option<usize>) -> Self {
|
pub fn optimizer(mut self, runs: Option<usize>) -> Self {
|
||||||
self.optimizer = runs;
|
self.optimizer = runs;
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in New Issue