tx · 9s4HzRGug4Jii9dBtYjSao3raLMji4sJKJfJyhzC4Xdo

3N7a7sTSKaE621QewSqQcL1mUbknJjnLkZc:  -0.01000000 Waves

2021.10.22 18:05 [1757664] smart account 3N7a7sTSKaE621QewSqQcL1mUbknJjnLkZc > SELF 0.00000000 Waves

{ "type": 13, "id": "9s4HzRGug4Jii9dBtYjSao3raLMji4sJKJfJyhzC4Xdo", "fee": 1000000, "feeAssetId": null, "timestamp": 1634915174113, "version": 2, "chainId": 84, "sender": "3N7a7sTSKaE621QewSqQcL1mUbknJjnLkZc", "senderPublicKey": "6LrPmGtwuADhwHYcxBouLzwfSTGgucbwYG5Pja7LUrcd", "proofs": [ "5qjPU1fHLwnWm2AHzHfk5ds6UmUhTPMbZGhm2RksKLQ8Y6dCJrCvEjhWHa1GgwiJw8JvY1oQ9NP8AwVtESm7d1nV" ], "script": "base64:AAIFAAAAAAAAABcIAhIECgIIGRIDCgEBEgMKAQESAwoBAQAAABUAAAAACm9mZmVySWRLZXkCAAAADSRPRkZFUl9OVU1CRVIAAAAAB3Rlc3RLZXkCAAAABSRURVNUAAAAAA9vZmZlck9wZW5TdGF0dXMAAAAAAAAAAAEAAAAAE29mZmVyQ2FuY2VsZWRTdGF0dXMAAAAAAAAAAAIAAAAAE29mZmVyQWNjZXB0ZWRTdGF0dXMAAAAAAAAAAAMAAAAAE29mZmVyUmVqZWN0ZWRTdGF0dXMAAAAAAAAAAAQAAAAAEndhdmVzU3RhbmRJblN0cmluZwIAAAAFV0FWRVMAAAAAFndhdmVzU3RhbmRJbkJ5dGVWZWN0b3IJAAGbAAAAAQUAAAASd2F2ZXNTdGFuZEluU3RyaW5nAAAAABJ3YXZlc1N0YW5kSW5CYXNlNjQJAAJaAAAAAQUAAAAWd2F2ZXNTdGFuZEluQnl0ZVZlY3RvcgEAAAARZ2V0T2ZmZXJTdGF0dXNLZXkAAAABAAAAB29mZmVySWQJAAEsAAAAAgkAAaQAAAABBQAAAAdvZmZlcklkAgAAAAdf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hZGRyZXNzVG8FAAAACWNhbGxlclN0cgkAAAIAAAABAgAAABxvZmZlciBtdXN0IGJlIG1hZGUgdG8gY2FsbGVyCQEAAAAJZHJvcE9mZmVyAAAAAgUAAAAHb2ZmZXJJZAUAAAATb2ZmZXJSZWplY3RlZFN0YXR1cwAAAACuqEbJ", "height": 1757664, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: trJuHoX1NitFuvuN9RLQ4nq5rCwRBmH4qXBDwrvjfFu Next: EoQ5H2avxZKPCvwRrn7ZsNX841NZ9Ugb1CCkykAKJdYC Diff:
OldNewDifferences
8282 }
8383
8484
85-func B (k,o) = {
86- let u = fromBase64String(getStringValue(this, n(k, o)))
85+func B (t) = {
86+ let u = fromBase64String(getStringValue(this, t))
8787 if ((u == h))
8888 then unit
8989 else u
9292
9393 func C (k,D) = {
9494 let E = Address(fromBase58String(getStringValue(this, l(k))))
95- let F = B(k, 0)
95+ let F = B(n(k, 0))
9696 let G = s(p(k, 0))
9797 [IntegerEntry(j(k), D), ScriptTransfer(E, G, F)]
9898 }
135135 let M = toBase58String(H.caller.bytes)
136136 if ((N != M))
137137 then throw("offer must be made to caller")
138- else [IntegerEntry(j(k), e)]
138+ else {
139+ let O = B(q(k, 0))
140+ let P = s(r(k, 0))
141+ let K = value(H.payments[0])
142+ if (!(isDefined(K)))
143+ then throw("no payment")
144+ else if ((K.assetId != O))
145+ then throw("not same asset")
146+ else if ((K.amount != P))
147+ then throw("not same amount")
148+ else {
149+ let Q = B(n(k, 0))
150+ let R = s(p(k, 0))
151+ let S = Address(fromBase58String(getStringValue(this, l(k))))
152+ let T = Address(fromBase58String(getStringValue(this, l(k))))
153+[IntegerEntry(j(k), e), ScriptTransfer(S, P, O), ScriptTransfer(T, R, Q)]
154+ }
155+ }
139156 }
140157 }
141158
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "$OFFER_NUMBER"
55
66 let b = "$TEST"
77
88 let c = 1
99
1010 let d = 2
1111
1212 let e = 3
1313
1414 let f = 4
1515
1616 let g = "WAVES"
1717
1818 let h = toBytes(g)
1919
2020 let i = toBase64String(h)
2121
2222 func j (k) = (toString(k) + "_status")
2323
2424
2525 func l (k) = (toString(k) + "_from")
2626
2727
2828 func m (k) = (toString(k) + "_to")
2929
3030
3131 func n (k,o) = (((toString(k) + "_") + toString(o)) + "_offered_asset_id")
3232
3333
3434 func p (k,o) = (((toString(k) + "_") + toString(o)) + "_offered_asset_amount")
3535
3636
3737 func q (k,o) = (((toString(k) + "_") + toString(o)) + "_asked_asset_id")
3838
3939
4040 func r (k,o) = (((toString(k) + "_") + toString(o)) + "_asked_asset_amount")
4141
4242
4343 func s (t) = {
4444 let u = {
4545 let v = getInteger(this, t)
4646 if ($isInstanceOf(v, "Int"))
4747 then {
4848 let w = v
4949 w
5050 }
5151 else 0
5252 }
5353 u
5454 }
5555
5656
5757 func x (y) = {
5858 let z = {
5959 let v = y[0]
6060 if ($isInstanceOf(v, "String"))
6161 then {
6262 let w = v
6363 toBytes(w)
6464 }
6565 else throw("must have an assetId")
6666 }
6767 z
6868 }
6969
7070
7171 func A (y) = {
7272 let z = {
7373 let v = y[1]
7474 if ($isInstanceOf(v, "Int"))
7575 then {
7676 let w = v
7777 w
7878 }
7979 else throw("must have an amount")
8080 }
8181 z
8282 }
8383
8484
85-func B (k,o) = {
86- let u = fromBase64String(getStringValue(this, n(k, o)))
85+func B (t) = {
86+ let u = fromBase64String(getStringValue(this, t))
8787 if ((u == h))
8888 then unit
8989 else u
9090 }
9191
9292
9393 func C (k,D) = {
9494 let E = Address(fromBase58String(getStringValue(this, l(k))))
95- let F = B(k, 0)
95+ let F = B(n(k, 0))
9696 let G = s(p(k, 0))
9797 [IntegerEntry(j(k), D), ScriptTransfer(E, G, F)]
9898 }
9999
100100
101101 @Callable(H)
102102 func createOffer (I,J) = {
103103 let k = (s(a) + 1)
104104 let K = value(H.payments[0])
105105 if (!(isDefined(K)))
106106 then throw("no payment")
107107 else [IntegerEntry(a, k), IntegerEntry(j(k), c), StringEntry(l(k), toBase58String(H.caller.bytes)), StringEntry(m(k), I), StringEntry(n(k, 0), toBase64String(valueOrElse(K.assetId, h))), IntegerEntry(p(k, 0), K.amount), StringEntry(q(k, 0), toBase64String(x(J))), IntegerEntry(r(k, 0), A(J))]
108108 }
109109
110110
111111
112112 @Callable(H)
113113 func cancelOffer (k) = {
114114 let L = s(j(k))
115115 if ((L != c))
116116 then throw("offer status must be open")
117117 else {
118118 let E = getStringValue(this, l(k))
119119 let M = toBase58String(H.caller.bytes)
120120 if ((E != M))
121121 then throw("offer must be made by caller")
122122 else C(k, d)
123123 }
124124 }
125125
126126
127127
128128 @Callable(H)
129129 func acceptOffer (k) = {
130130 let L = s(j(k))
131131 if ((L != c))
132132 then throw("offer status must be open")
133133 else {
134134 let N = getStringValue(this, m(k))
135135 let M = toBase58String(H.caller.bytes)
136136 if ((N != M))
137137 then throw("offer must be made to caller")
138- else [IntegerEntry(j(k), e)]
138+ else {
139+ let O = B(q(k, 0))
140+ let P = s(r(k, 0))
141+ let K = value(H.payments[0])
142+ if (!(isDefined(K)))
143+ then throw("no payment")
144+ else if ((K.assetId != O))
145+ then throw("not same asset")
146+ else if ((K.amount != P))
147+ then throw("not same amount")
148+ else {
149+ let Q = B(n(k, 0))
150+ let R = s(p(k, 0))
151+ let S = Address(fromBase58String(getStringValue(this, l(k))))
152+ let T = Address(fromBase58String(getStringValue(this, l(k))))
153+[IntegerEntry(j(k), e), ScriptTransfer(S, P, O), ScriptTransfer(T, R, Q)]
154+ }
155+ }
139156 }
140157 }
141158
142159
143160
144161 @Callable(H)
145162 func rejectOffer (k) = {
146163 let L = s(j(k))
147164 if ((L != c))
148165 then throw("offer status must be open")
149166 else {
150167 let N = getStringValue(this, m(k))
151168 let M = toBase58String(H.caller.bytes)
152169 if ((N != M))
153170 then throw("offer must be made to caller")
154171 else C(k, f)
155172 }
156173 }
157174
158175

github/deemru/w8io/026f985 
25.38 ms