Skip to content

Commit

Permalink
Merge pull request #46 from mantlenetworkio/bugfix/sponsor-percent-mo…
Browse files Browse the repository at this point in the history
…re-than-zero

R4R: sponsor percent should be more than zero
  • Loading branch information
Tri-stone authored Mar 3, 2024
2 parents a1734e5 + b5ea92b commit 64996df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/types/meta_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
ErrExpiredMetaTx = errors.New("expired meta transaction")
ErrInvalidGasFeeSponsorSig = errors.New("invalid gas fee sponsor signature")
ErrGasFeeSponsorMismatch = errors.New("gas fee sponsor address is mismatch with signature")
ErrInvalidSponsorPercent = errors.New("invalid sponsor percent, expected range [0, 100]")
ErrInvalidSponsorPercent = errors.New("invalid sponsor percent, expected range (0, 100]")
ErrSponsorBalanceNotEnough = errors.New("sponsor doesn't have enough balance")
)

Expand Down Expand Up @@ -128,7 +128,8 @@ func DecodeAndVerifyMetaTxParams(tx *Transaction, isMetaTxUpgraded bool) (*MetaT
return nil, nil
}

if metaTxParams.SponsorPercent > OneHundredPercent {
if metaTxParams.SponsorPercent > OneHundredPercent ||
metaTxParams.SponsorPercent == 0 {
return nil, ErrInvalidSponsorPercent
}

Expand Down

0 comments on commit 64996df

Please sign in to comment.