tx · 41exwtqWT7YAmEyhUFR2wK39mmxoZ1dgWHEAe1U4Bwe5 3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY: -0.01000000 Waves 2022.06.16 01:40 [2098100] smart account 3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY > SELF 0.00000000 Waves
{ "type": 13, "id": "41exwtqWT7YAmEyhUFR2wK39mmxoZ1dgWHEAe1U4Bwe5", "fee": 1000000, "feeAssetId": null, "timestamp": 1655332862900, "version": 2, "chainId": 84, "sender": "3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY", "senderPublicKey": "fFTt4dRQEMWmxs9cA5He1tph3gmQLAM4cnpj6eqkWPR", "proofs": [ "5EdHnNrQgqcf8TTTVovFSeGqb3mo5DMfaMaZ4tvBZvkf5FA6vccxUpcNoFA64XQ41o1tXzVGx8VcaLMZqSkK7ZFq" ], "script": "base64:AAIFAAAAAAAAADAIAhIKCggICAgICAQBARIDCgEEEgUKAwQEBBIDCgEBEgMKAQQSAwoBBBIAEgMKAQEAAAAfAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAAAnNhAgAAAA9TVEFLSU5HX0FNT1VOVF8AAAAAAmxhAgAAAA1MRUFTRV9BTU9VTlRfAAAAAAJpeAIAAAADSURfAAAAAAdyYXRlRmVlAgAAABNwZXJjZW50YWdlX3JhdGVfZmVlAAAAAAJEOAAAAAAABfXhAAAAAAACRDYAA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ity": 0 } View: original | compacted Prev: C7XMpyex3FdL3tmBKZA7RtsDzkM9WZg5JbfY1xwr4iGo Next: 2n2gtzArNCdz5Pn4BPkboGYxJrgS8P8AnTgXsHm5STcw Diff:
Old | New | Differences | |
---|---|---|---|
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(H) | |
104 | + | func blockDistribution (W) = if ((H.caller == this)) | |
105 | + | then [BooleanEntry(B, W)] | |
106 | + | else throw("Only the Admin itself can invoke this function") | |
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | @Callable(H) | |
104 | 111 | func deposit () = { | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | let | |
110 | - | if ( | |
111 | - | then if (!( | |
112 | - | then if (( | |
113 | - | then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String( | |
112 | + | let X = getBooleanValue(this, x) | |
113 | + | let Y = getBooleanValue(this, A) | |
114 | + | let Z = getBooleanValue(this, G) | |
115 | + | let aa = H.payments[0] | |
116 | + | let ab = fromBase58String(getStringValue(this, a)) | |
117 | + | if (X) | |
118 | + | then if (!(Y)) | |
119 | + | then if ((aa.assetId != ab)) | |
120 | + | then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String(ab))) | |
114 | 121 | else { | |
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | if ($isInstanceOf( | |
122 | + | let ac = toBase58String(H.caller.bytes) | |
123 | + | let ad = { | |
124 | + | let ae = getInteger(this, ac) | |
125 | + | if ($isInstanceOf(ae, "Int")) | |
119 | 126 | then { | |
120 | - | let | |
121 | - | | |
127 | + | let af = ae | |
128 | + | af | |
122 | 129 | } | |
123 | 130 | else 0 | |
124 | 131 | } | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | if ($isInstanceOf( | |
132 | + | let ag = (ad + aa.amount) | |
133 | + | let ah = IntegerEntry(ac, ag) | |
134 | + | let ai = IntegerEntry(("Deposit_Height_Of_" + ac), height) | |
135 | + | let aj = { | |
136 | + | let ae = getInteger(this, "Total_Tokens_Locked:") | |
137 | + | if ($isInstanceOf(ae, "Int")) | |
131 | 138 | then { | |
132 | - | let | |
133 | - | | |
139 | + | let af = ae | |
140 | + | af | |
134 | 141 | } | |
135 | 142 | else 0 | |
136 | 143 | } | |
137 | - | let | |
138 | - | let | |
139 | - | [ | |
144 | + | let ak = (aj + aa.amount) | |
145 | + | let al = IntegerEntry("Total_Tokens_Locked:", ak) | |
146 | + | [ah, ai, al] | |
140 | 147 | } | |
141 | 148 | else throw("liquidity is currently under maintenance.") | |
142 | 149 | else throw("dApp is currently under maintenance.") | |
145 | 152 | ||
146 | 153 | ||
147 | 154 | @Callable(H) | |
148 | - | func remove ( | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | if ( | |
155 | - | then if (!( | |
155 | + | func remove (am) = { | |
156 | + | let X = getBooleanValue(this, x) | |
157 | + | let Y = getBooleanValue(this, A) | |
158 | + | let Z = getBooleanValue(this, G) | |
159 | + | let aa = H.payments[0] | |
160 | + | let ab = fromBase58String(getStringValue(this, a)) | |
161 | + | if (X) | |
162 | + | then if (!(Y)) | |
156 | 163 | then { | |
157 | - | let | |
158 | - | let | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | if ((0 > | |
164 | + | let ac = toBase58String(H.caller.bytes) | |
165 | + | let ad = valueOrElse(getInteger(this, ac), 0) | |
166 | + | let an = ("Deposit_Height_Of_" + ac) | |
167 | + | let aj = getIntegerValue(this, "Total_Tokens_Locked:") | |
168 | + | let ak = (aj - am) | |
169 | + | let ao = (height - getIntegerValue(this, an)) | |
170 | + | let ap = getIntegerValue(this, B) | |
171 | + | if ((0 > am)) | |
165 | 172 | then throw("Can't withdraw negative AxAi amount") | |
166 | 173 | else { | |
167 | - | let | |
168 | - | if ((0 > | |
174 | + | let ag = (ad - am) | |
175 | + | if ((0 > ag)) | |
169 | 176 | then throw("Not enough AxAi balance") | |
170 | - | else [IntegerEntry( | |
177 | + | else [IntegerEntry(ac, ag), IntegerEntry("Total_Tokens_Locked:", ak), ScriptTransfer(H.caller, am, ab), ScriptTransfer(H.caller, (((ao * ap) / aj) * ad), ab)] | |
171 | 178 | } | |
172 | 179 | } | |
173 | 180 | else throw("liquidity is currently under maintenance.") | |
175 | 182 | } | |
176 | 183 | ||
177 | 184 | ||
178 | - | @Verifier( | |
179 | - | func | |
180 | - | let | |
181 | - | sigVerify( | |
185 | + | @Verifier(aq) | |
186 | + | func ar () = { | |
187 | + | let ae = aq | |
188 | + | sigVerify(aq.bodyBytes, aq.proofs[0], aq.senderPublicKey) | |
182 | 189 | } | |
183 | 190 |
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 = "STAKING_AMOUNT_" | |
27 | 27 | ||
28 | 28 | let m = "LEASE_AMOUNT_" | |
29 | 29 | ||
30 | 30 | let n = "ID_" | |
31 | 31 | ||
32 | 32 | let o = "percentage_rate_fee" | |
33 | 33 | ||
34 | 34 | let p = 100000000 | |
35 | 35 | ||
36 | 36 | let q = 1000000 | |
37 | 37 | ||
38 | 38 | let r = Address(this.bytes) | |
39 | 39 | ||
40 | 40 | let s = 5 | |
41 | 41 | ||
42 | 42 | func t (u) = toString(valueOrErrorMessage(addressFromString(u), (("Can't parse " + u) + " as address"))) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func v (w) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(w))).id, (("Asset Id: " + w) + " is invalid."))) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let x = "activate" | |
49 | 49 | ||
50 | 50 | let y = "activate_pools" | |
51 | 51 | ||
52 | 52 | let z = "activate_swap" | |
53 | 53 | ||
54 | 54 | let A = "activate_liquidity" | |
55 | 55 | ||
56 | 56 | let B = "block_distribuition" | |
57 | 57 | ||
58 | 58 | let C = "usdn_asset" | |
59 | 59 | ||
60 | 60 | let D = "usdt_asset" | |
61 | 61 | ||
62 | 62 | let E = "usdc_asset" | |
63 | 63 | ||
64 | 64 | let F = "ngnn_asset" | |
65 | 65 | ||
66 | 66 | let G = "accept_waves" | |
67 | 67 | ||
68 | 68 | @Callable(H) | |
69 | 69 | func constructor (I,J,K,L,M,N,O,P) = if ((H.caller == this)) | |
70 | 70 | then [StringEntry(a, I), StringEntry(C, J), StringEntry(E, L), StringEntry(D, K), StringEntry(F, M), BooleanEntry(G, N), IntegerEntry(o, O), BooleanEntry(x, true), BooleanEntry(z, false), BooleanEntry(y, false), BooleanEntry(A, false), IntegerEntry(B, P)] | |
71 | 71 | else throw("Only the Admin itself can invoke this function") | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(H) | |
76 | 76 | func activate (Q) = if ((H.caller == this)) | |
77 | 77 | then [BooleanEntry(x, Q)] | |
78 | 78 | else throw("Only the Admin itself can invoke this function") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | 82 | @Callable(H) | |
83 | 83 | func maintenance (R,S,T) = if ((H.caller == this)) | |
84 | 84 | then [BooleanEntry(y, R), BooleanEntry(z, S), BooleanEntry(A, T)] | |
85 | 85 | else throw("Only the Admin itself can invoke this function") | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(H) | |
90 | 90 | func percentualRateFeeEdit (U) = if ((H.caller == this)) | |
91 | 91 | then [IntegerEntry(o, U)] | |
92 | 92 | else throw("Only the Admin itself can invoke this function") | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(H) | |
97 | 97 | func acceptWaves (V) = if ((H.caller == this)) | |
98 | 98 | then [BooleanEntry(G, V)] | |
99 | 99 | else throw("Only the Admin itself can invoke this function") | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(H) | |
104 | + | func blockDistribution (W) = if ((H.caller == this)) | |
105 | + | then [BooleanEntry(B, W)] | |
106 | + | else throw("Only the Admin itself can invoke this function") | |
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | @Callable(H) | |
104 | 111 | func deposit () = { | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | let | |
110 | - | if ( | |
111 | - | then if (!( | |
112 | - | then if (( | |
113 | - | then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String( | |
112 | + | let X = getBooleanValue(this, x) | |
113 | + | let Y = getBooleanValue(this, A) | |
114 | + | let Z = getBooleanValue(this, G) | |
115 | + | let aa = H.payments[0] | |
116 | + | let ab = fromBase58String(getStringValue(this, a)) | |
117 | + | if (X) | |
118 | + | then if (!(Y)) | |
119 | + | then if ((aa.assetId != ab)) | |
120 | + | then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String(ab))) | |
114 | 121 | else { | |
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | if ($isInstanceOf( | |
122 | + | let ac = toBase58String(H.caller.bytes) | |
123 | + | let ad = { | |
124 | + | let ae = getInteger(this, ac) | |
125 | + | if ($isInstanceOf(ae, "Int")) | |
119 | 126 | then { | |
120 | - | let | |
121 | - | | |
127 | + | let af = ae | |
128 | + | af | |
122 | 129 | } | |
123 | 130 | else 0 | |
124 | 131 | } | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | if ($isInstanceOf( | |
132 | + | let ag = (ad + aa.amount) | |
133 | + | let ah = IntegerEntry(ac, ag) | |
134 | + | let ai = IntegerEntry(("Deposit_Height_Of_" + ac), height) | |
135 | + | let aj = { | |
136 | + | let ae = getInteger(this, "Total_Tokens_Locked:") | |
137 | + | if ($isInstanceOf(ae, "Int")) | |
131 | 138 | then { | |
132 | - | let | |
133 | - | | |
139 | + | let af = ae | |
140 | + | af | |
134 | 141 | } | |
135 | 142 | else 0 | |
136 | 143 | } | |
137 | - | let | |
138 | - | let | |
139 | - | [ | |
144 | + | let ak = (aj + aa.amount) | |
145 | + | let al = IntegerEntry("Total_Tokens_Locked:", ak) | |
146 | + | [ah, ai, al] | |
140 | 147 | } | |
141 | 148 | else throw("liquidity is currently under maintenance.") | |
142 | 149 | else throw("dApp is currently under maintenance.") | |
143 | 150 | } | |
144 | 151 | ||
145 | 152 | ||
146 | 153 | ||
147 | 154 | @Callable(H) | |
148 | - | func remove ( | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | if ( | |
155 | - | then if (!( | |
155 | + | func remove (am) = { | |
156 | + | let X = getBooleanValue(this, x) | |
157 | + | let Y = getBooleanValue(this, A) | |
158 | + | let Z = getBooleanValue(this, G) | |
159 | + | let aa = H.payments[0] | |
160 | + | let ab = fromBase58String(getStringValue(this, a)) | |
161 | + | if (X) | |
162 | + | then if (!(Y)) | |
156 | 163 | then { | |
157 | - | let | |
158 | - | let | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | if ((0 > | |
164 | + | let ac = toBase58String(H.caller.bytes) | |
165 | + | let ad = valueOrElse(getInteger(this, ac), 0) | |
166 | + | let an = ("Deposit_Height_Of_" + ac) | |
167 | + | let aj = getIntegerValue(this, "Total_Tokens_Locked:") | |
168 | + | let ak = (aj - am) | |
169 | + | let ao = (height - getIntegerValue(this, an)) | |
170 | + | let ap = getIntegerValue(this, B) | |
171 | + | if ((0 > am)) | |
165 | 172 | then throw("Can't withdraw negative AxAi amount") | |
166 | 173 | else { | |
167 | - | let | |
168 | - | if ((0 > | |
174 | + | let ag = (ad - am) | |
175 | + | if ((0 > ag)) | |
169 | 176 | then throw("Not enough AxAi balance") | |
170 | - | else [IntegerEntry( | |
177 | + | else [IntegerEntry(ac, ag), IntegerEntry("Total_Tokens_Locked:", ak), ScriptTransfer(H.caller, am, ab), ScriptTransfer(H.caller, (((ao * ap) / aj) * ad), ab)] | |
171 | 178 | } | |
172 | 179 | } | |
173 | 180 | else throw("liquidity is currently under maintenance.") | |
174 | 181 | else throw("dApp is currently under maintenance.") | |
175 | 182 | } | |
176 | 183 | ||
177 | 184 | ||
178 | - | @Verifier( | |
179 | - | func | |
180 | - | let | |
181 | - | sigVerify( | |
185 | + | @Verifier(aq) | |
186 | + | func ar () = { | |
187 | + | let ae = aq | |
188 | + | sigVerify(aq.bodyBytes, aq.proofs[0], aq.senderPublicKey) | |
182 | 189 | } | |
183 | 190 |
github/deemru/w8io/169f3d6 55.80 ms ◑