Skip to content

Commit

Permalink
chore: add changelog for #427 changes (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Sep 3, 2021
1 parent bc89878 commit 520645c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Unreleased

* Allow configuring the optimizer & passing arbitrary arguments to solc [#427](https://github.com/gakonst/ethers-rs/pull/427)

### 0.5.2
* Correctly RLP Encode transactions as received from the mempool ([#415](https://github.com/gakonst/ethers-rs/pull/415))

Expand Down
16 changes: 16 additions & 0 deletions ethers-core/src/utils/solc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,22 @@ impl Solc {
}

/// 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 {
self.optimizer = runs;
self
Expand Down

0 comments on commit 520645c

Please sign in to comment.