-
Notifications
You must be signed in to change notification settings - Fork 266
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(cli): Noir contract compiler CLI #1561
Conversation
Please could you also write a section of the docs for how to compile a noir contract? (See list of placeholder docs pages: #1456). |
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.
Very nice!
@@ -116,13 +116,13 @@ await viewUnencryptedLogs(); | |||
////////////// QUERYING THE TOKEN BALANCE FOR EACH ACCOUNT ////////////// | |||
|
|||
// Create the contract abstraction and link to Alice's wallet for future signing | |||
const tokenContractAlice = await PrivateTokenContract.create( | |||
const tokenContractAlice = await PrivateTokenContract.at( |
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.
Love this change.
"rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], | ||
"rebuildPatterns": [ | ||
"^circuits/cpp/barretenberg/cpp/" | ||
], |
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.
Incorrect formatting has been annoying me for a while so I've created an issue for this.
4e9f49f
to
ce9dd7b
Compare
Exposes a Noir contract compiler to end users via the CLI. Adds a new
compile
command in the aztec-cli, also exposed via thenoir-compiler
package asaztec-compile contract
. This command compiles a noir contract using nargo or noir-wasm (defaulting to nargo until noir-lang/noir#2210 is fixed), then reformats it for Aztec consumption, and optionally generates typescript wrappers and noir interfaces. All these actions are also exported as functions from thenoir-compiler
package, and are now used in thecopy-output
script.This PR also makes a few changes to the generated typescript type:
create
gets renamed toat
(to make it clear we're not creating a new contract but creating an instance of the ts wrapper for a contract at an address) and the import path to the ABI is directly to the JSON file.We could add more (sub)commands just for generating the typescript or noir interfaces from the CLI, so it can be used in flows where nargo is used directly. We should also update the project README and add a page in the docs about how to compile one's own contracts (not sure if there's already one in the skeleton).
Fixes #1457