-
Notifications
You must be signed in to change notification settings - Fork 211
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
Give the full path of each Struct used in the Abi #2238
Labels
enhancement
New feature or request
Comments
This was referenced Aug 9, 2023
spalladino
added a commit
to AztecProtocol/aztec-packages
that referenced
this issue
Aug 14, 2023
… contracts (#1487) Builds on @iAmMichaelConnor work to generate a contract interface for simplifying calling function in other contracts. Uses only information present in the ABI. For each function in the target contract, creates a wrapper function that receives the same arguments, serialises them based on the standard ABI encoding format (see [here](https://github.com/AztecProtocol/aztec-packages/blob/49d272159f1b27521ad34081c7f1622ccac19dff/yarn-project/foundation/src/abi/encoder.ts)), and uses the `call_private_function` from the `context` to call into them. To handle custom structs, we're re-defining them in the contract interface. Until we get struct type names in the ABI (see noir-lang/noir#2238), we are autogenerating the name as well, based on the function name and param name where they are used. Serialisation is done manually in the code, but we may want to replace it with a Noir intrinsic when available (see noir-lang/noir#2240). See [this file](https://github.com/AztecProtocol/aztec-packages/blob/49d272159f1b27521ad34081c7f1622ccac19dff/yarn-project/noir-contracts/src/contracts/test_contract/src/test_contract_interface.nr) for example output. Fixes #1237 --------- Co-authored-by: iAmMichaelConnor <[email protected]>
This was referenced Aug 18, 2023
superstar0402
added a commit
to superstar0402/aztec-nr
that referenced
this issue
Aug 16, 2024
… contracts (#1487) Builds on @iAmMichaelConnor work to generate a contract interface for simplifying calling function in other contracts. Uses only information present in the ABI. For each function in the target contract, creates a wrapper function that receives the same arguments, serialises them based on the standard ABI encoding format (see [here](https://github.com/AztecProtocol/aztec-packages/blob/49d272159f1b27521ad34081c7f1622ccac19dff/yarn-project/foundation/src/abi/encoder.ts)), and uses the `call_private_function` from the `context` to call into them. To handle custom structs, we're re-defining them in the contract interface. Until we get struct type names in the ABI (see noir-lang/noir#2238), we are autogenerating the name as well, based on the function name and param name where they are used. Serialisation is done manually in the code, but we may want to replace it with a Noir intrinsic when available (see noir-lang/noir#2240). See [this file](https://github.com/AztecProtocol/aztec-packages/blob/49d272159f1b27521ad34081c7f1622ccac19dff/yarn-project/noir-contracts/src/contracts/test_contract/src/test_contract_interface.nr) for example output. Fixes #1237 --------- Co-authored-by: iAmMichaelConnor <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
When used in the Abi a struct (or user defined type in general) does not give its full path. This can make the Abi more difficult to use with an external codegen tool to automatically create bindings for.
Happy Case
We should add the full path of each user-defined type in Noir's Abi.
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: