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

docs: remove mentions of noir-compiler #3702

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docs/docs/dev_docs/contracts/compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,6 @@ Read more about how to use the Aztec.nr interfaces [here](./syntax/functions.md#
At the moment, the compiler generates these interfaces from already compiled ABIs, and not from source code. This means that you should not import a generated interface from within the same project as its source contract, or you risk circular references.
:::

## Compile using nodejs

You can also programmatically access the compiler via the `@aztec/noir-compiler` package. To do this, install the package into your nodejs project:

`npm install @aztec/noir-compiler`

The compiler exposes the following functions:

- `compileUsingNoirWasm`: Compiles an Aztec.nr project in the target folder using a WASM build of the compiler and returns the generated ABIs.
- `compileUsingNargo`: Does the same as `compileUsingNargo` but instead of WASM it uses the `nargo` binary available on the shell `PATH`
- `generateTypescriptContractInterface`: Generates a typescript class for the given contract artifact.
- `generateNoirContractInterface`: Generates a Aztec.nr interface struct for the given contract artifact.

## Next steps

Once you have compiled your contracts, you can use the generated artifacts via the `Contract` class in the `aztec.js` package to deploy and interact with them, or rely on the type-safe typescript classes directly. Alternatively, use the CLI [to deploy](../../dev_docs/cli/main.md#deploying-a-token-contract) and [interact](../../dev_docs/cli/main.md#sending-a-transaction) with them.
Expand Down
23 changes: 4 additions & 19 deletions docs/docs/dev_docs/contracts/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,18 @@ aztec-cli deploy /path/to/contract/artifact.json
</TabItem>
<TabItem value="js" label="Aztec.js">

Pre-requisite - Generate type-safe typescript classes for your contract when compiling using the `@aztec/noir-compiler` package. You can install the package by running `npm install @aztec/noir-compiler`.
Pre-requisite - Compile the contract and generate a type-safe typescript class for it.

```ts
import { readFileSync, writeFileSync } from "fs";
import { createConsoleLogger } from "@aztec/foundation/log";
import {
compileUsingNoirWasm,
generateTypescriptContractInterface,
} from "@aztec/noir-compiler";

const compiled: ContractArtifact[] = await compileUsingNoirWasm(
projectPathToContractFolder,
{ log: createConsoleLogger() }
);
const abiImportPath = "../target/Example.json";
writeFileSync(
tsInterfaceDestFilePath,
generateTypescriptContractInterface(compiled[0], abiImportPath)
);
```bash
aztec-cli compile /path/to/contract -o target/ -ts target/
```

This would create a typescript file like `Example.ts` in the path specified. More details in the [compiling page](./compiling.md)

Now you can import it to easily deploy and interact with the contract.

```ts
import { ExampleContract } from "./Example.js";
import { ExampleContract } from "./target/Example.js";

const tx = ExampleContract.deploy(pxe).send();
await tx.wait({ interval: 0.5 });
Expand Down