tx · ACTuEEnfsTS4G32c8TdabeUCdNAQG6NQrMShCidNWiay 3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc: -0.01400000 Waves 2019.09.08 12:12 [666901] smart account 3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc > SELF 0.00000000 Waves
{ "type": 13, "id": "ACTuEEnfsTS4G32c8TdabeUCdNAQG6NQrMShCidNWiay", "fee": 1400000, "feeAssetId": null, "timestamp": 1567933999911, "version": 1, "sender": "3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc", "senderPublicKey": "9cETBksYN8YMHGvDB6BEqmH9HScpCMBRZwnjCviRQ9aA", "proofs": [ "5tscMVjbZ4oUpuEc3Bm8JCSibXguoQzNXmPgNXPHMnVfidJMetY6XfwPnyhYdhXGbbTkSZGfhMj9UVyZVSerAgHQ" ], "script": "base64:AAIDAAAAAAAAAAAAAAARAAAAAAVQUklDRQAAAAAABfXhAAAAAAALUEFURU5UUFJJQ0UAAAAAAAvrwgAAAAAABk9SQUNMRQIAAAAjM012aXNEZkE2dk5nNGk2aUtZV1o4Yld2eVA0aW1mQmI5ZXEAAAAAA1dJTgIAAAADV0lOAAAAAARMT1NFAgAAAARMT1NFAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEXZhbGlkY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AAAAAAAABBQAAAANuaWwAAAAA2patwQ==", "chainId": 84, "height": 666901, "spentComplexity": 0 } View: original | compacted Prev: 7163RmMFwUG5WXdkAkUzBLT5pdRUAhWEeYvNBgS4dngs Next: 6SqBpdzyNuRDS4TWdbwA4nC4TLXyGre3hzDEQDrUepJv Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = 200000000 | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "3MvisDfA6vNg4i6iKYWZ8bWvyP4imfBb9eq" | |
9 | 9 | ||
10 | 10 | let d = "WIN" | |
11 | 11 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(K) | |
140 | - | func | |
140 | + | func gameReport (P,Q,R) = { | |
141 | 141 | let S = toBase58String(K.caller.bytes) | |
142 | 142 | if ((S != c)) | |
143 | 143 | then throw("only oracle can inform about games results") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = 200000000 | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "3MvisDfA6vNg4i6iKYWZ8bWvyP4imfBb9eq" | |
9 | 9 | ||
10 | 10 | let d = "WIN" | |
11 | 11 | ||
12 | 12 | let e = "LOSE" | |
13 | 13 | ||
14 | 14 | let f = "none" | |
15 | 15 | ||
16 | 16 | func g (h) = { | |
17 | 17 | let i = { | |
18 | 18 | let j = getInteger(this, h) | |
19 | 19 | if ($isInstanceOf(j, "Int")) | |
20 | 20 | then { | |
21 | 21 | let k = j | |
22 | 22 | k | |
23 | 23 | } | |
24 | 24 | else 0 | |
25 | 25 | } | |
26 | 26 | i | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func l (h) = { | |
31 | 31 | let m = { | |
32 | 32 | let j = getString(this, h) | |
33 | 33 | if ($isInstanceOf(j, "String")) | |
34 | 34 | then { | |
35 | 35 | let k = j | |
36 | 36 | k | |
37 | 37 | } | |
38 | 38 | else f | |
39 | 39 | } | |
40 | 40 | m | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func n (o,p,q,r) = if ((o > q)) | |
45 | 45 | then false | |
46 | 46 | else if (if ((o == q)) | |
47 | 47 | then (p > r) | |
48 | 48 | else false) | |
49 | 49 | then false | |
50 | 50 | else true | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func s (o,p,q,r,t,u,v,w,x,y,z,A) = if (!(n(o, p, q, r))) | |
54 | 54 | then false | |
55 | 55 | else if (!(n(q, r, t, u))) | |
56 | 56 | then false | |
57 | 57 | else if (!(n(t, u, v, w))) | |
58 | 58 | then false | |
59 | 59 | else if (!(n(v, w, x, y))) | |
60 | 60 | then false | |
61 | 61 | else if (!(n(x, y, z, A))) | |
62 | 62 | then false | |
63 | 63 | else true | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func B (o,p,q,r,t,u,v,w,x,y,z,A) = ((((((((((((((((((((((toString(o) + ",") + toString(p)) + ";") + toString(q)) + ",") + toString(r)) + ";") + toString(t)) + ",") + toString(u)) + ";") + toString(v)) + ",") + toString(w)) + ";") + toString(x)) + ",") + toString(y)) + ";") + toString(z)) + ",") + toString(A)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func C (D) = (D + "_balance") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func E (D) = g(C(D)) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func F (G) = (G + "_wincnt") | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func H (G) = g(F(G)) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func I (G) = (G + "_losecnt") | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func J (G) = g(I(G)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | @Callable(K) | |
88 | 88 | func patent (o,p,q,r,t,u,v,w,x,y,z,A) = { | |
89 | 89 | let L = extract(K.payment) | |
90 | 90 | if (isDefined(L.assetId)) | |
91 | 91 | then throw("can use WAVES only at the moment") | |
92 | 92 | else { | |
93 | 93 | let M = toBase58String(K.caller.bytes) | |
94 | 94 | if ((L.amount != a)) | |
95 | 95 | then throw("purchase amount cannot be not equal to the price") | |
96 | 96 | else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A))) | |
97 | 97 | then throw("invalid coordinates order") | |
98 | 98 | else if ((l(B(o, p, q, r, t, u, v, w, x, y, z, A)) != f)) | |
99 | 99 | then throw("this patent is already exists") | |
100 | 100 | else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), M)]) | |
101 | 101 | } | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(K) | |
107 | 107 | func buyPatent (o,p,q,r,t,u,v,w,x,y,z,A) = { | |
108 | 108 | let L = extract(K.payment) | |
109 | 109 | if (isDefined(L.assetId)) | |
110 | 110 | then throw("can use WAVES only at the moment") | |
111 | 111 | else { | |
112 | 112 | let M = toBase58String(K.caller.bytes) | |
113 | 113 | let N = l(B(o, p, q, r, t, u, v, w, x, y, z, A)) | |
114 | 114 | if ((L.amount != b)) | |
115 | 115 | then throw("purchase amount cannot be not equal to the price") | |
116 | 116 | else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A))) | |
117 | 117 | then throw("invalid coordinates order") | |
118 | 118 | else if ((N == f)) | |
119 | 119 | then throw("there is no such patent") | |
120 | 120 | else if ((N == M)) | |
121 | 121 | then throw("you cannot buy your own patent") | |
122 | 122 | else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), M), DataEntry(C(N), (E(N) + L.amount))]) | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(K) | |
129 | 129 | func withdraw () = { | |
130 | 130 | let M = toBase58String(K.caller.bytes) | |
131 | 131 | let O = E(M) | |
132 | 132 | if ((0 >= O)) | |
133 | 133 | then throw("insufficient balance") | |
134 | 134 | else ScriptResult(WriteSet([DataEntry(C(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), O, unit)])) | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(K) | |
140 | - | func | |
140 | + | func gameReport (P,Q,R) = { | |
141 | 141 | let S = toBase58String(K.caller.bytes) | |
142 | 142 | if ((S != c)) | |
143 | 143 | then throw("only oracle can inform about games results") | |
144 | 144 | else if ((Q == R)) | |
145 | 145 | then throw("winner and loser must be different") | |
146 | 146 | else if ((l(P) != f)) | |
147 | 147 | then throw("this game has already been played") | |
148 | 148 | else WriteSet([DataEntry(P, (((Q + "-WIN;") + R) + "-LOSE")), DataEntry(F(Q), (H(Q) + 1)), DataEntry(I(R), (J(R) + 1))]) | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 |
github/deemru/w8io/026f985 31.04 ms ◑