Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@aztec/noir-contracts
Advanced tools
This package contains the source code and the Aztec ABIs for the example contracts used in tests.
This package contains the source code and the Aztec ABIs for the example contracts used in tests.
Install noirup
curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash
Nix is already globally installed but path to this installation needs to be added in $HOME/.zshenv so correct configuration can be found by VSCode, do so with:
echo -e '\n# Nix path set globally\nexport PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"' >> $HOME/.zshenv
Enable nix flake command in ~/.config/nix/nix.conf with commands:
mkdir -p $HOME/.config/nix && echo -e '\nexperimental-features = nix-command\nextra-experimental-features = flakes' >> $HOME/.config/nix/nix.conf
Install direnv into your Nix profile by running:
nix profile install nixpkgs#direnv
Add direnv to your shell following their guide
echo -e '\n# Adds direnv initialization\neval "$(direnv hook zsh)"' >> $HOME/.zshenv
VSCode needs to be resterted so direnv plugin can notice env changes with:
kill -9 ps aux | grep $(whoami)/.vscode-server | awk '{print $2}'
Restart shell
Clone noir repo:
git clone https://github.com/noir-lang/noir.git
Checkout aztec3 branch
cd noir
git checkout aztec3
Enable direnv
direnv allow
Restart shell
Go to the noir dir and install Noir:
cd noir
noirup -p ./
In the aztec-packages repository, go to the directory yarn-project/noir-contracts
Use the noir:build:all
script to compile the contracts you want and prepare the ABI for consumption
yarn noir:build:all
Alternatively you can run yarn noir:build CONTRACT1 CONTRACT2...
to build a subset of contracts:
yarn noir:build zk_token public_token
To view compilation output, including errors, run with the VERBOSE=1
flag:
VERBOSE=1 yarn noir:build zk_token public_token
Go to src/contracts
folder.
Create a new package whose name has to end with _contract. E.g.:
nargo new example_contract
Add the aztec dependency to nargo.toml
:
[package]
authors = [""]
compiler_version = "0.7.1"
[dependencies]
aztec = { path = "../../libs/noir-aztec" }
Replace the content of the generated example_contract/src/main.nr
file with your contract code.
Go to noir-contracts
root folder and run yarn noir:build example
to compile the contract.
Export the abi in src/examples/index.ts
to be able to use the contract in the rest of the project:
import ExampleContractJson from './example_contract.json' assert { type: 'json' };
export const ExampleContractAbi = ExampleContractJson as ContractAbi;
???
Profit.
FAQs
This package contains the source code and the Aztec ABIs for the example contracts used in tests.
The npm package @aztec/noir-contracts receives a total of 50 weekly downloads. As such, @aztec/noir-contracts popularity was classified as not popular.
We found that @aztec/noir-contracts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.