@@ -39,6 +39,7 @@ def compile_codes(
3939 interface_codes : Union [InterfaceDict , InterfaceImports , None ] = None ,
4040 initial_id : int = 0 ,
4141 no_optimize : bool = False ,
42+ show_gas_estimates : bool = False ,
4243) -> OrderedDict :
4344 """
4445 Generate compiler output(s) from one or more contract source codes.
@@ -60,6 +61,8 @@ def compile_codes(
6061 implemented ruleset.
6162 no_optimize: bool, optional
6263 Turn off optimizations. Defaults to False
64+ show_gas_estimates: bool, optional
65+ Show gas estimates for abi and ir output modes
6366 interface_codes: Dict, optional
6467 Interfaces that may be imported by the contracts during compilation.
6568
@@ -93,7 +96,14 @@ def compile_codes(
9396 ):
9497 interfaces = interfaces [contract_name ]
9598
96- compiler_data = CompilerData (source_code , contract_name , interfaces , source_id , no_optimize )
99+ compiler_data = CompilerData (
100+ source_code ,
101+ contract_name ,
102+ interfaces ,
103+ source_id ,
104+ no_optimize ,
105+ show_gas_estimates
106+ )
97107 for output_format in output_formats [contract_name ]:
98108 if output_format not in OUTPUT_FORMATS :
99109 raise ValueError (f"Unsupported format type { repr (output_format )} " )
@@ -118,6 +128,7 @@ def compile_code(
118128 interface_codes : Optional [InterfaceImports ] = None ,
119129 evm_version : str = DEFAULT_EVM_VERSION ,
120130 no_optimize : bool = False ,
131+ show_gas_estimates : bool = False ,
121132) -> dict :
122133 """
123134 Generate compiler output(s) from a single contract source code.
@@ -134,6 +145,8 @@ def compile_code(
134145 implemented ruleset.
135146 no_optimize: bool, optional
136147 Turn off optimizations. Defaults to False
148+ show_gas_estimates: bool, optional
149+ Show gas estimates for abi and ir output modes
137150 interface_codes: Dict, optional
138151 Interfaces that may be imported by the contracts during compilation.
139152
@@ -154,4 +167,5 @@ def compile_code(
154167 interface_codes = interface_codes ,
155168 evm_version = evm_version ,
156169 no_optimize = no_optimize ,
170+ show_gas_estimates = show_gas_estimates ,
157171 )[UNKNOWN_CONTRACT_NAME ]
0 commit comments