diff --git a/contract/contract.go b/contract/contract.go index df67dba3..a2e2cdc3 100644 --- a/contract/contract.go +++ b/contract/contract.go @@ -20,11 +20,7 @@ const ( CrosschainAddress = "0x0000000000000000000000000000000000001004" ) -const ( - DefaultGasCap uint64 = 30000000 -) - -var typeString, _ = abi.NewType("string", "", nil) +const DefaultGasCap uint64 = 30000000 var ( fip20Init = Contract{ @@ -95,11 +91,6 @@ func MustABIJson(str string) abi.ABI { return j } -func PackRetError(err error) ([]byte, error) { - pack, _ := abi.Arguments{{Type: typeString}}.Pack(err.Error()) - return pack, err -} - func PackRetErrV2(err error) ([]byte, error) { pack, _ := errorABI.Pack("Error", err.Error()) return pack, err diff --git a/x/staking/precompile/contract.go b/x/staking/precompile/contract.go index be17e707..5903ed45 100644 --- a/x/staking/precompile/contract.go +++ b/x/staking/precompile/contract.go @@ -99,7 +99,7 @@ func (c *Contract) Run(evm *vm.EVM, vmContract *vm.Contract, readonly bool) (ret stateDB := evm.StateDB.(evmtypes.ExtStateDB) if err = c.govKeeper.CheckDisabledPrecompiles(stateDB.Context(), c.Address(), vmContract.Input[:4]); err != nil { - return contract.PackRetError(err) + return contract.PackRetErrV2(err) } ret, err = method.Run(evm, vmContract)