-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add bindings test to Sanctuary #1159
base: main
Are you sure you want to change the base?
Add bindings test to Sanctuary #1159
Conversation
Sanctuary bundles all dependencies in the same source file, so all imports should resolve to the same, sole file.
This happens when there is special member access in some Yul identifier (like `x.slot` or `x.offset`). I think this issue was introduced when unreserving the `address` keyword since that changed the structure of `YulPath`. There is a proper test case in NomicFoundation#1149 already, but without this fix running Sanctuary with existing rules crashes.
|
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.
Left a couple of non-blocking questions. Mainly this: #1159 (comment)
d748a16
to
58b8f91
Compare
This PR adds a step to Sanctuary testing to exercise bindings. We now also consider a Sanctuary test to fail if any of the references found in it cannot be resolved to one (or possibly more) definitions.
This also includes a small binding rules fix to avoid crashing if we find a Solidity source file with an assembly block that has a
YulPath
with more than one identifier (eg. a member access likex.slot
). This is properly tested in #1149, but without it running Sanctuary tests will crash since there are contracts with the aforementioned contents.