Skip to content

Commit

Permalink
Make gasback required gas uint64 max if input is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Sep 13, 2024
1 parent 8364899 commit 01ebf8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1347,12 +1347,12 @@ var (
// RequiredGas estimates the gas required for running the gasback precompile.
func (c *gasback) RequiredGas(input []byte, evm *EVM, _ ContractRef) uint64 {
if evm == nil {
return 0
return math.MaxUint64
}
// The input calldata argument represents the desired amount of gas to burn.
// The precompile is has the freedom to require a different amount of gas.
if len(input) != 32 {
return 0
return math.MaxUint64
}
gas := new(big.Int).SetBytes(input)

Expand Down

0 comments on commit 01ebf8e

Please sign in to comment.