tx · EGiRnhZ2zb6ppaNAcbGuqtdcXPPQGh8Edt8NcUDywvB6 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.24 15:27 [556166] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "EGiRnhZ2zb6ppaNAcbGuqtdcXPPQGh8Edt8NcUDywvB6", "fee": 1400000, "feeAssetId": null, "timestamp": 1561379230365, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "4oYXNyaKL55TsrCvNQcjQzha2QMpRuWYJA4pJAF9vuW99kxeDUkPvTzDnKDg2PdgcCTPzG13ZPUXFMQ4bm4xHnLK" ], "script": "base64:AAIDAAAAAAAAAAAAAAAPAAAAAA9TZXJ2ZXJQdWJsaWNLZXkBAAAAIAQ1/gW4L6VUuKyMox3deX07Tu0dL8x1obg+vYqfUuwTAAAAABBSb3VsZXR0ZVNlY3Rpb25zAAAAAAAAAAAVAAAAABFEYXRhR2FtZU51bWJlcktleQIAAAALQVBQX0dBTUVfSUQAAAAADURhdGFBbW91bnRLZXkCAAAABkFNT1VOVAAAAAAORGF0YVNlY3Rpb25LZXkCAAAAB1NFQ1RJT04AAAAADURhdGFTdGF0dXNLZXkCAAAABlNUQVRVUwAAAAANRGF0YVN0YXR1c05ldwIAAAADTkVXAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAABVFcnJvck11c3RHcmVhdGVyVGhhbjACAAAAJVBhcmFtZXRlciBzaXplIG11c3QgYmUgZ3JlYXRlciB0aGFuIDAAAAAAFEVycm9yTXVzdExlc3NUaGFuMTAwAgAAACRQYXJhbWV0ZXIgc2l6ZSBtdXN0IGJlIGxlc3MgdGhhbiAxMDAAAAAAFUV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RTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwBgcHaUNugw==", "chainId": 84, "height": 556166, "spentComplexity": 0 } View: original | compacted Prev: 5tHV3wuijJHDsAixUxdf6yqZMs5kA1eFjWPLFtVoUUM3 Next: 7mVp76F4UpMeDWKvdDEYANqpQt8Ve2z29SWPoeifPe8m Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let c = "APP_GAME_ID" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "AMOUNT" | |
11 | 11 | ||
12 | - | func e () = { | |
13 | - | let f = { | |
14 | - | let g = getInteger(this, c) | |
15 | - | if ($isInstanceOf(g, "Int")) | |
12 | + | let e = "SECTION" | |
13 | + | ||
14 | + | let f = "STATUS" | |
15 | + | ||
16 | + | let g = "NEW" | |
17 | + | ||
18 | + | let h = "error_only_waves_accepted" | |
19 | + | ||
20 | + | let i = "Parameter size must be greater than 0" | |
21 | + | ||
22 | + | let j = "Parameter size must be less than 100" | |
23 | + | ||
24 | + | let k = "Bet amount must be in Waves" | |
25 | + | ||
26 | + | let l = "Transaction's fee must be in Waves" | |
27 | + | ||
28 | + | let m = "Passed txId had been used before. Game aborted." | |
29 | + | ||
30 | + | func n (o,p,q) = DataEntry(((o + "_") + p), q) | |
31 | + | ||
32 | + | ||
33 | + | func r () = { | |
34 | + | let s = { | |
35 | + | let t = getInteger(this, c) | |
36 | + | if ($isInstanceOf(t, "Int")) | |
16 | 37 | then { | |
17 | - | let | |
18 | - | | |
38 | + | let u = t | |
39 | + | u | |
19 | 40 | } | |
20 | 41 | else 0 | |
21 | 42 | } | |
22 | - | ( | |
43 | + | (s + 1) | |
23 | 44 | } | |
24 | 45 | ||
25 | 46 | ||
26 | - | @Callable( | |
27 | - | func GenerateRandInt ( | |
28 | - | let | |
29 | - | if ( | |
47 | + | @Callable(v) | |
48 | + | func GenerateRandInt (w,x) = { | |
49 | + | let y = sigVerify(fromBase58String(w), fromBase58String(x), a) | |
50 | + | if (y) | |
30 | 51 | then { | |
31 | - | let | |
32 | - | WriteSet([DataEntry("orig", toInt(sha256(toBytes( | |
52 | + | let z = (toInt(sha256(toBytes(x))) % b) | |
53 | + | WriteSet([DataEntry("orig", toInt(sha256(toBytes(x)))), DataEntry("rand", z)]) | |
33 | 54 | } | |
34 | 55 | else throw("Invalid RSA signature") | |
35 | 56 | } | |
36 | 57 | ||
37 | 58 | ||
38 | 59 | ||
39 | - | @Callable(i) | |
40 | - | func bet (n) = { | |
41 | - | let o = e() | |
42 | - | let j = toBase58String(i.transactionId) | |
43 | - | let p = extract(i.payment) | |
44 | - | WriteSet([DataEntry("orig", ""), DataEntry("rand", "")]) | |
60 | + | @Callable(v) | |
61 | + | func bet (A) = { | |
62 | + | let B = r() | |
63 | + | let C = toBase58String(v.transactionId) | |
64 | + | let D = toBase58String(v.caller.bytes) | |
65 | + | let E = extract(v.payment) | |
66 | + | let F = isDefined(getString(this, C)) | |
67 | + | let G = isDefined(E.assetId) | |
68 | + | let H = isDefined(E.assetId) | |
69 | + | let I = E.amount | |
70 | + | if (G) | |
71 | + | then throw(k) | |
72 | + | else if (H) | |
73 | + | then throw(l) | |
74 | + | else if (F) | |
75 | + | then throw(m) | |
76 | + | else WriteSet([DataEntry(C, D), DataEntry(c, toString(B)), n(C, d, toString(I)), n(C, e, toString(A)), n(C, f, g)]) | |
45 | 77 | } | |
46 | 78 | ||
47 | 79 | ||
48 | 80 | ||
49 | - | @Callable( | |
50 | - | func bet111 ( | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | if ($isInstanceOf( | |
81 | + | @Callable(v) | |
82 | + | func bet111 (A) = { | |
83 | + | let J = "last_auction_id" | |
84 | + | let K = { | |
85 | + | let t = getInteger(this, J) | |
86 | + | if ($isInstanceOf(t, "Int")) | |
55 | 87 | then { | |
56 | - | let | |
57 | - | | |
88 | + | let L = t | |
89 | + | L | |
58 | 90 | } | |
59 | 91 | else 0 | |
60 | 92 | } | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | if (isDefined( | |
66 | - | then throw( | |
93 | + | let M = (K + 1) | |
94 | + | let N = toString(M) | |
95 | + | let O = toBase58String(v.caller.bytes) | |
96 | + | let E = value(v.payment) | |
97 | + | if (isDefined(E.assetId)) | |
98 | + | then throw(h) | |
67 | 99 | else { | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | if ($isInstanceOf( | |
100 | + | let P = toBase58String(value(E.assetId)) | |
101 | + | let Q = (("auction_" + N) + "_duration") | |
102 | + | let R = (("auction_" + N) + "_min_bid") | |
103 | + | let S = (("auction_" + N) + "_last_bid") | |
104 | + | let T = (("auction_" + N) + "_last_bid_owner") | |
105 | + | let U = (("auction_" + N) + "_owner") | |
106 | + | let V = (("auction_" + N) + "_amount") | |
107 | + | let W = (("auction_" + N) + "_asset_id") | |
108 | + | let X = (("auction_" + N) + "_is_active") | |
109 | + | let Y = ((("balance_" + O) + "_") + P) | |
110 | + | let Z = { | |
111 | + | let t = getInteger(this, Y) | |
112 | + | if ($isInstanceOf(t, "Int")) | |
81 | 113 | then { | |
82 | - | let | |
83 | - | | |
114 | + | let L = t | |
115 | + | L | |
84 | 116 | } | |
85 | 117 | else 0 | |
86 | 118 | } | |
87 | - | let | |
88 | - | WriteSet([DataEntry( | |
119 | + | let aa = (Z + E.amount) | |
120 | + | WriteSet([DataEntry(S, 0), DataEntry(U, O), DataEntry(V, E.amount), DataEntry(W, P), DataEntry(Y, aa), DataEntry(X, true), DataEntry(T, ""), DataEntry(J, M)]) | |
89 | 121 | } | |
90 | 122 | } | |
91 | 123 | ||
92 | 124 | ||
93 | - | @Verifier( | |
94 | - | func | |
125 | + | @Verifier(ab) | |
126 | + | func ac () = if (sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey)) | |
95 | 127 | then { | |
96 | - | let | |
97 | - | if ($isInstanceOf( | |
128 | + | let t = ab | |
129 | + | if ($isInstanceOf(t, "SetScriptTransaction")) | |
98 | 130 | then { | |
99 | - | let | |
131 | + | let ad = t | |
100 | 132 | true | |
101 | 133 | } | |
102 | 134 | else false |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'HSP9V7edVKjfLJUfRkEF6vfV9Tyz4Us4yqH9rkwqnHY' | |
5 | 5 | ||
6 | 6 | let b = 21 | |
7 | 7 | ||
8 | 8 | let c = "APP_GAME_ID" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "AMOUNT" | |
11 | 11 | ||
12 | - | func e () = { | |
13 | - | let f = { | |
14 | - | let g = getInteger(this, c) | |
15 | - | if ($isInstanceOf(g, "Int")) | |
12 | + | let e = "SECTION" | |
13 | + | ||
14 | + | let f = "STATUS" | |
15 | + | ||
16 | + | let g = "NEW" | |
17 | + | ||
18 | + | let h = "error_only_waves_accepted" | |
19 | + | ||
20 | + | let i = "Parameter size must be greater than 0" | |
21 | + | ||
22 | + | let j = "Parameter size must be less than 100" | |
23 | + | ||
24 | + | let k = "Bet amount must be in Waves" | |
25 | + | ||
26 | + | let l = "Transaction's fee must be in Waves" | |
27 | + | ||
28 | + | let m = "Passed txId had been used before. Game aborted." | |
29 | + | ||
30 | + | func n (o,p,q) = DataEntry(((o + "_") + p), q) | |
31 | + | ||
32 | + | ||
33 | + | func r () = { | |
34 | + | let s = { | |
35 | + | let t = getInteger(this, c) | |
36 | + | if ($isInstanceOf(t, "Int")) | |
16 | 37 | then { | |
17 | - | let | |
18 | - | | |
38 | + | let u = t | |
39 | + | u | |
19 | 40 | } | |
20 | 41 | else 0 | |
21 | 42 | } | |
22 | - | ( | |
43 | + | (s + 1) | |
23 | 44 | } | |
24 | 45 | ||
25 | 46 | ||
26 | - | @Callable( | |
27 | - | func GenerateRandInt ( | |
28 | - | let | |
29 | - | if ( | |
47 | + | @Callable(v) | |
48 | + | func GenerateRandInt (w,x) = { | |
49 | + | let y = sigVerify(fromBase58String(w), fromBase58String(x), a) | |
50 | + | if (y) | |
30 | 51 | then { | |
31 | - | let | |
32 | - | WriteSet([DataEntry("orig", toInt(sha256(toBytes( | |
52 | + | let z = (toInt(sha256(toBytes(x))) % b) | |
53 | + | WriteSet([DataEntry("orig", toInt(sha256(toBytes(x)))), DataEntry("rand", z)]) | |
33 | 54 | } | |
34 | 55 | else throw("Invalid RSA signature") | |
35 | 56 | } | |
36 | 57 | ||
37 | 58 | ||
38 | 59 | ||
39 | - | @Callable(i) | |
40 | - | func bet (n) = { | |
41 | - | let o = e() | |
42 | - | let j = toBase58String(i.transactionId) | |
43 | - | let p = extract(i.payment) | |
44 | - | WriteSet([DataEntry("orig", ""), DataEntry("rand", "")]) | |
60 | + | @Callable(v) | |
61 | + | func bet (A) = { | |
62 | + | let B = r() | |
63 | + | let C = toBase58String(v.transactionId) | |
64 | + | let D = toBase58String(v.caller.bytes) | |
65 | + | let E = extract(v.payment) | |
66 | + | let F = isDefined(getString(this, C)) | |
67 | + | let G = isDefined(E.assetId) | |
68 | + | let H = isDefined(E.assetId) | |
69 | + | let I = E.amount | |
70 | + | if (G) | |
71 | + | then throw(k) | |
72 | + | else if (H) | |
73 | + | then throw(l) | |
74 | + | else if (F) | |
75 | + | then throw(m) | |
76 | + | else WriteSet([DataEntry(C, D), DataEntry(c, toString(B)), n(C, d, toString(I)), n(C, e, toString(A)), n(C, f, g)]) | |
45 | 77 | } | |
46 | 78 | ||
47 | 79 | ||
48 | 80 | ||
49 | - | @Callable( | |
50 | - | func bet111 ( | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | if ($isInstanceOf( | |
81 | + | @Callable(v) | |
82 | + | func bet111 (A) = { | |
83 | + | let J = "last_auction_id" | |
84 | + | let K = { | |
85 | + | let t = getInteger(this, J) | |
86 | + | if ($isInstanceOf(t, "Int")) | |
55 | 87 | then { | |
56 | - | let | |
57 | - | | |
88 | + | let L = t | |
89 | + | L | |
58 | 90 | } | |
59 | 91 | else 0 | |
60 | 92 | } | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | if (isDefined( | |
66 | - | then throw( | |
93 | + | let M = (K + 1) | |
94 | + | let N = toString(M) | |
95 | + | let O = toBase58String(v.caller.bytes) | |
96 | + | let E = value(v.payment) | |
97 | + | if (isDefined(E.assetId)) | |
98 | + | then throw(h) | |
67 | 99 | else { | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | if ($isInstanceOf( | |
100 | + | let P = toBase58String(value(E.assetId)) | |
101 | + | let Q = (("auction_" + N) + "_duration") | |
102 | + | let R = (("auction_" + N) + "_min_bid") | |
103 | + | let S = (("auction_" + N) + "_last_bid") | |
104 | + | let T = (("auction_" + N) + "_last_bid_owner") | |
105 | + | let U = (("auction_" + N) + "_owner") | |
106 | + | let V = (("auction_" + N) + "_amount") | |
107 | + | let W = (("auction_" + N) + "_asset_id") | |
108 | + | let X = (("auction_" + N) + "_is_active") | |
109 | + | let Y = ((("balance_" + O) + "_") + P) | |
110 | + | let Z = { | |
111 | + | let t = getInteger(this, Y) | |
112 | + | if ($isInstanceOf(t, "Int")) | |
81 | 113 | then { | |
82 | - | let | |
83 | - | | |
114 | + | let L = t | |
115 | + | L | |
84 | 116 | } | |
85 | 117 | else 0 | |
86 | 118 | } | |
87 | - | let | |
88 | - | WriteSet([DataEntry( | |
119 | + | let aa = (Z + E.amount) | |
120 | + | WriteSet([DataEntry(S, 0), DataEntry(U, O), DataEntry(V, E.amount), DataEntry(W, P), DataEntry(Y, aa), DataEntry(X, true), DataEntry(T, ""), DataEntry(J, M)]) | |
89 | 121 | } | |
90 | 122 | } | |
91 | 123 | ||
92 | 124 | ||
93 | - | @Verifier( | |
94 | - | func | |
125 | + | @Verifier(ab) | |
126 | + | func ac () = if (sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey)) | |
95 | 127 | then { | |
96 | - | let | |
97 | - | if ($isInstanceOf( | |
128 | + | let t = ab | |
129 | + | if ($isInstanceOf(t, "SetScriptTransaction")) | |
98 | 130 | then { | |
99 | - | let | |
131 | + | let ad = t | |
100 | 132 | true | |
101 | 133 | } | |
102 | 134 | else false | |
103 | 135 | } | |
104 | 136 | else false | |
105 | 137 |
github/deemru/w8io/169f3d6 181.72 ms ◑