Getting started with building on the Molten Network
eth_estimateGas
, which provides a value (gas limit) that should sufficiently cover the entire transaction fee at the specified L3 gas price.
Multiplying the value obtained from eth_estimateGas
by the L3 gas price will give you the total amount of MOLTEN required for the transaction to be successful. It’s important to note that, for a specific operation, the result of eth_estimateGas
value may vary over time due to fluctuations in the L2 calldata price.
Alternatively, to obtain the gas limit for your transaction, you can call NodeInterface.gasEstimateComponents()
and then use the first result, which is gasEstimate
. Next, to find the total cost, you need to multiply this amount by the L3 gas price, which is available in the third result, baseFee
.
Note that when working with L2 to L3 messages (also known as retryable tickets), you can use the function L2ToL3MessageGasEstimator.estimateAll()
of the Molten SDK or NodeInterface.estimateRetryableTicket()
to get all the gas information needed to send a successful transaction.