Task/fix sc template (#100)

* Fixed security issue in smart contract template

* Bumped version

* fixed typo
This commit is contained in:
Anthony De Meulemeester 2018-09-27 08:21:31 +02:00 committed by GitHub
parent d77354db66
commit 903bb86f96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -1 +1 @@
0.44.8
0.44.9

View file

@ -228,6 +228,9 @@ func approve(ctx storage.Context, owner, spender []byte, amount int) bool {
if !runtime.CheckWitness(owner) || amount < 0 {
return false
}
if len(spender) != 20 {
return false
}
toSpend := storage.Get(ctx, owner).(int)
if toSpend < amount {
return false