Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove fundFpc step from bootstrap #8245

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 47 additions & 45 deletions yarn-project/cli/src/cmds/devnet/bootstrap_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export async function bootstrapNetwork(
const fpc = await deployFPC(wallet, token.address);

const counter = await deployCounter(wallet);
await fundFPC(counter.address, wallet, l1Clients, fpc.address, debugLog);
// NOTE: Disabling for now in order to get devnet running
// await fundFPC(counter.address, wallet, l1Clients, fpc.address, debugLog);

if (json) {
log(
Expand Down Expand Up @@ -215,47 +216,48 @@ async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
return info;
}

async function fundFPC(
counterAddress: AztecAddress,
wallet: Wallet,
l1Clients: L1Clients,
fpcAddress: AztecAddress,
debugLog: DebugLogger,
) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
const { FeeJuiceContract, CounterContract } = await import('@aztec/noir-contracts.js');
const {
protocolContractAddresses: { feeJuice },
} = await wallet.getPXEInfo();

const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);

const feeJuicePortal = await FeeJuicePortalManager.new(
wallet,
l1Clients.publicClient,
l1Clients.walletClient,
debugLog,
);

const amount = 10n ** 21n;
const { claimAmount, claimSecret } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, amount, true);

const counter = await CounterContract.at(counterAddress, wallet);

// TODO (alexg) remove this once sequencer builds blocks continuously
// advance the chain
await counter.methods
.increment(wallet.getAddress(), wallet.getAddress())
.send()
.wait({ proven: true, provenTimeout: 600 });
await counter.methods
.increment(wallet.getAddress(), wallet.getAddress())
.send()
.wait({ proven: true, provenTimeout: 600 });

await feeJuiceContract.methods
.claim(fpcAddress, claimAmount, claimSecret)
.send()
.wait({ proven: true, provenTimeout: 600 });
}
// NOTE: Disabling for now in order to get devnet running
// async function fundFPC(
// counterAddress: AztecAddress,
// wallet: Wallet,
// l1Clients: L1Clients,
// fpcAddress: AztecAddress,
// debugLog: DebugLogger,
// ) {
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
// const { FeeJuiceContract, CounterContract } = await import('@aztec/noir-contracts.js');
// const {
// protocolContractAddresses: { feeJuice },
// } = await wallet.getPXEInfo();

// const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);

// const feeJuicePortal = await FeeJuicePortalManager.new(
// wallet,
// l1Clients.publicClient,
// l1Clients.walletClient,
// debugLog,
// );

// const amount = 10n ** 21n;
// const { claimAmount, claimSecret } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, amount, true);

// const counter = await CounterContract.at(counterAddress, wallet);

// // TODO (alexg) remove this once sequencer builds blocks continuously
// // advance the chain
// await counter.methods
// .increment(wallet.getAddress(), wallet.getAddress())
// .send()
// .wait({ proven: true, provenTimeout: 600 });
// await counter.methods
// .increment(wallet.getAddress(), wallet.getAddress())
// .send()
// .wait({ proven: true, provenTimeout: 600 });

// await feeJuiceContract.methods
// .claim(fpcAddress, claimAmount, claimSecret)
// .send()
// .wait({ proven: true, provenTimeout: 600 });
// }
Loading