Skip to content
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

feat(noir): separate arguments of inputs #456

Merged
merged 4 commits into from
May 5, 2023
Merged

Conversation

sirasistant
Copy link
Collaborator

Description

Closes #455

Extracts the arguments from the inputs struct in noir contracts. For now they have to be manually pushed to the context.
Updates the postprocessor to omit the Inputs & CallContext, allowing to avoid writing ABI comments in the noir code.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@sirasistant sirasistant self-assigned this May 4, 2023
Copy link
Collaborator

@spalladino spalladino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Great that we have the open keyword now.

_call_context: pub CallContext,
amount: pub Field,
recipient: pub Point,
open fn mint(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa!

fn constructor(
inputs: pub Inputs,
) -> pub [Field; dep::aztec3::abi::PUBLIC_INPUTS_LENGTH] {
PrivateFunctionContext::new().finish(inputs)
}

/// ABI value type "secret"
/// ABI value params [{"name":"input","type":{"kind":"field"},"visibility":"public"}]
/// ABI value return [{"kind":"field"}]
Copy link
Collaborator

@spalladino spalladino May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we keep the return annotation at least? Can the client consume this value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users currently cannot consume the return value for secret functions! The idea is to phase out the ABI manual comments for the introduction of the aztec noir compiler 😄

@sirasistant sirasistant merged commit 7b5f2bf into master May 5, 2023
@sirasistant sirasistant deleted the arv/separate_args branch May 5, 2023 07:16
ludamad added a commit that referenced this pull request Jul 14, 2023
codygunton pushed a commit that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants