Skip to content

Commit

Permalink
check conversion safety
Browse files Browse the repository at this point in the history
  • Loading branch information
adu-web3 committed Dec 13, 2024
1 parent e7a740d commit d80281b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions precompiles/assets/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package assets

import (
"errors"
"math"

assetstype "github.com/ExocoreNetwork/exocore/x/assets/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -101,6 +102,9 @@ func (p Precompile) GetTokenInfo(
if err != nil {
return nil, err
}
if tokenInfo.AssetBasicInfo.Decimals > math.MaxUint8 {
return nil, errors.New("decimals exceed max uint8")
}

// Pack the values into the struct
result := TokenInfo{
Expand Down

0 comments on commit d80281b

Please sign in to comment.