-
Notifications
You must be signed in to change notification settings - Fork 15
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
Soldity or Vyper? ABI - Or rephrase to contract method signature? #79
Comments
The reference implementation indeed only supports Solidity syntax. I would be more in favor of enforcing it in the spec for now and consider this a feature request, what do you think @lcastillo-ledger ? |
Hmm, but would the integration still work if it's specified in Solidity syntax, with the real code being Vyper? Vyper has come a long way and it's in production for many dApps (Curve & Yearn e.g.) |
This is a good question, my understanding is that vyper and solidity use the same calldata encoding since you can call solidity functions from vyper and vice versa, but we have not tested it yet. Regarding the syntax, it only impacts the source descriptor, you can actually use the 4-bytes selector directly like here to avoid any confusion. |
Yea they do use the same encoding and can call each other. Also wrt to the selector that's what I meant with doesn't strictly enforce the Solidity syntax. In the above example the resulting selector bytes would be exactly the same. So if the selector would work, likely the integration as well. For clarity I'd still personally prefer to use the Solidity syntax (transformed from Vyper). So if the integrator is just computing the selector from the format, and doesn't do string matching on the source code, it should work. |
By the way, our reference implementation includes an utility to transform our descriptors to a canonical form in which selectors have been converted to 4 bytes (can be used as CLI as well). So an integrator would typically use this tooling and start directly from the resolved form. (for reference, the current implementation of the transformation is here, using utilities from here.) |
The spec mentions solidity ABI
Vyper methods look slightly different in the code:
vs
However the ABI / Encoding would look and work exactly the same way.
The 7730 schema doesn't strictly enforce the Solidity syntax, so I assume it would work as is with Vyper too?
If so, maybe adjust the spec/wording to "contract method signature"?
The text was updated successfully, but these errors were encountered: