Merge pull request #946 from nspcc-dev/examples/nep5-transfer-bug
examples: Use "or" operator in transfer check of NEP5 token
This commit is contained in:
commit
9eaec2adcd
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ func (t Token) Transfer(ctx storage.Context, from []byte, to []byte, amount int)
|
|||
|
||||
// CanTransfer returns the amount it can transfer
|
||||
func (t Token) CanTransfer(ctx storage.Context, from []byte, to []byte, amount int) int {
|
||||
if len(to) != 20 && !IsUsableAddress(from) {
|
||||
if len(to) != 20 || !IsUsableAddress(from) {
|
||||
return -1
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue