diff --git a/x/evm/keeper/erc20.go b/x/evm/keeper/erc20.go index 216a7d23e..ef8140f92 100644 --- a/x/evm/keeper/erc20.go +++ b/x/evm/keeper/erc20.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "math" "math/big" "cosmossdk.io/errors" @@ -30,7 +31,7 @@ const ( // protection against recursive calls ERC20 -> precompile -> ERC20. func getCallGasWithLimit(ctx sdk.Context, gasLimit uint64) uint64 { availableGas := ctx.GasMeter().GasRemaining() - callGas := (availableGas * 63) / 64 + callGas := availableGas - uint64(math.Floor(float64(availableGas)/64)) return min(callGas, gasLimit) }