Skip to content

Commit

Permalink
recipient validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Liuhaai committed Sep 30, 2024
1 parent 2c77273 commit 497e5c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ func (tsf *Transfer) SanityCheck() error {
if tsf.Amount().Sign() < 0 {
return ErrNegativeValue
}
// check if recipient's address is valid
if _, err := address.FromString(tsf.recipient); err != nil {
return errors.Wrapf(err, "error when validating contract's address %s", tsf.recipient)
}
return nil
}

Expand Down

0 comments on commit 497e5c8

Please sign in to comment.