tx · 8bKc43RrtX9AiS43a1SqTMVw6XBDunxoL5JUCjo4zFLd

3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi:  -0.01400000 Waves

2019.08.29 19:22 [652745] smart account 3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi > SELF 0.00000000 Waves

{ "type": 13, "id": "8bKc43RrtX9AiS43a1SqTMVw6XBDunxoL5JUCjo4zFLd", "fee": 1400000, "feeAssetId": null, "timestamp": 1567095742811, "version": 1, "sender": "3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi", "senderPublicKey": "GNuHLNfdrBQFcKg3AwDj1fwFdrtuxDna2T8EZCxJA2Z6", "proofs": [ "3jRrDkeQRRmvi8kW54qVrYbTzqPkpszAyi6LFQanssMRX1zZCG6sh717v65QYz8KqSpAg3CY4KTsUDd3sMQJ98Qm" ], "script": "base64:AAIDAAAAAAAAAAAAAAANAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SXRlbV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mFsdWVCYWxhbmNlU3VwcGxpZXIAAAABBQAAAA9zdXBwbGllckFkZHJlc3MIBQAAAANwbXQAAAAGYW1vdW50BQAAAANuaWwAAAABaQEAAAAHYWRkSXRlbQAAAAMAAAAFdGl0bGUAAAAFcHJpY2UAAAAEZGF0YQQAAAAPc3VwcGxpZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABGl0ZW0JAQAAAApnZXRLZXlJdGVtAAAAAgUAAAAPc3VwcGxpZXJBZGRyZXNzBQAAAAV0aXRsZQMJAABnAAAAAgAAAAAAAAAAAAUAAAAFcHJpY2UJAAACAAAAAQIAAAAucHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZQMJAQAAAAIhPQAAAAIJAQAAABRnZXRWYWx1ZUl0ZW1TdXBwbGllcgAAAAEFAAAABGl0ZW0FAAAABE5PTkUJAAACAAAAAQIAAAAYYW4gaXRlbSBpcyBhbHJlYWR5IGV4aXN0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAPc3VwcGxpZXJBZGRyZXNzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUAAAAEaXRlbQUAAAAFcHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEFAAAAA25pbAAAAADsKGkm", "chainId": 84, "height": 652745, "spentComplexity": 0 } View: original | compacted Prev: 7PYJKuwTGQpr32HYDLGVDtLdfdvQjSkwLDEaxye6hG9U Next: none 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
6464 @Callable(x)
6565 func purchase (j) = {
6666 let y = extract(x.payment)
6767 if (isDefined(y.assetId))
6868 then throw("WAVES tokens only at the moment")
6969 else {
7070 let z = toBase58String(x.caller.bytes)
7171 let A = k(j)
7272 let B = t(j)
7373 if ((A > y.amount))
7474 then throw("purchase amount cannot be less than item price")
7575 else if ((y.amount > A))
7676 then throw("purchase amount cannot be higher than item price")
7777 else if ((B == a))
7878 then throw("supplier does not exist")
7979 else WriteSet([DataEntry(l(z, j), (n(z, j) + 1)), DataEntry(u(B), (w(B) + y.amount))])
8080 }
8181 }
8282
8383
8484
8585 @Callable(x)
8686 func addItem (q,A,C) = {
8787 let B = toBase58String(x.caller.bytes)
8888 let j = o(B, q)
8989 if ((0 >= A))
9090 then throw("purchase amount cannot be less than item price")
9191 else if ((t(j) != a))
9292 then throw("an item is already exist")
9393 else WriteSet([DataEntry(s(j), B), DataEntry(i(j), A), DataEntry(r(j), C)])
9494 }
9595
9696

github/deemru/w8io/fabc49c 
25.96 ms