tx · 3tHLN5ZZHp2SjmvX6R7QxoxSdqh2UbDYgc64Jg3PV5dz

3N9yCRmNsLK2aPStjLBne3EUiPSKvVHYgKk:  -0.05000000 Waves

2020.10.13 13:11 [1218641] smart account 3N9yCRmNsLK2aPStjLBne3EUiPSKvVHYgKk > SELF 0.00000000 Waves

{ "type": 13, "id": "3tHLN5ZZHp2SjmvX6R7QxoxSdqh2UbDYgc64Jg3PV5dz", "fee": 5000000, "feeAssetId": null, "timestamp": 1602583918766, "version": 2, "chainId": 84, "sender": "3N9yCRmNsLK2aPStjLBne3EUiPSKvVHYgKk", "senderPublicKey": "7nLAwoiRA4fWF4VHd6gRsbwF2UFFmRADXHqRcgy3h27w", "proofs": [ "2P2J46Dcj4AoyP8YHP1q3QQSaKtDQ2mKLgz5k9uDbc4dY7qNfXbhvn6zaNHtPHanaMsLg3UWyjVx37eqdgAnNCC7" ], "script": "base64:BAbMtW/U", "height": 1218641, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A8Yw9ax5SumPgTnALVFDudNTzuNawLsYqntFZ762M2oH Next: BCwzGWZboNmFNEAXiPsBz7ke5ARbNMhzTLcekLdin4xi Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-
5-
6-@Callable(i)
7-func deposit () = {
8- let pmt = value(i.payments[0])
9- if (isDefined(pmt.assetId))
10- then throw("works with waves only")
11- else {
12- let currentKey = toBase58String(i.caller.bytes)
13- let currentAmount = match getInteger(this, currentKey) {
14- case a: Int =>
15- a
16- case _ =>
17- 0
18- }
19- let newAmount = (currentAmount + pmt.amount)
20-[IntegerEntry(currentKey, newAmount)]
21- }
22- }
23-
24-
25-
26-@Callable(i)
27-func withdraw (amount) = {
28- let currentKey = toBase58String(i.caller.bytes)
29- let currentAmount = match getInteger(this, currentKey) {
30- case a: Int =>
31- a
32- case _ =>
33- 0
34- }
35- let newAmount = (currentAmount - amount)
36- if ((0 > amount))
37- then throw("Can't withdraw negative amount")
38- else if ((0 > newAmount))
39- then throw("Not enough balance")
40- else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)]
41- }
42-
43-
2+{-# CONTENT_TYPE EXPRESSION #-}
3+true

github/deemru/w8io/3ef1775 
23.70 ms