@aztec/ethereum 0.73.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2
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/chain.js +17 -18
- package/dest/client.js +5 -9
- package/dest/config.js +13 -14
- package/dest/constants.js +0 -1
- package/dest/contracts/empire_base.js +11 -0
- package/dest/contracts/forwarder.js +67 -32
- package/dest/contracts/governance.js +11 -6
- package/dest/contracts/governance_proposer.js +79 -37
- package/dest/contracts/index.js +2 -2
- package/dest/contracts/rollup.js +271 -234
- package/dest/contracts/slashing_proposer.js +32 -4
- package/dest/deploy_l1_contracts.js +203 -124
- package/dest/eth_cheat_codes.js +144 -127
- package/dest/index.js +0 -1
- package/dest/l1_contract_addresses.js +17 -19
- package/dest/l1_reader.js +6 -7
- package/dest/l1_tx_utils.js +229 -199
- package/dest/l1_tx_utils_with_blobs.js +25 -22
- package/dest/queries.js +6 -9
- package/dest/test/delayed_tx_utils.js +3 -3
- package/dest/test/eth_cheat_codes_with_state.js +10 -12
- package/dest/test/index.js +0 -1
- package/dest/test/start_anvil.js +17 -9
- package/dest/test/tx_delayer.js +77 -74
- package/dest/types.js +1 -2
- package/dest/utils.js +58 -38
- package/package.json +5 -4
- package/src/contracts/empire_base.ts +19 -0
- package/src/contracts/forwarder.ts +37 -14
- package/src/contracts/governance_proposer.ts +54 -4
- package/src/contracts/index.ts +2 -1
- package/src/contracts/rollup.ts +21 -9
- package/src/contracts/slashing_proposer.ts +29 -2
- package/src/deploy_l1_contracts.ts +6 -0
- package/src/l1_tx_utils.ts +9 -19
- package/src/l1_tx_utils_with_blobs.ts +1 -1
- package/src/utils.ts +29 -3
- package/dest/chain.d.ts +0 -25
- package/dest/chain.d.ts.map +0 -1
- package/dest/client.d.ts +0 -16
- package/dest/client.d.ts.map +0 -1
- package/dest/config.d.ts +0 -38
- package/dest/config.d.ts.map +0 -1
- package/dest/constants.d.ts +0 -4
- package/dest/constants.d.ts.map +0 -1
- package/dest/contracts/forwarder.d.ts +0 -23
- package/dest/contracts/forwarder.d.ts.map +0 -1
- package/dest/contracts/governance.d.ts +0 -14
- package/dest/contracts/governance.d.ts.map +0 -1
- package/dest/contracts/governance_proposer.d.ts +0 -13
- package/dest/contracts/governance_proposer.d.ts.map +0 -1
- package/dest/contracts/index.d.ts +0 -6
- package/dest/contracts/index.d.ts.map +0 -1
- package/dest/contracts/rollup.d.ts +0 -113
- package/dest/contracts/rollup.d.ts.map +0 -1
- package/dest/contracts/slashing_proposer.d.ts +0 -11
- package/dest/contracts/slashing_proposer.d.ts.map +0 -1
- package/dest/deploy_l1_contracts.d.ts +0 -19873
- package/dest/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/eth_cheat_codes.d.ts +0 -146
- package/dest/eth_cheat_codes.d.ts.map +0 -1
- package/dest/index.d.ts +0 -15
- package/dest/index.d.ts.map +0 -1
- package/dest/l1_contract_addresses.d.ts +0 -55
- package/dest/l1_contract_addresses.d.ts.map +0 -1
- package/dest/l1_reader.d.ts +0 -16
- package/dest/l1_reader.d.ts.map +0 -1
- package/dest/l1_tx_utils.d.ts +0 -193
- package/dest/l1_tx_utils.d.ts.map +0 -1
- package/dest/l1_tx_utils_with_blobs.d.ts +0 -12
- package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
- package/dest/queries.d.ts +0 -15
- package/dest/queries.d.ts.map +0 -1
- package/dest/test/delayed_tx_utils.d.ts +0 -8
- package/dest/test/delayed_tx_utils.d.ts.map +0 -1
- package/dest/test/eth_cheat_codes_with_state.d.ts +0 -18
- package/dest/test/eth_cheat_codes_with_state.d.ts.map +0 -1
- package/dest/test/index.d.ts +0 -5
- package/dest/test/index.d.ts.map +0 -1
- package/dest/test/start_anvil.d.ts +0 -9
- package/dest/test/start_anvil.d.ts.map +0 -1
- package/dest/test/tx_delayer.d.ts +0 -24
- package/dest/test/tx_delayer.d.ts.map +0 -1
- package/dest/types.d.ts +0 -12
- package/dest/types.d.ts.map +0 -1
- package/dest/utils.d.ts +0 -24
- package/dest/utils.d.ts.map +0 -1
package/src/l1_tx_utils.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { toHex } from '@aztec/foundation/bigint-buffer';
|
|
2
1
|
import { compactArray, times } from '@aztec/foundation/collection';
|
|
3
2
|
import {
|
|
4
3
|
type ConfigMappingsType,
|
|
@@ -23,7 +22,6 @@ import {
|
|
|
23
22
|
type HttpTransport,
|
|
24
23
|
MethodNotFoundRpcError,
|
|
25
24
|
MethodNotSupportedRpcError,
|
|
26
|
-
type PublicClient,
|
|
27
25
|
type StateOverride,
|
|
28
26
|
type TransactionReceipt,
|
|
29
27
|
type WalletClient,
|
|
@@ -32,6 +30,7 @@ import {
|
|
|
32
30
|
hexToBytes,
|
|
33
31
|
} from 'viem';
|
|
34
32
|
|
|
33
|
+
import { type L1Clients } from './deploy_l1_contracts.js';
|
|
35
34
|
import { formatViemError } from './utils.js';
|
|
36
35
|
|
|
37
36
|
// 1_000_000_000 Gwei = 1 ETH
|
|
@@ -207,7 +206,7 @@ export class L1TxUtils {
|
|
|
207
206
|
private interrupted = false;
|
|
208
207
|
|
|
209
208
|
constructor(
|
|
210
|
-
public publicClient:
|
|
209
|
+
public publicClient: L1Clients['publicClient'],
|
|
211
210
|
public walletClient: WalletClient<HttpTransport, Chain, Account>,
|
|
212
211
|
protected readonly logger?: Logger,
|
|
213
212
|
config?: Partial<L1TxUtilsConfig>,
|
|
@@ -658,32 +657,21 @@ export class L1TxUtils {
|
|
|
658
657
|
public async tryGetErrorFromRevertedTx(
|
|
659
658
|
data: Hex,
|
|
660
659
|
args: {
|
|
661
|
-
args: any[];
|
|
660
|
+
args: readonly any[];
|
|
662
661
|
functionName: string;
|
|
663
662
|
abi: Abi;
|
|
664
663
|
address: Hex;
|
|
665
664
|
},
|
|
666
|
-
blobInputs
|
|
665
|
+
blobInputs: (L1BlobInputs & { maxFeePerBlobGas: bigint }) | undefined,
|
|
666
|
+
stateOverride: StateOverride = [],
|
|
667
667
|
) {
|
|
668
668
|
try {
|
|
669
|
-
// NB: If this fn starts unexpectedly giving incorrect blob hash errors, it may be because the checkBlob
|
|
670
|
-
// bool is no longer at the slot below. To find the slot, run: forge inspect src/core/Rollup.sol:Rollup storage
|
|
671
|
-
const checkBlobSlot = 9n;
|
|
672
669
|
await this.publicClient.simulateContract({
|
|
673
670
|
...args,
|
|
674
671
|
account: this.walletClient.account,
|
|
675
|
-
stateOverride
|
|
676
|
-
{
|
|
677
|
-
address: args.address,
|
|
678
|
-
stateDiff: [
|
|
679
|
-
{
|
|
680
|
-
slot: toHex(checkBlobSlot, true),
|
|
681
|
-
value: toHex(0n, true),
|
|
682
|
-
},
|
|
683
|
-
],
|
|
684
|
-
},
|
|
685
|
-
],
|
|
672
|
+
stateOverride,
|
|
686
673
|
});
|
|
674
|
+
this.logger?.trace('Simulated blob tx', { blobInputs });
|
|
687
675
|
// If the above passes, we have a blob error. We cannot simulate blob txs, and failed txs no longer throw errors.
|
|
688
676
|
// Strangely, the only way to throw the revert reason as an error and provide blobs is prepareTransactionRequest.
|
|
689
677
|
// See: https://github.com/wevm/viem/issues/2075
|
|
@@ -702,7 +690,9 @@ export class L1TxUtils {
|
|
|
702
690
|
to: args.address,
|
|
703
691
|
data,
|
|
704
692
|
};
|
|
693
|
+
this.logger?.trace('Preparing tx', { request });
|
|
705
694
|
await this.walletClient.prepareTransactionRequest(request);
|
|
695
|
+
this.logger?.trace('Prepared tx');
|
|
706
696
|
return undefined;
|
|
707
697
|
} catch (simulationErr: any) {
|
|
708
698
|
// If we don't have a ContractFunctionExecutionError, we have a blob related error => use getContractError to get the error msg.
|
package/src/utils.ts
CHANGED
|
@@ -92,6 +92,30 @@ export function prettyLogViemErrorMsg(err: any) {
|
|
|
92
92
|
return err?.message ?? err;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
function getNestedErrorData(error: unknown): string | undefined {
|
|
96
|
+
// If nothing, bail
|
|
97
|
+
if (!error) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// If it's an object with a `data` property, return it
|
|
102
|
+
// (Remember to check TS type-safely or cast as needed)
|
|
103
|
+
if (typeof error === 'object' && error !== null && 'data' in error) {
|
|
104
|
+
const possibleData = (error as any).data;
|
|
105
|
+
if (typeof possibleData === 'string' && possibleData.startsWith('0x')) {
|
|
106
|
+
return possibleData;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// If it has a `cause`, recurse
|
|
111
|
+
if (typeof error === 'object' && error !== null && 'cause' in error) {
|
|
112
|
+
return getNestedErrorData((error as any).cause);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Not found
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
95
119
|
/**
|
|
96
120
|
* Formats a Viem error into a FormattedViemError instance.
|
|
97
121
|
* @param error - The error to format.
|
|
@@ -106,11 +130,12 @@ export function formatViemError(error: any, abi: Abi = ErrorsAbi): FormattedViem
|
|
|
106
130
|
|
|
107
131
|
// First try to decode as a custom error using the ABI
|
|
108
132
|
try {
|
|
109
|
-
|
|
133
|
+
const data = getNestedErrorData(error);
|
|
134
|
+
if (data) {
|
|
110
135
|
// Try to decode the error data using the ABI
|
|
111
136
|
const decoded = decodeErrorResult({
|
|
112
137
|
abi,
|
|
113
|
-
data:
|
|
138
|
+
data: data as Hex,
|
|
114
139
|
});
|
|
115
140
|
if (decoded) {
|
|
116
141
|
return new FormattedViemError(`${decoded.errorName}(${decoded.args?.join(', ') ?? ''})`, error?.metaMessages);
|
|
@@ -120,6 +145,7 @@ export function formatViemError(error: any, abi: Abi = ErrorsAbi): FormattedViem
|
|
|
120
145
|
// If it's a BaseError, try to get the custom error through ContractFunctionRevertedError
|
|
121
146
|
if (error instanceof BaseError) {
|
|
122
147
|
const revertError = error.walk(err => err instanceof ContractFunctionRevertedError);
|
|
148
|
+
|
|
123
149
|
if (revertError instanceof ContractFunctionRevertedError) {
|
|
124
150
|
let errorName = revertError.data?.errorName;
|
|
125
151
|
if (!errorName) {
|
|
@@ -138,7 +164,7 @@ export function formatViemError(error: any, abi: Abi = ErrorsAbi): FormattedViem
|
|
|
138
164
|
|
|
139
165
|
// If it's a regular Error instance, return it with its message
|
|
140
166
|
if (error instanceof Error) {
|
|
141
|
-
return
|
|
167
|
+
return error;
|
|
142
168
|
}
|
|
143
169
|
|
|
144
170
|
// Original formatting logic for non-custom errors
|
package/dest/chain.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type Chain } from 'viem';
|
|
2
|
-
/**
|
|
3
|
-
* Interface containing the connection and chain properties to interact with a blockchain.
|
|
4
|
-
*/
|
|
5
|
-
export interface EthereumChain {
|
|
6
|
-
/**
|
|
7
|
-
* An instance of the viem chain data.
|
|
8
|
-
*/
|
|
9
|
-
chainInfo: Chain;
|
|
10
|
-
/**
|
|
11
|
-
* The actual url to be used.
|
|
12
|
-
*/
|
|
13
|
-
rpcUrl: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Helper function to create an instance of Aztec Chain from an rpc url and api key.
|
|
17
|
-
* @param rpcUrl - The rpc url of the chain or a chain identifier (e.g. 'testnet')
|
|
18
|
-
* @param apiKey - An optional API key for the chain client.
|
|
19
|
-
*/
|
|
20
|
-
export declare function createEthereumChain(rpcUrl: string, _chainId: number | string): EthereumChain;
|
|
21
|
-
/**
|
|
22
|
-
* Helper function to determine if a chain id is an instance of Anvil
|
|
23
|
-
*/
|
|
24
|
-
export declare function isAnvilTestChain(_chainId: number | string): boolean;
|
|
25
|
-
//# sourceMappingURL=chain.d.ts.map
|
package/dest/chain.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAKlC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CA+B5F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CASnE"}
|
package/dest/client.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
-
import { type ViemPublicClient } from './types.js';
|
|
3
|
-
type Config = {
|
|
4
|
-
/** The RPC Url of the ethereum host. */
|
|
5
|
-
l1RpcUrl: string;
|
|
6
|
-
/** The chain ID of the ethereum host. */
|
|
7
|
-
l1ChainId: number;
|
|
8
|
-
/** The polling interval viem uses in ms */
|
|
9
|
-
viemPollingIntervalMS?: number;
|
|
10
|
-
};
|
|
11
|
-
/** Returns a viem public client given the L1 config. */
|
|
12
|
-
export declare function getPublicClient(config: Config): ViemPublicClient;
|
|
13
|
-
/** Returns a viem public client after waiting for the L1 RPC node to become available. */
|
|
14
|
-
export declare function waitForPublicClient(config: Config, logger?: Logger): Promise<ViemPublicClient>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dest/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,KAAK,MAAM,GAAG;IACZ,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAIF,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAOhE;AAED,0FAA0F;AAC1F,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAIpG"}
|
package/dest/config.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
-
export type L1ContractsConfig = {
|
|
3
|
-
/** How many seconds an L1 slot lasts. */
|
|
4
|
-
ethereumSlotDuration: number;
|
|
5
|
-
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
|
|
6
|
-
aztecSlotDuration: number;
|
|
7
|
-
/** How many L2 slots an epoch lasts. */
|
|
8
|
-
aztecEpochDuration: number;
|
|
9
|
-
/** The target validator committee size. */
|
|
10
|
-
aztecTargetCommitteeSize: number;
|
|
11
|
-
/** The number of L2 slots that we can wait for a proof of an epoch to be produced. */
|
|
12
|
-
aztecEpochProofClaimWindowInL2Slots: number;
|
|
13
|
-
/** The minimum stake for a validator. */
|
|
14
|
-
minimumStake: bigint;
|
|
15
|
-
/** The slashing quorum */
|
|
16
|
-
slashingQuorum: number;
|
|
17
|
-
/** The slashing round size */
|
|
18
|
-
slashingRoundSize: number;
|
|
19
|
-
/** Governance proposing quorum */
|
|
20
|
-
governanceProposerQuorum: number;
|
|
21
|
-
/** Governance proposing round size */
|
|
22
|
-
governanceProposerRoundSize: number;
|
|
23
|
-
};
|
|
24
|
-
export declare const DefaultL1ContractsConfig: {
|
|
25
|
-
ethereumSlotDuration: number;
|
|
26
|
-
aztecSlotDuration: number;
|
|
27
|
-
aztecEpochDuration: number;
|
|
28
|
-
aztecTargetCommitteeSize: number;
|
|
29
|
-
aztecEpochProofClaimWindowInL2Slots: number;
|
|
30
|
-
minimumStake: bigint;
|
|
31
|
-
slashingQuorum: number;
|
|
32
|
-
slashingRoundSize: number;
|
|
33
|
-
governanceProposerQuorum: number;
|
|
34
|
-
governanceProposerRoundSize: number;
|
|
35
|
-
};
|
|
36
|
-
export declare const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig>;
|
|
37
|
-
export declare function getL1ContractsConfigEnvVars(): L1ContractsConfig;
|
|
38
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dest/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yCAAyC;IACzC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wCAAwC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,wBAAwB,EAAE,MAAM,CAAC;IACjC,sFAAsF;IACtF,mCAAmC,EAAE,MAAM,CAAC;IAC5C,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,8BAA8B;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,wBAAwB,EAAE,MAAM,CAAC;IACjC,sCAAsC;IACtC,2BAA2B,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;CAWR,CAAC;AAE9B,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,iBAAiB,CAmD3E,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,iBAAiB,CAE/D"}
|
package/dest/constants.d.ts
DELETED
package/dest/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,eAAO,MAAM,QAAQ,EAAE,GAA+E,CAAC;AACvG,eAAO,MAAM,mBAAmB,SAAS,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
-
import { type Account, type Chain, type Hex, type HttpTransport, type PublicClient, type WalletClient } from 'viem';
|
|
3
|
-
import { type L1Clients } from '../deploy_l1_contracts.js';
|
|
4
|
-
import { type L1BlobInputs, type L1GasConfig, type L1TxRequest, type L1TxUtils } from '../l1_tx_utils.js';
|
|
5
|
-
export declare class ForwarderContract {
|
|
6
|
-
readonly client: L1Clients['publicClient'];
|
|
7
|
-
private readonly forwarder;
|
|
8
|
-
constructor(client: L1Clients['publicClient'], address: Hex);
|
|
9
|
-
static create(owner: Hex, walletClient: WalletClient<HttpTransport, Chain, Account>, publicClient: PublicClient<HttpTransport, Chain>, logger: Logger): Promise<ForwarderContract>;
|
|
10
|
-
getAddress(): `0x${string}`;
|
|
11
|
-
forward(requests: L1TxRequest[], l1TxUtils: L1TxUtils, gasConfig: L1GasConfig | undefined, blobConfig: L1BlobInputs | undefined): Promise<{
|
|
12
|
-
receipt: import("viem").TransactionReceipt;
|
|
13
|
-
gasPrice: import("../l1_tx_utils.js").GasPrice;
|
|
14
|
-
stats: import("../l1_tx_utils.js").TransactionStats | undefined;
|
|
15
|
-
errorMsg?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
receipt: import("viem").TransactionReceipt;
|
|
18
|
-
gasPrice: import("../l1_tx_utils.js").GasPrice;
|
|
19
|
-
errorMsg: string | undefined;
|
|
20
|
-
stats?: undefined;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=forwarder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forwarder.d.ts","sourceRoot":"","sources":["../../src/contracts/forwarder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EAGlB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE1G,qBAAa,iBAAiB;aAGA,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC;IAF7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiF;gBAE/E,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG;WAI9D,MAAM,CACjB,KAAK,EAAE,GAAG,EACV,YAAY,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,EACzD,YAAY,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,EAChD,MAAM,EAAE,MAAM;IAwBT,UAAU;IAIJ,OAAO,CAClB,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,UAAU,EAAE,YAAY,GAAG,SAAS;;;;;;;;;;;CAmDvC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { type Chain, type Hex, type HttpTransport, type PublicClient } from 'viem';
|
|
3
|
-
import { type L1ContractAddresses } from '../l1_contract_addresses.js';
|
|
4
|
-
import { GovernanceProposerContract } from './governance_proposer.js';
|
|
5
|
-
export type L1GovernanceContractAddresses = Pick<L1ContractAddresses, 'governanceAddress' | 'rollupAddress' | 'registryAddress' | 'governanceProposerAddress'>;
|
|
6
|
-
export declare class GovernanceContract {
|
|
7
|
-
readonly client: PublicClient<HttpTransport, Chain>;
|
|
8
|
-
private readonly governance;
|
|
9
|
-
constructor(client: PublicClient<HttpTransport, Chain>, address: Hex);
|
|
10
|
-
get address(): EthAddress;
|
|
11
|
-
getProposer(): Promise<GovernanceProposerContract>;
|
|
12
|
-
getGovernanceAddresses(): Promise<L1GovernanceContractAddresses>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=governance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"governance.d.ts","sourceRoot":"","sources":["../../src/contracts/governance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,mBAAmB,EACnB,mBAAmB,GAAG,eAAe,GAAG,iBAAiB,GAAG,2BAA2B,CACxF,CAAC;AAEF,qBAAa,kBAAkB;aAGD,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC;IAFtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkF;gBAEjF,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG;IAIpF,IAAW,OAAO,eAEjB;IAEY,WAAW;IAKX,sBAAsB,IAAI,OAAO,CAAC,6BAA6B,CAAC;CAa9E"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { type Chain, type Hex, type HttpTransport, type PublicClient } from 'viem';
|
|
3
|
-
export declare class GovernanceProposerContract {
|
|
4
|
-
readonly client: PublicClient<HttpTransport, Chain>;
|
|
5
|
-
private readonly proposer;
|
|
6
|
-
constructor(client: PublicClient<HttpTransport, Chain>, address: Hex);
|
|
7
|
-
get address(): EthAddress;
|
|
8
|
-
getRollupAddress(): Promise<EthAddress>;
|
|
9
|
-
getRegistryAddress(): Promise<EthAddress>;
|
|
10
|
-
getQuorumSize(): Promise<bigint>;
|
|
11
|
-
getRoundSize(): Promise<bigint>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=governance_proposer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"governance_proposer.d.ts","sourceRoot":"","sources":["../../src/contracts/governance_proposer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AAEd,qBAAa,0BAA0B;aAGT,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC;IAFtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0F;gBAEvF,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG;IAIpF,IAAW,OAAO,eAEjB;IAEY,gBAAgB;IAKhB,kBAAkB;IAIxB,aAAa;IAIb,YAAY;CAGpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
-
import type { ViemSignature } from '@aztec/foundation/eth-signature';
|
|
5
|
-
import { type Account, type Chain, type Hex, type HttpTransport, type PublicClient } from 'viem';
|
|
6
|
-
import { type DeployL1Contracts } from '../deploy_l1_contracts.js';
|
|
7
|
-
import { type L1ContractAddresses } from '../l1_contract_addresses.js';
|
|
8
|
-
import { type L1ReaderConfig } from '../l1_reader.js';
|
|
9
|
-
import { SlashingProposerContract } from './slashing_proposer.js';
|
|
10
|
-
export type L1RollupContractAddresses = Pick<L1ContractAddresses, 'rollupAddress' | 'inboxAddress' | 'outboxAddress' | 'feeJuicePortalAddress' | 'feeJuiceAddress' | 'stakingAssetAddress' | 'rewardDistributorAddress'>;
|
|
11
|
-
export type EpochProofQuoteViemArgs = {
|
|
12
|
-
epochToProve: bigint;
|
|
13
|
-
validUntilSlot: bigint;
|
|
14
|
-
bondAmount: bigint;
|
|
15
|
-
prover: `0x${string}`;
|
|
16
|
-
basisPointFee: number;
|
|
17
|
-
};
|
|
18
|
-
export declare class RollupContract {
|
|
19
|
-
readonly client: PublicClient<HttpTransport, Chain>;
|
|
20
|
-
private readonly rollup;
|
|
21
|
-
static getFromL1ContractsValues(deployL1ContractsValues: DeployL1Contracts): RollupContract;
|
|
22
|
-
static getFromConfig(config: L1ReaderConfig): RollupContract;
|
|
23
|
-
constructor(client: PublicClient<HttpTransport, Chain>, address: Hex);
|
|
24
|
-
get address(): `0x${string}`;
|
|
25
|
-
getSlashingProposer(): Promise<SlashingProposerContract>;
|
|
26
|
-
getL1StartBlock(): Promise<bigint>;
|
|
27
|
-
getL1GenesisTime(): Promise<bigint>;
|
|
28
|
-
getClaimDurationInL2Slots(): Promise<bigint>;
|
|
29
|
-
getEpochDuration(): Promise<bigint>;
|
|
30
|
-
getSlotDuration(): Promise<bigint>;
|
|
31
|
-
getTargetCommitteeSize(): Promise<bigint>;
|
|
32
|
-
getMinimumStake(): Promise<bigint>;
|
|
33
|
-
getSlashingProposerAddress(): Promise<EthAddress>;
|
|
34
|
-
getBlockNumber(): Promise<bigint>;
|
|
35
|
-
getProvenBlockNumber(): Promise<bigint>;
|
|
36
|
-
getSlotNumber(): Promise<bigint>;
|
|
37
|
-
getCommitteeAt(timestamp: bigint): Promise<readonly `0x${string}`[]>;
|
|
38
|
-
getSampleSeedAt(timestamp: bigint): Promise<bigint>;
|
|
39
|
-
getCurrentSampleSeed(): Promise<bigint>;
|
|
40
|
-
getCurrentEpochCommittee(): Promise<readonly `0x${string}`[]>;
|
|
41
|
-
getCurrentProposer(): Promise<`0x${string}`>;
|
|
42
|
-
getProposerAt(timestamp: bigint): Promise<`0x${string}`>;
|
|
43
|
-
getBlock(blockNumber: bigint): Promise<{
|
|
44
|
-
feeHeader: {
|
|
45
|
-
excessMana: bigint;
|
|
46
|
-
feeAssetPriceNumerator: bigint;
|
|
47
|
-
manaUsed: bigint;
|
|
48
|
-
provingCostPerManaNumerator: bigint;
|
|
49
|
-
congestionCost: bigint;
|
|
50
|
-
};
|
|
51
|
-
archive: `0x${string}`;
|
|
52
|
-
blockHash: `0x${string}`;
|
|
53
|
-
slotNumber: bigint;
|
|
54
|
-
}>;
|
|
55
|
-
getProofCommitmentEscrow(): Promise<`0x${string}`>;
|
|
56
|
-
getTips(): Promise<{
|
|
57
|
-
pendingBlockNumber: bigint;
|
|
58
|
-
provenBlockNumber: bigint;
|
|
59
|
-
}>;
|
|
60
|
-
getEpochNumber(blockNumber?: bigint): Promise<bigint>;
|
|
61
|
-
getRollupAddresses(): Promise<L1RollupContractAddresses>;
|
|
62
|
-
getEpochNumberForSlotNumber(slotNumber: bigint): Promise<bigint>;
|
|
63
|
-
getEpochProofPublicInputs(args: readonly [
|
|
64
|
-
bigint,
|
|
65
|
-
readonly [
|
|
66
|
-
`0x${string}`,
|
|
67
|
-
`0x${string}`,
|
|
68
|
-
`0x${string}`,
|
|
69
|
-
`0x${string}`,
|
|
70
|
-
`0x${string}`,
|
|
71
|
-
`0x${string}`,
|
|
72
|
-
`0x${string}`
|
|
73
|
-
],
|
|
74
|
-
readonly `0x${string}`[],
|
|
75
|
-
`0x${string}`,
|
|
76
|
-
`0x${string}`
|
|
77
|
-
]): Promise<readonly `0x${string}`[]>;
|
|
78
|
-
getProofClaim(): Promise<{
|
|
79
|
-
epochToProve: bigint;
|
|
80
|
-
basisPointFee: bigint;
|
|
81
|
-
bondAmount: bigint;
|
|
82
|
-
bondProvider: EthAddress;
|
|
83
|
-
proposerClaimant: EthAddress;
|
|
84
|
-
} | undefined>;
|
|
85
|
-
getClaimableEpoch(): Promise<bigint | undefined>;
|
|
86
|
-
getEpochToProve(): Promise<bigint | undefined>;
|
|
87
|
-
validateProofQuote(quote: {
|
|
88
|
-
quote: EpochProofQuoteViemArgs;
|
|
89
|
-
signature: ViemSignature;
|
|
90
|
-
}, account: `0x${string}` | Account, slotDuration: bigint | number): Promise<void>;
|
|
91
|
-
validateHeader(args: readonly [
|
|
92
|
-
`0x${string}`,
|
|
93
|
-
ViemSignature[],
|
|
94
|
-
`0x${string}`,
|
|
95
|
-
bigint,
|
|
96
|
-
`0x${string}`,
|
|
97
|
-
{
|
|
98
|
-
ignoreDA: boolean;
|
|
99
|
-
ignoreSignatures: boolean;
|
|
100
|
-
}
|
|
101
|
-
], account: `0x${string}` | Account): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* @notice Calls `canProposeAtTime` with the time of the next Ethereum block and the sender address
|
|
104
|
-
*
|
|
105
|
-
* @dev Throws if unable to propose
|
|
106
|
-
*
|
|
107
|
-
* @param archive - The archive that we expect to be current state
|
|
108
|
-
* @return [slot, blockNumber] - If you can propose, the L2 slot number and L2 block number of the next Ethereum block,
|
|
109
|
-
* @throws otherwise
|
|
110
|
-
*/
|
|
111
|
-
canProposeAtNextEthBlock(archive: Buffer, account: `0x${string}` | Account, slotDuration: bigint | number): Promise<[bigint, bigint]>;
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=rollup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/contracts/rollup.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { type Chain, type Hex, type HttpTransport, type PublicClient } from 'viem';
|
|
3
|
-
export declare class SlashingProposerContract {
|
|
4
|
-
readonly client: PublicClient<HttpTransport, Chain>;
|
|
5
|
-
private readonly proposer;
|
|
6
|
-
constructor(client: PublicClient<HttpTransport, Chain>, address: Hex);
|
|
7
|
-
get address(): EthAddress;
|
|
8
|
-
getQuorumSize(): Promise<bigint>;
|
|
9
|
-
getRoundSize(): Promise<bigint>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=slashing_proposer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slashing_proposer.d.ts","sourceRoot":"","sources":["../../src/contracts/slashing_proposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AAEd,qBAAa,wBAAwB;aAGP,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC;IAFtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwF;gBAErF,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG;IAIpF,IAAW,OAAO,eAEjB;IAEM,aAAa;IAIb,YAAY;CAGpB"}
|