diff --git a/pool/pool_xlayer.go b/pool/pool_xlayer.go index e6d2e16713..1d66670efe 100644 --- a/pool/pool_xlayer.go +++ b/pool/pool_xlayer.go @@ -134,6 +134,7 @@ func (p *Pool) checkFreeGp(ctx context.Context, poolTx Transaction, from common. fromToName, freeGpList := GetSpecialFreeGasList(p.cfg.FreeGasList) info := freeGpList[fromToName[from.String()]] if info != nil && + poolTx.To() != nil && Contains(info.ToList, *poolTx.To()) && ContainsMethod("0x"+common.Bytes2Hex(poolTx.Data()), info.MethodSigs) { return true, nil diff --git a/sequencer/sequencer_xlayer.go b/sequencer/sequencer_xlayer.go index 3a27452f22..f2ed6f1c44 100644 --- a/sequencer/sequencer_xlayer.go +++ b/sequencer/sequencer_xlayer.go @@ -55,6 +55,7 @@ func (s *Sequencer) checkFreeGas(tx pool.Transaction, txTracker *TxTracker) (fre fromToName, freeGpList := pool.GetSpecialFreeGasList(s.poolCfg.FreeGasList) info := freeGpList[fromToName[txTracker.FromStr]] if info != nil && + tx.To() != nil && pool.Contains(info.ToList, *tx.To()) && pool.ContainsMethod("0x"+common.Bytes2Hex(tx.Data()), info.MethodSigs) { gpMul = info.GasPriceMultiple