tx · 5y1oCkK3imL5H8cEMoC3Sc3Fqdd8oCxCyLP6VAMr1SrX

3NBY19sy9tBYtV3Xf15DrMAgM555oi7S4pP:  -0.05000000 Waves

2020.02.07 21:39 [889172] smart account 3NBY19sy9tBYtV3Xf15DrMAgM555oi7S4pP > SELF 0.00000000 Waves

{ "type": 13, "id": "5y1oCkK3imL5H8cEMoC3Sc3Fqdd8oCxCyLP6VAMr1SrX", "fee": 5000000, "feeAssetId": null, "timestamp": 1581100760971, "version": 1, "sender": "3NBY19sy9tBYtV3Xf15DrMAgM555oi7S4pP", "senderPublicKey": "FUWhBBCT8RpLYi4Ak1vzBzSaazgezQHqHdLScfYtbYNu", "proofs": [ "27dChn2UvSHRi94eWbNFTsvpM2SoVi8QPXswKE8rNkoLGxNhjCycQGyEArTHTZpJwRaFZ79w1XQexLhEbGCsQvk3" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgUKAwgBCAAAAA4AAAAABE5PTkUCAAAABG5vbmUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABl9wcmljZQEAAAARZ2V0VmFsdWVJdGVtUHJpY2UAAAABAAAABGl0ZW0JAQAAAA5nZXROdW1iZXJCeUtleQAAAAEJAQAAAA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QAAAAckbWF0Y2gwBgceI6TE", "chainId": 84, "height": 889172, "spentComplexity": 0 } View: original | compacted Prev: 5stZyQYToEcRjWSnLBrCg5HLp2PLmR7rkdzLsjSdeqSq Next: none Diff:
OldNewDifferences
6161 func w (v) = b(u(v))
6262
6363
64-@Callable(x)
64+let x = base58'AEPkVhxxwDcFuxp5ykhU7hErZWKFukRePVvcsTpUJm1L'
65+
66+@Callable(y)
6567 func purchase () = {
66- let y = extract(x.payment)
67- if (isDefined(y.assetId))
68+ let z = extract(y.payment)
69+ if (isDefined(z.assetId))
6870 then throw("can use WAVES only at the moment")
6971 else {
70- let z = toBase58String(x.caller.bytes)
71- let A = {
72+ let A = toBase58String(y.caller.bytes)
73+ let B = {
7274 let e = getInteger(this, "item_A_coupon_price")
7375 if ($isInstanceOf(e, "Int"))
7476 then {
7779 }
7880 else 0
7981 }
80- if ((A > y.amount))
82+ if ((B > z.amount))
8183 then throw("purchase amount cannot be less than item price")
82- else if ((y.amount > A))
84+ else if ((z.amount > B))
8385 then throw("purchase amount cannot be higher than item price")
84- else WriteSet([DataEntry(("status:purchase_item_A_customer_" + z), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + z), A)])
86+ else WriteSet([DataEntry(("status:purchase_item_A_customer_" + A), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + A), B)])
8587 }
8688 }
8789
8890
8991
90-@Callable(x)
91-func addItem (q,A,B) = {
92- let C = toBase58String(x.caller.bytes)
93- let j = o(C, q)
94- if ((0 >= A))
92+@Callable(y)
93+func addItem (q,B,C) = {
94+ let D = toBase58String(y.caller.bytes)
95+ let j = o(D, q)
96+ if ((0 >= B))
9597 then throw("purchase amount cannot be less than item price")
9698 else if ((t(j) != a))
9799 then throw("an item is already exist")
98- else WriteSet([DataEntry(s(j), C), DataEntry(i(j), A), DataEntry(r(j), B)])
100+ else WriteSet([DataEntry(s(j), D), DataEntry(i(j), B), DataEntry(r(j), C)])
99101 }
100102
103+
104+@Verifier(E)
105+func F () = {
106+ let e = E
107+ if ($isInstanceOf(e, "SetScriptTransaction"))
108+ then {
109+ let G = e
110+ sigVerify(E.bodyBytes, E.proofs[0], x)
111+ }
112+ else if ($isInstanceOf(e, "DataTransaction"))
113+ then {
114+ let G = e
115+ true
116+ }
117+ else false
118+ }
101119
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
66 func b (c) = {
77 let d = {
88 let e = getInteger(this, c)
99 if ($isInstanceOf(e, "Int"))
1010 then {
1111 let f = e
1212 f
1313 }
1414 else 0
1515 }
1616 d
1717 }
1818
1919
2020 func g (c) = {
2121 let h = {
2222 let e = getString(this, c)
2323 if ($isInstanceOf(e, "String"))
2424 then {
2525 let f = e
2626 f
2727 }
2828 else a
2929 }
3030 h
3131 }
3232
3333
3434 func i (j) = (j + "_price")
3535
3636
3737 func k (j) = b(i(j))
3838
3939
4040 func l (m,j) = (((j + "_") + m) + "_cnt")
4141
4242
4343 func n (m,j) = b(l(m, j))
4444
4545
4646 func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q)))))
4747
4848
4949 func r (j) = (j + "_data")
5050
5151
5252 func s (j) = (j + "_owner")
5353
5454
5555 func t (j) = g(s(j))
5656
5757
5858 func u (v) = (v + "_balance")
5959
6060
6161 func w (v) = b(u(v))
6262
6363
64-@Callable(x)
64+let x = base58'AEPkVhxxwDcFuxp5ykhU7hErZWKFukRePVvcsTpUJm1L'
65+
66+@Callable(y)
6567 func purchase () = {
66- let y = extract(x.payment)
67- if (isDefined(y.assetId))
68+ let z = extract(y.payment)
69+ if (isDefined(z.assetId))
6870 then throw("can use WAVES only at the moment")
6971 else {
70- let z = toBase58String(x.caller.bytes)
71- let A = {
72+ let A = toBase58String(y.caller.bytes)
73+ let B = {
7274 let e = getInteger(this, "item_A_coupon_price")
7375 if ($isInstanceOf(e, "Int"))
7476 then {
7577 let f = e
7678 f
7779 }
7880 else 0
7981 }
80- if ((A > y.amount))
82+ if ((B > z.amount))
8183 then throw("purchase amount cannot be less than item price")
82- else if ((y.amount > A))
84+ else if ((z.amount > B))
8385 then throw("purchase amount cannot be higher than item price")
84- else WriteSet([DataEntry(("status:purchase_item_A_customer_" + z), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + z), A)])
86+ else WriteSet([DataEntry(("status:purchase_item_A_customer_" + A), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + A), B)])
8587 }
8688 }
8789
8890
8991
90-@Callable(x)
91-func addItem (q,A,B) = {
92- let C = toBase58String(x.caller.bytes)
93- let j = o(C, q)
94- if ((0 >= A))
92+@Callable(y)
93+func addItem (q,B,C) = {
94+ let D = toBase58String(y.caller.bytes)
95+ let j = o(D, q)
96+ if ((0 >= B))
9597 then throw("purchase amount cannot be less than item price")
9698 else if ((t(j) != a))
9799 then throw("an item is already exist")
98- else WriteSet([DataEntry(s(j), C), DataEntry(i(j), A), DataEntry(r(j), B)])
100+ else WriteSet([DataEntry(s(j), D), DataEntry(i(j), B), DataEntry(r(j), C)])
99101 }
100102
103+
104+@Verifier(E)
105+func F () = {
106+ let e = E
107+ if ($isInstanceOf(e, "SetScriptTransaction"))
108+ then {
109+ let G = e
110+ sigVerify(E.bodyBytes, E.proofs[0], x)
111+ }
112+ else if ($isInstanceOf(e, "DataTransaction"))
113+ then {
114+ let G = e
115+ true
116+ }
117+ else false
118+ }
101119

github/deemru/w8io/169f3d6 
33.90 ms