@aztec/ethereum 0.82.3 → 0.83.0
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/account.d.ts +2 -0
- package/dest/account.d.ts.map +1 -0
- package/dest/account.js +4 -0
- package/dest/cli/forwarder_address.d.ts +2 -0
- package/dest/cli/forwarder_address.d.ts.map +1 -0
- package/dest/cli/forwarder_address.js +10 -0
- package/dest/config.d.ts +8 -0
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +17 -2
- package/dest/contracts/forwarder.d.ts +1 -0
- package/dest/contracts/forwarder.d.ts.map +1 -1
- package/dest/contracts/forwarder.js +7 -1
- package/dest/contracts/registry.d.ts +2 -0
- package/dest/contracts/registry.d.ts.map +1 -1
- package/dest/contracts/registry.js +19 -12
- package/dest/contracts/rollup.d.ts +3 -1
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +12 -3
- package/dest/deploy_l1_contracts.d.ts +2356 -564
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +248 -195
- package/dest/index.d.ts +1 -0
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/l1_contract_addresses.d.ts +4 -0
- package/dest/l1_contract_addresses.d.ts.map +1 -1
- package/dest/l1_contract_addresses.js +7 -1
- package/dest/queries.d.ts +1 -0
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +5 -3
- package/dest/test/start_anvil.d.ts +1 -0
- package/dest/test/start_anvil.d.ts.map +1 -1
- package/dest/test/start_anvil.js +3 -5
- package/dest/test/upgrade_utils.d.ts +1 -0
- package/dest/test/upgrade_utils.d.ts.map +1 -1
- package/dest/test/upgrade_utils.js +9 -2
- package/package.json +6 -5
- package/src/account.ts +5 -0
- package/src/cli/forwarder_address.ts +12 -0
- package/src/config.ts +26 -1
- package/src/contracts/forwarder.ts +6 -1
- package/src/contracts/registry.ts +19 -10
- package/src/contracts/rollup.ts +13 -4
- package/src/deploy_l1_contracts.ts +298 -214
- package/src/index.ts +1 -0
- package/src/l1_contract_addresses.ts +11 -1
- package/src/queries.ts +10 -1
- package/src/test/start_anvil.ts +4 -2
- package/src/test/upgrade_utils.ts +12 -3
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export type L1ContractAddresses = {
|
|
|
13
13
|
} & {
|
|
14
14
|
slashFactoryAddress?: EthAddress | undefined;
|
|
15
15
|
feeAssetHandlerAddress?: EthAddress | undefined;
|
|
16
|
+
stakingAssetHandlerAddress?: EthAddress | undefined;
|
|
16
17
|
};
|
|
17
18
|
export declare const L1ContractAddressesSchema: z.ZodObject<{
|
|
18
19
|
rollupAddress: z.ZodType<EthAddress, any, string>;
|
|
@@ -28,6 +29,7 @@ export declare const L1ContractAddressesSchema: z.ZodObject<{
|
|
|
28
29
|
governanceAddress: z.ZodType<EthAddress, any, string>;
|
|
29
30
|
slashFactoryAddress: z.ZodOptional<z.ZodType<EthAddress, any, string>>;
|
|
30
31
|
feeAssetHandlerAddress: z.ZodOptional<z.ZodType<EthAddress, any, string>>;
|
|
32
|
+
stakingAssetHandlerAddress: z.ZodOptional<z.ZodType<EthAddress, any, string>>;
|
|
31
33
|
}, "strip", z.ZodTypeAny, {
|
|
32
34
|
rollupAddress: EthAddress;
|
|
33
35
|
registryAddress: EthAddress;
|
|
@@ -42,6 +44,7 @@ export declare const L1ContractAddressesSchema: z.ZodObject<{
|
|
|
42
44
|
stakingAssetAddress: EthAddress;
|
|
43
45
|
slashFactoryAddress?: EthAddress | undefined;
|
|
44
46
|
feeAssetHandlerAddress?: EthAddress | undefined;
|
|
47
|
+
stakingAssetHandlerAddress?: EthAddress | undefined;
|
|
45
48
|
}, {
|
|
46
49
|
rollupAddress: string;
|
|
47
50
|
registryAddress: string;
|
|
@@ -56,6 +59,7 @@ export declare const L1ContractAddressesSchema: z.ZodObject<{
|
|
|
56
59
|
stakingAssetAddress: string;
|
|
57
60
|
slashFactoryAddress?: string | undefined;
|
|
58
61
|
feeAssetHandlerAddress?: string | undefined;
|
|
62
|
+
stakingAssetHandlerAddress?: string | undefined;
|
|
59
63
|
}>;
|
|
60
64
|
export declare const l1ContractAddressesMapping: ConfigMappingsType<L1ContractAddresses>;
|
|
61
65
|
//# sourceMappingURL=l1_contract_addresses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1_contract_addresses.d.ts","sourceRoot":"","sources":["../src/l1_contract_addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sPAYnB,CAAC;AAEX,8DAA8D;AAC9D,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU;CACrD,GAAG;
|
|
1
|
+
{"version":3,"file":"l1_contract_addresses.d.ts","sourceRoot":"","sources":["../src/l1_contract_addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sPAYnB,CAAC;AAEX,8DAA8D;AAC9D,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU;CACrD,GAAG;IACF,mBAAmB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7C,sBAAsB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChD,0BAA0B,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeE,CAAC;AAIzC,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CAAC,mBAAmB,CAuE9E,CAAC"}
|
|
@@ -31,7 +31,8 @@ export const L1ContractAddressesSchema = z.object({
|
|
|
31
31
|
governanceProposerAddress: schemas.EthAddress,
|
|
32
32
|
governanceAddress: schemas.EthAddress,
|
|
33
33
|
slashFactoryAddress: schemas.EthAddress.optional(),
|
|
34
|
-
feeAssetHandlerAddress: schemas.EthAddress.optional()
|
|
34
|
+
feeAssetHandlerAddress: schemas.EthAddress.optional(),
|
|
35
|
+
stakingAssetHandlerAddress: schemas.EthAddress.optional()
|
|
35
36
|
});
|
|
36
37
|
const parseEnv = (val)=>EthAddress.fromString(val);
|
|
37
38
|
export const l1ContractAddressesMapping = {
|
|
@@ -99,5 +100,10 @@ export const l1ContractAddressesMapping = {
|
|
|
99
100
|
env: 'FEE_ASSET_HANDLER_CONTRACT_ADDRESS',
|
|
100
101
|
description: 'The deployed L1 feeAssetHandler contract address',
|
|
101
102
|
parseEnv
|
|
103
|
+
},
|
|
104
|
+
stakingAssetHandlerAddress: {
|
|
105
|
+
env: 'STAKING_ASSET_HANDLER_CONTRACT_ADDRESS',
|
|
106
|
+
description: 'The deployed L1 stakingAssetHandler contract address',
|
|
107
|
+
parseEnv
|
|
102
108
|
}
|
|
103
109
|
};
|
package/dest/queries.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare function getL1ContractsConfig(publicClient: ViemPublicClient, add
|
|
|
9
9
|
}): Promise<Omit<L1ContractsConfig, 'ethereumSlotDuration'> & {
|
|
10
10
|
l1StartBlock: bigint;
|
|
11
11
|
l1GenesisTime: bigint;
|
|
12
|
+
rollupVersion: number;
|
|
12
13
|
}>;
|
|
13
14
|
export type L2BlockProposedEvent = {
|
|
14
15
|
versionedBlobHashes: readonly Hex[];
|
package/dest/queries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,qDAAqD;AACrD,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE;IAAE,iBAAiB,EAAE,UAAU,CAAC;IAAC,aAAa,CAAC,EAAE,UAAU,CAAA;CAAE,GACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,qDAAqD;AACrD,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE;IAAE,iBAAiB,EAAE,UAAU,CAAC;IAAC,aAAa,CAAC,EAAE,UAAU,CAAA;CAAE,GACvE,OAAO,CACR,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,GAAG;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CACF,CAwDA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,SAAS,GAAG,EAAE,CAAC;IACpC,OAAO,EAAE,GAAG,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,GAAG,EACZ,aAAa,CAAC,EAAE,UAAU,GACzB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAUjC"}
|
package/dest/queries.js
CHANGED
|
@@ -9,7 +9,7 @@ import { RollupContract } from './contracts/rollup.js';
|
|
|
9
9
|
const rollupAddress = addresses.rollupAddress ?? await governanceProposer.getRollupAddress();
|
|
10
10
|
const rollup = new RollupContract(publicClient, rollupAddress.toString());
|
|
11
11
|
const slasherProposer = await rollup.getSlashingProposer();
|
|
12
|
-
const [l1StartBlock, l1GenesisTime, aztecEpochDuration, aztecProofSubmissionWindow, aztecSlotDuration, aztecTargetCommitteeSize, minimumStake, governanceProposerQuorum, governanceProposerRoundSize, slashingQuorum, slashingRoundSize, manaTarget, provingCostPerMana] = await Promise.all([
|
|
12
|
+
const [l1StartBlock, l1GenesisTime, aztecEpochDuration, aztecProofSubmissionWindow, aztecSlotDuration, aztecTargetCommitteeSize, minimumStake, governanceProposerQuorum, governanceProposerRoundSize, slashingQuorum, slashingRoundSize, manaTarget, provingCostPerMana, rollupVersion] = await Promise.all([
|
|
13
13
|
rollup.getL1StartBlock(),
|
|
14
14
|
rollup.getL1GenesisTime(),
|
|
15
15
|
rollup.getEpochDuration(),
|
|
@@ -22,7 +22,8 @@ import { RollupContract } from './contracts/rollup.js';
|
|
|
22
22
|
slasherProposer.getQuorumSize(),
|
|
23
23
|
slasherProposer.getRoundSize(),
|
|
24
24
|
rollup.getManaTarget(),
|
|
25
|
-
rollup.getProvingCostPerMana()
|
|
25
|
+
rollup.getProvingCostPerMana(),
|
|
26
|
+
rollup.getVersion()
|
|
26
27
|
]);
|
|
27
28
|
return {
|
|
28
29
|
l1StartBlock,
|
|
@@ -37,7 +38,8 @@ import { RollupContract } from './contracts/rollup.js';
|
|
|
37
38
|
slashingQuorum: Number(slashingQuorum),
|
|
38
39
|
slashingRoundSize: Number(slashingRoundSize),
|
|
39
40
|
manaTarget: manaTarget,
|
|
40
|
-
provingCostPerMana: provingCostPerMana
|
|
41
|
+
provingCostPerMana: provingCostPerMana,
|
|
42
|
+
rollupVersion: Number(rollupVersion)
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
export async function getL2BlockProposalEvents(client, blockId, rollupAddress) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_anvil.d.ts","sourceRoot":"","sources":["../../src/test/start_anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,aAAa,CAAC;AAGtD;;GAEG;AACH,wBAAsB,UAAU,CAC9B,IAAI,GAAE;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"start_anvil.d.ts","sourceRoot":"","sources":["../../src/test/start_anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,aAAa,CAAC;AAGtD;;GAEG;AACH,wBAAsB,UAAU,CAC9B,IAAI,GAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAuCtE"}
|
package/dest/test/start_anvil.js
CHANGED
|
@@ -12,7 +12,8 @@ import { dirname, resolve } from 'path';
|
|
|
12
12
|
const anvil = await retry(async ()=>{
|
|
13
13
|
const anvil = createAnvil({
|
|
14
14
|
anvilBinary,
|
|
15
|
-
|
|
15
|
+
host: '127.0.0.1',
|
|
16
|
+
port: opts.port ?? 8545,
|
|
16
17
|
blockTime: opts.l1BlockTime,
|
|
17
18
|
stopTimeout: 1000
|
|
18
19
|
});
|
|
@@ -34,10 +35,7 @@ import { dirname, resolve } from 'path';
|
|
|
34
35
|
throw new Error('Failed to start anvil');
|
|
35
36
|
}
|
|
36
37
|
// Monkeypatch the anvil instance to include the actually assigned port
|
|
37
|
-
Object.defineProperty(anvil, 'port', {
|
|
38
|
-
value: port,
|
|
39
|
-
writable: false
|
|
40
|
-
});
|
|
38
|
+
// Object.defineProperty(anvil, 'port', { value: port, writable: false });
|
|
41
39
|
return {
|
|
42
40
|
anvil,
|
|
43
41
|
stop: ()=>anvil.stop(),
|
|
@@ -7,5 +7,6 @@ export declare function executeGovernanceProposal(proposalId: bigint, governance
|
|
|
7
7
|
export declare function createGovernanceProposal(payloadAddress: `0x${string}`, addresses: L1ContractAddresses, privateKey: PrivateKeyAccount, publicClient: L1Clients['publicClient'], logger: Logger): Promise<{
|
|
8
8
|
governance: GetContractReturnType<typeof GovernanceAbi, L1Clients['publicClient']>;
|
|
9
9
|
voteAmount: bigint;
|
|
10
|
+
proposalId: bigint;
|
|
10
11
|
}>;
|
|
11
12
|
//# sourceMappingURL=upgrade_utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade_utils.d.ts","sourceRoot":"","sources":["../../src/test/upgrade_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade_utils.d.ts","sourceRoot":"","sources":["../../src/test/upgrade_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAe,MAAM,MAAM,CAAC;AAIvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,qBAAqB,CAAC,OAAO,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC,EAClF,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,MAAM,iBAmCf;AAED,wBAAsB,wBAAwB,CAC5C,cAAc,EAAE,KAAK,MAAM,EAAE,EAC7B,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IACT,UAAU,EAAE,qBAAqB,CAAC,OAAO,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAyCD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi';
|
|
2
2
|
import { TestERC20Abi as StakingAssetAbi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
3
3
|
import { getContract } from 'viem';
|
|
4
|
+
import { extractProposalIdFromLogs } from '../contracts/governance.js';
|
|
4
5
|
import { EthCheatCodes } from '../eth_cheat_codes.js';
|
|
5
6
|
import { L1TxUtils } from '../l1_tx_utils.js';
|
|
6
7
|
export async function executeGovernanceProposal(proposalId, governance, voteAmount, privateKey, publicClient, walletClient, rpcUrls, logger) {
|
|
@@ -90,14 +91,20 @@ export async function createGovernanceProposal(payloadAddress, addresses, privat
|
|
|
90
91
|
hash: depositTx
|
|
91
92
|
});
|
|
92
93
|
logger.info(`Deposited tokens`);
|
|
93
|
-
await governance.write.proposeWithLock([
|
|
94
|
+
const proposeTx = await governance.write.proposeWithLock([
|
|
94
95
|
payloadAddress,
|
|
95
96
|
privateKey.address
|
|
96
97
|
], {
|
|
97
98
|
account: privateKey
|
|
98
99
|
});
|
|
100
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
101
|
+
hash: proposeTx
|
|
102
|
+
});
|
|
103
|
+
logger.info(`Proposed upgrade`);
|
|
104
|
+
const proposalId = extractProposalIdFromLogs(receipt.logs);
|
|
99
105
|
return {
|
|
100
106
|
governance,
|
|
101
|
-
voteAmount
|
|
107
|
+
voteAmount,
|
|
108
|
+
proposalId
|
|
102
109
|
};
|
|
103
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/ethereum",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
28
28
|
"start:dev": "tsc-watch -p tsconfig.json --onSuccess 'yarn start'",
|
|
29
29
|
"start": "node ./dest/index.js",
|
|
30
|
-
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
30
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
31
|
+
"proposer-address": "node ./dest/cli/forwarder_address.js"
|
|
31
32
|
},
|
|
32
33
|
"inherits": [
|
|
33
34
|
"../package.common.json"
|
|
34
35
|
],
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@aztec/blob-lib": "0.
|
|
37
|
-
"@aztec/foundation": "0.
|
|
38
|
-
"@aztec/l1-artifacts": "0.
|
|
37
|
+
"@aztec/blob-lib": "0.83.0",
|
|
38
|
+
"@aztec/foundation": "0.83.0",
|
|
39
|
+
"@aztec/l1-artifacts": "0.83.0",
|
|
39
40
|
"@viem/anvil": "^0.0.10",
|
|
40
41
|
"dotenv": "^16.0.3",
|
|
41
42
|
"tslib": "^2.4.0",
|
package/src/account.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwarderContract } from '../contracts/index.js';
|
|
2
|
+
|
|
3
|
+
const ownerAddress = process.argv[2];
|
|
4
|
+
if (!ownerAddress) {
|
|
5
|
+
process.stderr.write('Please provide an owner address as an argument\n');
|
|
6
|
+
process.exit(1);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Ensure the address starts with 0x
|
|
10
|
+
const formattedAddress = ownerAddress.startsWith('0x') ? ownerAddress : `0x${ownerAddress}`;
|
|
11
|
+
const address = ForwarderContract.expectedAddress(formattedAddress as `0x${string}`);
|
|
12
|
+
process.stdout.write(`${address}\n`);
|
package/src/config.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ConfigMappingsType,
|
|
3
3
|
bigintConfigHelper,
|
|
4
|
+
booleanConfigHelper,
|
|
4
5
|
getConfigFromMappings,
|
|
5
6
|
numberConfigHelper,
|
|
6
7
|
} from '@aztec/foundation/config';
|
|
7
8
|
|
|
8
9
|
import { type L1TxUtilsConfig, l1TxUtilsConfigMappings } from './l1_tx_utils.js';
|
|
9
10
|
|
|
11
|
+
export type GenesisStateConfig = {
|
|
12
|
+
/** Whether to populate the genesis state with initial fee juice for the test accounts */
|
|
13
|
+
testAccounts: boolean;
|
|
14
|
+
/** Whether to populate the genesis state with initial fee juice for the sponsored FPC */
|
|
15
|
+
sponsoredFPC: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
10
18
|
export type L1ContractsConfig = {
|
|
11
19
|
/** How many seconds an L1 slot lasts. */
|
|
12
20
|
ethereumSlotDuration: number;
|
|
@@ -45,7 +53,7 @@ export const DefaultL1ContractsConfig = {
|
|
|
45
53
|
slashingRoundSize: 10,
|
|
46
54
|
governanceProposerQuorum: 6,
|
|
47
55
|
governanceProposerRoundSize: 10,
|
|
48
|
-
manaTarget: BigInt(
|
|
56
|
+
manaTarget: BigInt(1e10),
|
|
49
57
|
provingCostPerMana: BigInt(100),
|
|
50
58
|
} satisfies L1ContractsConfig;
|
|
51
59
|
|
|
@@ -114,6 +122,23 @@ export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> =
|
|
|
114
122
|
...l1TxUtilsConfigMappings,
|
|
115
123
|
};
|
|
116
124
|
|
|
125
|
+
export const genesisStateConfigMappings: ConfigMappingsType<GenesisStateConfig> = {
|
|
126
|
+
testAccounts: {
|
|
127
|
+
env: 'TEST_ACCOUNTS',
|
|
128
|
+
description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
|
|
129
|
+
...booleanConfigHelper(false),
|
|
130
|
+
},
|
|
131
|
+
sponsoredFPC: {
|
|
132
|
+
env: 'SPONSORED_FPC',
|
|
133
|
+
description: 'Whether to populate the genesis state with initial fee juice for the sponsored FPC.',
|
|
134
|
+
...booleanConfigHelper(false),
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
117
138
|
export function getL1ContractsConfigEnvVars(): L1ContractsConfig {
|
|
118
139
|
return getConfigFromMappings(l1ContractsConfigMappings);
|
|
119
140
|
}
|
|
141
|
+
|
|
142
|
+
export function getGenesisStateConfigEnvVars(): GenesisStateConfig {
|
|
143
|
+
return getConfigFromMappings(genesisStateConfigMappings);
|
|
144
|
+
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getContract,
|
|
12
12
|
} from 'viem';
|
|
13
13
|
|
|
14
|
-
import { deployL1Contract } from '../deploy_l1_contracts.js';
|
|
14
|
+
import { deployL1Contract, getExpectedAddress } from '../deploy_l1_contracts.js';
|
|
15
15
|
import type { L1BlobInputs, L1GasConfig, L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
|
|
16
16
|
import type { L1Clients, ViemPublicClient, ViemWalletClient } from '../types.js';
|
|
17
17
|
import { RollupContract } from './rollup.js';
|
|
@@ -23,6 +23,11 @@ export class ForwarderContract {
|
|
|
23
23
|
this.forwarder = getContract({ address, abi: ForwarderAbi, client });
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
static expectedAddress(owner: Hex) {
|
|
27
|
+
const { address } = getExpectedAddress(ForwarderAbi, ForwarderBytecode, [owner], owner);
|
|
28
|
+
return address;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
static async create(
|
|
27
32
|
owner: Hex,
|
|
28
33
|
walletClient: ViemWalletClient,
|
|
@@ -42,12 +42,11 @@ export class RegistryContract {
|
|
|
42
42
|
version = BigInt(version);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
try {
|
|
46
|
+
return EthAddress.fromString(await this.registry.read.getRollup([version]));
|
|
47
|
+
} catch (e) {
|
|
48
48
|
throw new Error('Rollup address is undefined');
|
|
49
49
|
}
|
|
50
|
-
return address;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
/**
|
|
@@ -55,12 +54,7 @@ export class RegistryContract {
|
|
|
55
54
|
* @returns The canonical address of the rollup. If the rollup is not set, throws an error.
|
|
56
55
|
*/
|
|
57
56
|
public async getCanonicalAddress(): Promise<EthAddress> {
|
|
58
|
-
|
|
59
|
-
const address = EthAddress.fromString(snapshot.rollup);
|
|
60
|
-
if (address.equals(EthAddress.ZERO)) {
|
|
61
|
-
throw new Error('Rollup address is undefined');
|
|
62
|
-
}
|
|
63
|
-
return address;
|
|
57
|
+
return EthAddress.fromString(await this.registry.read.getCanonicalRollup());
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
public async getGovernanceAddresses(): Promise<
|
|
@@ -108,4 +102,19 @@ export class RegistryContract {
|
|
|
108
102
|
const version = await this.registry.read.numberOfVersions();
|
|
109
103
|
return Number(version);
|
|
110
104
|
}
|
|
105
|
+
|
|
106
|
+
public async getRollupVersions(): Promise<bigint[]> {
|
|
107
|
+
const count = await this.getNumberOfVersions();
|
|
108
|
+
|
|
109
|
+
const versions: bigint[] = [];
|
|
110
|
+
for (let i = 0; i < count; i++) {
|
|
111
|
+
versions.push(await this.registry.read.getVersion([BigInt(i)]));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return versions;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public async getRewardDistributor(): Promise<EthAddress> {
|
|
118
|
+
return EthAddress.fromString(await this.registry.read.getRewardDistributor());
|
|
119
|
+
}
|
|
111
120
|
}
|
package/src/contracts/rollup.ts
CHANGED
|
@@ -140,6 +140,11 @@ export class RollupContract {
|
|
|
140
140
|
return this.rollup.read.getManaLimit();
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
@memoize
|
|
144
|
+
getVersion() {
|
|
145
|
+
return this.rollup.read.getVersion();
|
|
146
|
+
}
|
|
147
|
+
|
|
143
148
|
getSlasher() {
|
|
144
149
|
return this.rollup.read.getSlasher();
|
|
145
150
|
}
|
|
@@ -185,6 +190,10 @@ export class RollupContract {
|
|
|
185
190
|
return this.rollup.read.getCurrentSampleSeed();
|
|
186
191
|
}
|
|
187
192
|
|
|
193
|
+
getCurrentEpoch() {
|
|
194
|
+
return this.rollup.read.getCurrentEpoch();
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
async getCurrentEpochCommittee() {
|
|
189
198
|
const { result } = await this.client.simulateContract({
|
|
190
199
|
address: this.address,
|
|
@@ -276,6 +285,10 @@ export class RollupContract {
|
|
|
276
285
|
};
|
|
277
286
|
}
|
|
278
287
|
|
|
288
|
+
public async getFeeJuicePortal() {
|
|
289
|
+
return EthAddress.fromString(await this.rollup.read.getFeeAssetPortal());
|
|
290
|
+
}
|
|
291
|
+
|
|
279
292
|
public async getEpochNumberForSlotNumber(slotNumber: bigint): Promise<bigint> {
|
|
280
293
|
return await this.rollup.read.getEpochAtSlot([slotNumber]);
|
|
281
294
|
}
|
|
@@ -360,10 +373,6 @@ export class RollupContract {
|
|
|
360
373
|
return this.rollup.read.getManaBaseFeeAt([timestamp, inFeeAsset]);
|
|
361
374
|
}
|
|
362
375
|
|
|
363
|
-
getVersion() {
|
|
364
|
-
return this.rollup.read.getVersion();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
376
|
getSlotAt(timestamp: bigint) {
|
|
368
377
|
return this.rollup.read.getSlotAt([timestamp]);
|
|
369
378
|
}
|