Skip to content

Commit

Permalink
use default gasprice when gasprice==0
Browse files Browse the repository at this point in the history
  • Loading branch information
millken committed Nov 20, 2023
1 parent ef90d46 commit 76fcc47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action/protocol/execution/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/iotexproject/iotex-core/blockchain/genesis"
"github.com/iotexproject/iotex-core/pkg/log"
"github.com/iotexproject/iotex-core/pkg/tracer"
"github.com/iotexproject/iotex-core/pkg/unit"
"github.com/iotexproject/iotex-core/pkg/util/byteutil"
)

Expand Down Expand Up @@ -279,6 +280,10 @@ func ExecuteContract(
sharedGas uint64
sharedGasFee, totalGasFee *big.Int
)
// if gas price is zero, set it to smallest unit
if ps.txCtx.GasPrice.Sign() == 0 {
ps.txCtx.GasPrice = big.NewInt(unit.Qev)
}
if ps.featureCtx.SharedGasWithDapp && sgd != nil {
// TODO: sgd is whether nil should be checked in processSGD
receiver, sharedGas, err = processSGD(ctx, sm, execution, consumedGas, sgd)
Expand Down

0 comments on commit 76fcc47

Please sign in to comment.