Skip to content

Commit f7970a3

Browse files
committed
fix restrictions for optimizer runs
1 parent 3e81970 commit f7970a3

File tree

1 file changed

+5
-0
lines changed
  • crates/compilers/src/compilers/solc

1 file changed

+5
-0
lines changed

crates/compilers/src/compilers/solc/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ impl CompilerSettings for SolcSettings {
331331
.max_optimizer_runs
332332
.map_or(true, |max| self.optimizer.runs.map_or(false, |runs| runs <= max));
333333

334+
// Ensure that we either don't have min optimizer runs set or that the optimizer is enabled
335+
satisfies &= restrictions
336+
.min_optimizer_runs
337+
.map_or(true, |min| min == 0 || self.optimizer.enabled.unwrap_or_default());
338+
334339
satisfies
335340
}
336341
}

0 commit comments

Comments
 (0)