tx · 4aE1RWDGZvnqb3TTzcMkPUVp36YCCjz72vqBWZVEZuTf 3Mr9dr53WfCEhsUAUdVw5pgy5X8VXQSiNE1: -0.01400000 Waves 2019.11.14 18:53 [764939] smart account 3Mr9dr53WfCEhsUAUdVw5pgy5X8VXQSiNE1 > SELF 0.00000000 Waves
{ "type": 13, "id": "4aE1RWDGZvnqb3TTzcMkPUVp36YCCjz72vqBWZVEZuTf", "fee": 1400000, "feeAssetId": null, "timestamp": 1573746426424, "version": 1, "sender": "3Mr9dr53WfCEhsUAUdVw5pgy5X8VXQSiNE1", "senderPublicKey": "5JzGcJEtLxWD9C1pzmvrj77LkgxLZGFd1RaierZeLnfP", "proofs": [ "4PtiUUtTLFH2L5YTFAUXXyjeDfr4dzhn4FCHYtDV8Tb55b5NP2G7we2M4edG1SvobGz46pjRhe2tg29ZR86XwVXW" ], "script": "base64:AAIDAAAAAAAAAAsIARIDCgEIEgASAAAAAAQAAAAAE2xvdHRlcnlUaWNrZXRIb2xkZXIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQY85hy7YeAyDRGFObJCypdEQTLdt733vIAAAAADGxvdHRlcnlPd25lcgIAAAAjM014dHpuY0tNOXgxa0twTFAzc3A4V1pQdmcxY3phOGpIR20AAAAAC293bmVyUHViS2V5AQAAACCmNNugTM3YDCyk7xZ6vz/eGflRJPu15vOIW0V7gpcRMAAAAAARZEFwcFJhbmRvbUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQs+qsE+m8UScrki/mi9Vg1BPLz1NtSCiEAAAADAAAACmNvbnRleHRPYmoBAAAAF3JhbmRvbVJlcXVlc3RUeElkUmVjb3JkAAAAAQAAABFyYW5kb21SZXF1ZXN0VHhJZAMJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMCAAAAEXJhbmRvbVJlcXVlc3RUeElkCQAAAgAAAAECAAAAInJhbmRvbUlkVHggaXMgYWxyZWFkeSBpbiB0aGUgc3RhdGU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EAAAACBQAAAAckbWF0Y2gwAgAAABBMZWFzZVRyYW5zYWN0aW9uBAAAAAFsBQAAAAckbWF0Y2gwAwMDCQAAZgAAAAIFAAAABmhlaWdodAUAAAAQaGVpZ2h0U3RhcnRMZWFzZQkAAGYAAAACBQAAAA5oZWlnaHRFbmRMZWFzZQUAAAAGaGVpZ2h0BwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwIAAAANd2lubmVyQWRkcmVzcwcJAAAAAAAAAggFAAAAAWwAAAAJcmVjaXBpZW50CQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA13aW5uZXJBZGRyZXNzBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAWTGVhc2VDYW5jZWxUcmFuc2FjdGlvbgQAAAACbGMFAAAAByRtYXRjaDADCQAAZgAAAAIFAAAABmhlaWdodAUAAAAQaGVpZ2h0U3RhcnRMZWFzZQkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5BwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAMJAABmAAAAAgUAAAAGaGVpZ2h0BQAAABBoZWlnaHRTdGFydExlYXNlCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAALb3duZXJQdWJLZXkHBjMLcbo=", "chainId": 84, "height": 764939, "spentComplexity": 0 } View: original | compacted Prev: CSieLaun5j5Pqries2LxXRUPiGBgyuaJeCJxKAtPbwF6 Next: F1HWUuNrY8Qt9q7A6AMoRzGk7R8ngCtCnpWGTAY41C13 Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | WriteSet([DataEntry("randomResult", l)]) | |
44 | 44 | } | |
45 | 45 | else { | |
46 | - | let m = | |
46 | + | let m = getStringValue(a, ("ticket" + toString(j))) | |
47 | 47 | WriteSet([DataEntry("winnerTicket", j), DataEntry("winnerAddress", m)]) | |
48 | 48 | } | |
49 | 49 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = Address(base58'3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP') | |
5 | 5 | ||
6 | 6 | let b = "3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm" | |
7 | 7 | ||
8 | 8 | let c = base58'CBoRgqiPjXZMaoN8BwCSFfXsRX5jvNDiZ9SArkfMQX1Z' | |
9 | 9 | ||
10 | 10 | let d = Address(base58'3Mt1uo5ieYK8Pk9XyVZp88HBLMfprrq515z') | |
11 | 11 | ||
12 | 12 | @Callable(e) | |
13 | 13 | func randomRequestTxIdRecord (f) = if (isDefined(getString(this, "randomRequestTxId"))) | |
14 | 14 | then throw("randomIdTx is already in the state") | |
15 | 15 | else if ((e.caller == addressFromString(b))) | |
16 | 16 | then WriteSet([DataEntry("randomRequestTxId", f)]) | |
17 | 17 | else throw("only owner can start the lottery") | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(e) | |
22 | 22 | func checkRandom () = { | |
23 | 23 | let g = getStringValue(this, "randomRequestTxId") | |
24 | 24 | let h = getStringValue(d, g) | |
25 | 25 | let i = split(h, "_")[0] | |
26 | 26 | let j = split(h, "--")[1] | |
27 | 27 | if ((i == "FINISHED")) | |
28 | 28 | then WriteSet([DataEntry("randomResult", parseIntValue(j))]) | |
29 | 29 | else throw("Incorrect random result") | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(e) | |
35 | 35 | func defineTheWinner () = { | |
36 | 36 | let j = getIntegerValue(this, "randomResult") | |
37 | 37 | if (isDefined(getInteger(a, ("winningTicket" + toString(j))))) | |
38 | 38 | then { | |
39 | 39 | let k = getIntegerValue(a, "ticketAmount") | |
40 | 40 | let l = if ((j == k)) | |
41 | 41 | then 1 | |
42 | 42 | else (j + 1) | |
43 | 43 | WriteSet([DataEntry("randomResult", l)]) | |
44 | 44 | } | |
45 | 45 | else { | |
46 | - | let m = | |
46 | + | let m = getStringValue(a, ("ticket" + toString(j))) | |
47 | 47 | WriteSet([DataEntry("winnerTicket", j), DataEntry("winnerAddress", m)]) | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Verifier(n) | |
53 | 53 | func o () = { | |
54 | 54 | let p = 1 | |
55 | 55 | let q = 0 | |
56 | 56 | let r = n | |
57 | 57 | if ($isInstanceOf(r, "LeaseTransaction")) | |
58 | 58 | then { | |
59 | 59 | let s = r | |
60 | 60 | if (if (if ((height > p)) | |
61 | 61 | then (q > height) | |
62 | 62 | else false) | |
63 | 63 | then isDefined(getString(this, "winnerAddress")) | |
64 | 64 | else false) | |
65 | 65 | then (s.recipient == addressFromString(getStringValue(this, "winnerAddress"))) | |
66 | 66 | else false | |
67 | 67 | } | |
68 | 68 | else if ($isInstanceOf(r, "LeaseCancelTransaction")) | |
69 | 69 | then { | |
70 | 70 | let t = r | |
71 | 71 | if ((height > p)) | |
72 | 72 | then sigVerify(n.bodyBytes, n.proofs[0], c) | |
73 | 73 | else false | |
74 | 74 | } | |
75 | 75 | else if ($isInstanceOf(r, "TransferTransaction")) | |
76 | 76 | then { | |
77 | 77 | let u = r | |
78 | 78 | if ((height > p)) | |
79 | 79 | then sigVerify(n.bodyBytes, n.proofs[0], c) | |
80 | 80 | else false | |
81 | 81 | } | |
82 | 82 | else true | |
83 | 83 | } | |
84 | 84 |
github/deemru/w8io/026f985 36.81 ms ◑