Skip to content

Commit 6b5019d

Browse files
committed
working update
1 parent 6967317 commit 6b5019d

File tree

13 files changed

+3809
-3358
lines changed

13 files changed

+3809
-3358
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONTRACT_ADDRESS=
2+
DEPLOYER_ADDRESS=
3+
DEPLOYMENT_SALT=
4+
AZTEC_NODE_URL=http://localhost:8080

.github/workflows/e2e.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,38 @@ jobs:
99
timeout-minutes: 120
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1313

14-
- uses: actions/setup-node@v4
15-
with:
16-
node-version: lts/*
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: lts/*
1717

18-
- name: Set up Docker
19-
uses: docker/setup-buildx-action@v2
18+
- name: Set up Docker
19+
uses: docker/setup-buildx-action@v2
2020

21-
- name: Install Aztec CLI
22-
run: |
23-
curl -s https://install.aztec.network > tmp.sh
24-
bash tmp.sh <<< yes "yes"
21+
- name: Install Aztec CLI
22+
run: |
23+
curl -s https://install.aztec.network > tmp.sh
24+
bash tmp.sh <<< yes "yes"
2525
26-
- name: Update path
27-
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
26+
- name: Update path
27+
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
2828

29-
- name: Set Aztec version and start sandbox
30-
run: |
31-
aztec-up 0.87.4
32-
aztec start --sandbox &
29+
- name: Set Aztec version and start sandbox
30+
run: |
31+
aztec-up 2.0.2
32+
aztec start --sandbox &
3333
34-
- name: Install dependencies
35-
working-directory: ./app
36-
run: npm install -g yarn && yarn
34+
- name: Install dependencies
35+
working-directory: ./app
36+
run: npm install -g yarn && yarn
3737

38-
- name: Install Playwright Browsers
39-
working-directory: ./app
40-
run: yarn playwright install --with-deps
38+
- name: Install Playwright Browsers
39+
working-directory: ./app
40+
run: yarn playwright install --with-deps
4141

42-
- name: Build
43-
run: yarn build
42+
- name: Build
43+
run: yarn build
4444

45-
- name: Run tests
46-
run: yarn test
45+
- name: Run tests
46+
run: yarn test

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ This is an example web app that demonstrates how to interact with an Aztec contr
1010

1111
1. Install the Aztec tools from the first few steps in [Quick Start Guide](https://docs.aztec.network/developers/getting_started).
1212

13-
Please note that this project uses `0.87.4` version of Aztec SDK. If you wish to use a different version, please update the dependencies in the `app/package.json` and in `contracts/Nargo.toml` file to match your version.
13+
Please note that this project uses `2.0.2` version of Aztec SDK. If you wish to use a different version, please update the dependencies in the `app/package.json` and in `contracts/Nargo.toml` file to match your version.
1414

1515
You can install a specific version of Aztec tools by running `aztec-up 0.X.X`
1616

17-
1817
2. Compile smart contracts in `/contracts`:
1918

2019
```sh
Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
type ContractInstanceWithAddress,
1515
type ContractMethod,
1616
type ContractStorageLayout,
17-
type ContractNotes,
1817
decodeFromAbi,
1918
DeployMethod,
2019
EthAddress,
@@ -26,29 +25,28 @@ import {
2625
loadContractArtifact,
2726
loadContractArtifactForPublic,
2827
type NoirCompiledContract,
29-
NoteSelector,
3028
Point,
3129
type PublicKey,
3230
PublicKeys,
3331
type Wallet,
3432
type U128Like,
3533
type WrappedFieldLike,
3634
} from '@aztec/aztec.js';
37-
import EasyPrivateVotingContractArtifactJson from './private_voting-EasyPrivateVoting.json' with { type: 'json' };
38-
export const EasyPrivateVotingContractArtifact = loadContractArtifact(EasyPrivateVotingContractArtifactJson as NoirCompiledContract);
35+
import PrivateVotingContractArtifactJson from './private_voting-PrivateVoting.json' with { type: 'json' };
36+
export const PrivateVotingContractArtifact = loadContractArtifact(PrivateVotingContractArtifactJson as NoirCompiledContract);
3937

4038

4139

4240
/**
43-
* Type-safe interface for contract EasyPrivateVoting;
41+
* Type-safe interface for contract PrivateVoting;
4442
*/
45-
export class EasyPrivateVotingContract extends ContractBase {
43+
export class PrivateVotingContract extends ContractBase {
4644

4745
private constructor(
4846
instance: ContractInstanceWithAddress,
4947
wallet: Wallet,
5048
) {
51-
super(instance, EasyPrivateVotingContractArtifact, wallet);
49+
super(instance, PrivateVotingContractArtifact, wallet);
5250
}
5351

5452

@@ -63,36 +61,36 @@ export class EasyPrivateVotingContract extends ContractBase {
6361
address: AztecAddress,
6462
wallet: Wallet,
6563
) {
66-
return Contract.at(address, EasyPrivateVotingContract.artifact, wallet) as Promise<EasyPrivateVotingContract>;
64+
return Contract.at(address, PrivateVotingContract.artifact, wallet) as Promise<PrivateVotingContract>;
6765
}
6866

6967

7068
/**
7169
* Creates a tx to deploy a new instance of this contract.
7270
*/
7371
public static deploy(wallet: Wallet, admin: AztecAddressLike) {
74-
return new DeployMethod<EasyPrivateVotingContract>(PublicKeys.default(), wallet, EasyPrivateVotingContractArtifact, EasyPrivateVotingContract.at, Array.from(arguments).slice(1));
72+
return new DeployMethod<PrivateVotingContract>(PublicKeys.default(), wallet, PrivateVotingContractArtifact, PrivateVotingContract.at, Array.from(arguments).slice(1));
7573
}
7674

7775
/**
7876
* Creates a tx to deploy a new instance of this contract using the specified public keys hash to derive the address.
7977
*/
8078
public static deployWithPublicKeys(publicKeys: PublicKeys, wallet: Wallet, admin: AztecAddressLike) {
81-
return new DeployMethod<EasyPrivateVotingContract>(publicKeys, wallet, EasyPrivateVotingContractArtifact, EasyPrivateVotingContract.at, Array.from(arguments).slice(2));
79+
return new DeployMethod<PrivateVotingContract>(publicKeys, wallet, PrivateVotingContractArtifact, PrivateVotingContract.at, Array.from(arguments).slice(2));
8280
}
8381

8482
/**
8583
* Creates a tx to deploy a new instance of this contract using the specified constructor method.
8684
*/
87-
public static deployWithOpts<M extends keyof EasyPrivateVotingContract['methods']>(
85+
public static deployWithOpts<M extends keyof PrivateVotingContract['methods']>(
8886
opts: { publicKeys?: PublicKeys; method?: M; wallet: Wallet },
89-
...args: Parameters<EasyPrivateVotingContract['methods'][M]>
87+
...args: Parameters<PrivateVotingContract['methods'][M]>
9088
) {
91-
return new DeployMethod<EasyPrivateVotingContract>(
89+
return new DeployMethod<PrivateVotingContract>(
9290
opts.publicKeys ?? PublicKeys.default(),
9391
opts.wallet,
94-
EasyPrivateVotingContractArtifact,
95-
EasyPrivateVotingContract.at,
92+
PrivateVotingContractArtifact,
93+
PrivateVotingContract.at,
9694
Array.from(arguments).slice(1),
9795
opts.method ?? 'constructor',
9896
);
@@ -104,14 +102,14 @@ export class EasyPrivateVotingContract extends ContractBase {
104102
* Returns this contract's artifact.
105103
*/
106104
public static get artifact(): ContractArtifact {
107-
return EasyPrivateVotingContractArtifact;
105+
return PrivateVotingContractArtifact;
108106
}
109107

110108
/**
111109
* Returns this contract's artifact with public bytecode.
112110
*/
113111
public static get artifactForPublic(): ContractArtifact {
114-
return loadContractArtifactForPublic(EasyPrivateVotingContractArtifactJson as NoirCompiledContract);
112+
return loadContractArtifactForPublic(PrivateVotingContractArtifactJson as NoirCompiledContract);
115113
}
116114

117115

@@ -133,15 +131,6 @@ active_at_block: {
133131
}
134132

135133

136-
public static get notes(): ContractNotes<'ValueNote'> {
137-
return {
138-
ValueNote: {
139-
id: new NoteSelector(0),
140-
}
141-
} as ContractNotes<'ValueNote'>;
142-
}
143-
144-
145134
/** Type-safe wrappers for the public methods exposed by the contract. */
146135
public declare methods: {
147136

@@ -157,6 +146,9 @@ active_at_block: {
157146
/** get_vote(candidate: field) */
158147
get_vote: ((candidate: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
159148

149+
/** process_message(message_ciphertext: struct, message_context: struct) */
150+
process_message: ((message_ciphertext: FieldLike[], message_context: { tx_hash: FieldLike, unique_note_hashes_in_tx: FieldLike[], first_nullifier_in_tx: FieldLike, recipient: AztecAddressLike }) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
151+
160152
/** public_dispatch(selector: field) */
161153
public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
162154

0 commit comments

Comments
 (0)