tx · 4ZzWwsmnqzxLZGDaMS8nqcGk11cwMVzj6G8MfLPANVxn 3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm: -0.01000000 Waves 2022.03.17 16:10 [1967986] smart account 3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm > SELF 0.00000000 Waves
{ "type": 13, "id": "4ZzWwsmnqzxLZGDaMS8nqcGk11cwMVzj6G8MfLPANVxn", "fee": 1000000, "feeAssetId": null, "timestamp": 1647522634278, "version": 2, "chainId": 84, "sender": "3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm", "senderPublicKey": "DKZcYM5WoZ3gBkiAgjzXdfQaZcfisgn2Zn4B226GHMcD", "proofs": [ "57NFYB92U3BHdVZtkJrTY6mRvm8Twss8ucrgU6FXJ8oDm4iZAELktTQraxT7UPwX395iXnPw8WZNeCgT26MahvmC" ], "script": "base64:AAIFAAAAAAAAAAIIAgAAAAMAAAAACkFQdWJsaWNLZXkBAAAAIIu19x30Xz+P53LrUAJYEkMtH1VpfGt0/1aTVmldOosMAAAAAApCUHVibGljS2V5AQAAACC3DZKziv/tGyt03Qly8mbrCHW73dDw0g2OKdh4o9AuGgAAAAAKQ1B1YmxpY0tleQEAAAAgTEDWlbqWShJQlBG6PB0IqAYOORzGNp+r5czsD9gl8mAAAAAAAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAACQTEJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAApBUHVibGljS2V5BAAAAAJBMgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAACkFQdWJsaWNLZXkEAAAAAkEzCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAA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AAAAJCMwcGAwUAAAACQzIFAAAAAkIxBwYDBQAAAAJDMgUAAAACQjMHBgMFAAAAAkMzBQAAAAJCMQcGAwUAAAACQzMFAAAAAkIyBwQAAAAHJG1hdGNoMAUAAAACdHgDAwUAAAACQUIGBQAAAAJBQwYFAAAAAkJDm8GJ5g==", "height": 1967986, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EHVLtGp9TM6QhaC2Rgv3XYvDb8rb4XgKFR6ixCSnviHx Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = base58'AQNbrqrtZ6QZSsdTekNofCi39KjhtsyRBSpBEmc4EqMm' | |
5 | 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 | - | } | |
6 | + | let b = base58'DKZcYM5WoZ3gBkiAgjzXdfQaZcfisgn2Zn4B226GHMcD' | |
7 | + | ||
8 | + | let c = base58'68fL3LofvP8XvE3Nei5sjoZprfVxdDALDjkQ5SGLVDeX' | |
18 | 9 | ||
19 | 10 | ||
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 | |
11 | + | @Verifier(d) | |
12 | + | func e () = { | |
13 | + | let f = sigVerify(d.bodyBytes, d.proofs[0], a) | |
14 | + | let g = sigVerify(d.bodyBytes, d.proofs[1], a) | |
15 | + | let h = sigVerify(d.bodyBytes, d.proofs[2], a) | |
16 | + | let i = sigVerify(d.bodyBytes, d.proofs[0], b) | |
17 | + | let j = sigVerify(d.bodyBytes, d.proofs[1], b) | |
18 | + | let k = sigVerify(d.bodyBytes, d.proofs[2], b) | |
19 | + | let l = sigVerify(d.bodyBytes, d.proofs[0], c) | |
20 | + | let m = sigVerify(d.bodyBytes, d.proofs[1], c) | |
21 | + | let n = sigVerify(d.bodyBytes, d.proofs[2], c) | |
22 | + | let o = if (if (if (if (if (if (f) | |
23 | + | then j | |
24 | + | else false) | |
25 | + | then true | |
26 | + | else if (f) | |
27 | + | then k | |
28 | + | else false) | |
29 | + | then true | |
30 | + | else if (g) | |
31 | + | then i | |
32 | + | else false) | |
33 | + | then true | |
34 | + | else if (g) | |
35 | + | then k | |
36 | + | else false) | |
37 | + | then true | |
38 | + | else if (h) | |
39 | + | then i | |
40 | + | else false) | |
41 | + | then true | |
42 | + | else if (h) | |
43 | + | then j | |
44 | + | else false | |
45 | + | let p = if (if (if (if (if (if (f) | |
46 | + | then m | |
47 | + | else false) | |
48 | + | then true | |
49 | + | else if (f) | |
50 | + | then n | |
51 | + | else false) | |
52 | + | then true | |
53 | + | else if (g) | |
54 | + | then l | |
55 | + | else false) | |
56 | + | then true | |
57 | + | else if (g) | |
58 | + | then n | |
59 | + | else false) | |
60 | + | then true | |
61 | + | else if (h) | |
62 | + | then l | |
63 | + | else false) | |
64 | + | then true | |
65 | + | else if (h) | |
66 | + | then m | |
67 | + | else false | |
68 | + | let q = if (if (if (if (if (if (l) | |
69 | + | then j | |
70 | + | else false) | |
71 | + | then true | |
72 | + | else if (l) | |
73 | + | then k | |
74 | + | else false) | |
75 | + | then true | |
76 | + | else if (m) | |
77 | + | then i | |
78 | + | else false) | |
79 | + | then true | |
80 | + | else if (m) | |
81 | + | then k | |
82 | + | else false) | |
83 | + | then true | |
84 | + | else if (n) | |
85 | + | then i | |
86 | + | else false) | |
87 | + | then true | |
88 | + | else if (n) | |
89 | + | then j | |
90 | + | else false | |
91 | + | let r = d | |
92 | + | if (if (o) | |
93 | + | then true | |
94 | + | else p) | |
95 | + | then true | |
96 | + | else q | |
31 | 97 | } | |
32 | - | ||
33 | - | ||
34 | - | func i (j) = (j + "_price") | |
35 | - | ||
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 + "_owner") | |
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 $Tuple2([StringEntry(s(j), A), IntegerEntry(i(j), y), StringEntry(r(j), z)], unit) | |
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("can use WAVES only at the moment") | |
82 | - | else { | |
83 | - | let C = toBase58String(x.caller.bytes) | |
84 | - | let y = k(j) | |
85 | - | let A = t(j) | |
86 | - | if ((y > B.amount)) | |
87 | - | then throw("purchase amount 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 ((A == a)) | |
91 | - | then throw("supplier does not exist") | |
92 | - | else $Tuple2([IntegerEntry(l(C, j), (n(C, j) + 1)), IntegerEntry(u(A), (w(A) + B.amount))], unit) | |
93 | - | } | |
94 | - | } | |
95 | - | ||
96 | 98 |
github/deemru/w8io/026f985 24.64 ms ◑