diff --git a/lib/ain-contracts/build.rs b/lib/ain-contracts/build.rs index 8c8a474330..55a37fc2c6 100644 --- a/lib/ain-contracts/build.rs +++ b/lib/ain-contracts/build.rs @@ -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> { // compile solidity project @@ -26,8 +26,17 @@ fn main() -> Result<(), Box> { .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()