From 3c667312df5d31a10721248fa8099f1877f0ff58 Mon Sep 17 00:00:00 2001 From: jongwhan lee Date: Mon, 12 Jul 2021 20:39:36 +0900 Subject: [PATCH] Problem: etherjs smartcontract cannot change state (fix #257) Solution: increase base gas to make similar with ethereum --- ethereum/rpc/namespaces/eth/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereum/rpc/namespaces/eth/api.go b/ethereum/rpc/namespaces/eth/api.go index 729484e8b9..c4e69a925d 100644 --- a/ethereum/rpc/namespaces/eth/api.go +++ b/ethereum/rpc/namespaces/eth/api.go @@ -567,7 +567,9 @@ func (e *PublicAPI) EstimateGas(args evmtypes.CallArgs) (hexutil.Uint64, error) return 0, evmtypes.NewExecErrorWithReason(data.Ret) } - return hexutil.Uint64(data.GasUsed), nil + // estimate for ethereum + // example: computed 21204 , ethereum 41646 + return hexutil.Uint64(data.GasUsed + 40000), nil } // GetBlockByHash returns the block identified by hash.