Skip to content

Commit 5a78206

Browse files
committed
fix optimizations not applied in solc-standard-json mode
optimization options are applied when using the etherscan way but they don't apply in case we fetch the source code manually and run crytic-compile on it. By appending the optimization to the input json, they are now applied as for the etherscan platform.
1 parent 1ca05b8 commit 5a78206

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crytic_compile/platform/solc_standard_json.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: Any) -> None:
407407
optimized=is_optimized(solc_arguments),
408408
)
409409

410+
add_optimization(
411+
self._json,
412+
compilation_unit.compiler_version.optimized,
413+
compilation_unit.compiler_version.optimize_runs,
414+
)
415+
410416
# Add all remappings
411417
if solc_remaps:
412418
if isinstance(solc_remaps, str):

0 commit comments

Comments
 (0)