tx · FKgZeamTSAGX9Nd1sY79abc12895EVxuqwhmtDg8STkg

3MuqnVvTnn9Bngyisk54NRUw6BHqjJBYCpH:  -0.01000000 Waves

2021.07.07 11:53 [1602975] smart account 3MuqnVvTnn9Bngyisk54NRUw6BHqjJBYCpH > SELF 0.00000000 Waves

{ "type": 13, "id": "FKgZeamTSAGX9Nd1sY79abc12895EVxuqwhmtDg8STkg", "fee": 1000000, "feeAssetId": null, "timestamp": 1625648007939, "version": 2, "chainId": 84, "sender": "3MuqnVvTnn9Bngyisk54NRUw6BHqjJBYCpH", "senderPublicKey": "DTKevHBeHpCD79KujaY4ZL2TFmNbU3yJ6E42UXcTxqvp", "proofs": [ "4qrw1vHuJ6xPvyVUoTUAAdS4mdmoFB6SUFFaZ4fVR4ZMxfZJAwUKsnCAL3P8mVV56QEQdUzZ9T5spv88mJR8sKVj" ], "script": "base64:AAIFAAAAAAAAAi4IAhIFCgMIAQgSAwoBCBIAGgoKAmExEgROT05FGhQKAmEyEg5nZXROdW1iZXJCeUtleRoJCgJhMxIDa2V5GgkKAmE0EgNudW0aDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEaEQoCYTcSC2dldFN0ckJ5S2V5GgkKAmE4EgNzdHIaFQoCYTkSD2dldEtleUl0ZW1QcmljZRoKCgJiMRIEaXRlbRoXCgJiMhIRZ2V0VmFsdWVJdGVtUHJpY2UaGwoCYjMSFWdldEtleVVzZXJJdGVtQ291bnRlchoKCgJiNBIEdXNlchodCgJiNRIXZ2V0VmFsdWVVc2VySXRlbUNvdW50ZXIaEAoCYjYSCmdldEtleUl0ZW0aDgoCYjcSCHN1cHBsaWVyGgsKAmI4EgV0aXRsZRoUCgJiORIOZ2V0S2V5SXRlbURhdGEaGAoCYzESEmdldEtleUl0ZW1TdXBwbGllchoaCgJjMhIUZ2V0VmFsdWVJdGVtU3VwcGxpZXIaGwoCYzMSFWdldEtleUJhbGFuY2VTdXBwbGllchoNCgJjNBIHYWNjb3VudBodCgJjNRIXZ2V0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ZgAAAAIFAAAAAmM3CAUAAAACZDEAAAAGYW1vdW50CQAAAgAAAAECAAAALlB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgbGVzcyB0aGFuIGl0ZW0gcHJpY2UDCQAAAAAAAAIFAAAAAmM5BQAAAAJhMQkAAAIAAAABAgAAABdTdXBwbGllciBkb2VzIG5vdCBleGlzdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAAmIzAAAAAgUAAAACZDIFAAAAAmIxCQAAZAAAAAIJAQAAAAJiNQAAAAIFAAAAAmQyBQAAAAJiMQAAAAAAAAAAAQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAAmMzAAAAAQUAAAACYzkJAABkAAAAAgkBAAAAAmM1AAAAAQUAAAACYzkIBQAAAAJkMQAAAAZhbW91bnQFAAAAA25pbAAAAAJjNgEAAAAId2l0aGRyYXcAAAAABAAAAAJjOQkAAlgAAAABCAgFAAAAAmM2AAAABmNhbGxlcgAAAAVieXRlcwQAAAACZDMJAQAAAAJjNQAAAAEFAAAAAmM5AwkAAGcAAAACAAAAAAAAAAAABQAAAAJkMwkAAAIAAAABAgAAABNpbnN1ZmljaWVudCBiYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQEAAAACYzMAAAABBQAAAAJjOQAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAJjOQUAAAACZDMFAAAABHVuaXQFAAAAA25pbAAAAAAceWLv", "height": 1602975, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ChhPoZTcPqnA1caZvuENk9FwUvWed1UUfME7bnrjhvZ Next: 49hjBT7m43zYh9SUVaVP11h76ototP8VjBs7iyxpEx7b Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
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 addItem (q,y,z) = {
6666 let A = toBase58String(x.caller.bytes)
6767 let j = o(A, q)
6868 if ((0 >= y))
6969 then throw("Purchase amount cannot be less than item price")
7070 else if ((t(j) != a))
7171 then throw("an item already exists")
7272 else [StringEntry(s(j), A), IntegerEntry(i(j), y), StringEntry(r(j), z)]
7373 }
7474
7575
7676
7777 @Callable(x)
7878 func purchase (j) = {
7979 let B = x.payments[0]
8080 if (isDefined(B.assetId))
8181 then throw("WAVES ONLY HHEUAWHEUAS")
8282 else {
8383 let C = toBase58String(x.caller.bytes)
8484 let y = k(j)
8585 let A = t(j)
8686 if ((y > B.amount))
8787 then throw("Purchase amount cannot be less than item price")
8888 else if ((A == a))
8989 then throw("Supplier does not exist")
9090 else [IntegerEntry(l(C, j), (n(C, j) + 1)), IntegerEntry(u(A), (w(A) + B.amount))]
9191 }
9292 }
9393
9494
9595
9696 @Callable(x)
9797 func withdraw () = {
9898 let A = toBase58String(x.caller.bytes)
9999 let D = w(A)
100100 if ((0 >= D))
101101 then throw("insuficient balance")
102102 else [IntegerEntry(u(A), 0), ScriptTransfer(addressFromStringValue(A), D, unit)]
103103 }
104104
105105

github/deemru/w8io/026f985 
23.11 ms