tx · BdcbaA9oBiVYJpP7HCLpMmnisL3mptRw2ZkBsYowHGSV 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE: -0.01400000 Waves 2019.09.08 08:33 [666688] smart account 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE > SELF 0.00000000 Waves
{ "type": 13, "id": "BdcbaA9oBiVYJpP7HCLpMmnisL3mptRw2ZkBsYowHGSV", "fee": 1400000, "feeAssetId": null, "timestamp": 1567920792753, "version": 1, "sender": "3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE", "senderPublicKey": "ESNVczQiY4oxY2hoRSZcruKNBwsPdXVu1nSCbpprDGJB", "proofs": [ "3UGkijM49ZYe1ehZNP3ykLBnmBJ7cq4M4tHSqehYBDKGS77EowCVgrCvt795hAFBnmvb63zWxt8dyLfmQtJPiviX" ], "script": "base64:AAIDAAAAAAAAAAAAAAAOAAAAAA9TZXJ2ZXJQdWJsaWNLZXkJAAJZAAAAAQIAAAAsN2ltOWNhaUNtRTRTTDZqVG00S1RpY0hINGJHUGY1djU5cm5mVUEzY0NSRGoAAAAACUJldFNlcnZlcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTjZ5Rko1WjhOVVVRdmZHR01McDVlZm1ldlJSdFRnUXV1bgAAAAAHV0FWRUxFVAkAAGgAAAACCQAAaAAAAAIAAAAAAAAAAGQAAAAAAAAAA+gAAAAAAAAAA+gAAAAACkNPTU1JU1NJT04JAABpAAAAAgkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAAAAAPoAAAAAA5UaWNrZXRzUGVyV2F2ZQAAAAAAAAAAZAAAAAALQ1VSUkVOVEdBTUUCAAAADSRDVVJSRU5UX0dBTUUAAAAACkxBU1RUSUNLRVQCAAAADCRMQVNUX1RJQ0tFVAEAAAAPR2VuZXJhdGVSYW5kSW50AAAAAgAAAAZnYW1lSWQAAAAHcnNhU2lnbgQAAAAKbGFzdFRp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cgUAAAAQd2lubmVyQWRkcmVzc1N0cgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAZnYW1lSWQCAAAAB193aW5BbXQFAAAABndpbkFtdAUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQUAAAAKZ2FtZVJlc3VsdAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAAFd2luVFgJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAQQ3VycmVudCBHYW1lIGlzIAUAAAALY3VycmVudEdhbWUCAAAACiwgYnV0IG5vdCAFAAAABmdhbWVJZAAAAABdVjkV", "chainId": 84, "height": 666688, "spentComplexity": 0 } View: original | compacted Prev: none Next: Gb1METas8sCSMMZjfEWKYCAEMhmCLotbQmPmcWTT9jZB Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = fromBase58String("7im9caiCmE4SL6jTm4KTicHH4bGPf5v59rnfUA3cCRDj") | |
5 | + | ||
6 | + | let b = addressFromStringValue("3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun") | |
7 | + | ||
8 | + | let c = ((100 * 1000) * 1000) | |
9 | + | ||
10 | + | let d = ((5 * c) / 1000) | |
11 | + | ||
12 | + | let e = 100 | |
13 | + | ||
14 | + | let f = "$CURRENT_GAME" | |
15 | + | ||
16 | + | let g = "$LAST_TICKET" | |
17 | + | ||
18 | + | func h (i,j) = { | |
19 | + | let k = getIntegerValue(b, g) | |
20 | + | let l = sigVerify(toBytes(i), j, a) | |
21 | + | if (l) | |
22 | + | then { | |
23 | + | let m = (toInt(sha256(j)) % k) | |
24 | + | if ((0 > m)) | |
25 | + | then ((-1 * m) + 1) | |
26 | + | else (m + 1) | |
27 | + | } | |
28 | + | else throw("Invalid RSA signature") | |
29 | + | } | |
30 | + | ||
31 | + | ||
32 | + | func n (i,o) = { | |
33 | + | let p = (((i + "_") + o) + "_tickets") | |
34 | + | getStringValue(b, p) | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func q (r) = { | |
39 | + | let s = size(r) | |
40 | + | if ((s > 0)) | |
41 | + | then { | |
42 | + | let t = parseIntValue(take(r, 2)) | |
43 | + | let u = take(drop(r, 2), t) | |
44 | + | let v = drop(r, (t + 2)) | |
45 | + | let w = v | |
46 | + | [u, w] | |
47 | + | } | |
48 | + | else throw("Empty string was passed into parseNextAttribute func") | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | func x (p) = ["1", "100", "101", "300", "0", "0", "0", "0"] | |
53 | + | ||
54 | + | ||
55 | + | func y (i,o,z) = { | |
56 | + | let A = x(n(i, o)) | |
57 | + | if (if ((z >= parseIntValue(A[0]))) | |
58 | + | then (parseIntValue(A[1]) >= z) | |
59 | + | else false) | |
60 | + | then true | |
61 | + | else if (if ((z >= parseIntValue(A[2]))) | |
62 | + | then (parseIntValue(A[3]) >= z) | |
63 | + | else false) | |
64 | + | then true | |
65 | + | else if (if ((z >= parseIntValue(A[4]))) | |
66 | + | then (parseIntValue(A[5]) >= z) | |
67 | + | else false) | |
68 | + | then true | |
69 | + | else if (if ((z >= parseIntValue(A[6]))) | |
70 | + | then (parseIntValue(A[7]) >= z) | |
71 | + | else false) | |
72 | + | then true | |
73 | + | else false | |
74 | + | } | |
75 | + | ||
76 | + | ||
77 | + | func B (i,z) = { | |
78 | + | let C = getStringValue(b, (i + "_players")) | |
79 | + | let D = split(C, "_") | |
80 | + | if (y(i, D[0], z)) | |
81 | + | then D[0] | |
82 | + | else if (y(i, D[1], z)) | |
83 | + | then D[1] | |
84 | + | else if (y(i, D[2], z)) | |
85 | + | then D[2] | |
86 | + | else if (y(i, D[3], z)) | |
87 | + | then D[3] | |
88 | + | else throw("Error with defining winner") | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | func E (F) = (1 * c) | |
93 | + | ||
94 | + | ||
95 | + | @Callable(G) | |
96 | + | func generateResult (i,H) = { | |
97 | + | let I = getStringValue(b, f) | |
98 | + | if ((I == i)) | |
99 | + | then { | |
100 | + | let j = fromBase58String(H) | |
101 | + | let z = h(i, j) | |
102 | + | let F = "3N6xavpiLALkk4H4qWfeZ4N1cmvoykyToBa" | |
103 | + | let J = E(F) | |
104 | + | let K = [ScriptTransfer(addressFromStringValue(F), J, unit)] | |
105 | + | let L = [DataEntry((i + "_result"), toString(z)), DataEntry((i + "_winner"), F), DataEntry((i + "_winAmt"), J)] | |
106 | + | ScriptResult(WriteSet(L), TransferSet(K)) | |
107 | + | } | |
108 | + | else throw(((("Current Game is " + I) + ", but not ") + i)) | |
109 | + | } | |
110 | + | ||
111 | + |
github/deemru/w8io/169f3d6 31.07 ms ◑