tx · 2xGPBNsfLpWVTGPcd9QBJEUf8A5wb7Xy4cP3DgEimFtx

3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o:  -0.05000000 Waves

2019.08.06 15:16 [619040] smart account 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o > SELF 0.00000000 Waves

{ "type": 13, "id": "2xGPBNsfLpWVTGPcd9QBJEUf8A5wb7Xy4cP3DgEimFtx", "fee": 5000000, "feeAssetId": null, "timestamp": 1565093837847, "version": 1, "sender": "3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o", "senderPublicKey": "Ebb2ffqL8cMnNmXPNvHLy53xrK7t5WaSFhneCPBSoxop", "proofs": [ "48MshA7qEQsEAwadArZtVGPqaV6QWXrzsWBEHmS9bg1qTKTVhREKjsDawN6pW2ZzTLGH389g64WhQ3M87nitXEz7" ], "script": "base64:AAIDAAAAAAAAAAAAAAANAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SX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ZW0EAAAAD3N1cHBsaWVyQWRkcmVzcwkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAAdwYXltZW50AAAABmFtb3VudAkAAAIAAAABAgAAAB5QbGVhc2Ugc2VuZCBleGFjdCBjb3Vwb24gcHJpY2UDCQAAZgAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAeUGxlYXNlIHNlbmQgZXhhY3QgY291cG9uIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAVZ2V0S2V5VXNlckl0ZW1Db3VudGVyAAAAAgUAAAALdXNlckFkZHJlc3MFAAAABGl0ZW0JAABkAAAAAgkBAAAAF2dldFZhbHVlVXNlckl0ZW1Db3VudGVyAAAAAgUAAAALdXNlckFkZHJlc3MFAAAABGl0ZW0AAAAAAAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABVnZXRLZXlCYWxhbmNlU3VwcGxpZXIAAAABBQAAAA9zdXBwbGllckFkZHJlc3MJAABkAAAAAgkBAAAAFmdldFZhbHVlQmFsYW5jZVN1cGxpZXIAAAABBQAAAA9zdXBwbGllckFkZHJlc3MIBQAAAAdwYXltZW50AAAABmFtb3VudAUAAAADbmlsAAAAAH42dDs=", "chainId": 84, "height": 619040, "spentComplexity": 0 } View: original | compacted Prev: 4ue3bbAyLyduYEfhLWf7K87Bqy8jJeqMwDqenqpw24rd Next: 3HGTZWJH9WeaqStV5m2Aezjv6wBqqNX6486mUJD8yo1y Diff:
OldNewDifferences
7373 }
7474
7575
76+
77+@Callable(y)
78+func purchase (k) = {
79+ let C = extract(y.payment)
80+ if (isDefined(C.assetId))
81+ then throw("Only payments in WAVES are avalible")
82+ else {
83+ let D = toBase58String(y.caller.bytes)
84+ let z = l(k)
85+ let B = u(k)
86+ if ((z > C.amount))
87+ then throw("Please send exact coupon price")
88+ else if ((C.amount > z))
89+ then throw("Please send exact coupon price")
90+ else WriteSet([DataEntry(m(D, k), (o(D, k) + 1)), DataEntry(v(B), (x(B) + C.amount))])
91+ }
92+ }
93+
94+
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 i = e
2626 i
2727 }
2828 else a
2929 }
3030 h
3131 }
3232
3333
3434 func j (k) = (k + "_price")
3535
3636
3737 func l (k) = b(j(k))
3838
3939
4040 func m (n,k) = (((k + "_") + n) + "_cnt")
4141
4242
4343 func o (n,k) = b(m(n, k))
4444
4545
4646 func p (q,r) = ("ietm_" + toBase58String(sha256(toBytes((q + r)))))
4747
4848
4949 func s (k) = (k + "_data")
5050
5151
5252 func t (k) = (k + "_owner")
5353
5454
5555 func u (k) = g(t(k))
5656
5757
5858 func v (w) = (w + "_balance")
5959
6060
6161 func x (w) = b(v(w))
6262
6363
6464 @Callable(y)
6565 func addItem (r,z,A) = {
6666 let B = toBase58String(y.caller.bytes)
6767 let k = p(B, r)
6868 if ((0 >= z))
6969 then throw("Please add valid price")
7070 else if ((u(k) != a))
7171 then throw((k + " - item already exists"))
7272 else WriteSet([DataEntry(t(k), B), DataEntry(j(k), z), DataEntry(s(k), A)])
7373 }
7474
7575
76+
77+@Callable(y)
78+func purchase (k) = {
79+ let C = extract(y.payment)
80+ if (isDefined(C.assetId))
81+ then throw("Only payments in WAVES are avalible")
82+ else {
83+ let D = toBase58String(y.caller.bytes)
84+ let z = l(k)
85+ let B = u(k)
86+ if ((z > C.amount))
87+ then throw("Please send exact coupon price")
88+ else if ((C.amount > z))
89+ then throw("Please send exact coupon price")
90+ else WriteSet([DataEntry(m(D, k), (o(D, k) + 1)), DataEntry(v(B), (x(B) + C.amount))])
91+ }
92+ }
93+
94+

github/deemru/w8io/169f3d6 
31.48 ms