tx · 85iKRZVSPmoyb4Z1JMrvgD8HC6xeHk3Bf1gkbiaiimtf 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE: -0.04000000 Waves 2022.05.04 22:28 [2037366] smart account 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE > SELF 0.00000000 Waves
{ "type": 13, "id": "85iKRZVSPmoyb4Z1JMrvgD8HC6xeHk3Bf1gkbiaiimtf", "fee": 4000000, "feeAssetId": null, "timestamp": 1651692601627, "version": 2, "chainId": 84, "sender": "3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE", "senderPublicKey": "B3JNxLE1zmVDjs6MqSA1d3N7V6dS5Rq2wvxZqqVHo1fK", "proofs": [ "4FmfkXcMMs1AXSjFQsc5zxWjtJaTMwkusTvDp9S1T8gX3APTuzBSb6gBWySYf5s4mnFh7f2AJB9YNmWu4QjbugUf" ], "script": "base64:AAIFAAAAAAAAACQIAhIDCgEIEggKBggICAgICBIDCgEEEgcKBQgICAgIEgMKAQgAAAASAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAACWxlYXNlUG9vbAkBAAAAB0FkZHJlc3MAAAABCAUAAAAEdGhpcwAAAAVieXRlcwAAAAACc2ECAAAAD1NUQUtJTkdfQU1PVU5UXwAAAAACbGECAAAADUxFQVNFX0FNT1VOVF8AAAAAAml4AgAAAANJRF8AAAAADGV4Y2hhbmdlUmF0ZQAAAAA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bGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAJhMQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAAmEyBQAAAAdhZGRyZXNzBQAAAANuaWwFAAAACWRlbGV0RW50eQQAAAAHYmJlbnRyeQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAdhZGRyZXNzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgIAAAAFUE9PTF8FAAAABFBNQUEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACAgAAAAlscF9hc3NldF8FAAAABFBNQUEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAANhYTEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAANhYTIFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAR0eXBlBQAAAAdhZGRyZXNzBQAAAANuaWwFAAAAB2JiZW50cnkJAAACAAAAAQIAAAAuT25seSB0aGUgQWRtaW4gaXRzZWxmIGNhbiBpbnZva2UgdGhpcyBmdW5jdGlvbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRVVlK8=", "height": 2037366, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: eqbcHuimumrFQy33VSYmh2ENB5VF31jmJac5miPvo4Y Next: none Diff:
Old | New | Differences | |
---|---|---|---|
59 | 59 | then throw("The pool has been previously added.") | |
60 | 60 | else if ((w == C)) | |
61 | 61 | then throw("Pool address cannot be the same as staker") | |
62 | - | else [StringEntry(r, x), StringEntry(("POOL_" + x), C), StringEntry((b + x), D), StringEntry((h + r), E), StringEntry((i + r), F), StringEntry((k + r), "pools")] | |
62 | + | else if ((E == F)) | |
63 | + | then throw("Asset1 cannot be equal to Asset2 and vice versa") | |
64 | + | else [StringEntry(r, x), StringEntry(("POOL_" + x), C), StringEntry((b + x), D), StringEntry((h + r), E), StringEntry((i + r), F), StringEntry((k + r), "pools")] | |
63 | 65 | else throw("Only the Admin itself can invoke this function") | |
64 | 66 | } | |
65 | 67 | ||
73 | 75 | ||
74 | 76 | ||
75 | 77 | @Callable(u) | |
76 | - | func addSwap (w,z,x, | |
78 | + | func addSwap (w,z,x,A,B) = { | |
77 | 79 | let r = q(w) | |
78 | 80 | let C = q(z) | |
79 | 81 | let G = getString(this, r) | |
82 | + | let E = s(A) | |
83 | + | let F = s(B) | |
80 | 84 | if ((u.caller == this)) | |
81 | 85 | then if (isDefined(G)) | |
82 | 86 | then throw("The address for this swap has been previously added.") | |
83 | 87 | else if ((w == C)) | |
84 | 88 | then throw("Swap address cannot be the same as staker") | |
85 | - | else [StringEntry(("swap_" + x), C), StringEntry(r, x), StringEntry((c + r), E), StringEntry((g + r), F), StringEntry((k + r), "swap")] | |
89 | + | else if ((E == F)) | |
90 | + | then throw("Asset1 cannot be equal to Asset2 and vice versa") | |
91 | + | else [StringEntry(("swap_" + x), C), StringEntry(r, x), StringEntry((c + r), E), StringEntry((g + r), F), StringEntry((k + r), "swap")] | |
86 | 92 | else throw("Only the Admin itself can invoke this function") | |
87 | 93 | } | |
88 | 94 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "main_asset" | |
5 | 5 | ||
6 | 6 | let b = "lp_asset_" | |
7 | 7 | ||
8 | 8 | let c = "swap_asset1_" | |
9 | 9 | ||
10 | 10 | let d = "address_staker_" | |
11 | 11 | ||
12 | 12 | let e = "address_pool_" | |
13 | 13 | ||
14 | 14 | let f = "address_swap_" | |
15 | 15 | ||
16 | 16 | let g = "swap_asset2_" | |
17 | 17 | ||
18 | 18 | let h = "pool_1_" | |
19 | 19 | ||
20 | 20 | let i = "pool_2_" | |
21 | 21 | ||
22 | 22 | let j = "staker_address" | |
23 | 23 | ||
24 | 24 | let k = "type_" | |
25 | 25 | ||
26 | 26 | let l = Address(this.bytes) | |
27 | 27 | ||
28 | 28 | let m = "STAKING_AMOUNT_" | |
29 | 29 | ||
30 | 30 | let n = "LEASE_AMOUNT_" | |
31 | 31 | ||
32 | 32 | let o = "ID_" | |
33 | 33 | ||
34 | 34 | let p = 5 | |
35 | 35 | ||
36 | 36 | func q (r) = toString(valueOrErrorMessage(addressFromString(r), (("Can't parse " + r) + " as address"))) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func s (t) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(t))).id, (("Asset Id: " + t) + " is invalid."))) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(u) | |
43 | 43 | func addMainAsset (v) = if ((u.caller == this)) | |
44 | 44 | then [StringEntry(a, v)] | |
45 | 45 | else throw("Only the Admin itself can invoke this function") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(u) | |
50 | 50 | func addPool (w,x,y,z,A,B) = { | |
51 | 51 | let r = q(w) | |
52 | 52 | let C = q(z) | |
53 | 53 | let D = s(y) | |
54 | 54 | let E = s(A) | |
55 | 55 | let F = s(B) | |
56 | 56 | let G = getString(this, r) | |
57 | 57 | if ((u.caller == this)) | |
58 | 58 | then if (isDefined(G)) | |
59 | 59 | then throw("The pool has been previously added.") | |
60 | 60 | else if ((w == C)) | |
61 | 61 | then throw("Pool address cannot be the same as staker") | |
62 | - | else [StringEntry(r, x), StringEntry(("POOL_" + x), C), StringEntry((b + x), D), StringEntry((h + r), E), StringEntry((i + r), F), StringEntry((k + r), "pools")] | |
62 | + | else if ((E == F)) | |
63 | + | then throw("Asset1 cannot be equal to Asset2 and vice versa") | |
64 | + | else [StringEntry(r, x), StringEntry(("POOL_" + x), C), StringEntry((b + x), D), StringEntry((h + r), E), StringEntry((i + r), F), StringEntry((k + r), "pools")] | |
63 | 65 | else throw("Only the Admin itself can invoke this function") | |
64 | 66 | } | |
65 | 67 | ||
66 | 68 | ||
67 | 69 | ||
68 | 70 | @Callable(u) | |
69 | 71 | func activate (H) = if ((u.caller == this)) | |
70 | 72 | then [BooleanEntry("activate", H)] | |
71 | 73 | else throw("Only the Admin itself can invoke this function") | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | ||
75 | 77 | @Callable(u) | |
76 | - | func addSwap (w,z,x, | |
78 | + | func addSwap (w,z,x,A,B) = { | |
77 | 79 | let r = q(w) | |
78 | 80 | let C = q(z) | |
79 | 81 | let G = getString(this, r) | |
82 | + | let E = s(A) | |
83 | + | let F = s(B) | |
80 | 84 | if ((u.caller == this)) | |
81 | 85 | then if (isDefined(G)) | |
82 | 86 | then throw("The address for this swap has been previously added.") | |
83 | 87 | else if ((w == C)) | |
84 | 88 | then throw("Swap address cannot be the same as staker") | |
85 | - | else [StringEntry(("swap_" + x), C), StringEntry(r, x), StringEntry((c + r), E), StringEntry((g + r), F), StringEntry((k + r), "swap")] | |
89 | + | else if ((E == F)) | |
90 | + | then throw("Asset1 cannot be equal to Asset2 and vice versa") | |
91 | + | else [StringEntry(("swap_" + x), C), StringEntry(r, x), StringEntry((c + r), E), StringEntry((g + r), F), StringEntry((k + r), "swap")] | |
86 | 92 | else throw("Only the Admin itself can invoke this function") | |
87 | 93 | } | |
88 | 94 | ||
89 | 95 | ||
90 | 96 | ||
91 | 97 | @Callable(u) | |
92 | 98 | func removeSwapOrPool (r) = { | |
93 | 99 | let I = getStringValue(this, (k + r)) | |
94 | 100 | let G = getStringValue(this, r) | |
95 | 101 | if ((u.caller == this)) | |
96 | 102 | then if ((I == "swap")) | |
97 | 103 | then { | |
98 | 104 | let J = [DeleteEntry(("swap_" + G)), DeleteEntry(r), DeleteEntry((k + r)), DeleteEntry((c + r)), DeleteEntry((g + r))] | |
99 | 105 | J | |
100 | 106 | } | |
101 | 107 | else { | |
102 | 108 | let K = [DeleteEntry(r), DeleteEntry(("POOL_" + G)), DeleteEntry(("lp_asset_" + G)), DeleteEntry((h + r)), DeleteEntry((i + r)), DeleteEntry((k + r))] | |
103 | 109 | K | |
104 | 110 | } | |
105 | 111 | else throw("Only the Admin itself can invoke this function") | |
106 | 112 | } | |
107 | 113 | ||
108 | 114 | ||
109 | 115 | @Verifier(L) | |
110 | 116 | func M () = { | |
111 | 117 | let N = L | |
112 | 118 | sigVerify(L.bodyBytes, L.proofs[0], L.senderPublicKey) | |
113 | 119 | } | |
114 | 120 |
github/deemru/w8io/169f3d6 59.27 ms ◑