Skip to content

Commit

Permalink
fix: enforce recipient address to lower case when signing data to be …
Browse files Browse the repository at this point in the history
…compatible with the contract
  • Loading branch information
j75689 committed Nov 27, 2023
1 parent c2ffd69 commit 4fe054d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/airdrop/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"encoding/hex"
"fmt"
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -43,7 +44,8 @@ func GetApprovalCmd(cdc *codec.Codec) *cobra.Command {
amount := viper.GetInt64(flagAmount)
tokenSymbol := viper.GetString(flagTokenSymbol)
recipient := viper.GetString(flagRecipient)
msg := airdrop.NewAirdropApprovalMsg(tokenSymbol, uint64(amount), common.HexToAddress(recipient).Hex())

msg := airdrop.NewAirdropApprovalMsg(tokenSymbol, uint64(amount), strings.ToLower(common.HexToAddress(recipient).Hex()))

sdkErr := msg.ValidateBasic()
if sdkErr != nil {
Expand Down

0 comments on commit 4fe054d

Please sign in to comment.