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:AAIFAAAAAAAAAi4IAhIFCgMIAQgSAwoBCBIAGgoKAmExEgROT05FGhQKAmEyEg5nZXROdW1iZXJCeUtleRoJCgJhMxIDa2V5GgkKAmE0EgNudW0aDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEaEQoCYTcSC2dldFN0ckJ5S2V5GgkKAmE4EgNzdHIaFQoCYTkSD2dldEtleUl0ZW1QcmljZRoKCgJiMRIEaXRlbRoXCgJiMhIRZ2V0VmFsdWVJdGVtUHJpY2UaGwoCYjMSFWdldEtleVVzZXJJdGVtQ291bnRlchoKCgJiNBIEdXNlchodCgJiNRIXZ2V0VmFsdWVVc2VySXRlbUNvdW50ZXIaEAoCYjYSCmdldEtleUl0ZW0aDgoCYjcSCHN1cHBsaWVyGgsKAmI4EgV0aXRsZRoUCgJiORIOZ2V0S2V5SXRlbURhdGEaGAoCYzESEmdldEtleUl0ZW1TdXBwbGllchoaCgJjMhIUZ2V0VmFsdWVJdGVtU3VwcGxpZXIaGwoCYzMSFWdldEtleUJhbGFuY2VTdXBwbGllchoNCgJjNBIHYWNjb3VudBodCgJjNRIXZ2V0V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gAAAAIFAAAAAmM3CAUAAAACZDEAAAAGYW1vdW50CQAAAgAAAAECAAAALlB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgbGVzcyB0aGFuIGl0ZW0gcHJpY2UDCQAAAAAAAAIFAAAAAmM5BQAAAAJhMQkAAAIAAAABAgAAABdTdXBwbGllciBkb2VzIG5vdCBleGlzdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAAmIzAAAAAgUAAAACZDIFAAAAAmIxCQAAZAAAAAIJAQAAAAJiNQAAAAIFAAAAAmQyBQAAAAJiMQAAAAAAAAAAAQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAAmMzAAAAAQUAAAACYzkJAABkAAAAAgkBAAAAAmM1AAAAAQUAAAACYzkIBQAAAAJkMQAAAAZhbW91bnQFAAAAA25pbAAAAAJjNgEAAAAId2l0aGRyYXcAAAAABAAAAAJjOQkAAlgAAAABCAgFAAAAAmM2AAAABmNhbGxlcgAAAAVieXRlcwQAAAACZDMJAQAAAAJjNQAAAAEFAAAAAmM5AwkAAGcAAAACAAAAAAAAAAAABQAAAAJkMwkAAAIAAAABAgAAABNpbnN1ZmljaWVudCBiYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQEAAAACYzMAAAABBQAAAAJjOQAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAJjOQUAAAACZDMFAAAABHVuaXQFAAAAA25pbAAAAAAceWLv", "height": 1602975, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ChhPoZTcPqnA1caZvuENk9FwUvWed1UUfME7bnrjhvZ Next: 49hjBT7m43zYh9SUVaVP11h76ototP8VjBs7iyxpEx7b Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "none" | |
5 | 5 | ||
6 | 6 | func b (c) = { | |
7 | 7 | let d = { | |
8 | 8 | let e = getInteger(this, c) | |
9 | 9 | if ($isInstanceOf(e, "Int")) | |
10 | 10 | then { | |
11 | 11 | let f = e | |
12 | 12 | f | |
13 | 13 | } | |
14 | 14 | else 0 | |
15 | 15 | } | |
16 | 16 | d | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func g (c) = { | |
21 | 21 | let h = { | |
22 | 22 | let e = getString(this, c) | |
23 | 23 | if ($isInstanceOf(e, "String")) | |
24 | 24 | then { | |
25 | 25 | let f = e | |
26 | 26 | f | |
27 | 27 | } | |
28 | 28 | else a | |
29 | 29 | } | |
30 | 30 | h | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func i (j) = (j + "_price") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func k (j) = b(i(j)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func l (m,j) = (((j + "_") + m) + "_cnt") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func n (m,j) = b(l(m, j)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func r (j) = (j + "_data") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func s (j) = (j + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func t (j) = g(s(j)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func u (v) = (v + "_balance") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func w (v) = b(u(v)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(x) | |
65 | 65 | func addItem (q,y,z) = { | |
66 | 66 | let A = toBase58String(x.caller.bytes) | |
67 | 67 | let j = o(A, q) | |
68 | 68 | if ((0 >= y)) | |
69 | 69 | then throw("Purchase amount cannot be less than item price") | |
70 | 70 | else if ((t(j) != a)) | |
71 | 71 | then throw("an item already exists") | |
72 | 72 | else [StringEntry(s(j), A), IntegerEntry(i(j), y), StringEntry(r(j), z)] | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(x) | |
78 | 78 | func purchase (j) = { | |
79 | 79 | let B = x.payments[0] | |
80 | 80 | if (isDefined(B.assetId)) | |
81 | 81 | then throw("WAVES ONLY HHEUAWHEUAS") | |
82 | 82 | else { | |
83 | 83 | let C = toBase58String(x.caller.bytes) | |
84 | 84 | let y = k(j) | |
85 | 85 | let A = t(j) | |
86 | 86 | if ((y > B.amount)) | |
87 | 87 | then throw("Purchase amount cannot be less than item price") | |
88 | 88 | else if ((A == a)) | |
89 | 89 | then throw("Supplier does not exist") | |
90 | 90 | else [IntegerEntry(l(C, j), (n(C, j) + 1)), IntegerEntry(u(A), (w(A) + B.amount))] | |
91 | 91 | } | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(x) | |
97 | 97 | func withdraw () = { | |
98 | 98 | let A = toBase58String(x.caller.bytes) | |
99 | 99 | let D = w(A) | |
100 | 100 | if ((0 >= D)) | |
101 | 101 | then throw("insuficient balance") | |
102 | 102 | else [IntegerEntry(u(A), 0), ScriptTransfer(addressFromStringValue(A), D, unit)] | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 |
github/deemru/w8io/026f985 23.11 ms ◑