Skip to content

Commit a12973c

Browse files
authored
Merge branch 'main' into jc/87.2
2 parents 8ef270a + 1ddf1a5 commit a12973c

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

scripts/deploy_contract.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { EasyPrivateVotingContract } from "../src/artifacts/EasyPrivateVoting.js"
22
import { createLogger, PXE, Logger, SponsoredFeePaymentMethod, Fr } from "@aztec/aztec.js";
3-
import { TokenContract } from "@aztec/noir-contracts.js/Token"
43
import { setupPXE } from "../src/utils/setup_pxe.js";
54
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
65
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
@@ -21,7 +20,7 @@ async function main() {
2120

2221
let accountManager = await deploySchnorrAccount(pxe);
2322
const wallet = await accountManager.getWallet();
24-
const address = await accountManager.getAddress();
23+
const address = accountManager.getAddress();
2524

2625
const votingContract = await EasyPrivateVotingContract.deploy(wallet, address).send({ fee: { paymentMethod: sponsoredPaymentMethod } }).deployed();
2726
logger.info(`Voting Contract deployed at: ${votingContract.address}`);

scripts/fees.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
2323
const MNEMONIC = 'test test test test test test test test test test test junk';
2424
const FEE_FUNDING_FOR_TESTER_ACCOUNT = 1000000000000000000n;
2525

26-
let walletClient = getL1WalletClient(foundry.rpcUrls.default.http[0], 0);
27-
const ownerEthAddress = walletClient.account.address;
28-
2926
async function main() {
3027

3128
let pxe: PXE;
@@ -69,7 +66,7 @@ async function main() {
6966
await pxe.registerContract({ instance: sponseredFPC, artifact: SponsoredFPCContract.artifact });
7067
const paymentMethod = new SponsoredFeePaymentMethod(sponseredFPC.address);
7168

72-
// Two arbitraty txs to make the L1 message available on L2
69+
// Two arbitrary txs to make the L1 message available on L2
7370
const votingContract = await EasyPrivateVotingContract.deploy(wallet1, wallet1.getAddress()).send({ fee: { paymentMethod } }).deployed();
7471
const bananaCoin = await TokenContract.deploy(wallet1, wallet1.getAddress(), "bananaCoin", "BNC", 18).send({ fee: { paymentMethod } }).deployed()
7572

scripts/multiple_pxe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function main() {
6969
let schnorrAccount = await getSchnorrAccount(pxe1, secretKey, deriveSigningKey(secretKey), salt);
7070
let tx = await schnorrAccount.deploy({ fee: { paymentMethod } }).wait();
7171
let ownerWallet = await schnorrAccount.getWallet();
72-
let ownerAddress = await ownerWallet.getAddress();
72+
let ownerAddress = ownerWallet.getAddress();
7373
const token = await TokenContract.deploy(ownerWallet, ownerAddress, 'Clean USDC', 'USDC', 6).send({ contractAddressSalt: L2_TOKEN_CONTRACT_SALT, fee: { paymentMethod } }).wait()
7474

7575
// setup account on 2nd pxe
@@ -114,7 +114,7 @@ async function main() {
114114
const balance = await l2TokenContract.methods.balance_of_private(wallet2.getAddress()).simulate()
115115
console.log("private balance should be 100", balance)
116116
// errors
117-
const public_balance = await l2TokenContract.methods.balance_of_public(wallet2.getAddress()).simulate()
117+
await l2TokenContract.methods.balance_of_public(wallet2.getAddress()).simulate()
118118

119119
}
120120

src/utils/deploy_account.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { createLogger, Fr, PXE, Logger, AccountManager } from "@aztec/aztec.js";
1+
import { createLogger, Fr, AccountManager } from "@aztec/aztec.js";
2+
import type { PXE, Logger } from "@aztec/aztec.js";
23
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
34
import { deriveSigningKey } from '@aztec/stdlib/keys';
45
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
56
import { getSponsoredFPCInstance } from "./sponsored_fpc.js";
6-
import { setupPXE } from "./setup_pxe.js";
77
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
88

99
export async function deploySchnorrAccount(pxe: PXE): Promise<AccountManager> {
@@ -19,7 +19,7 @@ export async function deploySchnorrAccount(pxe: PXE): Promise<AccountManager> {
1919
let salt = Fr.random();
2020

2121
let schnorrAccount = await getSchnorrAccount(pxe, secretKey, deriveSigningKey(secretKey), salt);
22-
let tx = await schnorrAccount.deploy({ fee: { paymentMethod: sponsoredPaymentMethod } }).wait();
22+
await schnorrAccount.deploy({ fee: { paymentMethod: sponsoredPaymentMethod } }).wait();
2323
let wallet = await schnorrAccount.getWallet();
2424

2525
logger.info(`Schnorr account deployed at: ${wallet.getAddress()}`);

0 commit comments

Comments
 (0)