Skip to content

Commit

Permalink
evm: Enable DST20 optimisation (#2375)
Browse files Browse the repository at this point in the history
* Enable DST20 optimisation

* Use maximum number of runs

* Use u32::MAX

* nightly fmt

---------

Co-authored-by: Prasanna Loganathar <[email protected]>
  • Loading branch information
shohamc1 and prasannavl authored Sep 6, 2023
1 parent 3c2459a commit fa4d6b1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/ain-contracts/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{env, fs, path::PathBuf};

use anyhow::format_err;
use ethers_solc::{Project, ProjectPathsConfig, Solc};
use ethers_solc::{artifacts::Optimizer, Project, ProjectPathsConfig, Solc, SolcConfig};

fn main() -> Result<(), Box<dyn std::error::Error>> {
// compile solidity project
Expand All @@ -26,8 +26,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.sources(&root)
.build()?;

let mut solc_config = SolcConfig::builder().build();

solc_config.settings.optimizer = Optimizer {
enabled: Some(true),
runs: Some(u32::MAX as usize),
details: None,
};

let project = Project::builder()
.solc(solc)
.solc_config(solc_config)
.paths(paths)
.set_auto_detect(true)
.no_artifacts()
Expand Down

0 comments on commit fa4d6b1

Please sign in to comment.