abi-to-sol
abi-to-sol copied to clipboard
Tool fails to validate old Vyper output, which specified non-compliant `outputs: []` in constructor ABI entries
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?
hey @viper7882, thanks for raising this! I'll take a look and hopefully see about fixing this quickly.
Looks like there are two problems:
- 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). - ~~More worryingly, the contract you linked uses
type
as an identifier for a variable in theDeposit
event. Sincetype
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 :)
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.