tx · 7W8E8JzrLkUesMfwsS9EVCkA74PU67vdh5TJ2kh9k7Nb 3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX: -0.05000000 Waves 2019.10.30 14:58 [742846] smart account 3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX > SELF 0.00000000 Waves
{ "type": 13, "id": "7W8E8JzrLkUesMfwsS9EVCkA74PU67vdh5TJ2kh9k7Nb", "fee": 5000000, "feeAssetId": null, "timestamp": 1572436703916, "version": 1, "sender": "3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX", "senderPublicKey": "ACfUG5PwG2GssMuyEwVEhkYAbbbP1geSHR8XoNxLyu6V", "proofs": [ "5EW5FsRdzuQBBXpinR1Zxcd91fjvdpZRbKnhkqDkTJxXV7V1Pkc3vAmBWuzqGhuWAYEFfN6vT9FY8THHCHJskEHQ" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAEAAAAAA5SRVNFUlZBVElPTktFWQIAAAAVJFdCRVRfUkVTRVJWRURfQU1PVU5UAAAAAARXQkVUBQAAAAR1bml0AQAAABJFeHRyYWN0UmVzZXJ2ZWRBbXQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAADlJFU0VSVkFUSU9OS0VZAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAAEEV4dHJhY3RQbGF5ZXJBbXQAAAABAAAABndhbGxldAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAAZ3YWxsZXQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAB3BheW1lbnQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGd2FsbGV0CQAEJQAAAAEI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W50cnkAAAACBQAAAA5SRVNFUlZBVElPTktFWQUAAAARbmV3UmVzZXJ2ZWRBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABndhbGxldAUAAAAPbmV3UGxheWVyQW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABFdCRVQFAAAAA25pbAAAAABb08kp", "chainId": 84, "height": 742846, "spentComplexity": 0 } View: original | compacted Prev: FFdkm8c4aYMyHyycA8YtXpQ98QZeQtN2NppBq8bia24B Next: none Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RESERVATIONKEY = "$WBET_RESERVED_AMOUNT" | |
5 | 5 | ||
6 | - | let WBET = | |
6 | + | let WBET = unit | |
7 | 7 | ||
8 | 8 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
9 | 9 | case a: Int => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RESERVATIONKEY = "$WBET_RESERVED_AMOUNT" | |
5 | 5 | ||
6 | - | let WBET = | |
6 | + | let WBET = unit | |
7 | 7 | ||
8 | 8 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
9 | 9 | case a: Int => | |
10 | 10 | a | |
11 | 11 | case _ => | |
12 | 12 | 0 | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func ExtractPlayerAmt (wallet) = match getInteger(this, wallet) { | |
17 | 17 | case a: Int => | |
18 | 18 | a | |
19 | 19 | case _ => | |
20 | 20 | 0 | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func deposit () = { | |
26 | 26 | let payment = extract(i.payment) | |
27 | 27 | let wallet = toString(i.caller) | |
28 | 28 | let newPlayerAmount = (ExtractPlayerAmt(wallet) + payment.amount) | |
29 | 29 | let newReservedAmount = (ExtractReservedAmt() + payment.amount) | |
30 | 30 | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, newReservedAmount), DataEntry(wallet, newPlayerAmount)]), TransferSet(nil)) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | 36 | func withdraw (amount) = { | |
37 | 37 | let wallet = toString(i.caller) | |
38 | 38 | let playerAmount = ExtractPlayerAmt(wallet) | |
39 | 39 | if ((amount > playerAmount)) | |
40 | 40 | then throw("There is not enough balance to withdraw the amount requested.") | |
41 | 41 | else { | |
42 | 42 | let newPlayerAmount = (playerAmount - amount) | |
43 | 43 | let newReservedAmount = (ExtractReservedAmt() - amount) | |
44 | 44 | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, newReservedAmount), DataEntry(wallet, newPlayerAmount)]), TransferSet([ScriptTransfer(i.caller, amount, WBET)])) | |
45 | 45 | } | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 |
github/deemru/w8io/169f3d6 32.26 ms ◑