Skip to content

Commit

Permalink
transactor: return error if gas limit is lower than dry-run estimated…
Browse files Browse the repository at this point in the history
… value
  • Loading branch information
xiaozhou committed Dec 19, 2023
1 parent 2dd3805 commit 53768fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eth/transactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func (t *Transactor) determineGas(method TxMethod, signer *bind.TransactOpts, tx
// Use estimiated gas limit multiplied by the configured ratio
signer.GasLimit = uint64(float64(dryTx.Gas()) * (1 + txopts.addGasEstimateRatio))
}
if signer.GasLimit < dryTx.Gas() {
return fmt.Errorf("gas limit lower than estimated value")
}
return nil
}

Expand Down

0 comments on commit 53768fb

Please sign in to comment.