Skip to content

Commit

Permalink
add instructions in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari committed Sep 21, 2023
1 parent 0caaa94 commit b287e2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
12 changes: 10 additions & 2 deletions docs/docs/dev_docs/contracts/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,24 @@ Before writing the contracts, we must add the aztec.nr library. This adds smart

Open Nargo.toml that is in the `contracts/example_contract` folder, and add the dependency section as follows

<CodeBlock language="toml">{`
<CodeBlock language="toml">{`[package]
name = "example_contract"
authors = [""]
compiler_version = "0.1"
type = "contract"

[dependencies]
# Framework import
aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/aztec" }

# Utility dependencies
value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/value-note"}
safe_math = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/safe-math"}
`}</CodeBlock>

:::info
Note: currently the dependency name **_MUST_** be `aztec`. The framework expects this namespace to be available when compiling into contracts. This limitation may be removed in the future.
:::

You are now ready to write your own contracts!

## Next Steps
Expand Down
21 changes: 1 addition & 20 deletions docs/docs/dev_docs/contracts/syntax/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,6 @@ Aztec.nr contains abstractions which remove the need to understand the low-level
- secrets
- Functions for communicating with [Ethereum L1](../portals/main.md)

To import Aztec.nr into your Aztec contract project, simply include it as a dependency. For example:

<CodeBlock language="toml">{`[package]
name = "token_contract"
authors = [""]
compiler_version = "0.1"
type = "contract"

[dependencies]
# Framework import
aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/aztec" }

# Utility dependencies
value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/value-note"}
safe_math = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${AztecPackagesVersion()}", directory="yarn-project/aztec-nr/safe-math"}
`}</CodeBlock>

:::info
Note: currently the dependency name **_MUST_** be `aztec`. The framework expects this namespace to be available when compiling into contracts. This limitation may be removed in the future.
:::
To setup a aztec-nr project, follow the [setup instructions](../setup.md)

<DocCardList />

0 comments on commit b287e2f

Please sign in to comment.