The result of estimating the gas cost of a transaction.

interface EstimateGasResult {
    reverted: boolean;
    revertReasons: (string | bigint)[];
    totalGas: number;
    vmErrors: string[];
}

Properties

reverted: boolean

Boolean indicating whether the transaction reverted or not.

revertReasons: (string | bigint)[]

Decoded Solidity revert reasons for each clause. If the n-th clause reverted, then the n-th element of this array will be the decoded revert reason for the n-th clause.

revertReasons will be undefined if the transaction did not revert.

totalGas: number

The total gas cost estimation of the transaction.

vmErrors: string[]

The error message produced by the Virtual Machine.

vmErrors will be undefined if the transaction did not revert.