diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index 4799d4758f..355c3d2512 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -79,6 +79,9 @@ func (d *DASignersPrecompile) Address() common.Address { // RequiredGas implements vm.PrecompiledContract. func (d *DASignersPrecompile) RequiredGas(input []byte) uint64 { + if len(input) < 4 { + return DASignersRequiredGasMax + } method, err := d.abi.MethodById(input[:4]) if err != nil { return DASignersRequiredGasMax diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go index af5633618f..77a6515e80 100644 --- a/core/vm/wrapped_a0gi_base.go +++ b/core/vm/wrapped_a0gi_base.go @@ -60,6 +60,9 @@ func (w *WrappedA0giBasePrecompile) Address() common.Address { // RequiredGas implements vm.PrecompiledContract. func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 { + if len(input) < 4 { + return WrappedA0GIBaseRequiredGasMax + } method, err := w.abi.MethodById(input[:4]) if err != nil { return WrappedA0GIBaseRequiredGasMax