abi-to-sol icon indicating copy to clipboard operation
abi-to-sol copied to clipboard

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

Open viper7882 opened this issue 11 months ago • 3 comments

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?

viper7882 avatar Feb 25 '24 08:02 viper7882

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

gnidan avatar Feb 28 '24 20:02 gnidan

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 #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 avatar Feb 28 '24 21:02 gnidan

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.

gnidan avatar Feb 29 '24 19:02 gnidan