tx · 894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2

3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR:  -0.01400000 Waves

2019.07.14 03:49 [584716] smart account 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR > SELF 0.00000000 Waves

{ "type": 13, "id": "894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2", "fee": 1400000, "feeAssetId": null, "timestamp": 1563065377008, "version": 1, "sender": "3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR", "senderPublicKey": "Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV", "proofs": [ "2PA3sVcPxEMYj5JLLw6Zw1BnC6xDdoB64RuNzFwBjABwcgwRib4kNr5CRhC8eybqtruun4tj2Ci8kpWCM2Zwv5ok" ], "script": "base64:AAIDAAAAAAAAAAAAAAAXAAAAAA5vd25lclB1YmxpY0tleQEAAAAgAnfP9tCFuj2k2BUY5PW9DVGxrCHBHKJwugv8WyiaGXIAAAAABE5PTkUCAAAABG5vbmUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABl9wcmljZQEAAAARZ2V0VmFsdWVJd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XzvqiAPqYjPdJdosZ63qvimexPF7 Diff:
OldNewDifferences
147147 let R = f
148148 true
149149 }
150- else false
150+ else if ($isInstanceOf(f, "TransferTransaction"))
151+ then {
152+ let R = f
153+ true
154+ }
155+ else false
151156 }
152157
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV'
55
66 let b = "none"
77
88 func c (d) = {
99 let e = {
1010 let f = getInteger(this, d)
1111 if ($isInstanceOf(f, "Int"))
1212 then {
1313 let g = f
1414 g
1515 }
1616 else 0
1717 }
1818 e
1919 }
2020
2121
2222 func h (d) = {
2323 let i = {
2424 let f = getString(this, d)
2525 if ($isInstanceOf(f, "String"))
2626 then {
2727 let g = f
2828 g
2929 }
3030 else b
3131 }
3232 i
3333 }
3434
3535
3636 func j (k) = (k + "_price")
3737
3838
3939 func l (k) = c(j(k))
4040
4141
4242 func m (n,k) = (((k + "_") + n) + "_cnt")
4343
4444
4545 func o (n,k) = c(m(n, k))
4646
4747
4848 func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r)))))
4949
5050
5151 func s (k) = (k + "_data")
5252
5353
5454 func t (k) = (k + "_owner")
5555
5656
5757 func u (k) = h(t(k))
5858
5959
6060 func v (w) = (w + "_balance")
6161
6262
6363 func x (w) = c(v(w))
6464
6565
6666 func y (k,n) = (((k + "_") + n) + "_commit")
6767
6868
6969 func z (k,n) = h(y(k, n))
7070
7171
7272 func A (k) = (k + "_comcnt")
7373
7474
7575 func B (k) = c(A(k))
7676
7777
7878 func C (k,n) = (((k + "_") + n) + "_reveal")
7979
8080
8181 func D (k,n) = h(C(k, n))
8282
8383
8484 func E (k) = (k + "_status")
8585
8686
8787 func F (k) = h(E(k))
8888
8989
9090 func G (k,H) = ((k + "_res:") + H)
9191
9292
9393 @Callable(I)
9494 func purchase (k) = {
9595 let J = extract(I.payment)
9696 if (isDefined(J.assetId))
9797 then throw("can use WAVES only at the moment")
9898 else {
9999 let K = toBase58String(I.caller.bytes)
100100 let L = l(k)
101101 let M = u(k)
102102 if ((L > J.amount))
103103 then throw("purchase amount cannot be less than item price")
104104 else if ((J.amount > L))
105105 then throw("purchase amount cannot be higher than item price")
106106 else if ((M == b))
107107 then throw("supplier does not exist")
108108 else WriteSet([DataEntry(m(K, k), (o(K, k) + 1)), DataEntry(v(M), (x(M) + J.amount))])
109109 }
110110 }
111111
112112
113113
114114 @Callable(I)
115115 func withdraw () = {
116116 let M = toBase58String(I.caller.bytes)
117117 let N = x(M)
118118 if ((0 >= N))
119119 then throw("insufficient balance")
120120 else ScriptResult(WriteSet([DataEntry(v(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), N, unit)]))
121121 }
122122
123123
124124
125125 @Callable(I)
126126 func addItem (r,L,O) = {
127127 let M = toBase58String(I.caller.bytes)
128128 let k = p(M, r)
129129 if ((0 >= L))
130130 then throw("purchase amount cannot be less than item price")
131131 else if ((u(k) != b))
132132 then throw("an item is already exist")
133133 else WriteSet([DataEntry(t(k), M), DataEntry(j(k), L), DataEntry(s(k), O)])
134134 }
135135
136136
137137 @Verifier(P)
138138 func Q () = {
139139 let f = P
140140 if ($isInstanceOf(f, "SetScriptTransaction"))
141141 then {
142142 let R = f
143143 sigVerify(P.bodyBytes, P.proofs[0], a)
144144 }
145145 else if ($isInstanceOf(f, "DataTransaction"))
146146 then {
147147 let R = f
148148 true
149149 }
150- else false
150+ else if ($isInstanceOf(f, "TransferTransaction"))
151+ then {
152+ let R = f
153+ true
154+ }
155+ else false
151156 }
152157

github/deemru/w8io/169f3d6 
38.12 ms