-
Notifications
You must be signed in to change notification settings - Fork 12
Add automated interface generation for Payments contract #191
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
base: main
Are you sure you want to change the base?
Conversation
…s in interface generation, update Makefile
Co-authored-by: Rod Vagg <[email protected]>
Co-authored-by: Rod Vagg <[email protected]>
… step Co-authored-by: Rod Vagg <[email protected]>
… streamline workflow
tools/generate-interface.sh
Outdated
|
|
||
| # Extract ABI using jq | ||
| echo "Generating interface at $OUTPUT_PATH..." | ||
| jq '.abi' out/Payments.sol/Payments.json | npx [email protected] IPayments --license MIT --solidity-version "^0.8.27" > "$OUTPUT_PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional, but you could pull these two versions up to variables at the top of the file so we can update it more easily, but it's not a big deal, we'll probably only ever change this when stuff doesn't work the way we expect -- unless we have the solidity version hard-wired somewhere else too?
Co-authored-by: Rod Vagg <[email protected]>
|
@pali101 Let's keep this PR open till we integrate it with Pandora and make sure the interface/compilation/tests work in Pandora as well. |
rvagg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm if it all works nicely locally (sorry I haven't had time to actually try it out myself)
I'll stop tormenting you now; good work!
|
It seems like switching to interfaces did not have any impact on contract size, ref conversation that happenend in Slack here:
Do we expect that this PR will land, or should it be moved back to draft? |
|
From @aarshkshah1992 in Slack: I will revert this back to draft for now, to signal that this is not expected to land until the audit is completed |
Summary
This PR introduces an auto-generated
IPaymentsinterface for the Payments contract, along with tooling and CI checks to ensure it remains consistent with the contract ABI.Changes
src/interfaces/IPayments.solusing abi-to-sol for external use and inheritancetools/generate-interface.shbuilds the contract, extracts its ABI, and generates a clean IPayments interfaceIValidatortosrc/interfaces/IValidator.solMakefile: Addedmake interfacetargettools/README.mdwith usage details for the script and make interfaceCloses #122