tx · F7jSwEifyEzaJafyMkayZcDsHjn7NvNhVETn8miV9QcV 3N8icXyy8nP599uu4C5Tydn7qwU8y9V2dP5: -0.02100000 Waves 2023.01.06 03:12 [2392359] smart account 3N8icXyy8nP599uu4C5Tydn7qwU8y9V2dP5 > SELF 0.00000000 Waves
{ "type": 13, "id": "F7jSwEifyEzaJafyMkayZcDsHjn7NvNhVETn8miV9QcV", "fee": 2100000, "feeAssetId": null, "timestamp": 1672963959584, "version": 2, "chainId": 84, "sender": "3N8icXyy8nP599uu4C5Tydn7qwU8y9V2dP5", "senderPublicKey": "7g2oH3HDdgHMD6FU9M7WneDyHy7VzFBYp8VswdpHQa85", "proofs": [ "3pps9rKqF7Uv4EstwjJpYfdjGZXcTymtYahbACs5qono2yqwPz7p981njwCGSK3t1kXut569rd9kjZjhz5W9iYxj" ], "script": "base64:BgJHCAISBAoCCAgSBAoCCAgSBgoECAgIBBIFCgMICAESBQoDBAgIEgYKBAQICAESBAoCCAgSAwoBCBIDCgEIEgQKAgEIEgMKAQgsAAxhZG1pbkFkZHJlc3MCIzNQTFZQb0I2S3NYQ3Rxb3doeldKU3Rpak53N1Nqc1BLc3E2AAVBZG1pbgkBB0FkZHJlc3MBCQDZBAEFDGFkbWluQWRkcmVzcwAFd2F2ZXMCBVdBVkVTAAZhV2F2ZXMCDGFjY2VwdF93YXZlcwAFV0FWRVMFBHVuaXQABm5mZXRBYwIMYWN0aXZhdGVfbmZ0AARtYWluAgptYWluX2Fzc2V0AAFsAglscF9hc3NldF8AA2FhMQIGcG9vbF9fAAJzYQIPU1RBS0lOR19BTU9VTlRfAAJsYQINTEVBU0VfQU1PVU5UXwACaXgCA0lEXwAHcmF0ZUZlZQIYcGVyY2VudGFnZV9yYXRlX2ZlZV9zd2FwAAxyYXRlRmVlTGltaXQCDnJhdGVfZmVlX2xpbWl0AA1yYXRlRmVlSGVpZ2h0Ag9yYXRlX2ZlZV9oZWlnaHQADmRlcG9zaXRfaGVpZ2h0AhJEZXBvc2l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QIkZEFwcCBpcyBjdXJyZW50bHkgdW5kZXIgbWFpbnRlbmFuY2UuAWkBEENyZWF0ZUNvbGxlY3Rpb24BDmNvbGxlY3Rpb25OYW1lBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEAnRjBAckbWF0Y2gwCQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzCQCsAgIFCmN1cnJlbnRLZXkCEV90b3RhbF9jb2xsZWN0aW9uAwkAAQIFByRtYXRjaDACA0ludAQCYWkFByRtYXRjaDAFAmFpAAADCQEVdmVyaWZpQ29sbGVjdGlvbkV4aXN0AQUOY29sbGVjdGlvbk5hbWUJAAIBAkNFcnJvcjogQSBjb2xsZWN0aW9uIHdpdGggdGhhdCBuYW1lIGFscmVhZHkgZXhpc3RzLCB0cnkgYW5vdGhlciBvbmUuCQDMCAIJAQtTdHJpbmdFbnRyeQIFDmNvbGxlY3Rpb25OYW1lBQpjdXJyZW50S2V5CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCmN1cnJlbnRLZXkCEV90b3RhbF9jb2xsZWN0aW9uCQBkAgUCdGMAAQUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlefOJwVI=", "height": 2392359, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: BDuVYzSWcXc3Vm6kdnQkVW56UbSDdKh6AJ7Frmmi5Fbo Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let adminAddress = "3PLVPoB6KsXCtqowhzWJStijNw7SjsPKsq6" | |
5 | + | ||
6 | + | let Admin = Address(fromBase58String(adminAddress)) | |
7 | + | ||
8 | + | let waves = "WAVES" | |
9 | + | ||
10 | + | let aWaves = "accept_waves" | |
11 | + | ||
12 | + | let WAVES = unit | |
13 | + | ||
14 | + | let nfetAc = "activate_nft" | |
15 | + | ||
16 | + | let main = "main_asset" | |
17 | + | ||
18 | + | let l = "lp_asset_" | |
19 | + | ||
20 | + | let aa1 = "pool__" | |
21 | + | ||
22 | + | let sa = "STAKING_AMOUNT_" | |
23 | + | ||
24 | + | let la = "LEASE_AMOUNT_" | |
25 | + | ||
26 | + | let ix = "ID_" | |
27 | + | ||
28 | + | let rateFee = "percentage_rate_fee_swap" | |
29 | + | ||
30 | + | let rateFeeLimit = "rate_fee_limit" | |
31 | + | ||
32 | + | let rateFeeHeight = "rate_fee_height" | |
33 | + | ||
34 | + | let deposit_height = "Deposit_Height_Of_" | |
35 | + | ||
36 | + | let ac = "activate" | |
37 | + | ||
38 | + | let poolAc = "activate_pools" | |
39 | + | ||
40 | + | let swapAc = "activate_swap" | |
41 | + | ||
42 | + | let liquidityAc = "activate_liquidity" | |
43 | + | ||
44 | + | let bcD = "block_distribuition" | |
45 | + | ||
46 | + | let D8 = pow(10, 0, 8, 0, 0, HALFUP) | |
47 | + | ||
48 | + | let total_locked = "Total_Tokens_Locked_" | |
49 | + | ||
50 | + | let iniError = "Smart contract admin has not yet been initialized." | |
51 | + | ||
52 | + | func D (i) = value(assetInfo(i)).decimals | |
53 | + | ||
54 | + | ||
55 | + | func dM (i,o) = pow(10, 0, (i - o), 0, 0, HALFUP) | |
56 | + | ||
57 | + | ||
58 | + | func D10 (i) = pow(10, 0, value(assetInfo(i)).decimals, 0, 0, HALFUP) | |
59 | + | ||
60 | + | ||
61 | + | func validateAsset (assetS,stringAsset,acWaves) = if (if ((assetS == WAVES)) | |
62 | + | then (stringAsset == waves) | |
63 | + | else false) | |
64 | + | then if (acWaves) | |
65 | + | then true | |
66 | + | else throw("The smart contract does not currently support Waves.") | |
67 | + | else if ((assetS == fromBase58String(stringAsset))) | |
68 | + | then true | |
69 | + | else false | |
70 | + | ||
71 | + | ||
72 | + | func getAsset (a) = match a { | |
73 | + | case a: ByteVector => | |
74 | + | toBase58String(a) | |
75 | + | case _ => | |
76 | + | throw("Requires NFT as payment for sale.") | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | func kp (asset1,asset2) = (((aa1 + asset1) + "_") + asset2) | |
81 | + | ||
82 | + | ||
83 | + | func validPoolK (key) = match getInteger(this, key) { | |
84 | + | case i: Int => | |
85 | + | i | |
86 | + | case _ => | |
87 | + | false | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | func kpAddress (address,key) = match getInteger(this, ((key + "_") + address)) { | |
92 | + | case t: Int => | |
93 | + | t | |
94 | + | case _ => | |
95 | + | 0 | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | func poolAA (address,key,asset) = match getInteger(this, ((((address + "_") + key) + "_") + asset)) { | |
100 | + | case a: Int => | |
101 | + | a | |
102 | + | case _ => | |
103 | + | 0 | |
104 | + | } | |
105 | + | ||
106 | + | ||
107 | + | func assetP (key,asset) = match getInteger(this, ((key + "_") + asset)) { | |
108 | + | case a: Int => | |
109 | + | a | |
110 | + | case _ => | |
111 | + | 1 | |
112 | + | } | |
113 | + | ||
114 | + | ||
115 | + | func verifiCollectionExist (a) = match getStringValue(this, a) { | |
116 | + | case o: String => | |
117 | + | true | |
118 | + | case _ => | |
119 | + | false | |
120 | + | } | |
121 | + | ||
122 | + | ||
123 | + | func getAssetName (assetId) = match assetInfo(assetId) { | |
124 | + | case asset: Asset => | |
125 | + | asset.name | |
126 | + | case _ => | |
127 | + | throw("Can't find asset") | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | func getAssetIssueAddress (a) = match assetInfo(a) { | |
132 | + | case asset: Asset => | |
133 | + | asset.issuer | |
134 | + | case _ => | |
135 | + | throw("Can't find asset") | |
136 | + | } | |
137 | + | ||
138 | + | ||
139 | + | func totalAssetPool (key,assetLp) = match getInteger(this, key) { | |
140 | + | case a: Int => | |
141 | + | a | |
142 | + | case _ => | |
143 | + | if (assetLp) | |
144 | + | then D8 | |
145 | + | else 1 | |
146 | + | } | |
147 | + | ||
148 | + | ||
149 | + | func valid (assetPay,pair1,pair2) = { | |
150 | + | let pair1_58 = if ((pair1 == waves)) | |
151 | + | then WAVES | |
152 | + | else fromBase58String(pair1) | |
153 | + | let pair2_58 = if ((pair2 == waves)) | |
154 | + | then WAVES | |
155 | + | else fromBase58String(pair2) | |
156 | + | if ((assetPay == pair1_58)) | |
157 | + | then pair2_58 | |
158 | + | else pair1_58 | |
159 | + | } | |
160 | + | ||
161 | + | ||
162 | + | func pkey (Asset1,Asset2,address) = (((deposit_height + kp(Asset1, Asset2)) + "_") + address) | |
163 | + | ||
164 | + | ||
165 | + | func getAmountBlockAsset (assetId) = match getInteger(this, assetId) { | |
166 | + | case i: Int => | |
167 | + | i | |
168 | + | case _ => | |
169 | + | 0 | |
170 | + | } | |
171 | + | ||
172 | + | ||
173 | + | func MainAsset () = fromBase58String(getStringValue(Admin, main)) | |
174 | + | ||
175 | + | ||
176 | + | func GetRateFeeSwap () = getIntegerValue(Admin, rateFee) | |
177 | + | ||
178 | + | ||
179 | + | func lpBlocked (address,key) = match getInteger(this, ((("STAKE_LP_" + address) + "_") + key)) { | |
180 | + | case a: Int => | |
181 | + | a | |
182 | + | case _ => | |
183 | + | 0 | |
184 | + | } | |
185 | + | ||
186 | + | ||
187 | + | @Callable(i) | |
188 | + | func Swap (Asset1,Asset2) = { | |
189 | + | let currentKey = toBase58String(i.caller.bytes) | |
190 | + | let acWaves = getBooleanValue(Admin, aWaves) | |
191 | + | let power = getBooleanValue(Admin, ac) | |
192 | + | let swapActivate = getBooleanValue(Admin, swapAc) | |
193 | + | let poolKey = kp(Asset1, Asset2) | |
194 | + | let key = validPoolK(poolKey) | |
195 | + | let asset1 = i.payments[0].assetId | |
196 | + | let asset2 = i.payments[1].assetId | |
197 | + | let lpAssetId = getIntegerValue(this, (l + kp(Asset1, Asset2))) | |
198 | + | let totalAsset1 = totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset1), false) | |
199 | + | let totalAsset2 = totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset2), false) | |
200 | + | let feeRatePercentual = getIntegerValue(Admin, rateFee) | |
201 | + | let prAsset1 = (toBigInt(i.payments[0].amount) * fraction(toBigInt(D8), toBigInt(totalAsset2), toBigInt(totalAsset1))) | |
202 | + | let priceAsset1 = toInt(((prAsset1 - ((prAsset1 / toBigInt(feeRatePercentual)) * toBigInt(100))) / toBigInt(D8))) | |
203 | + | let prAsset2 = (toBigInt(i.payments[0].amount) * fraction(toBigInt(D8), toBigInt(totalAsset1), toBigInt(totalAsset2))) | |
204 | + | let priceAsset2 = toInt(((prAsset2 - ((prAsset2 / toBigInt(feeRatePercentual)) * toBigInt(100))) / toBigInt(D8))) | |
205 | + | let sendValue = if (if ((asset1 == WAVES)) | |
206 | + | then (Asset1 == waves) | |
207 | + | else false) | |
208 | + | then priceAsset1 | |
209 | + | else if ((asset1 == fromBase58String(Asset1))) | |
210 | + | then priceAsset1 | |
211 | + | else priceAsset2 | |
212 | + | let assetUpdatePay = if ((asset1 == WAVES)) | |
213 | + | then waves | |
214 | + | else if ((asset1 == fromBase58String(Asset1))) | |
215 | + | then Asset1 | |
216 | + | else Asset2 | |
217 | + | let assetUpdateSwap = if ((asset1 == WAVES)) | |
218 | + | then waves | |
219 | + | else if ((asset1 == fromBase58String(Asset1))) | |
220 | + | then Asset2 | |
221 | + | else Asset1 | |
222 | + | let assetSendSwap = valid(i.payments[0].assetId, Asset1, Asset2) | |
223 | + | let n1s = (assetP(kp(Asset1, Asset2), assetUpdateSwap) - sendValue) | |
224 | + | let nw = (getAmountBlockAsset(assetUpdateSwap) - sendValue) | |
225 | + | let newUpda = if ((0 > n1s)) | |
226 | + | then 0 | |
227 | + | else n1s | |
228 | + | let newUpdateSwap = if ((0 > nw)) | |
229 | + | then 0 | |
230 | + | else nw | |
231 | + | let Dx = match i.payments[0].assetId { | |
232 | + | case o: Unit => | |
233 | + | pow(10, 0, 8, 0, 0, HALFUP) | |
234 | + | case x: ByteVector => | |
235 | + | pow(10, 0, value(assetInfo(x)).decimals, 0, 0, HALFUP) | |
236 | + | case _ => | |
237 | + | throw("Match error") | |
238 | + | } | |
239 | + | if (power) | |
240 | + | then if (!(swapActivate)) | |
241 | + | then if (if (!((Asset1 == Asset2))) | |
242 | + | then if (validateAsset(asset1, Asset1, acWaves)) | |
243 | + | then true | |
244 | + | else validateAsset(asset1, Asset2, acWaves) | |
245 | + | else false) | |
246 | + | then if ((key != false)) | |
247 | + | then if ((i.payments[1].assetId == MainAsset())) | |
248 | + | then if ((i.payments[1].amount == GetRateFeeSwap())) | |
249 | + | then if (if ((totalAsset1 > 2)) | |
250 | + | then true | |
251 | + | else (totalAsset2 > 2)) | |
252 | + | then { | |
253 | + | let oldRateFeeSwapTotal = match getInteger(this, (poolKey + "_rate_fee_swap")) { | |
254 | + | case o: Int => | |
255 | + | (o + GetRateFeeSwap()) | |
256 | + | case _ => | |
257 | + | GetRateFeeSwap() | |
258 | + | } | |
259 | + | [ScriptTransfer(Address(i.caller.bytes), if ((0 > sendValue)) | |
260 | + | then Dx | |
261 | + | else sendValue, assetSendSwap), IntegerEntry(assetUpdateSwap, newUpdateSwap), IntegerEntry(((kp(Asset1, Asset2) + "_") + assetUpdateSwap), newUpda), IntegerEntry(((kp(Asset1, Asset2) + "_") + assetUpdatePay), (assetP(kp(Asset1, Asset2), assetUpdatePay) + i.payments[0].amount)), IntegerEntry(assetUpdatePay, (getAmountBlockAsset(assetUpdatePay) + i.payments[0].amount)), IntegerEntry(toBase58String(MainAsset()), (getAmountBlockAsset(toBase58String(MainAsset())) + i.payments[1].amount)), IntegerEntry((poolKey + "_rate_fee_swap"), oldRateFeeSwapTotal)] | |
262 | + | } | |
263 | + | else throw("Pool has no liquidity.") | |
264 | + | else throw((("Swap denied! " + toString(GetRateFeeSwap())) + " Bicon is required for the swap fee.")) | |
265 | + | else throw("Invalid rate asset") | |
266 | + | else throw("Invalid Swap Key.") | |
267 | + | else throw("Asset1 cannot be equal to Asset2") | |
268 | + | else throw("Swap is currently under maintenance.") | |
269 | + | else throw("dApp is currently under maintenance.") | |
270 | + | } | |
271 | + | ||
272 | + | ||
273 | + | ||
274 | + | @Callable(i) | |
275 | + | func AddLiquidity (Asset1,Asset2) = { | |
276 | + | let power = getBooleanValue(Admin, ac) | |
277 | + | let poolActivate = getBooleanValue(Admin, poolAc) | |
278 | + | let acWaves = getBooleanValue(Admin, aWaves) | |
279 | + | let key = validPoolK(kp(Asset1, Asset2)) | |
280 | + | let asset1 = i.payments[0].assetId | |
281 | + | let asset2 = i.payments[1].assetId | |
282 | + | let lpAssetId = getStringValue(this, (l + kp(Asset1, Asset2))) | |
283 | + | let totalAsset1Pool = if ((2 > totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset1), false))) | |
284 | + | then i.payments[0].amount | |
285 | + | else totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset1), false) | |
286 | + | let totalAsset2Pool = if ((2 > totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset1), false))) | |
287 | + | then i.payments[1].amount | |
288 | + | else totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset2), false) | |
289 | + | let totalLp = totalAssetPool(lpAssetId, true) | |
290 | + | let priceLpAsset = ((totalAsset1Pool + totalAsset2Pool) / totalLp) | |
291 | + | let quantityAsset2 = (i.payments[0].amount * (totalAsset2Pool / totalAsset1Pool)) | |
292 | + | let rateTop = (i.payments[1].amount + ((i.payments[1].amount * 2) / 100)) | |
293 | + | let rateBottom = (i.payments[1].amount - ((i.payments[1].amount * 2) / 100)) | |
294 | + | let Validate = if (if (if ((i.payments[1].amount == quantityAsset2)) | |
295 | + | then true | |
296 | + | else (rateTop > i.payments[1].amount)) | |
297 | + | then true | |
298 | + | else (i.payments[1].amount > rateBottom)) | |
299 | + | then true | |
300 | + | else false | |
301 | + | if (power) | |
302 | + | then if (!(poolActivate)) | |
303 | + | then if (if (if (!((asset1 == asset2))) | |
304 | + | then validateAsset(asset1, Asset1, acWaves) | |
305 | + | else false) | |
306 | + | then validateAsset(asset2, Asset2, acWaves) | |
307 | + | else false) | |
308 | + | then if ((key != false)) | |
309 | + | then if (Validate) | |
310 | + | then { | |
311 | + | let currentKey = toBase58String(i.caller.bytes) | |
312 | + | let currentAmount = kpAddress(currentKey, kp(Asset1, Asset2)) | |
313 | + | let currentAmountAsset1 = poolAA(currentKey, kp(Asset1, Asset2), Asset1) | |
314 | + | let currentAmountAsset2 = poolAA(currentKey, kp(Asset1, Asset2), Asset2) | |
315 | + | let asset1pool = assetP(kp(Asset1, Asset2), Asset1) | |
316 | + | let asset2pool = assetP(kp(Asset1, Asset2), Asset2) | |
317 | + | let receiveLp = if ((totalAsset1Pool == i.payments[0].amount)) | |
318 | + | then (1 * D8) | |
319 | + | else toInt((((toBigInt(i.payments[0].amount) * toBigInt(D8)) + (toBigInt(i.payments[1].amount) * toBigInt(D8))) / (((toBigInt(totalAsset1Pool) * toBigInt(D8)) + (toBigInt(totalAsset2Pool) * toBigInt(D8))) / toBigInt(totalLp)))) | |
320 | + | let newcurrentAmountAsset1 = (currentAmountAsset1 + i.payments[0].amount) | |
321 | + | let newcurrentAmountAsset2 = (currentAmountAsset2 + i.payments[1].amount) | |
322 | + | let newcurrentAmount = (currentAmount + receiveLp) | |
323 | + | let newasset1pool = (asset1pool + i.payments[0].amount) | |
324 | + | let newasset2pool = (asset2pool + i.payments[1].amount) | |
325 | + | [Reissue(fromBase58String(lpAssetId), receiveLp, true), ScriptTransfer(Address(i.caller.bytes), receiveLp, fromBase58String(lpAssetId)), IntegerEntry(pkey(Asset1, Asset2, currentKey), height), IntegerEntry(((((currentKey + "_") + kp(Asset1, Asset2)) + "_") + Asset1), newcurrentAmountAsset1), IntegerEntry(((((currentKey + "_") + kp(Asset1, Asset2)) + "_") + Asset2), newcurrentAmountAsset2), IntegerEntry(((kp(Asset1, Asset2) + "_") + currentKey), newcurrentAmount), IntegerEntry(((kp(Asset1, Asset2) + "_") + Asset1), newasset1pool), IntegerEntry(((kp(Asset1, Asset2) + "_") + Asset2), newasset2pool), IntegerEntry(Asset1, (getAmountBlockAsset(Asset1) + i.payments[0].amount)), IntegerEntry(Asset2, (getAmountBlockAsset(Asset2) + i.payments[1].amount)), IntegerEntry(lpAssetId, (getAmountBlockAsset(lpAssetId) + receiveLp))] | |
326 | + | } | |
327 | + | else throw(((((("Payment of invalid 1/1 amounts to the Pool. Try Asset2: {value:" + toString((i.payments[0].amount * (totalAsset2Pool / totalAsset1Pool)))) + "} Received: ") + toString(i.payments[1].amount)) + " Validate: ") + toString(Validate))) | |
328 | + | else throw("Invalid Pool Key.") | |
329 | + | else throw("Asset1 cannot be equal to Asset2") | |
330 | + | else throw("liquidity is currently under maintenance.") | |
331 | + | else throw("dApp is currently under maintenance.") | |
332 | + | } | |
333 | + | ||
334 | + | ||
335 | + | ||
336 | + | @Callable(i) | |
337 | + | func ActivatePool (asset1,asset2,Name,customName) = { | |
338 | + | let nameAsset1 = if ((asset1 == waves)) | |
339 | + | then waves | |
340 | + | else getAssetName(fromBase58String(asset1)) | |
341 | + | let nameAsset2 = if ((asset2 == waves)) | |
342 | + | then waves | |
343 | + | else getAssetName(fromBase58String(asset2)) | |
344 | + | let name = if (customName) | |
345 | + | then Name | |
346 | + | else ((nameAsset1 + "_") + nameAsset2) | |
347 | + | let key = validPoolK(kp(asset1, asset2)) | |
348 | + | if ((i.caller == getAssetIssueAddress(fromBase58String(asset1)))) | |
349 | + | then if ((key != false)) | |
350 | + | then { | |
351 | + | let assetLpCreate = Issue(name, ((("LP asset for pool liquidity in Bicon DEX pair " + asset1) + "_") + asset2), (1 * D8), 8, true) | |
352 | + | let idAssetLp = calculateAssetId(assetLpCreate) | |
353 | + | [StringEntry((l + kp(asset1, asset2)), toBase58String(idAssetLp)), assetLpCreate] | |
354 | + | } | |
355 | + | else throw("Invalid Pool Key. Try inverting the assets") | |
356 | + | else throw("Only the issuer address of asset1 itself can invoke this function.") | |
357 | + | } | |
358 | + | ||
359 | + | ||
360 | + | ||
361 | + | @Callable(i) | |
362 | + | func RemoveLiquidity (Asset1,Asset2,Amount) = { | |
363 | + | let currentKey = toBase58String(i.caller.bytes) | |
364 | + | let power = getBooleanValue(Admin, ac) | |
365 | + | let poolActivate = getBooleanValue(Admin, poolAc) | |
366 | + | let acWaves = getBooleanValue(Admin, aWaves) | |
367 | + | let poolKey = kp(Asset1, Asset2) | |
368 | + | let key = validPoolK(poolKey) | |
369 | + | let asset1 = if ((Asset1 == waves)) | |
370 | + | then if (acWaves) | |
371 | + | then WAVES | |
372 | + | else throw("The smart contract does not currently support Waves.") | |
373 | + | else fromBase58String(Asset1) | |
374 | + | let asset2 = if ((Asset2 == waves)) | |
375 | + | then if (acWaves) | |
376 | + | then WAVES | |
377 | + | else throw("The smart contract does not currently support Waves.") | |
378 | + | else fromBase58String(Asset2) | |
379 | + | let lpAssetId = getStringValue(this, (l + kp(Asset1, Asset2))) | |
380 | + | let currentAmount = kpAddress(currentKey, kp(Asset1, Asset2)) | |
381 | + | let amountLpBlocked = lpBlocked(currentKey, poolKey) | |
382 | + | let totalLP = totalAssetPool(lpAssetId, true) | |
383 | + | let totalAsset1Pool = totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset1), false) | |
384 | + | let totalAsset2Pool = totalAssetPool(((kp(Asset1, Asset2) + "_") + Asset2), false) | |
385 | + | if (power) | |
386 | + | then if (!(poolActivate)) | |
387 | + | then if (!((Asset1 == Asset2))) | |
388 | + | then if ((key != false)) | |
389 | + | then if (!((currentAmount == 0))) | |
390 | + | then if (((currentAmount - amountLpBlocked) >= Amount)) | |
391 | + | then if (if ((totalAsset1Pool > 2)) | |
392 | + | then true | |
393 | + | else (totalAsset2Pool > 2)) | |
394 | + | then { | |
395 | + | let receiveAsset1 = (toInt(((fraction(toBigInt(i.payments[0].amount), toBigInt(D8), toBigInt(totalLP)) * toBigInt(totalAsset1Pool)) / toBigInt(D8))) - 1) | |
396 | + | let receiveAsset2 = (toInt(((fraction(toBigInt(i.payments[0].amount), toBigInt(D8), toBigInt(totalLP)) * toBigInt(totalAsset2Pool)) / toBigInt(D8))) - 1) | |
397 | + | let asset1pool = assetP(kp(Asset1, Asset2), Asset1) | |
398 | + | let asset2pool = assetP(kp(Asset1, Asset2), Asset2) | |
399 | + | let currentAmountAsset1 = poolAA(currentKey, kp(Asset1, Asset2), Asset1) | |
400 | + | let currentAmountAsset2 = poolAA(currentKey, kp(Asset1, Asset2), Asset2) | |
401 | + | let newcurrentAmountAsset1 = (currentAmountAsset1 - receiveAsset1) | |
402 | + | let newcurrentAmountAsset2 = (currentAmountAsset2 - receiveAsset2) | |
403 | + | let newcurrentAmount = (currentAmount - Amount) | |
404 | + | let newasset1pool = (asset1pool - receiveAsset1) | |
405 | + | let newasset2pool = (asset2pool - receiveAsset2) | |
406 | + | if ((i.payments[0].assetId == fromBase58String(lpAssetId))) | |
407 | + | then if ((Amount == i.payments[0].amount)) | |
408 | + | then [Burn(fromBase58String(lpAssetId), Amount), ScriptTransfer(Address(i.caller.bytes), receiveAsset1, asset1), ScriptTransfer(Address(i.caller.bytes), receiveAsset2, asset2), IntegerEntry(pkey(Asset1, Asset2, currentKey), height), IntegerEntry(((((currentKey + "_") + kp(Asset1, Asset2)) + "_") + Asset1), newcurrentAmountAsset1), IntegerEntry(((((currentKey + "_") + kp(Asset1, Asset2)) + "_") + Asset2), newcurrentAmountAsset2), IntegerEntry(((kp(Asset1, Asset2) + "_") + currentKey), newcurrentAmount), IntegerEntry(((kp(Asset1, Asset2) + "_") + Asset1), newasset1pool), IntegerEntry(((kp(Asset1, Asset2) + "_") + Asset2), newasset2pool), IntegerEntry(Asset1, (getAmountBlockAsset(Asset1) - receiveAsset1)), IntegerEntry(Asset2, (getAmountBlockAsset(Asset2) - receiveAsset2)), IntegerEntry(lpAssetId, (getAmountBlockAsset(lpAssetId) - Amount))] | |
409 | + | else throw(("Withdrawal amount lower than asset lp amount. Your Lp amount available: " + toString(Amount))) | |
410 | + | else throw("Requires an lp asset as payment to remove locked amounts.") | |
411 | + | } | |
412 | + | else throw("Pool has no liquidity.") | |
413 | + | else throw(("Amount to be withdrawn greater than the amount available for withdrawal. Available: " + toString(Amount))) | |
414 | + | else throw("You have no locked values in the pool") | |
415 | + | else throw("Invalid Pool Key.") | |
416 | + | else throw("Asset1 cannot be equal to Asset2") | |
417 | + | else throw("liquidity is currently under maintenance.") | |
418 | + | else throw("dApp is currently under maintenance.") | |
419 | + | } | |
420 | + | ||
421 | + | ||
422 | + | ||
423 | + | @Callable(i) | |
424 | + | func Stake (pool,Asset1,Asset2) = { | |
425 | + | let power = getBooleanValue(Admin, ac) | |
426 | + | let liquidityPower = getBooleanValue(Admin, liquidityAc) | |
427 | + | let lpAssetId = if (pool) | |
428 | + | then getStringValue(Admin, (l + kp(Asset1, Asset2))) | |
429 | + | else MainAsset() | |
430 | + | let lpAId = match lpAssetId { | |
431 | + | case xi: String => | |
432 | + | fromBase58String(xi) | |
433 | + | case x: ByteVector => | |
434 | + | x | |
435 | + | case _ => | |
436 | + | throw("Match error") | |
437 | + | } | |
438 | + | if (power) | |
439 | + | then if (!(liquidityPower)) | |
440 | + | then if ((i.payments[0].assetId != lpAId)) | |
441 | + | then throw((("Invalid asset! Kindly Deposit Only " + toBase58String(MainAsset())) + " or valid asset lp")) | |
442 | + | else if (!(pool)) | |
443 | + | then { | |
444 | + | let currentKey = toBase58String(i.caller.bytes) | |
445 | + | let currentAmount = match getInteger(this, currentKey) { | |
446 | + | case a: Int => | |
447 | + | a | |
448 | + | case _ => | |
449 | + | 0 | |
450 | + | } | |
451 | + | let h = if ((currentAmount == 0)) | |
452 | + | then height | |
453 | + | else valueOrElse(getIntegerValue(this, (deposit_height + currentKey)), height) | |
454 | + | let newAmount = (currentAmount + i.payments[0].amount) | |
455 | + | let useramount = IntegerEntry(currentKey, newAmount) | |
456 | + | let userdepositheight = IntegerEntry((deposit_height + currentKey), h) | |
457 | + | let previouslockbalance = match getInteger(this, "Total_Tokens_Locked:") { | |
458 | + | case a: Int => | |
459 | + | a | |
460 | + | case _ => | |
461 | + | 0 | |
462 | + | } | |
463 | + | let totaltoken = (previouslockbalance + i.payments[0].amount) | |
464 | + | let TLV = IntegerEntry("Total_Tokens_Locked:", totaltoken) | |
465 | + | [useramount, userdepositheight, TLV] | |
466 | + | } | |
467 | + | else { | |
468 | + | let poolKey = kp(Asset1, Asset2) | |
469 | + | let key = validPoolK(poolKey) | |
470 | + | if ((key != false)) | |
471 | + | then { | |
472 | + | let currentKey = toBase58String(i.caller.bytes) | |
473 | + | let currentAmount = match getInteger(this, ((("STAKE_LP_" + currentKey) + "_") + poolKey)) { | |
474 | + | case a: Int => | |
475 | + | a | |
476 | + | case _ => | |
477 | + | 0 | |
478 | + | } | |
479 | + | let h = if ((currentAmount == 0)) | |
480 | + | then height | |
481 | + | else valueOrElse(getIntegerValue(this, ((((deposit_height + "_") + currentKey) + "_") + poolKey)), height) | |
482 | + | let newAmount = (currentAmount + i.payments[0].amount) | |
483 | + | let useramount = IntegerEntry(((("STAKE_LP_" + currentKey) + "_") + poolKey), newAmount) | |
484 | + | let userdepositheight = IntegerEntry(((((deposit_height + "_") + currentKey) + "_") + poolKey), height) | |
485 | + | let previouslockbalance = match getInteger(this, ("Total_Tokens_LP_Locked_" + poolKey)) { | |
486 | + | case a: Int => | |
487 | + | a | |
488 | + | case _ => | |
489 | + | 0 | |
490 | + | } | |
491 | + | let totaltoken = (previouslockbalance + i.payments[0].amount) | |
492 | + | let TLV = IntegerEntry(("Total_Tokens_LP_Locked_" + poolKey), totaltoken) | |
493 | + | [useramount, userdepositheight, TLV] | |
494 | + | } | |
495 | + | else throw("Invalid Pool key.") | |
496 | + | } | |
497 | + | else throw("liquidity is currently under maintenance.") | |
498 | + | else throw("dApp is currently under maintenance.") | |
499 | + | } | |
500 | + | ||
501 | + | ||
502 | + | ||
503 | + | @Callable(i) | |
504 | + | func Unstake (pool,Asset1,Asset2,amount) = { | |
505 | + | let power = getBooleanValue(Admin, ac) | |
506 | + | let liquidityPower = getBooleanValue(Admin, liquidityAc) | |
507 | + | let poolKey = kp(Asset1, Asset2) | |
508 | + | let pmt = i.payments[0] | |
509 | + | if (power) | |
510 | + | then if (!(liquidityPower)) | |
511 | + | then { | |
512 | + | let currentKey = toBase58String(i.caller.bytes) | |
513 | + | let currentAmount = match if (pool) | |
514 | + | then getIntegerValue(this, ((("STAKE_LP_" + currentKey) + "_") + kp(Asset1, Asset2))) | |
515 | + | else getIntegerValue(this, currentKey) { | |
516 | + | case a: Int => | |
517 | + | a | |
518 | + | case _ => | |
519 | + | 0 | |
520 | + | } | |
521 | + | let swapheightkeyname = if (pool) | |
522 | + | then ((((deposit_height + "_") + currentKey) + "_") + kp(Asset1, Asset2)) | |
523 | + | else (deposit_height + currentKey) | |
524 | + | let previouslockbalance = if (pool) | |
525 | + | then getIntegerValue(this, ("Total_Tokens_LP_Locked_" + kp(Asset1, Asset2))) | |
526 | + | else getIntegerValue(this, "Total_Tokens_Locked:") | |
527 | + | let totaltoken = (previouslockbalance - amount) | |
528 | + | let diff = (height - getIntegerValue(this, swapheightkeyname)) | |
529 | + | let bcd = getIntegerValue(this, bcD) | |
530 | + | let reward = ((diff * bcd) * D8) | |
531 | + | let ood = match getInteger((poolKey + "_rate_fee_swap")) { | |
532 | + | case iw: Int => | |
533 | + | iw | |
534 | + | case _ => | |
535 | + | 0 | |
536 | + | } | |
537 | + | let oldT = match getInteger((poolKey + "_rate_fee_swap")) { | |
538 | + | case idd: Int => | |
539 | + | (idd / (previouslockbalance / amount)) | |
540 | + | case _ => | |
541 | + | 0 | |
542 | + | } | |
543 | + | let feeCalc = if ((Asset1 == getStringValue(this, main))) | |
544 | + | then (reward / (previouslockbalance / amount)) | |
545 | + | else oldT | |
546 | + | if ((0 > amount)) | |
547 | + | then throw(if (pool) | |
548 | + | then (((("Can't withdraw negative " + Asset1) + "/") + Asset2) + " amount") | |
549 | + | else "Can't withdraw negative AxAi amount") | |
550 | + | else { | |
551 | + | let newAmount = (currentAmount - amount) | |
552 | + | if ((0 > newAmount)) | |
553 | + | then throw(if (pool) | |
554 | + | then (((("Not enough Asset Lp " + Asset1) + "/") + Asset2) + " balance") | |
555 | + | else "Not enough AxAi balance") | |
556 | + | else [IntegerEntry(if (pool) | |
557 | + | then ((("STAKE_LP_" + currentKey) + "_") + kp(Asset1, Asset2)) | |
558 | + | else currentKey, newAmount), IntegerEntry(if (pool) | |
559 | + | then ("Total_Tokens_LP_Locked_" + kp(Asset1, Asset2)) | |
560 | + | else "Total_Tokens_Locked:", totaltoken), ScriptTransfer(i.caller, amount, if (pool) | |
561 | + | then fromBase58String(getStringValue(this, (l + kp(Asset1, Asset2)))) | |
562 | + | else MainAsset()), ScriptTransfer(i.caller, feeCalc, MainAsset()), IntegerEntry((poolKey + "_rate_fee_swap"), (ood - oldT))] | |
563 | + | } | |
564 | + | } | |
565 | + | else throw("liquidity is currently under maintenance.") | |
566 | + | else throw("dApp is currently under maintenance.") | |
567 | + | } | |
568 | + | ||
569 | + | ||
570 | + | ||
571 | + | @Callable(i) | |
572 | + | func CreateNFT (name,ipfs) = { | |
573 | + | let shah = sha256(fromBase58String(ipfs)) | |
574 | + | [Issue(name, (((("{'ipfs':'" + ipfs) + "','SHA-HASH':'") + toBase58String(shah)) + "'}"), 1, 0, false)] | |
575 | + | } | |
576 | + | ||
577 | + | ||
578 | + | ||
579 | + | @Callable(i) | |
580 | + | func BuyNFT (NFTId) = { | |
581 | + | let power = getBooleanValue(Admin, ac) | |
582 | + | let nftm = getBooleanValue(Admin, nfetAc) | |
583 | + | let pmt = i.payments[0] | |
584 | + | let price = match getIntegerValue(this, (NFTId + "_tosale")) { | |
585 | + | case is: Int => | |
586 | + | is | |
587 | + | case _ => | |
588 | + | 0 | |
589 | + | } | |
590 | + | let asset = match getStringValue(this, (NFTId + "_assetsale")) { | |
591 | + | case s: String => | |
592 | + | if (if ((s == "WAVES")) | |
593 | + | then true | |
594 | + | else (s == "waves")) | |
595 | + | then WAVES | |
596 | + | else fromBase58String(s) | |
597 | + | case _ => | |
598 | + | throw("NFT not listed for sale") | |
599 | + | } | |
600 | + | let oldAddress = match getStringValue(this, (NFTId + "_address")) { | |
601 | + | case s: String => | |
602 | + | s | |
603 | + | case _ => | |
604 | + | throw("NFT not listed for sale") | |
605 | + | } | |
606 | + | if (power) | |
607 | + | then if (!(nftm)) | |
608 | + | then if ((price != 0)) | |
609 | + | then if ((price == pmt.amount)) | |
610 | + | then if ((pmt.assetId == asset)) | |
611 | + | then [IntegerEntry((NFTId + "_tosale"), 0), BooleanEntry((NFTId + "_saled"), true), StringEntry((NFTId + "_address_SAle"), ""), StringEntry((NFTId + "_assetsale"), NFTId), StringEntry((NFTId + "_address"), toBase58String(i.caller.bytes)), ScriptTransfer(i.caller, 1, fromBase58String(NFTId)), ScriptTransfer(Address(fromBase58String(oldAddress)), pmt.amount, asset)] | |
612 | + | else throw("Asset not equal to the asset defined as a payment method by the NFT issuer") | |
613 | + | else throw("Value not equal to sale value") | |
614 | + | else throw("This NFT is not for sale.") | |
615 | + | else throw("NFT is currently under maintenance.") | |
616 | + | else throw("dApp is currently under maintenance.") | |
617 | + | } | |
618 | + | ||
619 | + | ||
620 | + | ||
621 | + | @Callable(i) | |
622 | + | func RemoveToSell (NFTId) = { | |
623 | + | let power = getBooleanValue(Admin, ac) | |
624 | + | let nftm = getBooleanValue(Admin, nfetAc) | |
625 | + | let pmt = i.payments[0] | |
626 | + | if (power) | |
627 | + | then if (!(nftm)) | |
628 | + | then if ((getAssetIssueAddress(fromBase58String(NFTId)) == i.caller)) | |
629 | + | then [DeleteEntry((NFTId + "_tosale")), DeleteEntry((NFTId + "_saled")), DeleteEntry((NFTId + "_address_SAle")), DeleteEntry((NFTId + "_assetsale")), DeleteEntry((NFTId + "_address"))] | |
630 | + | else throw("Only the owner of the NFT can remove it from the list.") | |
631 | + | else throw("NFT is currently under maintenance.") | |
632 | + | else throw("dApp is currently under maintenance.") | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | @Callable(i) | |
638 | + | func SellNFT (Price,asset) = { | |
639 | + | let power = getBooleanValue(Admin, ac) | |
640 | + | let nftm = getBooleanValue(Admin, nfetAc) | |
641 | + | let pmt = i.payments[0] | |
642 | + | if (power) | |
643 | + | then if (!(nftm)) | |
644 | + | then if (if ((pmt.amount == 0)) | |
645 | + | then true | |
646 | + | else (pmt.assetId == WAVES)) | |
647 | + | then throw("Requires NFT as transfer payment for sale.") | |
648 | + | else [IntegerEntry((getAsset(pmt.assetId) + "_tosale"), Price), BooleanEntry((getAsset(pmt.assetId) + "_saled"), false), StringEntry((getAsset(pmt.assetId) + "_address_SAle"), ""), StringEntry((getAsset(pmt.assetId) + "_assetsale"), asset), StringEntry((getAsset(pmt.assetId) + "_address"), toBase58String(i.caller.bytes))] | |
649 | + | else throw("NFT is currently under maintenance.") | |
650 | + | else throw("dApp is currently under maintenance.") | |
651 | + | } | |
652 | + | ||
653 | + | ||
654 | + | ||
655 | + | @Callable(i) | |
656 | + | func CreateCollection (collectionName) = { | |
657 | + | let currentKey = toBase58String(i.caller.bytes) | |
658 | + | let tc = match getIntegerValue(this, (currentKey + "_total_collection")) { | |
659 | + | case ai: Int => | |
660 | + | ai | |
661 | + | case _ => | |
662 | + | 0 | |
663 | + | } | |
664 | + | if (verifiCollectionExist(collectionName)) | |
665 | + | then throw("Error: A collection with that name already exists, try another one.") | |
666 | + | else [StringEntry(collectionName, currentKey), IntegerEntry((currentKey + "_total_collection"), (tc + 1))] | |
667 | + | } | |
668 | + | ||
669 | + | ||
670 | + | @Verifier(tx) | |
671 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
672 | + |
github/deemru/w8io/03bedc9 41.27 ms ◑![]()