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

Tool fails to validate old Vyper output, which specified non-compliant outputs: [] in constructor ABI entries #130

Open
viper7882 opened this issue Feb 25, 2024 · 3 comments

Comments

@viper7882
Copy link

Hi @gnidan,

Copy ABI from Voting Escrow and paste into abi-to-sol, Invalid error is observed. "internalType" is absent in this contract. Probably that's why abi-to-sol treating the ABI input as invalid?

@gnidan
Copy link
Owner

gnidan commented Feb 28, 2024

hey @viper7882, thanks for raising this! I'll take a look and hopefully see about fixing this quickly.

@gnidan
Copy link
Owner

gnidan commented Feb 28, 2024

Looks like there are two problems:

  1. Vyper's generated ABI JSON includes an outputs property for constructors. This does not validate the JSON Schema that I'm using as a pre-flight check. Sadly, this formal schema is part of the now-unmaintained Truffle, so I'm going to have to fork that schema elsewhere to fix that. (Should be no problem; I authored that JSON Schema originally).
  2. More worryingly, the contract you linked uses type as an identifier for a variable in the Deposit event. Since type is a keyword in Solidity, abi-to-sol will need a code change to handle this discrepancy. I'll have to think about this... it's probably fine to append an underscore in such cases (e.g., type_), but kind of not ideal.
    (Moving this concern to Nothing prevents abi-to-sol from generating invalid identifiers #131)

Might be worth noting: the lack of internalType is not the issue here at all! that's one thing I do test quite extensively for :)

@gnidan gnidan changed the title Unable to parse Vyper 0.3.7 contract without "internalType" Tool fails to validate old Vyper output, which specified non-compliant outputs: [] in constructor ABI entries Feb 28, 2024
@gnidan
Copy link
Owner

gnidan commented Feb 29, 2024

Considering this a bit more, I think the ABI schema validation can probably just be skipped in the web-ui. I'll make that change in the next couple days and redeploy.

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

2 participants