diff --git a/common/gas.go b/common/gas.go index 1e40721b14..7f1135ceea 100644 --- a/common/gas.go +++ b/common/gas.go @@ -13,6 +13,8 @@ func GetGasFee(blockNumber, gas uint64) *big.Int { fee = fee.Mul(fee, GasPrice50x) } else if blockNumber > TIPTRC21Fee.Uint64() { fee = fee.Mul(fee, TRC21GasPrice) + } else { + fee = fee.Mul(fee, TRC21GasPriceBefore) } return fee diff --git a/contracts/trc21issuer/trc21issuer_test.go b/contracts/trc21issuer/trc21issuer_test.go index 19e3dde595..42b750cb0f 100644 --- a/contracts/trc21issuer/trc21issuer_test.go +++ b/contracts/trc21issuer/trc21issuer_test.go @@ -30,6 +30,12 @@ var ( ) func TestFeeTxWithTRC21Token(t *testing.T) { + oldTRC21GasPriceBefore := new(big.Int).Set(common.TIPTRC21Fee) + defer func() { + common.TIPTRC21Fee = oldTRC21GasPriceBefore + }() + common.TRC21GasPriceBefore = big.NewInt(1) + // init genesis contractBackend := backends.NewXDCSimulatedBackend( types.GenesisAlloc{