forked from TrueCloudLab/frostfs-contract
[#15] Check amount value in withdraw method
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
7a275a3c4b
commit
d75c11c897
1 changed files with 4 additions and 2 deletions
|
@ -228,10 +228,12 @@ func Withdraw(user []byte, amount int) bool {
|
||||||
panic("withdraw: you should be the owner of the wallet")
|
panic("withdraw: you should be the owner of the wallet")
|
||||||
}
|
}
|
||||||
|
|
||||||
if amount > 0 {
|
if amount < 0 {
|
||||||
amount = amount * 100000000
|
panic("withdraw: non positive amount number")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
amount = amount * 100000000
|
||||||
|
|
||||||
tx := runtime.GetScriptContainer()
|
tx := runtime.GetScriptContainer()
|
||||||
runtime.Notify("Withdraw", user, amount, tx.Hash)
|
runtime.Notify("Withdraw", user, amount, tx.Hash)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue