tx · 7XkBHyiRnVhtGybv7sTvBbdykMC4njL1ZBaYUta5KHQB 3N9D8brsPwA8d2SWKxCKoG15TfAqjtp749H: -0.01000000 Waves 2020.09.16 11:48 [1179605] smart account 3N9D8brsPwA8d2SWKxCKoG15TfAqjtp749H > SELF 0.00000000 Waves
{ "type": 13, "id": "7XkBHyiRnVhtGybv7sTvBbdykMC4njL1ZBaYUta5KHQB", "fee": 1000000, "feeAssetId": null, "timestamp": 1600246089840, "version": 2, "chainId": 84, "sender": "3N9D8brsPwA8d2SWKxCKoG15TfAqjtp749H", "senderPublicKey": "FpA31WAx86gMxdfoFSRBf8HbjDPaHre9SnjfE1rcjTSA", "proofs": [ "3WAebMDy8R8KWKQQ2iCozPpF6etVuqXVzCZCsdtCNA3UEAjA84XUu3oVjHYGa6XBnngYGL7UuzsMPiT85yZ65Zcq" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEIEgAAAAACAAAAAAZOU0JUaWQJAAJZAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAGTlNCVGlkAAAAAAloZWlnaHRFbmQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAACmhlaWdodF9lbmQAAAACAAAACmNvbnRleHRPYmoBAAAACGNhc3RWb3RlAAAAAQAAAAR2b3RlBAAAAAh2b2l0ZUtleQkABLkAAAACCQAETAAAAAICAAAABXZvaXRlCQAETAAAAAIFAAAABHZvdGUFAAAAA25pbAIAAAABXwQAAAAOdXNlckJhbGFuY2VLZXkJAAS5AAAAAgkABEwAAAACAgAAAAdiYWxhbmNlCQAETAAAAAIJAAQlAAAAAQgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAANuaWwCAAAAAV8EAAAAB3BheW1lbnQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAACmNvbnRleHRPYmoAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAD2Fzc2V0SWR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0b2tlblJlY2VpdmVBbW91bnQFAAAAA25pbAAAAApjb250ZXh0T2JqAQAAAAh3aXRoZHJhdwAAAAAEAAAADnVzZXJCYWxhbmNlS2V5CQAEuQAAAAIJAARMAAAAAgIAAAAHYmFsYW5jZQkABEwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgUAAAADbmlsAgAAAAFfAwkAAGYAAAACBQAAAAloZWlnaHRFbmQFAAAABmhlaWdodAkAAAIAAAABAgAAAA92b3RlIGluIHByb2Nlc3MEAAAADWNhbGxlckJhbGFuY2UJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAADnVzZXJCYWxhbmNlS2V5CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgUAAAANY2FsbGVyQmFsYW5jZQUAAAAGTlNCVGlkCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA51c2VyQmFsYW5jZUtleQAAAAAAAAAAAAUAAAADbmlsAAAAAAz+DNU=", "height": 1179605, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 28foWu6uX7FoP1gvq6VwYKAJ78d4YrAk86Hxg5aHDbqU Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let NSBTid = fromBase58String(getStringValue(this, "NSBTid")) | |
5 | + | ||
6 | + | let heightEnd = getIntegerValue(this, "height_end") | |
7 | + | ||
8 | + | @Callable(contextObj) | |
9 | + | func castVote (vote) = { | |
10 | + | let voiteKey = makeString(["voite", vote], "_") | |
11 | + | let userBalanceKey = makeString(["balance", toString(contextObj.caller)], "_") | |
12 | + | let payment = value(contextObj.payments[0]) | |
13 | + | let assetIdReceived = payment.assetId | |
14 | + | let tokenReceiveAmount = payment.amount | |
15 | + | let voteNumberThis = match getInteger(this, voiteKey) { | |
16 | + | case voteValue: Int => | |
17 | + | voteValue | |
18 | + | case voteValue: Unit => | |
19 | + | 0 | |
20 | + | case _ => | |
21 | + | throw("Match error") | |
22 | + | } | |
23 | + | let contractUserBalance = match getInteger(this, userBalanceKey) { | |
24 | + | case balance: Int => | |
25 | + | balance | |
26 | + | case balance: Unit => | |
27 | + | 0 | |
28 | + | case _ => | |
29 | + | throw("Match error") | |
30 | + | } | |
31 | + | if ((assetIdReceived != NSBTid)) | |
32 | + | then throw("incorrect assets") | |
33 | + | else if ((height >= heightEnd)) | |
34 | + | then throw("vote finished") | |
35 | + | else [IntegerEntry(voiteKey, (voteNumberThis + tokenReceiveAmount)), IntegerEntry(userBalanceKey, tokenReceiveAmount)] | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | @Callable(contextObj) | |
41 | + | func withdraw () = { | |
42 | + | let userBalanceKey = makeString(["balance", toString(contextObj.caller)], "_") | |
43 | + | if ((heightEnd > height)) | |
44 | + | then throw("vote in process") | |
45 | + | else { | |
46 | + | let callerBalance = getIntegerValue(this, userBalanceKey) | |
47 | + | [ScriptTransfer(contextObj.caller, callerBalance, NSBTid), IntegerEntry(userBalanceKey, 0)] | |
48 | + | } | |
49 | + | } | |
50 | + | ||
51 | + |
github/deemru/w8io/169f3d6 23.74 ms ◑