@aztec/cli 1.0.0-nightly.20250810 → 1.0.0-nightly.20250812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +27 -14
- package/dest/utils/setup_contracts.d.ts +2 -2
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +2 -1
- package/package.json +22 -22
- package/src/cmds/devnet/bootstrap_network.ts +21 -15
- package/src/utils/setup_contracts.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAqB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAqB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAkFjB"}
|
|
@@ -18,17 +18,18 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
18
18
|
const [accountManager] = await getInitialTestAccountsManagers(pxe);
|
|
19
19
|
await accountManager.register();
|
|
20
20
|
const wallet = await accountManager.getWallet();
|
|
21
|
+
const defaultAccountAddress = wallet.getAddress();
|
|
21
22
|
const l1Client = createExtendedL1Client(l1Urls, l1PrivateKey ? privateKeyToAccount(l1PrivateKey) : // Note that this account needs to be funded on L1 !
|
|
22
23
|
mnemonicToAccount(l1Mnemonic, {
|
|
23
24
|
addressIndex
|
|
24
25
|
}), createEthereumChain(l1Urls, +l1ChainId).chainInfo);
|
|
25
26
|
const { erc20Address, portalAddress } = await deployERC20(l1Client);
|
|
26
|
-
const { token, bridge } = await deployToken(wallet, portalAddress);
|
|
27
|
+
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
27
28
|
await initPortal(pxe, l1Client, erc20Address, portalAddress, bridge.address);
|
|
28
29
|
const fpcAdmin = wallet.getAddress();
|
|
29
|
-
const fpc = await deployFPC(wallet, token.address, fpcAdmin);
|
|
30
|
-
const counter = await deployCounter(wallet);
|
|
31
|
-
await fundFPC(pxe, counter.address, wallet, l1Client, fpc.address, debugLog);
|
|
30
|
+
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
31
|
+
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
32
|
+
await fundFPC(pxe, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
32
33
|
if (json) {
|
|
33
34
|
log(JSON.stringify({
|
|
34
35
|
devCoinL1: erc20Address.toString(),
|
|
@@ -98,23 +99,27 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
98
99
|
}
|
|
99
100
|
/**
|
|
100
101
|
* Step 2. Deploy the L2 contracts
|
|
101
|
-
*/ async function deployToken(wallet, l1Portal) {
|
|
102
|
+
*/ async function deployToken(wallet, defaultAccountAddress, l1Portal) {
|
|
102
103
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
103
104
|
// @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
|
|
104
105
|
const { TokenContract } = await import('@aztec/noir-contracts.js/Token');
|
|
105
106
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
106
107
|
// @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
|
|
107
108
|
const { TokenBridgeContract } = await import('@aztec/noir-contracts.js/TokenBridge');
|
|
108
|
-
const devCoin = await TokenContract.deploy(wallet,
|
|
109
|
+
const devCoin = await TokenContract.deploy(wallet, defaultAccountAddress, 'DevCoin', 'DEV', 18).send({
|
|
110
|
+
from: defaultAccountAddress,
|
|
109
111
|
universalDeploy: true
|
|
110
112
|
}).deployed(waitOpts);
|
|
111
113
|
const bridge = await TokenBridgeContract.deploy(wallet, devCoin.address, l1Portal).send({
|
|
114
|
+
from: defaultAccountAddress,
|
|
112
115
|
universalDeploy: true
|
|
113
116
|
}).deployed(waitOpts);
|
|
114
117
|
await new BatchCall(wallet, [
|
|
115
118
|
devCoin.methods.set_minter(bridge.address, true),
|
|
116
119
|
devCoin.methods.set_admin(bridge.address)
|
|
117
|
-
]).send(
|
|
120
|
+
]).send({
|
|
121
|
+
from: defaultAccountAddress
|
|
122
|
+
}).wait(waitOpts);
|
|
118
123
|
return {
|
|
119
124
|
token: {
|
|
120
125
|
address: devCoin.address,
|
|
@@ -147,11 +152,12 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
147
152
|
hash
|
|
148
153
|
});
|
|
149
154
|
}
|
|
150
|
-
async function deployFPC(wallet, tokenAddress, admin) {
|
|
155
|
+
async function deployFPC(wallet, defaultAccountAddress, tokenAddress, admin) {
|
|
151
156
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
152
157
|
// @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
|
|
153
158
|
const { FPCContract } = await import('@aztec/noir-contracts.js/FPC');
|
|
154
159
|
const fpc = await FPCContract.deploy(wallet, tokenAddress, admin).send({
|
|
160
|
+
from: defaultAccountAddress,
|
|
155
161
|
universalDeploy: true
|
|
156
162
|
}).deployed(waitOpts);
|
|
157
163
|
const info = {
|
|
@@ -161,11 +167,12 @@ async function deployFPC(wallet, tokenAddress, admin) {
|
|
|
161
167
|
};
|
|
162
168
|
return info;
|
|
163
169
|
}
|
|
164
|
-
async function deployCounter(wallet) {
|
|
170
|
+
async function deployCounter(wallet, defaultAccountAddress) {
|
|
165
171
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
166
172
|
// @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
|
|
167
173
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
168
|
-
const counter = await CounterContract.deploy(wallet, 1,
|
|
174
|
+
const counter = await CounterContract.deploy(wallet, 1, defaultAccountAddress).send({
|
|
175
|
+
from: defaultAccountAddress,
|
|
169
176
|
universalDeploy: true
|
|
170
177
|
}).deployed(waitOpts);
|
|
171
178
|
const info = {
|
|
@@ -176,7 +183,7 @@ async function deployCounter(wallet) {
|
|
|
176
183
|
return info;
|
|
177
184
|
}
|
|
178
185
|
// NOTE: Disabling for now in order to get devnet running
|
|
179
|
-
async function fundFPC(pxe, counterAddress, wallet, l1Client, fpcAddress, debugLog) {
|
|
186
|
+
async function fundFPC(pxe, counterAddress, wallet, defaultAccountAddress, l1Client, fpcAddress, debugLog) {
|
|
180
187
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
181
188
|
// @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
|
|
182
189
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
@@ -192,10 +199,16 @@ async function fundFPC(pxe, counterAddress, wallet, l1Client, fpcAddress, debugL
|
|
|
192
199
|
debugLog.info('Incrementing Counter');
|
|
193
200
|
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
194
201
|
// advance the chain
|
|
195
|
-
await counter.methods.increment(wallet.getAddress()).send(
|
|
196
|
-
|
|
202
|
+
await counter.methods.increment(wallet.getAddress()).send({
|
|
203
|
+
from: defaultAccountAddress
|
|
204
|
+
}).wait(waitOpts);
|
|
205
|
+
await counter.methods.increment(wallet.getAddress()).send({
|
|
206
|
+
from: defaultAccountAddress
|
|
207
|
+
}).wait(waitOpts);
|
|
197
208
|
debugLog.info('Claiming FPC');
|
|
198
|
-
const receipt = await feeJuiceContract.methods.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex).send(
|
|
209
|
+
const receipt = await feeJuiceContract.methods.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex).send({
|
|
210
|
+
from: defaultAccountAddress
|
|
211
|
+
}).wait({
|
|
199
212
|
...waitOpts
|
|
200
213
|
});
|
|
201
214
|
await waitForProven(pxe, receipt, provenWaitOpts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PXE, type WaitForProvenOpts } from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress, type PXE, type WaitForProvenOpts } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getSponsoredFPCAddress(): Promise<
|
|
3
|
+
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
4
4
|
export declare function setupSponsoredFPC(pxe: PXE, log: LogFn, waitOpts?: import("@aztec/aztec.js").WaitOpts, waitForProvenOptions?: WaitForProvenOpts): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,KAAK,GAAG,EAGR,KAAK,iBAAiB,EAGvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,wBAAsB,sBAAsB,0BAM3C;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,KAAK,EACV,QAAQ,qCAAkB,EAC1B,oBAAoB,CAAC,EAAE,iBAAiB,iBAuBzC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod, getContractInstanceFromInstantiationParams, waitForProven } from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress, DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod, getContractInstanceFromInstantiationParams, waitForProven } from '@aztec/aztec.js';
|
|
2
2
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
3
|
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
4
4
|
async function getSponsoredFPCContract() {
|
|
@@ -21,6 +21,7 @@ export async function setupSponsoredFPC(pxe, log, waitOpts = DefaultWaitOpts, wa
|
|
|
21
21
|
const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
|
|
22
22
|
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
|
|
23
23
|
const deployTx = SponsoredFPCContract.deploy(deployer).send({
|
|
24
|
+
from: AztecAddress.ZERO,
|
|
24
25
|
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
25
26
|
universalDeploy: true,
|
|
26
27
|
fee: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250812",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
73
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
75
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
76
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
77
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
78
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
79
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
81
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
72
|
+
"@aztec/archiver": "1.0.0-nightly.20250812",
|
|
73
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250812",
|
|
74
|
+
"@aztec/constants": "1.0.0-nightly.20250812",
|
|
75
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250812",
|
|
76
|
+
"@aztec/ethereum": "1.0.0-nightly.20250812",
|
|
77
|
+
"@aztec/foundation": "1.0.0-nightly.20250812",
|
|
78
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250812",
|
|
79
|
+
"@aztec/p2p": "1.0.0-nightly.20250812",
|
|
80
|
+
"@aztec/stdlib": "1.0.0-nightly.20250812",
|
|
81
|
+
"@aztec/world-state": "1.0.0-nightly.20250812",
|
|
82
82
|
"@iarna/toml": "^2.2.5",
|
|
83
83
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
84
84
|
"commander": "^12.1.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"viem": "2.23.7"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
94
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
93
|
+
"@aztec/accounts": "1.0.0-nightly.20250812",
|
|
94
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250812",
|
|
95
95
|
"@jest/globals": "^30.0.0",
|
|
96
96
|
"@types/jest": "^30.0.0",
|
|
97
97
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -107,15 +107,15 @@
|
|
|
107
107
|
"typescript": "^5.3.3"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
111
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
112
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
113
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
114
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
115
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
116
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
117
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
118
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
110
|
+
"@aztec/accounts": "1.0.0-nightly.20250812",
|
|
111
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250812",
|
|
112
|
+
"@aztec/ethereum": "1.0.0-nightly.20250812",
|
|
113
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250812",
|
|
114
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250812",
|
|
115
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250812",
|
|
116
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250812",
|
|
117
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250812",
|
|
118
|
+
"@aztec/stdlib": "1.0.0-nightly.20250812"
|
|
119
119
|
},
|
|
120
120
|
"files": [
|
|
121
121
|
"dest",
|
|
@@ -60,6 +60,7 @@ export async function bootstrapNetwork(
|
|
|
60
60
|
await accountManager.register();
|
|
61
61
|
|
|
62
62
|
const wallet = await accountManager.getWallet();
|
|
63
|
+
const defaultAccountAddress = wallet.getAddress();
|
|
63
64
|
|
|
64
65
|
const l1Client = createExtendedL1Client(
|
|
65
66
|
l1Urls,
|
|
@@ -73,16 +74,16 @@ export async function bootstrapNetwork(
|
|
|
73
74
|
|
|
74
75
|
const { erc20Address, portalAddress } = await deployERC20(l1Client);
|
|
75
76
|
|
|
76
|
-
const { token, bridge } = await deployToken(wallet, portalAddress);
|
|
77
|
+
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
77
78
|
|
|
78
79
|
await initPortal(pxe, l1Client, erc20Address, portalAddress, bridge.address);
|
|
79
80
|
|
|
80
81
|
const fpcAdmin = wallet.getAddress();
|
|
81
|
-
const fpc = await deployFPC(wallet, token.address, fpcAdmin);
|
|
82
|
+
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
82
83
|
|
|
83
|
-
const counter = await deployCounter(wallet);
|
|
84
|
+
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
84
85
|
|
|
85
|
-
await fundFPC(pxe, counter.address, wallet, l1Client, fpc.address, debugLog);
|
|
86
|
+
await fundFPC(pxe, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
86
87
|
|
|
87
88
|
if (json) {
|
|
88
89
|
log(
|
|
@@ -168,6 +169,7 @@ async function deployERC20(l1Client: ExtendedViemWalletClient) {
|
|
|
168
169
|
*/
|
|
169
170
|
async function deployToken(
|
|
170
171
|
wallet: Wallet,
|
|
172
|
+
defaultAccountAddress: AztecAddress,
|
|
171
173
|
l1Portal: EthAddress,
|
|
172
174
|
): Promise<{ token: ContractDeploymentInfo; bridge: ContractDeploymentInfo }> {
|
|
173
175
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -176,18 +178,18 @@ async function deployToken(
|
|
|
176
178
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
177
179
|
// @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
|
|
178
180
|
const { TokenBridgeContract } = await import('@aztec/noir-contracts.js/TokenBridge');
|
|
179
|
-
const devCoin = await TokenContract.deploy(wallet,
|
|
180
|
-
.send({ universalDeploy: true })
|
|
181
|
+
const devCoin = await TokenContract.deploy(wallet, defaultAccountAddress, 'DevCoin', 'DEV', 18)
|
|
182
|
+
.send({ from: defaultAccountAddress, universalDeploy: true })
|
|
181
183
|
.deployed(waitOpts);
|
|
182
184
|
const bridge = await TokenBridgeContract.deploy(wallet, devCoin.address, l1Portal)
|
|
183
|
-
.send({ universalDeploy: true })
|
|
185
|
+
.send({ from: defaultAccountAddress, universalDeploy: true })
|
|
184
186
|
.deployed(waitOpts);
|
|
185
187
|
|
|
186
188
|
await new BatchCall(wallet, [
|
|
187
189
|
devCoin.methods.set_minter(bridge.address, true),
|
|
188
190
|
devCoin.methods.set_admin(bridge.address),
|
|
189
191
|
])
|
|
190
|
-
.send()
|
|
192
|
+
.send({ from: defaultAccountAddress })
|
|
191
193
|
.wait(waitOpts);
|
|
192
194
|
|
|
193
195
|
return {
|
|
@@ -232,13 +234,16 @@ async function initPortal(
|
|
|
232
234
|
|
|
233
235
|
async function deployFPC(
|
|
234
236
|
wallet: Wallet,
|
|
237
|
+
defaultAccountAddress: AztecAddress,
|
|
235
238
|
tokenAddress: AztecAddress,
|
|
236
239
|
admin: AztecAddress,
|
|
237
240
|
): Promise<ContractDeploymentInfo> {
|
|
238
241
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
239
242
|
// @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
|
|
240
243
|
const { FPCContract } = await import('@aztec/noir-contracts.js/FPC');
|
|
241
|
-
const fpc = await FPCContract.deploy(wallet, tokenAddress, admin)
|
|
244
|
+
const fpc = await FPCContract.deploy(wallet, tokenAddress, admin)
|
|
245
|
+
.send({ from: defaultAccountAddress, universalDeploy: true })
|
|
246
|
+
.deployed(waitOpts);
|
|
242
247
|
const info: ContractDeploymentInfo = {
|
|
243
248
|
address: fpc.address,
|
|
244
249
|
initHash: fpc.instance.initializationHash,
|
|
@@ -247,12 +252,12 @@ async function deployFPC(
|
|
|
247
252
|
return info;
|
|
248
253
|
}
|
|
249
254
|
|
|
250
|
-
async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
|
|
255
|
+
async function deployCounter(wallet: Wallet, defaultAccountAddress: AztecAddress): Promise<ContractDeploymentInfo> {
|
|
251
256
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
252
257
|
// @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
|
|
253
258
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
254
|
-
const counter = await CounterContract.deploy(wallet, 1,
|
|
255
|
-
.send({ universalDeploy: true })
|
|
259
|
+
const counter = await CounterContract.deploy(wallet, 1, defaultAccountAddress)
|
|
260
|
+
.send({ from: defaultAccountAddress, universalDeploy: true })
|
|
256
261
|
.deployed(waitOpts);
|
|
257
262
|
const info: ContractDeploymentInfo = {
|
|
258
263
|
address: counter.address,
|
|
@@ -267,6 +272,7 @@ async function fundFPC(
|
|
|
267
272
|
pxe: PXE,
|
|
268
273
|
counterAddress: AztecAddress,
|
|
269
274
|
wallet: Wallet,
|
|
275
|
+
defaultAccountAddress: AztecAddress,
|
|
270
276
|
l1Client: ExtendedViemWalletClient,
|
|
271
277
|
fpcAddress: AztecAddress,
|
|
272
278
|
debugLog: Logger,
|
|
@@ -299,14 +305,14 @@ async function fundFPC(
|
|
|
299
305
|
|
|
300
306
|
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
301
307
|
// advance the chain
|
|
302
|
-
await counter.methods.increment(wallet.getAddress()).send().wait(waitOpts);
|
|
303
|
-
await counter.methods.increment(wallet.getAddress()).send().wait(waitOpts);
|
|
308
|
+
await counter.methods.increment(wallet.getAddress()).send({ from: defaultAccountAddress }).wait(waitOpts);
|
|
309
|
+
await counter.methods.increment(wallet.getAddress()).send({ from: defaultAccountAddress }).wait(waitOpts);
|
|
304
310
|
|
|
305
311
|
debugLog.info('Claiming FPC');
|
|
306
312
|
|
|
307
313
|
const receipt = await feeJuiceContract.methods
|
|
308
314
|
.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex)
|
|
309
|
-
.send()
|
|
315
|
+
.send({ from: defaultAccountAddress })
|
|
310
316
|
.wait({ ...waitOpts });
|
|
311
317
|
|
|
312
318
|
await waitForProven(pxe, receipt, provenWaitOpts);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AztecAddress,
|
|
2
3
|
DefaultWaitOpts,
|
|
3
4
|
Fr,
|
|
4
5
|
type PXE,
|
|
@@ -41,6 +42,7 @@ export async function setupSponsoredFPC(
|
|
|
41
42
|
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
|
|
42
43
|
|
|
43
44
|
const deployTx = SponsoredFPCContract.deploy(deployer).send({
|
|
45
|
+
from: AztecAddress.ZERO,
|
|
44
46
|
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
45
47
|
universalDeploy: true,
|
|
46
48
|
fee: { paymentMethod },
|