tx · 6Mc3XStPnFATV4aFF2bJsSSBc6RBYjKtnf2LbWw7j1v5 3N86zk6P6pyxFnu5o1U62pZeiRQ6Q1b3Lgb: -0.01000010 Waves 2021.07.09 11:11 [1605820] smart account 3N86zk6P6pyxFnu5o1U62pZeiRQ6Q1b3Lgb > SELF 0.00000000 Waves
{ "type": 13, "id": "6Mc3XStPnFATV4aFF2bJsSSBc6RBYjKtnf2LbWw7j1v5", "fee": 1000010, "feeAssetId": null, "timestamp": 1625818307016, "version": 2, "chainId": 84, "sender": "3N86zk6P6pyxFnu5o1U62pZeiRQ6Q1b3Lgb", "senderPublicKey": "J5UWSH8o2ZgSCRmahKoyq3Zzf9CSXEJtFQjoxuiqw8jN", "proofs": [ "47sDgGaT8CcZ7P96wBJesaBE7iVB82C2PcK1mWvZMuUMAWZKzxHNoJTxkrarHnG5DyJA17Uc1NeEMfLJeDBWDMDL" ], "script": "base64:AAIFAAAAAAAAAKMIAhIECgIICBokCgJhMRIeZ2V0RXh0VmFsdWVJdGVtV2hpdGVMaXN0U3RhdHVzGgoKAmEyEgRpdGVtGg4KAmEzEgh2ZXJpZmllchoOCgJhNBIIVkVSSUZJRUQaEQoCYTUSC0JMQUNLTElTVEVEGgcKAmE2EgFpGg4KAmE3EghzdXBwbGllchoMCgJhOBIGc3RhdHVzGg0KAmE5EgdhY2NvdW50AAAABAEAAAACYTEAAAABAAAAAmEyCQABLAAAAAIFAAAAAmEyAgAAABBfdmVyaWZpZXJfc3RhdHVzAAAAAAJhMwIAAAAAAAAAAAJhNAIAAAAIdmVyaWZpZWQAAAAAAmE1AgAAAAlibGFja2xpc3QAAAABAAAAAmE2AQAAAAlzZXRzdGF0dXMAAAACAAAAAmE3AAAAAmE4BAAAAAJhOQkAAlgAAAABCAgFAAAAAmE2AAAABmNhbGxlcgAAAAVieXRlcwMJAQAAAAIhPQAAAAIFAAAAAmE5BQAAAAJhMwkAAAIAAAABAgAAADFvbmx5IG9yYWNsZSB2ZXJ5ZmllciBhcmUgYWJsZSB0byBtYW5hZ2Ugd2hpbGVsaXN0AwMJAQAAAAIhPQAAAAIFAAAAAmE4BQAAAAJhNAkBAAAAAiE9AAAAAgUAAAACYTgFAAAAAmE1BwkAAAIAAAABAgAAAA53YWl0aW5nIHN0YXR1cwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAACYTEAAAABBQAAAAJhNwUAAAACYTgFAAAAA25pbAAAAABS+3XG", "height": 1605820, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 99uJVYqixKRVEV7pCvK1LsqQ6NeWsQyEGf8hxt78eNVp Next: 3FLYHxTcgsRVkwUGqG5rvJRBHbssDJ2gjfWjfoMtCVoT Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = "none" | |
5 | - | ||
6 | - | func b (c) = { | |
7 | - | let d = { | |
8 | - | let e = getInteger(this, c) | |
9 | - | if ($isInstanceOf(e, "Int")) | |
10 | - | then { | |
11 | - | let f = e | |
12 | - | f | |
13 | - | } | |
14 | - | else 0 | |
15 | - | } | |
16 | - | d | |
17 | - | } | |
4 | + | func a (b) = (b + "_verifier_status") | |
18 | 5 | ||
19 | 6 | ||
20 | - | func g (c) = { | |
21 | - | let h = { | |
22 | - | let e = getString(this, c) | |
23 | - | if ($isInstanceOf(e, "String")) | |
24 | - | then { | |
25 | - | let f = e | |
26 | - | f | |
27 | - | } | |
28 | - | else a | |
29 | - | } | |
30 | - | h | |
31 | - | } | |
7 | + | let c = "" | |
32 | 8 | ||
9 | + | let d = "verified" | |
33 | 10 | ||
34 | - | ||
11 | + | let e = "blacklist" | |
35 | 12 | ||
36 | - | ||
37 | - | func k (j) = b(i(j)) | |
38 | - | ||
39 | - | ||
40 | - | func l (m,j) = (((j + "_") + m) + "_cnt") | |
41 | - | ||
42 | - | ||
43 | - | func n (m,j) = b(l(m, j)) | |
44 | - | ||
45 | - | ||
46 | - | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) | |
47 | - | ||
48 | - | ||
49 | - | func r (j) = (j + "_data") | |
50 | - | ||
51 | - | ||
52 | - | func s (j) = (j + "_data") | |
53 | - | ||
54 | - | ||
55 | - | func t (j) = g(s(j)) | |
56 | - | ||
57 | - | ||
58 | - | func u (v) = (v + "_balance") | |
59 | - | ||
60 | - | ||
61 | - | func w (v) = b(u(v)) | |
62 | - | ||
63 | - | ||
64 | - | @Callable(x) | |
65 | - | func addItem (q,y,z) = { | |
66 | - | let A = toBase58String(x.caller.bytes) | |
67 | - | let j = o(A, q) | |
68 | - | if ((0 >= y)) | |
69 | - | then throw("purchase amount cannot be less than item price") | |
70 | - | else if ((t(j) != a)) | |
71 | - | then throw("an item is already exist") | |
72 | - | else [StringEntry(s(j), A), IntegerEntry(i(j), y), StringEntry(r(j), z)] | |
73 | - | } | |
74 | - | ||
75 | - | ||
76 | - | ||
77 | - | @Callable(x) | |
78 | - | func purchase (j) = { | |
79 | - | let B = x.payments[0] | |
80 | - | if (isDefined(B.assetId)) | |
81 | - | then throw("WAVES token only at the moment") | |
82 | - | else { | |
83 | - | let C = toBase58String(x.caller.bytes) | |
84 | - | let y = k(j) | |
85 | - | let D = t(j) | |
86 | - | if ((y > B.amount)) | |
87 | - | then throw("purchase amunt cannot be less than item price") | |
88 | - | else if ((B.amount > y)) | |
89 | - | then throw("purchase amount cannot be higher than item price") | |
90 | - | else if ((D == a)) | |
91 | - | then throw("Supplier address doesn't exist") | |
92 | - | else [IntegerEntry(l(C, j), (n(C, j) + 1)), IntegerEntry(u(D), (w(D) + B.amount))] | |
93 | - | } | |
94 | - | } | |
95 | - | ||
96 | - | ||
97 | - | ||
98 | - | @Callable(x) | |
99 | - | func withdraw () = { | |
100 | - | let A = toBase58String(x.caller.bytes) | |
101 | - | let E = w(A) | |
102 | - | if ((0 >= E)) | |
103 | - | then throw("za mało środków") | |
104 | - | else [IntegerEntry(u(A), 0), ScriptTransfer(addressFromStringValue(A), E, unit)] | |
13 | + | @Callable(f) | |
14 | + | func setstatus (g,h) = { | |
15 | + | let i = toBase58String(f.caller.bytes) | |
16 | + | if ((i != c)) | |
17 | + | then throw("only oracle veryfier are able to manage whilelist") | |
18 | + | else if (if ((h != d)) | |
19 | + | then (h != e) | |
20 | + | else false) | |
21 | + | then throw("waiting status") | |
22 | + | else [StringEntry(a(g), h)] | |
105 | 23 | } | |
106 | 24 | ||
107 | 25 |
github/deemru/w8io/026f985 56.94 ms ◑