tx · 83rrYT3m2RtbbcvcoNRpRfxW23gZamgXrWz5iLxXbiNk

3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu:  -0.01700000 Waves

2022.06.09 11:43 [2088606] smart account 3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu > SELF 0.00000000 Waves

{ "type": 13, "id": "83rrYT3m2RtbbcvcoNRpRfxW23gZamgXrWz5iLxXbiNk", "fee": 1700000, "feeAssetId": null, "timestamp": 1654764183672, "version": 1, "sender": "3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu", "senderPublicKey": "668WwQVaWxezbvLEK3FccCSTbjst4zYAJDPrfLFRj9b9", "proofs": [ "QfXoijFSZNrF6f1HmroyftWcupTsPsG5eK288w6U1UCYcYixXLYikeMLUwb2ffQ8GUayLQsXtVLDkCEobeuLLed" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgASABIFCgMICAgSCQoHCAgICAEIARIAEgQKAggIEgMKAQgSAAAAABcAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAACGNvbnRyYWN0AgAAAA9scF9zdGFraW5nX3YyOiABAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAACQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAQbWFuYWdlclB1YmxpY0tleQUAAAADbmlsBQAAAANTRVABAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQAAAANuaWwFAAAAA1NFUAEAAAAGa2V5VFZMAAAAAQAAAAdhc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAAEJXMlcwkABEwAAAACAgAAAAN0dmwJAARMAAAAAgUAAAAHYXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAADWtleVRWTEhpc3RvcnkAAAACAAAAB2Fzc2V0SWQAAAAGaGVpZ2h0CQAEuQAAAA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AAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXluEqvv", "chainId": 84, "height": 2088606, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3UKHsdkxXxJbHrvg2UYRqUCd8wu4443LsRP1Fh1mUDjK Next: Er2dBrBRRNEbQv8FtrU9wtyXaeZjJtnJKbeRcHXZRFpJ Diff:
OldNewDifferences
180180 then true
181181 else throwErr("no corresponding withdrawal request")]
182182 if ((checks == checks))
183- then {
184- let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(assetId)), 0)
185-[ScriptTransfer(addressFromStringValue(userAddress), withdrawalAmount, fromBase58String(assetId)), DeleteEntry(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId)), IntegerEntry(keyPendingWithdrawals(assetId), (pendingWithdrawals - withdrawalAmount))]
186- }
183+ then [ScriptTransfer(addressFromStringValue(userAddress), withdrawalAmount, fromBase58String(assetId)), DeleteEntry(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId))]
187184 else throw("Strict value is not equal to itself.")
188185 }
189186
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let contract = "lp_staking_v2: "
99
1010 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1111
1212
1313 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1414
1515
1616 func keyTVL (assetId) = makeString(["%s%s", "tvl", assetId], SEP)
1717
1818
1919 func keyTVLHistory (assetId,height) = makeString(["%s%s%d", "tvlHistory", assetId, toString(height)], SEP)
2020
2121
2222 func keyTopUpHistory (assetId,height) = makeString(["%s%s%d", "topUpHistory", assetId, toString(height)], SEP)
2323
2424
2525 func keyPendingWithdrawals (assetId) = makeString(["%s%s", "pendingWithdrawals", assetId], SEP)
2626
2727
2828 func keyDelayInBlocks (assetId) = makeString(["%s%s", "delayInBlocks", assetId], SEP)
2929
3030
3131 func keyCreated (assetId) = makeString(["%s%s", "created", assetId], SEP)
3232
3333
3434 func keyAssetIdToLPId (assetId) = makeString(["%s%s", "assetIdToLPId", assetId], SEP)
3535
3636
3737 func keyLPIdToAssetId (lpId) = makeString(["%s%s", "lpIdToAssetId", lpId], SEP)
3838
3939
4040 func keyProxyAddress (assetId) = makeString(["%s%s", "proxyAddress", assetId], SEP)
4141
4242
4343 func keyMappingsUserToWithdrawal (assetId,userAddress,txId) = makeString(["%s%s%s%s", "userWithdrawalAmount", assetId, userAddress, txId], SEP)
4444
4545
4646 func keyOtherChainAssetDecimals (assetId) = makeString(["%s%s", "otherChainAssetDecimals", assetId], SEP)
4747
4848
4949 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
5050
5151
5252 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
5353 case s: String =>
5454 fromBase58String(s)
5555 case _: Unit =>
5656 unit
5757 case _ =>
5858 throw("Match error")
5959 }
6060
6161
6262 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
6363 case s: String =>
6464 fromBase58String(s)
6565 case _: Unit =>
6666 unit
6767 case _ =>
6868 throw("Match error")
6969 }
7070
7171
7272 func throwErr (msg) = throw((contract + msg))
7373
7474
7575 func mustManager (i) = {
7676 let pd = throwErr("permission denied")
7777 match managerPublicKeyOrUnit() {
7878 case pk: ByteVector =>
7979 if ((i.callerPublicKey == pk))
8080 then true
8181 else pd
8282 case _: Unit =>
8383 if ((i.caller == this))
8484 then true
8585 else pd
8686 case _ =>
8787 throw("Match error")
8888 }
8989 }
9090
9191
9292 func assetsStoreContract () = addressFromStringValue(value(getString(keyAssetsStoreContract())))
9393
9494
9595 func mustProxyAddress (i,assetId) = {
9696 let isProxy = (toString(i.caller) == valueOrElse(getString(keyProxyAddress(assetId)), EMPTY))
9797 if (isProxy)
9898 then true
9999 else {
100100 let checkCaller = mustManager(i)
101101 if ((checkCaller == checkCaller))
102102 then true
103103 else throw("Strict value is not equal to itself.")
104104 }
105105 }
106106
107107
108108 @Callable(i)
109109 func constructor (assetsStoreContract) = {
110110 let checkCaller = mustManager(i)
111111 if ((checkCaller == checkCaller))
112112 then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)]
113113 else throw("Strict value is not equal to itself.")
114114 }
115115
116116
117117
118118 @Callable(i)
119119 func put () = {
120120 let pmt = value(i.payments[0])
121121 let asset = value(pmt.assetId)
122122 let assetId = toBase58String(asset)
123123 let checks = [if ((size(i.payments) == 1))
124124 then true
125125 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
126126 then true
127127 else throwErr("attached payment asset must be registered in the contract"), if ((pmt.amount > 0))
128128 then true
129129 else throwErr("positive amount required")]
130130 if ((checks == checks))
131131 then {
132132 let tvl = valueOrElse(getInteger(keyTVL(assetId)), 0)
133133 let lpId = value(getString(keyAssetIdToLPId(assetId)))
134134 let lpInfo = value(assetInfo(fromBase58String(assetId)))
135135 let sharesAmount = if ((tvl > 0))
136136 then ((pmt.amount * lpInfo.quantity) / tvl)
137137 else pmt.amount
138138 [Reissue(lpInfo.id, sharesAmount, true), ScriptTransfer(i.caller, sharesAmount, lpInfo.id)]
139139 }
140140 else throw("Strict value is not equal to itself.")
141141 }
142142
143143
144144
145145 @Callable(i)
146146 func submitGetRequest () = {
147147 let pmt = value(i.payments[0])
148148 let lp = value(pmt.assetId)
149149 let lpId = toBase58String(lp)
150150 let userAddress = toString(i.caller)
151151 let baseAssetId = value(getString(keyLPIdToAssetId(lpId)))
152152 let shares = pmt.amount
153153 let checks = [if ((size(i.payments) == 1))
154154 then true
155155 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(baseAssetId)), false))
156156 then true
157157 else throwErr("attached payment asset must be registered in the contract"), if ((shares > 0))
158158 then true
159159 else throwErr("positive amount to withdrawal required")]
160160 if ((checks == checks))
161161 then {
162162 let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(baseAssetId)), 0)
163163 let tvl = valueOrElse(getInteger(keyTVL(baseAssetId)), 0)
164164 let lpInfo = value(assetInfo(lp))
165165 let decimals = lpInfo.decimals
166166 let withdrawalAmount = ((shares * tvl) / lpInfo.quantity)
167167 [Burn(lp, shares), IntegerEntry(keyPendingWithdrawals(baseAssetId), (pendingWithdrawals + withdrawalAmount)), IntegerEntry(keyMappingsUserToWithdrawal(baseAssetId, userAddress, toBase58String(i.transactionId)), withdrawalAmount)]
168168 }
169169 else throw("Strict value is not equal to itself.")
170170 }
171171
172172
173173
174174 @Callable(i)
175175 func executeGetRequest (assetId,userAddress,submitTxId) = {
176176 let withdrawalAmount = valueOrElse(getInteger(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId)), 0)
177177 let checks = [if (valueOrElse(getBoolean(keyCreated(assetId)), false))
178178 then true
179179 else throwErr("asset must be registered in the contract"), if ((withdrawalAmount > 0))
180180 then true
181181 else throwErr("no corresponding withdrawal request")]
182182 if ((checks == checks))
183- then {
184- let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(assetId)), 0)
185-[ScriptTransfer(addressFromStringValue(userAddress), withdrawalAmount, fromBase58String(assetId)), DeleteEntry(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId)), IntegerEntry(keyPendingWithdrawals(assetId), (pendingWithdrawals - withdrawalAmount))]
186- }
183+ then [ScriptTransfer(addressFromStringValue(userAddress), withdrawalAmount, fromBase58String(assetId)), DeleteEntry(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId))]
187184 else throw("Strict value is not equal to itself.")
188185 }
189186
190187
191188
192189 @Callable(i)
193190 func registerAsset (assetId,lpName,lpDescription,lpLogo,delayInBlocks,proxyAddress,otherChainAssetDecimals) = {
194191 let checks = [mustManager(i), if ((delayInBlocks >= 0))
195192 then true
196193 else throwErr("invalid delayInBlocks"), if ((addressFromString(proxyAddress) != unit))
197194 then true
198195 else throwErr("invalid proxyAddress"), if ((valueOrElse(getBoolean(keyCreated(assetId)), false) == false))
199196 then true
200197 else throwErr("asset already registered")]
201198 if ((checks == checks))
202199 then {
203200 let decimals = value(assetInfo(fromBase58String(assetId))).decimals
204201 let lpIssue = Issue(lpName, lpDescription, 1, decimals, true)
205202 let lp = calculateAssetId(lpIssue)
206203 let lpId = toBase58String(lp)
207204 let createOrUpdate = invoke(assetsStoreContract(), "createOrUpdate", [lpId, lpLogo, false], nil)
208205 if ((createOrUpdate == createOrUpdate))
209206 then {
210207 let addLabel = invoke(assetsStoreContract(), "addLabel", [lpId, "DEFI"], nil)
211208 if ((addLabel == addLabel))
212209 then [BooleanEntry(keyCreated(assetId), true), IntegerEntry(keyTVL(assetId), 0), IntegerEntry(keyTVLHistory(assetId, height), 0), IntegerEntry(keyDelayInBlocks(assetId), delayInBlocks), StringEntry(keyLPIdToAssetId(lpId), assetId), StringEntry(keyAssetIdToLPId(assetId), lpId), StringEntry(keyProxyAddress(assetId), proxyAddress), IntegerEntry(keyOtherChainAssetDecimals(assetId), otherChainAssetDecimals), lpIssue, Burn(lp, 1)]
213210 else throw("Strict value is not equal to itself.")
214211 }
215212 else throw("Strict value is not equal to itself.")
216213 }
217214 else throw("Strict value is not equal to itself.")
218215 }
219216
220217
221218
222219 @Callable(i)
223220 func topUpBalance () = {
224221 let pmt = valueOrErrorMessage(i.payments[0], (contract + "payment must be attached"))
225222 let assetId = toBase58String(value(pmt.assetId))
226223 let amount = pmt.amount
227224 let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(assetId)), 0)
228225 let checks = [mustProxyAddress(i, assetId), if ((size(i.payments) == 1))
229226 then true
230227 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
231228 then true
232229 else throwErr("attached payment asset must be registered in the contract"), if ((pendingWithdrawals != 0))
233230 then true
234231 else throwErr("zero pendingWithdrawals, nothing to top up"), if ((pendingWithdrawals >= amount))
235232 then true
236233 else throwErr("amount to top up must be less or equal than pendingWithdrawals"), if ((getInteger(keyTopUpHistory(assetId, height)) == unit))
237234 then true
238235 else throwErr("already have topUp in current block, wait for next block")]
239236 if ((checks == checks))
240237 then [IntegerEntry(keyPendingWithdrawals(assetId), (pendingWithdrawals - amount)), IntegerEntry(keyTopUpHistory(assetId, height), amount)]
241238 else throw("Strict value is not equal to itself.")
242239 }
243240
244241
245242
246243 @Callable(i)
247244 func setTVL (assetId,newStrTVL) = {
248245 let checks = [mustProxyAddress(i, assetId), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
249246 then true
250247 else throwErr("asset must be registered in the contract"), if ((getInteger(keyTVLHistory(assetId, height)) == unit))
251248 then true
252249 else throwErr("already have setTVL in current block, wait for next block")]
253250 if ((checks == checks))
254251 then {
255252 let newBigIntTVL = parseBigIntValue(newStrTVL)
256253 let ten = parseBigIntValue("10")
257254 let assetDecimals = value(assetInfo(fromBase58String(assetId))).decimals
258255 let otherChainAssetDecimals = value(getInteger(keyOtherChainAssetDecimals(assetId)))
259256 let newTVLWavesDecimals = if ((otherChainAssetDecimals > assetDecimals))
260257 then {
261258 let diff = parseBigIntValue(toString((otherChainAssetDecimals - assetDecimals)))
262259 (newBigIntTVL / pow(ten, 0, diff, 0, 0, DOWN))
263260 }
264261 else if ((assetDecimals > otherChainAssetDecimals))
265262 then {
266263 let diff = parseBigIntValue(toString((assetDecimals - otherChainAssetDecimals)))
267264 (newBigIntTVL * pow(ten, 0, diff, 0, 0, DOWN))
268265 }
269266 else newBigIntTVL
270267 let newTVL = toInt(newTVLWavesDecimals)
271268 [IntegerEntry(keyTVL(assetId), newTVL), IntegerEntry(keyTVLHistory(assetId, height), newTVL)]
272269 }
273270 else throw("Strict value is not equal to itself.")
274271 }
275272
276273
277274
278275 @Callable(i)
279276 func setManager (pendingManagerPublicKey) = {
280277 let checkCaller = mustManager(i)
281278 if ((checkCaller == checkCaller))
282279 then {
283280 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
284281 if ((checkManagerPublicKey == checkManagerPublicKey))
285282 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
286283 else throw("Strict value is not equal to itself.")
287284 }
288285 else throw("Strict value is not equal to itself.")
289286 }
290287
291288
292289
293290 @Callable(i)
294291 func confirmManager () = {
295292 let pm = pendingManagerPublicKeyOrUnit()
296293 let hasPM = if (isDefined(pm))
297294 then true
298295 else throwErr("no pending manager")
299296 if ((hasPM == hasPM))
300297 then {
301298 let checkPM = if ((i.callerPublicKey == value(pm)))
302299 then true
303300 else throwErr("you are not pending manager")
304301 if ((checkPM == checkPM))
305302 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
306303 else throw("Strict value is not equal to itself.")
307304 }
308305 else throw("Strict value is not equal to itself.")
309306 }
310307
311308
312309 @Verifier(tx)
313310 func verify () = {
314311 let targetPublicKey = match managerPublicKeyOrUnit() {
315312 case pk: ByteVector =>
316313 pk
317314 case _: Unit =>
318315 tx.senderPublicKey
319316 case _ =>
320317 throw("Match error")
321318 }
322319 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
323320 }
324321

github/deemru/w8io/026f985 
43.31 ms