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

Only last contract declaration appears in compilation output #1157

Closed
1 task
joss-aztec opened this issue Apr 17, 2023 · 0 comments · Fixed by #1158
Closed
1 task

Only last contract declaration appears in compilation output #1157

joss-aztec opened this issue Apr 17, 2023 · 0 comments · Fixed by #1158
Labels
bug Something isn't working

Comments

@joss-aztec
Copy link
Contributor

Aim

To have access to build products for all contracts within a project.

Expected behavior

The compilation output should contain build products for all contracts defined within the project.

Bug

When compiling the following:

contract Foo {
    fn do_foo(input: pub Field) -> pub Field {
        input + 1
    }
}

contract Bar {
    fn do_bar(input: pub Field) -> pub Field {
        input + 2
    }
}

contract Baz {
    fn do_baz(input: pub Field) -> pub Field {
        input + 3
    }
}

The json compilation output only contains products for the last contract (Baz).

{
  "name": "Baz",
  "backend": "acvm-backend-barretenberg",
  "functions": [
    {
      "name": "do_baz",
      "function_type": "Secret",
      "abi": {
        "parameters": [
          {
            "name": "input",
            "type": { "kind": "field" },
            "visibility": "public"
          }
        ],
        "param_witnesses": { "input": [1] },
        "return_type": { "kind": "field" },
        "return_witnesses": [2]
      },
      "bytecode": [/* CUT */],
      "proving_key": [/* CUT */],
      "verification_key": [/* CUT */]
    }
  ]
}

To reproduce

  1. nargo compile -c the above

Installation method

Compiled from source

Nargo version

nargo 0.3.2 (git version hash: 89e7936, is dirty: false)

@noir-lang/noir_wasm version

No response

@noir-lang/barretenberg version

No response

@noir-lang/aztec_backend version

No response

Additional context

No response

Submission Checklist

  • Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant