Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.

Commit 86d4667

Browse files
authored
chore: v5.0.0-rc.2 release (#364)
# 🤖 Linear Closes AZT-XXX ## Description v5.0.0-rc.2 release
2 parents 12e3714 + a3859e5 commit 86d4667

56 files changed

Lines changed: 5344 additions & 313 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Nargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
[workspace]
22
members = [
33
"src/token_contract",
4+
"src/token_contract/src/test/test_authorization_contract",
45
"src/vault_contract",
56
"src/vault_deployer",
67
"src/dripper",
78
"src/nft_contract",
9+
"src/multitoken_contract",
10+
"src/multitoken_contract/src/test/multitoken_authorization_contract",
811
"src/escrow_contract",
912
"src/escrow_contract/src/test/test_logic_contract",
1013
"src/generic_proxy",
@@ -13,6 +16,7 @@ members = [
1316
[benchmark]
1417
token = "benchmarks/token_contract.benchmark.ts"
1518
nft = "benchmarks/nft_contract.benchmark.ts"
19+
multitoken = "benchmarks/multitoken_contract.benchmark.ts"
1620
vault = "benchmarks/vault_contract.benchmark.ts"
1721
escrow = "benchmarks/escrow_contract.benchmark.ts"
1822
logic = "benchmarks/logic_contract.benchmark.ts"
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import type { Wallet } from '@aztec/aztec.js/wallet';
2+
import { AztecAddress } from '@aztec/aztec.js/addresses';
3+
import type { ContractFunctionInteractionCallIntent } from '@aztec/aztec.js/authorization';
4+
5+
// Import the new Benchmark base class and context
6+
import { Benchmark, BenchmarkContext } from '@defi-wonderland/aztec-benchmark';
7+
8+
import { MultiTokenContract } from '../src/artifacts/MultiToken.js';
9+
import {
10+
deployMultiTokenWithMinter,
11+
initializeMultiTokenTransferCommitment,
12+
setupTestSuite,
13+
ID_A,
14+
} from '../src/ts/test/utils.js';
15+
16+
// Extend the BenchmarkContext from the new package
17+
interface MultiTokenBenchmarkContext extends BenchmarkContext {
18+
cleanup: () => Promise<void>;
19+
wallet: Wallet;
20+
deployer: AztecAddress;
21+
accounts: AztecAddress[];
22+
multiTokenContract: MultiTokenContract;
23+
commitments: bigint[];
24+
}
25+
26+
// --- Helper Functions ---
27+
28+
function amt(x: bigint | number) {
29+
// MultiToken carries NO decimals (its constructor takes only name/symbol/minter/auth_contract, unlike the
30+
// Token contract's `decimals` arg), so amounts are raw u128 values. We keep the sibling token benchmark's
31+
// magnitudes (mint 100, move 10) without the 10**18 scaling that `parseUnits` would apply.
32+
return BigInt(x);
33+
}
34+
35+
// Use export default class extending Benchmark
36+
export default class MultiTokenContractBenchmark extends Benchmark {
37+
/**
38+
* Sets up the benchmark environment for the MultiTokenContract.
39+
* Creates wallet, gets accounts, and deploys the contract.
40+
*/
41+
async setup(): Promise<MultiTokenBenchmarkContext> {
42+
const { cleanup, wallet, accounts } = await setupTestSuite(true);
43+
const [deployer] = accounts;
44+
// minter = deployer, auth_contract = ZERO (ARC-403 hook disabled) — mirrors the default JS suite deploy.
45+
const multiTokenContract = await deployMultiTokenWithMinter(wallet, deployer, deployer, AztecAddress.ZERO);
46+
47+
// Pre-initialize the partial notes consumed by transfer_private_to_commitment / transfer_public_to_commitment.
48+
// The commitment is id-agnostic (the completer binds the id at completion); the payer (alice) must be the
49+
// completer, and the note must come from a PRIOR settled tx (the helper settles each one).
50+
const [alice, bob] = accounts;
51+
const commitment_1 = await initializeMultiTokenTransferCommitment(multiTokenContract, alice, bob, alice);
52+
const commitment_2 = await initializeMultiTokenTransferCommitment(multiTokenContract, alice, bob, alice);
53+
54+
const commitments = [commitment_1, commitment_2];
55+
56+
return { cleanup, wallet, deployer, accounts, multiTokenContract, commitments };
57+
}
58+
59+
/**
60+
* Returns the list of MultiTokenContract methods to be benchmarked.
61+
* Ordering matters: the mints seed the balances that the following transfers/burns/commitments spend.
62+
* Every op is an `alice` self-spend of token id `ID_A` (nonce = 0, so no authwit is needed).
63+
*/
64+
getMethods(context: MultiTokenBenchmarkContext): ContractFunctionInteractionCallIntent[] {
65+
const { multiTokenContract, accounts, wallet, commitments } = context;
66+
const [alice, bob] = accounts;
67+
const owner = alice;
68+
const id = ID_A;
69+
70+
const methods: ContractFunctionInteractionCallIntent[] = [
71+
// Mint methods
72+
{
73+
caller: alice,
74+
action: multiTokenContract.withWallet(wallet).methods.mint_to_private(owner, id, amt(100)),
75+
},
76+
{
77+
caller: alice,
78+
action: multiTokenContract.withWallet(wallet).methods.mint_to_public(owner, id, amt(100)),
79+
},
80+
81+
// Transfer methods
82+
{
83+
caller: alice,
84+
action: multiTokenContract.withWallet(wallet).methods.transfer_private_to_public(owner, bob, id, amt(10), 0),
85+
},
86+
{
87+
caller: alice,
88+
action: multiTokenContract.withWallet(wallet).methods.transfer_private_to_private(owner, bob, id, amt(10), 0),
89+
},
90+
{
91+
caller: alice,
92+
action: multiTokenContract.withWallet(wallet).methods.transfer_public_to_private(owner, bob, id, amt(10), 0),
93+
},
94+
{
95+
caller: alice,
96+
action: multiTokenContract.withWallet(wallet).methods.transfer_public_to_public(owner, bob, id, amt(10), 0),
97+
},
98+
99+
// Burn methods
100+
{
101+
caller: alice,
102+
action: multiTokenContract.withWallet(wallet).methods.burn_private(owner, id, amt(10), 0),
103+
},
104+
{
105+
caller: alice,
106+
action: multiTokenContract.withWallet(wallet).methods.burn_public(owner, id, amt(10), 0),
107+
},
108+
109+
// Partial notes methods
110+
{
111+
caller: alice,
112+
action: multiTokenContract.withWallet(wallet).methods.initialize_transfer_commitment(bob, owner),
113+
},
114+
{
115+
caller: alice,
116+
action: multiTokenContract
117+
.withWallet(wallet)
118+
.methods.transfer_private_to_commitment(owner, id, commitments[0], amt(10), 0),
119+
},
120+
{
121+
caller: alice,
122+
action: multiTokenContract
123+
.withWallet(wallet)
124+
.methods.transfer_public_to_commitment(owner, id, commitments[1], amt(10), 0),
125+
},
126+
];
127+
128+
return methods.filter(Boolean);
129+
}
130+
131+
async teardown(context: MultiTokenBenchmarkContext): Promise<void> {
132+
await context.cleanup();
133+
}
134+
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@defi-wonderland/aztec-standards",
3-
"version": "5.0.0-rc.1",
3+
"version": "5.0.0-rc.2",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/defi-wonderland/aztec-standards.git"
@@ -26,15 +26,15 @@
2626
"*.ts": "prettier --write -u"
2727
},
2828
"dependencies": {
29-
"@aztec/accounts": "5.0.0-rc.1",
30-
"@aztec/aztec.js": "5.0.0-rc.1",
31-
"@aztec/noir-contracts.js": "5.0.0-rc.1",
32-
"@aztec/protocol-contracts": "5.0.0-rc.1",
33-
"@aztec/pxe": "5.0.0-rc.1",
34-
"@aztec/stdlib": "5.0.0-rc.1",
35-
"@aztec/wallet-sdk": "5.0.0-rc.1",
36-
"@aztec/wallets": "5.0.0-rc.1",
37-
"@defi-wonderland/aztec-benchmark": "5.0.0-rc.1",
29+
"@aztec/accounts": "5.0.0-rc.2",
30+
"@aztec/aztec.js": "5.0.0-rc.2",
31+
"@aztec/noir-contracts.js": "5.0.0-rc.2",
32+
"@aztec/protocol-contracts": "5.0.0-rc.2",
33+
"@aztec/pxe": "5.0.0-rc.2",
34+
"@aztec/stdlib": "5.0.0-rc.2",
35+
"@aztec/wallet-sdk": "5.0.0-rc.2",
36+
"@aztec/wallets": "5.0.0-rc.2",
37+
"@defi-wonderland/aztec-benchmark": "https://github.com/defi-wonderland/aztec-benchmark/releases/download/prerelease-a2add93/defi-wonderland-aztec-benchmark-5.0.0-rc.2-prerelease.a2add93.tgz",
3838
"commander": "14.0.1",
3939
"dotenv": "16.4.7"
4040
},
@@ -50,7 +50,7 @@
5050
"vitest": "4.0.17"
5151
},
5252
"config": {
53-
"aztecVersion": "5.0.0-rc.1"
53+
"aztecVersion": "5.0.0-rc.2"
5454
},
5555
"engines": {
5656
"node": ">=22"

scripts/deploy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ interface TokenConstructorArgs {
5353
symbol: string;
5454
decimals: number;
5555
minter: AztecAddress;
56+
authContract: AztecAddress;
5657
}
5758

5859
interface DeploymentToken {
@@ -105,6 +106,7 @@ function getDeploymentData(
105106
symbol: tokenConfig.symbol,
106107
decimals: tokenConfig.decimals,
107108
minter: minterAddress,
109+
authContract: AztecAddress.ZERO,
108110
},
109111
}));
110112

@@ -309,7 +311,7 @@ export async function deployToken(
309311
deployer,
310312
node,
311313
TokenContractArtifact,
312-
[params.name, params.symbol, params.decimals, minter],
314+
[params.name, params.symbol, params.decimals, minter, AztecAddress.ZERO],
313315
'constructor_with_minter',
314316
params.salt,
315317
options,
@@ -363,7 +365,7 @@ async function computeContractAddresses(config: DeploymentConfig): Promise<Compu
363365
const tokens: Record<string, AztecAddress> = {};
364366
for (const [key, tokenConfig] of Object.entries(config.contracts.tokens)) {
365367
const instance = await getContractInstanceFromInstantiationParams(TokenContractArtifact, {
366-
constructorArgs: [tokenConfig.name, tokenConfig.symbol, tokenConfig.decimals, dripper],
368+
constructorArgs: [tokenConfig.name, tokenConfig.symbol, tokenConfig.decimals, dripper, AztecAddress.ZERO],
367369
salt: new Fr(tokenConfig.salt),
368370
publicKeys: PublicKeys.default(),
369371
deployer: AztecAddress.ZERO,

src/dripper/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ compiler_version = ">=1.0.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.1", directory = "noir-projects/aztec-nr/aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.2", directory = "noir-projects/aztec-nr/aztec" }
99
token = { path = "../token_contract" }

src/escrow_contract/Nargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ compiler_version = ">=1.0.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.1", directory = "noir-projects/aztec-nr/aztec" }
9-
serde = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.1", directory = "noir-projects/noir-protocol-circuits/crates/serde" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.2", directory = "noir-projects/aztec-nr/aztec" }
9+
serde = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.2", directory = "noir-projects/noir-protocol-circuits/crates/serde" }
1010
token = { path = "../token_contract" }
1111
nft = { path = "../nft_contract" }
1212
sha512 = { git = "https://github.com/noir-lang/sha512", tag = "mv/use-bool-over-u1" }

src/escrow_contract/src/library/logic.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn _get_escrow(
3939
let escrow_instance = ContractInstance {
4040
salt: context.this_address().to_field(),
4141
deployer: AztecAddress::from_field(0),
42-
contract_class_id: ContractClassId::from_field(escrow_class_id),
42+
original_contract_class_id: ContractClassId::from_field(escrow_class_id),
4343
initialization_hash: 0,
4444
immutables_hash: 0,
4545
public_keys: computed_public_keys,

src/escrow_contract/src/test/test_logic_contract/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ compiler_version = ">=1.0.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.1", directory = "noir-projects/aztec-nr/aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v5.0.0-rc.2", directory = "noir-projects/aztec-nr/aztec" }
99
escrow_contract = { path = "../../../" }
1010
token = { path = "../../../../token_contract" }
1111
nft = { path = "../../../../nft_contract" }

src/escrow_contract/src/test/test_logic_contract/src/test/get_escrow.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unconstrained fn get_escrow_correct_instance() {
3131
assert_eq(escrow_instance.salt, logic.to_field(), "Salt is not the logic contract");
3232
assert_eq(escrow_instance.deployer, AztecAddress::from_field(0), "Deployer is not zero");
3333
assert_eq(
34-
escrow_instance.contract_class_id.to_field(),
34+
escrow_instance.original_contract_class_id.to_field(),
3535
escrow_class_id,
3636
"Escrow class id mismatch",
3737
);

src/escrow_contract/src/test/utils.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ pub unconstrained fn get_escrow_class_id() -> Field {
5656
random(),
5757
AztecAddress::zero(),
5858
);
59-
escrow_instance.contract_class_id.to_field()
59+
escrow_instance.original_contract_class_id.to_field()
6060
}

0 commit comments

Comments
 (0)