tx · Vzswnt7gd2A5f1f7uwyfSoRmTwGhiLfkLkfqHH6kP2E

3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc:  -0.01400000 Waves

2019.09.08 12:30 [666918] smart account 3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc > SELF 0.00000000 Waves

{ "type": 13, "id": "Vzswnt7gd2A5f1f7uwyfSoRmTwGhiLfkLkfqHH6kP2E", "fee": 1400000, "feeAssetId": null, "timestamp": 1567935022111, "version": 1, "sender": "3N18S8xfWJYHVuGfJcpcPVh7LsnqR9hKTcc", "senderPublicKey": "9cETBksYN8YMHGvDB6BEqmH9HScpCMBRZwnjCviRQ9aA", "proofs": [ "2tFPz6YgYyXcV8XWe23ipw4BJL5VaE1ywNE586yd1eHTCG9v52KKt38combPhBf3MmjpYSpPYfgmQWHRF1Ea9PVb" ], "script": "base64:AAIDAAAAAAAAAAAAAAATAAAAAAVQUklDRQAAAAAABfXhAAAAAAALUEFURU5UUFJJQ0UAAAAAAAvrwgAAAAAABk9SQUNMRQIAAAAjM012aXNEZkE2dk5nNGk2aUtZV1o4Yld2eVA0aW1mQmI5ZXEAAAAAA1dJTgIAAAADV0lOAAAAAARMT1NFAgAAAARMT1NFAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEXZh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nQAAAABBQAAAAZ3aW5uZXIJAABkAAAAAgkBAAAAEGdldFZhbHVlV2luQ291bnQAAAABBQAAAAZ3aW5uZXIAAAAAAAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRLZXlMb3NlQ291bnQAAAABBQAAAAVsb3NlcgkAAGQAAAACCQEAAAARZ2V0VmFsdWVMb3NlQ291bnQAAAABBQAAAAVsb3NlcgAAAAAAAAAAAQUAAAADbmlsAAAAAPKxcdI=", "chainId": 84, "height": 666918, "spentComplexity": 0 } View: original | compacted Prev: 6SqBpdzyNuRDS4TWdbwA4nC4TLXyGre3hzDEQDrUepJv Next: 5kXvuNXuHnR48SPhf4ffSCSz5SDzhS1g8ehCzuPDv7fg Diff:
OldNewDifferences
8484 func J (G) = g(I(G))
8585
8686
87-@Callable(K)
87+func K (L) = ("game_" + L)
88+
89+
90+func M (L) = l(K(L))
91+
92+
93+@Callable(N)
8894 func patent (o,p,q,r,t,u,v,w,x,y,z,A) = {
89- let L = extract(K.payment)
90- if (isDefined(L.assetId))
95+ let O = extract(N.payment)
96+ if (isDefined(O.assetId))
9197 then throw("can use WAVES only at the moment")
9298 else {
93- let M = toBase58String(K.caller.bytes)
94- if ((L.amount != a))
99+ let P = toBase58String(N.caller.bytes)
100+ if ((O.amount != a))
95101 then throw("purchase amount cannot be not equal to the price")
96102 else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A)))
97103 then throw("invalid coordinates order")
98104 else if ((l(B(o, p, q, r, t, u, v, w, x, y, z, A)) != f))
99105 then throw("this patent is already exists")
100- else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), M)])
106+ else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), P)])
101107 }
102108 }
103109
104110
105111
106-@Callable(K)
112+@Callable(N)
107113 func buyPatent (o,p,q,r,t,u,v,w,x,y,z,A) = {
108- let L = extract(K.payment)
109- if (isDefined(L.assetId))
114+ let O = extract(N.payment)
115+ if (isDefined(O.assetId))
110116 then throw("can use WAVES only at the moment")
111117 else {
112- let M = toBase58String(K.caller.bytes)
113- let N = l(B(o, p, q, r, t, u, v, w, x, y, z, A))
114- if ((L.amount != b))
118+ let P = toBase58String(N.caller.bytes)
119+ let Q = l(B(o, p, q, r, t, u, v, w, x, y, z, A))
120+ if ((O.amount != b))
115121 then throw("purchase amount cannot be not equal to the price")
116122 else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A)))
117123 then throw("invalid coordinates order")
118- else if ((N == f))
124+ else if ((Q == f))
119125 then throw("there is no such patent")
120- else if ((N == M))
126+ else if ((Q == P))
121127 then throw("you cannot buy your own patent")
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))])
128+ else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), P), DataEntry(C(Q), (E(Q) + O.amount))])
123129 }
124130 }
125131
126132
127133
128-@Callable(K)
134+@Callable(N)
129135 func withdraw () = {
130- let M = toBase58String(K.caller.bytes)
131- let O = E(M)
132- if ((0 >= O))
136+ let P = toBase58String(N.caller.bytes)
137+ let R = E(P)
138+ if ((0 >= R))
133139 then throw("insufficient balance")
134- else ScriptResult(WriteSet([DataEntry(C(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), O, unit)]))
140+ else ScriptResult(WriteSet([DataEntry(C(P), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(P), R, unit)]))
135141 }
136142
137143
138144
139-@Callable(K)
140-func gameReport (P,Q,R) = {
141- let S = toBase58String(K.caller.bytes)
142- if ((S != c))
145+@Callable(N)
146+func gameReport (L,S,T) = {
147+ let U = toBase58String(N.caller.bytes)
148+ if ((U != c))
143149 then throw("only oracle can inform about games results")
144- else if ((Q == R))
150+ else if ((S == T))
145151 then throw("winner and loser must be different")
146- else if ((l(P) != f))
152+ else if ((M(L) != f))
147153 then throw("this game has already been played")
148- else WriteSet([DataEntry(("game_" + P), (((Q + "-WIN;") + R) + "-LOSE")), DataEntry(F(Q), (H(Q) + 1)), DataEntry(I(R), (J(R) + 1))])
154+ else WriteSet([DataEntry(K(L), (((S + "-WIN;") + T) + "-LOSE")), DataEntry(F(S), (H(S) + 1)), DataEntry(I(T), (J(T) + 1))])
149155 }
150156
151157
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 100000000
55
66 let b = 200000000
77
88 let c = "3MvisDfA6vNg4i6iKYWZ8bWvyP4imfBb9eq"
99
1010 let d = "WIN"
1111
1212 let e = "LOSE"
1313
1414 let f = "none"
1515
1616 func g (h) = {
1717 let i = {
1818 let j = getInteger(this, h)
1919 if ($isInstanceOf(j, "Int"))
2020 then {
2121 let k = j
2222 k
2323 }
2424 else 0
2525 }
2626 i
2727 }
2828
2929
3030 func l (h) = {
3131 let m = {
3232 let j = getString(this, h)
3333 if ($isInstanceOf(j, "String"))
3434 then {
3535 let k = j
3636 k
3737 }
3838 else f
3939 }
4040 m
4141 }
4242
4343
4444 func n (o,p,q,r) = if ((o > q))
4545 then false
4646 else if (if ((o == q))
4747 then (p > r)
4848 else false)
4949 then false
5050 else true
5151
5252
5353 func s (o,p,q,r,t,u,v,w,x,y,z,A) = if (!(n(o, p, q, r)))
5454 then false
5555 else if (!(n(q, r, t, u)))
5656 then false
5757 else if (!(n(t, u, v, w)))
5858 then false
5959 else if (!(n(v, w, x, y)))
6060 then false
6161 else if (!(n(x, y, z, A)))
6262 then false
6363 else true
6464
6565
6666 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))
6767
6868
6969 func C (D) = (D + "_balance")
7070
7171
7272 func E (D) = g(C(D))
7373
7474
7575 func F (G) = (G + "_wincnt")
7676
7777
7878 func H (G) = g(F(G))
7979
8080
8181 func I (G) = (G + "_losecnt")
8282
8383
8484 func J (G) = g(I(G))
8585
8686
87-@Callable(K)
87+func K (L) = ("game_" + L)
88+
89+
90+func M (L) = l(K(L))
91+
92+
93+@Callable(N)
8894 func patent (o,p,q,r,t,u,v,w,x,y,z,A) = {
89- let L = extract(K.payment)
90- if (isDefined(L.assetId))
95+ let O = extract(N.payment)
96+ if (isDefined(O.assetId))
9197 then throw("can use WAVES only at the moment")
9298 else {
93- let M = toBase58String(K.caller.bytes)
94- if ((L.amount != a))
99+ let P = toBase58String(N.caller.bytes)
100+ if ((O.amount != a))
95101 then throw("purchase amount cannot be not equal to the price")
96102 else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A)))
97103 then throw("invalid coordinates order")
98104 else if ((l(B(o, p, q, r, t, u, v, w, x, y, z, A)) != f))
99105 then throw("this patent is already exists")
100- else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), M)])
106+ else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), P)])
101107 }
102108 }
103109
104110
105111
106-@Callable(K)
112+@Callable(N)
107113 func buyPatent (o,p,q,r,t,u,v,w,x,y,z,A) = {
108- let L = extract(K.payment)
109- if (isDefined(L.assetId))
114+ let O = extract(N.payment)
115+ if (isDefined(O.assetId))
110116 then throw("can use WAVES only at the moment")
111117 else {
112- let M = toBase58String(K.caller.bytes)
113- let N = l(B(o, p, q, r, t, u, v, w, x, y, z, A))
114- if ((L.amount != b))
118+ let P = toBase58String(N.caller.bytes)
119+ let Q = l(B(o, p, q, r, t, u, v, w, x, y, z, A))
120+ if ((O.amount != b))
115121 then throw("purchase amount cannot be not equal to the price")
116122 else if (!(s(o, p, q, r, t, u, v, w, x, y, z, A)))
117123 then throw("invalid coordinates order")
118- else if ((N == f))
124+ else if ((Q == f))
119125 then throw("there is no such patent")
120- else if ((N == M))
126+ else if ((Q == P))
121127 then throw("you cannot buy your own patent")
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))])
128+ else WriteSet([DataEntry(B(o, p, q, r, t, u, v, w, x, y, z, A), P), DataEntry(C(Q), (E(Q) + O.amount))])
123129 }
124130 }
125131
126132
127133
128-@Callable(K)
134+@Callable(N)
129135 func withdraw () = {
130- let M = toBase58String(K.caller.bytes)
131- let O = E(M)
132- if ((0 >= O))
136+ let P = toBase58String(N.caller.bytes)
137+ let R = E(P)
138+ if ((0 >= R))
133139 then throw("insufficient balance")
134- else ScriptResult(WriteSet([DataEntry(C(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), O, unit)]))
140+ else ScriptResult(WriteSet([DataEntry(C(P), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(P), R, unit)]))
135141 }
136142
137143
138144
139-@Callable(K)
140-func gameReport (P,Q,R) = {
141- let S = toBase58String(K.caller.bytes)
142- if ((S != c))
145+@Callable(N)
146+func gameReport (L,S,T) = {
147+ let U = toBase58String(N.caller.bytes)
148+ if ((U != c))
143149 then throw("only oracle can inform about games results")
144- else if ((Q == R))
150+ else if ((S == T))
145151 then throw("winner and loser must be different")
146- else if ((l(P) != f))
152+ else if ((M(L) != f))
147153 then throw("this game has already been played")
148- else WriteSet([DataEntry(("game_" + P), (((Q + "-WIN;") + R) + "-LOSE")), DataEntry(F(Q), (H(Q) + 1)), DataEntry(I(R), (J(R) + 1))])
154+ else WriteSet([DataEntry(K(L), (((S + "-WIN;") + T) + "-LOSE")), DataEntry(F(S), (H(S) + 1)), DataEntry(I(T), (J(T) + 1))])
149155 }
150156
151157

github/deemru/w8io/169f3d6 
42.85 ms