Skip to content

Commit

Permalink
Added extra-output info to forge build
Browse files Browse the repository at this point in the history
  • Loading branch information
lisandrasilva committed Sep 10, 2024
1 parent fdecd1b commit 046bf21
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/kontrol/foundry.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,23 +387,22 @@ def custom_view(self, contract_name: str, element: KCFGElem, compilation_unit: C
return ['NO DATA']

def build(self, no_metadata: bool) -> None:
forge_build_args = ['forge', 'build', '--root', str(self._root)]
env = {
'FOUNDRY_OPTIMIZER': 'false',
'FOUNDRY_BUILD_INFO': 'true',
'FOUNDRY_EXTRA_OUTPUT': '["storageLayout", "evm.bytecode.generatedSources"]',
'FOUNDRY_BYTECODE_HASH': 'ipfs',
'FOUNDRY_CBOR_METADATA': 'true',
}
if no_metadata:
forge_build_args += ['--no-metadata']
env = env = {
'FOUNDRY_OPTIMIZER': 'false',
'FOUNDRY_BUILD_INFO': 'true',
'FOUNDRY_EXTRA_OUTPUT': '["storageLayout", "evm.bytecode.generatedSources"]',
}
forge_build_args = [
'forge',
'build',
'--build-info',
'--extra-output',
'storageLayout',
'evm.bytecode.generatedSources',
'evm.deployedBytecode.generatedSources',
'--root',
str(self._root),
] + (['--no-metadata'] if no_metadata else [])
try:
run_process_2(forge_build_args, env=env, logger=_LOGGER)
run_process_2(
forge_build_args,
logger=_LOGGER,
)
except FileNotFoundError as err:
raise RuntimeError(
"Error: 'forge' command not found. Please ensure that 'forge' is installed and added to your PATH."
Expand Down

0 comments on commit 046bf21

Please sign in to comment.