-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathprofile_deploy.ts
More file actions
31 lines (23 loc) · 1.15 KB
/
profile_deploy.ts
File metadata and controls
31 lines (23 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { PrivateVotingContract } from "../src/artifacts/PrivateVoting.js"
import { createLogger, PXE, Logger, SponsoredFeePaymentMethod, Fr } from "@aztec/aztec.js";
import { setupPXE } from "../src/utils/setup_pxe.js";
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
import { deploySchnorrAccount } from "../src/utils/deploy_account.js";
async function main() {
let pxe: PXE;
let logger: Logger;
logger = createLogger('aztec:aztec-starter');
pxe = await setupPXE();
const sponsoredFPC = await getSponsoredFPCInstance();
await pxe.registerContract({ instance: sponsoredFPC, artifact: SponsoredFPCContract.artifact });
let accountManager = await deploySchnorrAccount(pxe);
const wallet = await accountManager.getWallet();
const address = await accountManager.getAddress();
const profileTx = await PrivateVotingContract.deploy(wallet, address).profile({ profileMode: "full", from: address });
console.dir(profileTx, { depth: 2 });
}
main().catch((error) => {
console.error("Error:", error);
process.exit(1);
});