-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔨 fallback to Foundry remappings #44
Conversation
We should probably just get them from crytic-compile here fuzz-utils/tests/test_harness.py Line 194 in 01a2ac1
https://github.com/crytic/crytic-compile/blob/b5c538aaa66be44b7a68d9723881a7eba2c20898/crytic_compile/platform/abstract_platform.py#L34 |
c482880
to
1fbd4d2
Compare
Hi @0xalpharush not sure how to do that, seems that |
If we want to use crytic-compile I think we can do this like so: def find_remappings(include_attacks: bool, slither: Slither) -> dict:
... # regex
working_dir = slither.crytic_compile.working_dir
platform_config = slither.crytic_compile.platform.config(working_dir)
remappings: str = ""
if platform_config:
remappings = "\n".join(platform_config.remappings)
else:
output = subprocess.run(["forge", "remappings"], capture_output=True, text=True, check=True)
forge_remaps = str(output.stdout).split("\n")
if os.path.exists("remappings.txt"):
with open("remappings.txt", "r", encoding="utf-8") as file:
remappings_file = file.read().split("\n")
# Converting to set to remove duplicates, back to list for joining
forge_remaps = list(set(forge_remaps + remappings_file))
remappings = "\n".join(forge_remaps) We'd need to update all the places that call Would be cool if we could have a test for this specific case as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Update the PR so that the crytic-compile platform config remappings are used
- Run the subprocess before fetching the remappings file and merge the two (without duplicates)
- Add a single test case for when the remappings file does not contain all of the remappings
I'll be updating the PR with the proposed changes sometime this week so we can merge it. @GianfrancoBazzani really appreciate you opening the PR and highlighting the issue |
Thank you, I don't had time to check it out :(. |
Hey guys i had a problem with resolution when not all remappings are defined in remmapings.txt