Skip to content

Commit

Permalink
fix the integer overflow warning from cosmos-sec
Browse files Browse the repository at this point in the history
  • Loading branch information
lukema95 committed Feb 7, 2024
1 parent de278b4 commit 93d2c5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/crosschain/client/cli/cli_whitelist_erc20.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cli

import (
"fmt"
"strconv"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -33,6 +34,9 @@ func CmdWhitelistERC20() *cobra.Command {
if err != nil {
return err
}
if decimals > 128 {
return fmt.Errorf("decimals must be less than 128")
}

gasLimit, err := strconv.ParseInt(args[5], 10, 64)
if err != nil {
Expand All @@ -45,6 +49,7 @@ func CmdWhitelistERC20() *cobra.Command {
chainID,
name,
symbol,
// #nosec G701 always in range
uint32(decimals),
gasLimit,
)
Expand Down

0 comments on commit 93d2c5c

Please sign in to comment.