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

Nothing prevents abi-to-sol from generating invalid identifiers #131

Open
gnidan opened this issue Feb 28, 2024 · 0 comments
Open

Nothing prevents abi-to-sol from generating invalid identifiers #131

gnidan opened this issue Feb 28, 2024 · 0 comments

Comments

@gnidan
Copy link
Owner

gnidan commented Feb 28, 2024

Discovered while investigating #130.

Solidity has a bunch of keywords that cannot be used as identifiers for variable names. This list of keywords of course is unlikely to (and does not) match the list of keywords from other languages, like Vyper. So if a Vyper contract defines, e.g., an event event Payment:\n type: uint256, abi-to-sol will produce event Payment(uint256 type), which is invalid.

Likely the fix for this is to cross-reference variable identifiers with a list of Solidity keywords, then to append an underscore when there's a collision.

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

No branches or pull requests

1 participant