-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: read fee params from diamond proxy storage
- Loading branch information
Showing
6 changed files
with
128 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//See: https://github.com/matter-labs/era-contracts/blob/8a70bbbc48125f5bde6189b4e3c6a3ee79631678/l1-contracts/contracts/state-transition/chain-deps/ZkSyncHyperchainStorage.sol#L52 | ||
export type FeeParams = { | ||
pubdataPricingMode: number; | ||
batchOverheadL1Gas: number; | ||
maxPubdataPerBatch: number; | ||
maxL2GasPerBatch: number; | ||
priorityTxMaxPubdata: number; | ||
minimalL2GasPrice?: bigint; | ||
}; | ||
|
||
// Define the lengths for each field (in hex digits, each byte is 2 hex digits) | ||
export const feeParamsFieldLengths = { | ||
pubdataPricingMode: 2, // uint8 -> 1 byte -> 2 hex digits | ||
batchOverheadL1Gas: 8, // uint32 -> 4 bytes -> 8 hex digits | ||
maxPubdataPerBatch: 8, // uint32 -> 4 bytes -> 8 hex digits | ||
maxL2GasPerBatch: 8, // uint32 -> 4 bytes -> 8 hex digits | ||
priorityTxMaxPubdata: 8, // uint32 -> 4 bytes -> 8 hex digits | ||
minimalL2GasPrice: 16, // uint64 -> 8 bytes -> 16 hex digits | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./gasInfo.type"; | ||
export * from "./tvl.type"; | ||
export * from "./feeParams.type"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters