IL2GasCalculator
The IL2GasCalculator interface provides functions to calculate gas costs specific to Layer 2 (L2) solutions with different fee structures compared to the Ethereum mainnet.
Functions
getCalldataCost
function getCalldataCost(uint256 length) external view returns (uint256 calldataCostETH);
Calculates the cost of calldata in Ether on an L2 with a different fee structure than mainnet.
Parameters
Name | Type | Description |
---|---|---|
length | uint256 | The length of the calldata. |
Return Value
Type | Description |
---|---|
uint256 | The cost of the calldata in Ether. |
initialGasUsed
function initialGasUsed(uint256 calldataLength) external view returns (uint256 gasUsed);
Calculates the initial gas used for a transaction with a different calldata fee structure than mainnet.
Parameters
Name | Type | Description |
---|---|---|
calldataLength | uint256 | The length of the calldata. |
Return Value
Type | Description |
---|---|
uint256 | The initial gas used for the transaction. |