Skip to content

Commit f4d1407

Browse files
authored
Merge pull request #2 from AztecProtocol/gj/nigthly_update
nigthly update
2 parents 337d90f + a17772c commit f4d1407

File tree

7 files changed

+303
-280
lines changed

7 files changed

+303
-280
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ curl -s https://install.aztec.network | bash
3333

3434
### 3. Set Aztec Version
3535

36-
The project uses Aztec version `v3.0.0-devnet.2`. Set it using:
36+
The project uses Aztec version `v3.0.0-nightly.20251120`. Set it using:
3737

3838
```bash
39-
aztec-up 3.0.0-devnet.2
40-
docker tag aztecprotocol/aztec:3.0.0-devnet.2 aztecprotocol/aztec:latest # Temporary workaround for aztec-nargo issues
39+
aztec-up 3.0.0-nightly.20251120
40+
docker tag aztecprotocol/aztec:3.0.0-nightly.20251120 aztecprotocol/aztec:latest # Temporary workaround for aztec-nargo issues
4141
```
4242

4343
## Development Setup

contracts/proof_of_password/Nargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type = "contract"
44
authors = [""]
55

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/aztec" }
8-
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/aztec-nr/aztec" }
8+
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
99
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
10-
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/compressed-string" }
10+
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/aztec-nr/compressed-string" }

contracts/proof_of_password/src/main.nr

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ use aztec::macros::aztec;
66
pub contract ProofOfPassword {
77

88
use aztec::{
9-
macros::{functions::{external, initializer, internal}, storage::storage},
9+
macros::{functions::{external, initializer, only_self}, storage::storage},
1010
oracle::notes::set_sender_for_tags,
11-
protocol_types::{
12-
address::AztecAddress,
13-
hash::poseidon2_hash,
14-
traits::{Serialize, ToField},
15-
},
11+
protocol_types::{address::AztecAddress, hash::poseidon2_hash, traits::{Serialize, ToField}},
1612
state_vars::PublicImmutable,
1713
};
1814
use compressed_string::FieldCompressedString;
@@ -29,30 +25,31 @@ pub contract ProofOfPassword {
2925
fn constructor(grego_coin_address: AztecAddress, password: str<31>) {
3026
let field_compressed_str = FieldCompressedString::from_string(password);
3127
let password_hash = poseidon2_hash(field_compressed_str.serialize());
32-
ProofOfPassword::at(context.this_address())
33-
._init_storage(grego_coin_address, password_hash)
34-
.enqueue(&mut context);
28+
self.enqueue(ProofOfPassword::at(self.address)._init_storage(
29+
grego_coin_address,
30+
password_hash,
31+
));
3532
}
3633

3734
#[external("public")]
38-
#[internal]
35+
#[only_self]
3936
fn _init_storage(grego_coin_address: AztecAddress, password_hash: Field) {
40-
storage.grego_coin_address.initialize(grego_coin_address);
41-
storage.password_hash.initialize(password_hash);
37+
self.storage.grego_coin_address.initialize(grego_coin_address);
38+
self.storage.password_hash.initialize(password_hash);
4239
}
4340

4441
#[external("private")]
4542
fn check_password_and_mint(password: str<31>, to: AztecAddress) {
4643
let field_compressed_str = FieldCompressedString::from_string(password);
47-
let password_hash = storage.password_hash.read();
44+
let password_hash = self.storage.password_hash.read();
4845
assert(
4946
poseidon2_hash(field_compressed_str.serialize()) == password_hash,
5047
f"Invalid password {password}",
5148
);
5249

5350
// Safety: PXE will enforce a sender for the tags of the notes created
5451
// in the Token.mint function, but this one intented to be called by anyone
55-
// that knows the passord, not necessarily the recipient. Chances are this fn
52+
// that knows the passord, not necessarily the recipient. Chances are this fn
5653
// will be invoked by the MultiCallEntrypoint protocol contract,
5754
// which does not set a sender for tags.
5855
// We intend the "to" of this function to claim the notes, so we're just calling
@@ -61,13 +58,13 @@ pub contract ProofOfPassword {
6158
set_sender_for_tags(to);
6259
}
6360

64-
let address = storage.grego_coin_address.read();
65-
Token::at(address).mint_to_private(to, 1000).call(&mut context);
61+
let address = self.storage.grego_coin_address.read();
62+
self.call(Token::at(address).mint_to_private(to, 1000));
6663

67-
// Derive nullifier from sender and password. This is still a privacy leak, since
64+
// Derive nullifier from sender and password. This is still a privacy leak, since
6865
// knowing the password and an address is sufficient to know if someone has used this
6966
// contract or not. But at least, they need the password
70-
let nullifier = poseidon2_hash([to.to_field(), field_compressed_str.serialize()[0]]);
71-
context.push_nullifier(nullifier);
67+
let nullifier = poseidon2_hash([to.to_field(), field_compressed_str.serialize()[0]]);
68+
self.context.push_nullifier(nullifier);
7269
}
7370
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"serve": "vite",
1010
"build": "tsc -b && vite build",
1111
"lint": "eslint .",
12-
"copy:dependencies": "cd contracts && aztec-nargo check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-devnet.2/noir-projects/noir-contracts && aztec-nargo compile --package token_contract && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-devnet.2/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/contracts/target/token_contract-Token.json",
13-
"compile:contracts": "cd contracts && aztec-nargo compile && aztec-postprocess-contract && aztec codegen ./target/proof_of_password-ProofOfPassword.json",
12+
"copy:dependencies": "cd contracts && aztec check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-nightly.20251120/noir-projects/noir-contracts && aztec compile --package token_contract && mkdir -p $WORKDIR/target && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-nightly.20251120/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/target/token_contract-Token.json",
13+
"compile:contracts": "cd contracts && aztec compile --package proof_of_password && aztec codegen ./target/proof_of_password-ProofOfPassword.json",
1414
"test": "cd contracts && aztec test",
1515
"preview": "vite preview",
1616
"deploy:local": "node --experimental-transform-types scripts/deploy.ts --network local",
@@ -19,14 +19,14 @@
1919
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src"
2020
},
2121
"dependencies": {
22-
"@aztec/accounts": "v3.0.0-devnet.2",
23-
"@aztec/aztec.js": "v3.0.0-devnet.2",
24-
"@aztec/constants": "v3.0.0-devnet.2",
25-
"@aztec/entrypoints": "v3.0.0-devnet.2",
26-
"@aztec/foundation": "v3.0.0-devnet.2",
27-
"@aztec/noir-contracts.js": "v3.0.0-devnet.2",
28-
"@aztec/pxe": "v3.0.0-devnet.2",
29-
"@aztec/stdlib": "v3.0.0-devnet.2",
22+
"@aztec/accounts": "v3.0.0-nightly.20251120",
23+
"@aztec/aztec.js": "v3.0.0-nightly.20251120",
24+
"@aztec/constants": "v3.0.0-nightly.20251120",
25+
"@aztec/entrypoints": "v3.0.0-nightly.20251120",
26+
"@aztec/foundation": "v3.0.0-nightly.20251120",
27+
"@aztec/noir-contracts.js": "v3.0.0-nightly.20251120",
28+
"@aztec/pxe": "v3.0.0-nightly.20251120",
29+
"@aztec/stdlib": "v3.0.0-nightly.20251120",
3030
"@emotion/react": "^11.14.0",
3131
"@emotion/styled": "^11.14.0",
3232
"@mui/icons-material": "^6.3.1",
@@ -39,7 +39,7 @@
3939
"zod": "^3.23.8"
4040
},
4141
"devDependencies": {
42-
"@aztec/test-wallet": "v3.0.0-devnet.2",
42+
"@aztec/test-wallet": "v3.0.0-nightly.20251120",
4343
"@eslint/js": "^9.18.0",
4444
"@playwright/test": "1.49.0",
4545
"@types/buffer-json": "^2",

src/contexts/ContractsContext.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ export function ContractsProvider({ children }: ContractsProviderProps) {
186186
] as unknown as any);
187187

188188
// After registration, instantiate the contracts
189-
const gregoCoinContract = await TokenContract.at(gregoCoinAddress, wallet);
190-
const gregoCoinPremiumContract = await TokenContract.at(gregoCoinPremiumAddress, wallet);
191-
const ammContract = await AMMContract.at(ammAddress, wallet);
189+
const gregoCoinContract = TokenContract.at(gregoCoinAddress, wallet);
190+
const gregoCoinPremiumContract = TokenContract.at(gregoCoinPremiumAddress, wallet);
191+
const ammContract = AMMContract.at(ammAddress, wallet);
192192

193193
setGregoCoin(gregoCoinContract);
194194
setGregoCoinPremium(gregoCoinPremiumContract);
@@ -213,7 +213,7 @@ export function ContractsProvider({ children }: ContractsProviderProps) {
213213
]);
214214

215215
// After registration, instantiate the ProofOfPassword contract
216-
const popContract = await ProofOfPasswordContract.at(popAddress, wallet);
216+
const popContract = ProofOfPasswordContract.at(popAddress, wallet);
217217
setPop(popContract);
218218

219219
setIsLoadingContracts(false);

src/embedded_wallet.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { SchnorrAccountContract } from '@aztec/accounts/schnorr/lazy';
33

44
import { getPXEConfig, type PXEConfig } from '@aztec/pxe/config';
55
import { createPXE, PXE } from '@aztec/pxe/client/lazy';
6-
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
76
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
87
import { AztecAddress } from '@aztec/stdlib/aztec-address';
98
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
10-
import type { TxSimulationResult } from '@aztec/stdlib/tx';
9+
import { mergeExecutionPayloads, type ExecutionPayload, type TxSimulationResult } from '@aztec/stdlib/tx';
1110
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
1211
import { deriveSigningKey } from '@aztec/stdlib/keys';
1312
import { SignerlessAccount, type Account, type AccountContract } from '@aztec/aztec.js/account';
@@ -127,8 +126,8 @@ export class EmbeddedWallet extends BaseWallet {
127126
opts: SimulateInteractionOptions,
128127
): Promise<TxSimulationResult> {
129128
const feeOptions = opts.fee?.estimateGas
130-
? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee)
131-
: await this.getDefaultFeeOptions(opts.from, opts.fee);
129+
? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee.gasSettings)
130+
: await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee.gasSettings);
132131
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
133132
const executionOptions: DefaultAccountEntrypointOptions = {
134133
txNonce: Fr.random(),

0 commit comments

Comments
 (0)