Skip to content
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

Protect Against Solidity Keywords in Structs/Objects #162

Merged
merged 3 commits into from
Jun 2, 2021
Merged

Conversation

chrisnevers
Copy link
Contributor

  • Check Struct names against a list of reserved words
  • Have Objects preface field names with _ . munge/unmunge adds/removes the _ appropriately

hs/src/Reach/Connector/ETH_Solidity.hs Outdated Show resolved Hide resolved
hs/src/Reach/Eval/Core.hs Show resolved Hide resolved
hs/src/Reach/Eval/Types.hs Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
reachc: error: ./Err_Sol_Reserved.rsh:5:24:application: `super` is not a valid field name because it is reserved in Solidity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the _ prefix treatment not handle this use case? Do we intend for it to handle it in the future?

Copy link
Contributor Author

@chrisnevers chrisnevers Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not handled because the Structs have to obey an interface with remote contracts and AFAIK it wouldn't be possible to construct such an object, with an illegal field, before making the call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants