tx · AVLttHkisLVeoL8fufv1bjmXiFcWnQyPL2ELJooyTAYg 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.09.07 15:09 [665630] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "AVLttHkisLVeoL8fufv1bjmXiFcWnQyPL2ELJooyTAYg", "fee": 1400000, "feeAssetId": null, "timestamp": 1567858125173, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "4U6SWJ8DHs5Hxmxu3kg9wXqmrEyGLFnhcdpfyXQ9PmtgSTpxmXYXXG2KsFaEfTpwbupPNe4NxPh8WHAVMFD6xQ9U" ], "script": "base64:AAIDAAAAAAAAAAAAAAAMAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAADlRpY2tldHNQZXJXYXZlAAAAAAAAAABkAAAAAAtDVVJSRU5UR0FNRQIAAAANJENVUlJFTlRfR0FNRQAAAAAPR0FNRVNDT1VOVEVSS0VZAgAAAAkkR0FNRV9OVU0AAAAACkxBU1RUSUNLRVQCAAAADCRMQVNUX1RJQ0tFVAEAAAAOZ2V0UGxheWVyc0xpc3QAAAACAAAABmdhbWVJZAAAAA1jdXJyZW50UGxheWVyBAAAABBwbGF5ZXJzUHJlc2VudGVkCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAR0aGlzCQABLAAAAAIFAAAABmdhbWVJZAIAAAAIX3BsYXllcnMDCQEAAAABIQAAAAEFAAAAEHBsYXllcnNQcmVzZW50ZWQFAAAADWN1cnJl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ADcG10AAAABmFtb3VudAUAAAADbmlsCQEAAAAIV3JpdGVTZXQAAAABBQAAAAdiZXREYXRhAAAAANZMiuQ=", "chainId": 84, "height": 665630, "spentComplexity": 0 } View: original | compacted Prev: JBR3Ab46RRb7MWoEStof8mBaJAqHDJVY17wDZYUkWCwK Next: DBoibHSauK7HCqAZCnJf4igFtEdWzinSrSt7FAjbkQ9 Diff:
Old | New | Differences | |
---|---|---|---|
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | - | func x (h,y) = if ((h == y)) | |
54 | + | func x (p) = { | |
55 | + | let q = getIntegerValue(this, f) | |
56 | + | let r = (p / a) | |
57 | + | (q + (r * c)) | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | func y (h,z) = if ((h == z)) | |
55 | 62 | then { | |
56 | - | let | |
57 | - | let | |
58 | - | if ($isInstanceOf( | |
63 | + | let A = { | |
64 | + | let B = getInteger(this, e) | |
65 | + | if ($isInstanceOf(B, "Int")) | |
59 | 66 | then { | |
60 | - | let | |
61 | - | | |
67 | + | let C = B | |
68 | + | C | |
62 | 69 | } | |
63 | 70 | else 0 | |
64 | 71 | } | |
65 | - | toString(( | |
72 | + | toString((A + 1)) | |
66 | 73 | } | |
67 | 74 | else toString(getIntegerValue(this, e)) | |
68 | 75 | ||
69 | 76 | ||
70 | - | func | |
77 | + | func D (z) = { | |
71 | 78 | let h = getStringValue(this, d) | |
72 | - | let | |
73 | - | if ( | |
79 | + | let E = isDefined(getString(this, (h + "_result"))) | |
80 | + | if (E) | |
74 | 81 | then h | |
75 | - | else | |
82 | + | else z | |
76 | 83 | } | |
77 | 84 | ||
78 | 85 | ||
79 | - | @Callable( | |
86 | + | @Callable(F) | |
80 | 87 | func bet () = { | |
81 | - | let | |
82 | - | let h = | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | if ( | |
88 | + | let z = toBase58String(F.transactionId) | |
89 | + | let h = D(z) | |
90 | + | let A = y(h, z) | |
91 | + | let G = extract(F.payment) | |
92 | + | let H = isDefined(G.assetId) | |
93 | + | let I = isDefined(G.assetId) | |
94 | + | let J = toBase58String(F.callerPublicKey) | |
95 | + | let K = addressFromPublicKey(fromBase58String(J)) | |
96 | + | if (H) | |
90 | 97 | then throw("Bet amount must be in Waves") | |
91 | - | else if ( | |
98 | + | else if (I) | |
92 | 99 | then throw("Transaction's fee must be in Waves") | |
93 | 100 | else { | |
94 | - | let o = toString( | |
95 | - | let | |
96 | - | WriteSet( | |
101 | + | let o = toString(K) | |
102 | + | let L = [DataEntry(d, h), DataEntry(e, A), DataEntry((((h + "_") + o) + "_tickets"), n(h, o, G.amount)), DataEntry((h + "_players"), g(h, o)), DataEntry(f, x(G.amount))] | |
103 | + | WriteSet(L) | |
97 | 104 | } | |
98 | 105 | } | |
99 | 106 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = ((100 * 1000) * 1000) | |
5 | 5 | ||
6 | 6 | let b = ((5 * a) / 1000) | |
7 | 7 | ||
8 | 8 | let c = 100 | |
9 | 9 | ||
10 | 10 | let d = "$CURRENT_GAME" | |
11 | 11 | ||
12 | 12 | let e = "$GAME_NUM" | |
13 | 13 | ||
14 | 14 | let f = "$LAST_TICKET" | |
15 | 15 | ||
16 | 16 | func g (h,i) = { | |
17 | 17 | let j = isDefined(getString(this, (h + "_players"))) | |
18 | 18 | if (!(j)) | |
19 | 19 | then i | |
20 | 20 | else if (isDefined(getString(this, (((h + "_") + i) + "_tickets")))) | |
21 | 21 | then getStringValue(this, (h + "_players")) | |
22 | 22 | else ((getStringValue(this, (h + "_players")) + "_") + i) | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func k (l) = { | |
27 | 27 | let m = size(l) | |
28 | 28 | if ((m == 0)) | |
29 | 29 | then throw("Parameter size must be greater then 0") | |
30 | 30 | else if ((m > 99)) | |
31 | 31 | then throw("Parameter size must be less then 100") | |
32 | 32 | else if ((10 > m)) | |
33 | 33 | then (("0" + toString(m)) + l) | |
34 | 34 | else (toString(m) + l) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func n (h,o,p) = { | |
39 | 39 | let q = getIntegerValue(this, f) | |
40 | 40 | let r = (p / a) | |
41 | 41 | let s = (q + 1) | |
42 | 42 | let t = (s + (r * c)) | |
43 | 43 | let u = ((k(toString(s)) + "_") + k(toString(t))) | |
44 | 44 | let v = isDefined(getString(this, (((h + "_") + o) + "_tickets"))) | |
45 | 45 | if (v) | |
46 | 46 | then { | |
47 | 47 | let w = getStringValue(this, (((h + "_") + o) + "_tickets")) | |
48 | 48 | ((w + " ") + u) | |
49 | 49 | } | |
50 | 50 | else u | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | - | func x (h,y) = if ((h == y)) | |
54 | + | func x (p) = { | |
55 | + | let q = getIntegerValue(this, f) | |
56 | + | let r = (p / a) | |
57 | + | (q + (r * c)) | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | func y (h,z) = if ((h == z)) | |
55 | 62 | then { | |
56 | - | let | |
57 | - | let | |
58 | - | if ($isInstanceOf( | |
63 | + | let A = { | |
64 | + | let B = getInteger(this, e) | |
65 | + | if ($isInstanceOf(B, "Int")) | |
59 | 66 | then { | |
60 | - | let | |
61 | - | | |
67 | + | let C = B | |
68 | + | C | |
62 | 69 | } | |
63 | 70 | else 0 | |
64 | 71 | } | |
65 | - | toString(( | |
72 | + | toString((A + 1)) | |
66 | 73 | } | |
67 | 74 | else toString(getIntegerValue(this, e)) | |
68 | 75 | ||
69 | 76 | ||
70 | - | func | |
77 | + | func D (z) = { | |
71 | 78 | let h = getStringValue(this, d) | |
72 | - | let | |
73 | - | if ( | |
79 | + | let E = isDefined(getString(this, (h + "_result"))) | |
80 | + | if (E) | |
74 | 81 | then h | |
75 | - | else | |
82 | + | else z | |
76 | 83 | } | |
77 | 84 | ||
78 | 85 | ||
79 | - | @Callable( | |
86 | + | @Callable(F) | |
80 | 87 | func bet () = { | |
81 | - | let | |
82 | - | let h = | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | if ( | |
88 | + | let z = toBase58String(F.transactionId) | |
89 | + | let h = D(z) | |
90 | + | let A = y(h, z) | |
91 | + | let G = extract(F.payment) | |
92 | + | let H = isDefined(G.assetId) | |
93 | + | let I = isDefined(G.assetId) | |
94 | + | let J = toBase58String(F.callerPublicKey) | |
95 | + | let K = addressFromPublicKey(fromBase58String(J)) | |
96 | + | if (H) | |
90 | 97 | then throw("Bet amount must be in Waves") | |
91 | - | else if ( | |
98 | + | else if (I) | |
92 | 99 | then throw("Transaction's fee must be in Waves") | |
93 | 100 | else { | |
94 | - | let o = toString( | |
95 | - | let | |
96 | - | WriteSet( | |
101 | + | let o = toString(K) | |
102 | + | let L = [DataEntry(d, h), DataEntry(e, A), DataEntry((((h + "_") + o) + "_tickets"), n(h, o, G.amount)), DataEntry((h + "_players"), g(h, o)), DataEntry(f, x(G.amount))] | |
103 | + | WriteSet(L) | |
97 | 104 | } | |
98 | 105 | } | |
99 | 106 | ||
100 | 107 |
github/deemru/w8io/169f3d6 40.45 ms ◑