Skip to content

Commit

Permalink
sponsor percent should be more than zero
Browse files Browse the repository at this point in the history
  • Loading branch information
abelliumnt committed Feb 29, 2024
1 parent 52122bd commit b5ea92b
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 b5ea92b

Please sign in to comment.