-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathdeploy-contract.ts
More file actions
28 lines (21 loc) · 972 Bytes
/
deploy-contract.ts
File metadata and controls
28 lines (21 loc) · 972 Bytes
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
import { EasyPrivateVotingContract } from "../src/artifacts/EasyPrivateVoting.js"
import { AccountWallet, createLogger, PXE, waitForPXE, createPXEClient, Logger } from "@aztec/aztec.js";
import { getInitialTestAccountsWallets } from "@aztec/accounts/testing";
import { TokenContract } from "@aztec/noir-contracts.js/Token"
const setupSandbox = async () => {
const { PXE_URL = 'http://localhost:8080' } = process.env;
const pxe = await createPXEClient(PXE_URL);
await waitForPXE(pxe);
return pxe;
};
async function main() {
let pxe: PXE;
let wallets: AccountWallet[] = [];
let logger: Logger;
logger = createLogger('aztec:aztec-starter');
pxe = await setupSandbox();
wallets = await getInitialTestAccountsWallets(pxe);
const votingContract = await EasyPrivateVotingContract.deploy(wallets[0], wallets[0].getAddress()).send().deployed();
logger.info(`Voting Contract deployed at: ${votingContract.address}`);
}
main();