tx · 6sPeaTDqUhQpwXGNvnYT6n6xbuAnYxreRmSWLoseSPUw

3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu:  -0.01700000 Waves

2022.06.09 11:04 [2088569] smart account 3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu > SELF 0.00000000 Waves

{ "type": 13, "id": "6sPeaTDqUhQpwXGNvnYT6n6xbuAnYxreRmSWLoseSPUw", "fee": 1700000, "feeAssetId": null, "timestamp": 1654761898715, "version": 1, "sender": "3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu", "senderPublicKey": "668WwQVaWxezbvLEK3FccCSTbjst4zYAJDPrfLFRj9b9", "proofs": [ "5F5uR7txHpM5i96ikYK5iCCUQ8uiKQqfAZj738MX4yodhcNNkGziWnZVaqRZCUCivTEYdfE5KxDubPY9EdWZGpLg" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgASABIFCgMICAgSCQoHCAgICAEIARIAEgQKAggIEgMKAQgSAAAAABYAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAACGNvbnRyYWN0AgAAAA9scF9zdGFraW5nX3YyOiABAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAACQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAQbWFuYWdlclB1YmxpY0tleQUAAAADbmlsBQAAAANTRVABAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQAAAANuaWwFAAAAA1NFUAEAAAAGa2V5VFZMAAAAAQAAAAdhc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAAEJXMlcwkABEwAAAACAgAAAAN0dmwJAARMAAAAAgUAAAAHYXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAADWtleVRWTEhpc3RvcnkAAAACAAAAB2Fzc2V0SWQAAAAGaGVpZ2h0CQAE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AABt5b3UgYXJlIG5vdCBwZW5kaW5nIG1hbmFnZXIDCQAAAAAAAAIFAAAAB2NoZWNrUE0FAAAAB2NoZWNrUE0JAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAACQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEFAAAAAnBtCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAABprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAAAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAPdGFyZ2V0UHVibGljS2V5BAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAD3RhcmdldFB1YmxpY0tledBWeMA=", "chainId": 84, "height": 2088569, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J78Pt3YfBwHAVf6ptMvBLvzAyznFXL4h1rHqAdNS74Dh Next: 3UKHsdkxXxJbHrvg2UYRqUCd8wu4443LsRP1Fh1mUDjK Diff:
OldNewDifferences
239239
240240
241241 @Callable(i)
242-func setTVL (assetId,newRawTVL) = {
242+func setTVL (assetId,newStrTVL) = {
243243 let checks = [mustProxyAddress(i, assetId), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
244244 then true
245245 else throwErr("asset must be registered in the contract")]
246246 if ((checks == checks))
247247 then {
248+ let newBigIntTVL = parseBigIntValue(newStrTVL)
249+ let ten = parseBigIntValue("10")
248250 let assetDecimals = value(assetInfo(fromBase58String(assetId))).decimals
249251 let otherChainAssetDecimals = value(getInteger(keyOtherChainAssetDecimals(assetId)))
250- let newTVL = if ((otherChainAssetDecimals > assetDecimals))
252+ let newTVLWavesDecimals = if ((otherChainAssetDecimals > assetDecimals))
251253 then {
252- let diff = (otherChainAssetDecimals - assetDecimals)
253- (newRawTVL / pow(10, 0, diff, 0, 0, DOWN))
254+ let diff = parseBigIntValue(toString((otherChainAssetDecimals - assetDecimals)))
255+ (newBigIntTVL / pow(ten, 0, diff, 0, 0, DOWN))
254256 }
255257 else if ((assetDecimals > otherChainAssetDecimals))
256258 then {
257- let diff = (assetDecimals - otherChainAssetDecimals)
258- (newRawTVL * pow(10, 0, diff, 0, 0, DOWN))
259+ let diff = parseBigIntValue(toString((assetDecimals - otherChainAssetDecimals)))
260+ (newBigIntTVL * pow(ten, 0, diff, 0, 0, DOWN))
259261 }
260- else newRawTVL
262+ else newBigIntTVL
263+ let newTVL = toInt(newTVLWavesDecimals)
261264 [IntegerEntry(keyTVL(assetId), newTVL), IntegerEntry(keyTVLHistory(assetId, height), newTVL)]
262265 }
263266 else throw("Strict value is not equal to itself.")
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 keyPendingWithdrawals (assetId) = makeString(["%s%s", "pendingWithdrawals", assetId], SEP)
2323
2424
2525 func keyDelayInBlocks (assetId) = makeString(["%s%s", "delayInBlocks", assetId], SEP)
2626
2727
2828 func keyCreated (assetId) = makeString(["%s%s", "created", assetId], SEP)
2929
3030
3131 func keyAssetIdToLPId (assetId) = makeString(["%s%s", "assetIdToLPId", assetId], SEP)
3232
3333
3434 func keyLPIdToAssetId (lpId) = makeString(["%s%s", "lpIdToAssetId", lpId], SEP)
3535
3636
3737 func keyProxyAddress (assetId) = makeString(["%s%s", "proxyAddress", assetId], SEP)
3838
3939
4040 func keyMappingsUserToWithdrawal (assetId,userAddress,txId) = makeString(["%s%s%s%s", "userWithdrawalAmount", assetId, userAddress, txId], SEP)
4141
4242
4343 func keyOtherChainAssetDecimals (assetId) = makeString(["%s%s", "otherChainAssetDecimals", assetId], SEP)
4444
4545
4646 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
4747
4848
4949 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
5050 case s: String =>
5151 fromBase58String(s)
5252 case _: Unit =>
5353 unit
5454 case _ =>
5555 throw("Match error")
5656 }
5757
5858
5959 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
6060 case s: String =>
6161 fromBase58String(s)
6262 case _: Unit =>
6363 unit
6464 case _ =>
6565 throw("Match error")
6666 }
6767
6868
6969 func throwErr (msg) = throw((contract + msg))
7070
7171
7272 func mustManager (i) = {
7373 let pd = throwErr("permission denied")
7474 match managerPublicKeyOrUnit() {
7575 case pk: ByteVector =>
7676 if ((i.callerPublicKey == pk))
7777 then true
7878 else pd
7979 case _: Unit =>
8080 if ((i.caller == this))
8181 then true
8282 else pd
8383 case _ =>
8484 throw("Match error")
8585 }
8686 }
8787
8888
8989 func assetsStoreContract () = addressFromStringValue(value(getString(keyAssetsStoreContract())))
9090
9191
9292 func mustProxyAddress (i,assetId) = {
9393 let isProxy = (toString(i.caller) == valueOrElse(getString(keyProxyAddress(assetId)), EMPTY))
9494 if (isProxy)
9595 then true
9696 else {
9797 let checkCaller = mustManager(i)
9898 if ((checkCaller == checkCaller))
9999 then true
100100 else throw("Strict value is not equal to itself.")
101101 }
102102 }
103103
104104
105105 @Callable(i)
106106 func constructor (assetsStoreContract) = {
107107 let checkCaller = mustManager(i)
108108 if ((checkCaller == checkCaller))
109109 then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)]
110110 else throw("Strict value is not equal to itself.")
111111 }
112112
113113
114114
115115 @Callable(i)
116116 func put () = {
117117 let pmt = value(i.payments[0])
118118 let asset = value(pmt.assetId)
119119 let assetId = toBase58String(asset)
120120 let checks = [if ((size(i.payments) == 1))
121121 then true
122122 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
123123 then true
124124 else throwErr("attached payment asset must be registered in the contract"), if ((pmt.amount > 0))
125125 then true
126126 else throwErr("positive amount required")]
127127 if ((checks == checks))
128128 then {
129129 let tvl = valueOrElse(getInteger(keyTVL(assetId)), 0)
130130 let lpId = value(getString(keyAssetIdToLPId(assetId)))
131131 let lpInfo = value(assetInfo(fromBase58String(assetId)))
132132 let sharesAmount = if ((tvl > 0))
133133 then ((pmt.amount * lpInfo.quantity) / tvl)
134134 else pmt.amount
135135 [Reissue(lpInfo.id, sharesAmount, true), ScriptTransfer(i.caller, sharesAmount, lpInfo.id)]
136136 }
137137 else throw("Strict value is not equal to itself.")
138138 }
139139
140140
141141
142142 @Callable(i)
143143 func submitGetRequest () = {
144144 let pmt = value(i.payments[0])
145145 let lp = value(pmt.assetId)
146146 let lpId = toBase58String(lp)
147147 let userAddress = toString(i.caller)
148148 let baseAssetId = value(getString(keyLPIdToAssetId(lpId)))
149149 let shares = pmt.amount
150150 let checks = [if ((size(i.payments) == 1))
151151 then true
152152 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(baseAssetId)), false))
153153 then true
154154 else throwErr("attached payment asset must be registered in the contract"), if ((shares > 0))
155155 then true
156156 else throwErr("positive amount to withdrawal required")]
157157 if ((checks == checks))
158158 then {
159159 let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(baseAssetId)), 0)
160160 let tvl = valueOrElse(getInteger(keyTVL(baseAssetId)), 0)
161161 let lpInfo = value(assetInfo(lp))
162162 let decimals = lpInfo.decimals
163163 let withdrawalAmount = ((shares * tvl) / lpInfo.quantity)
164164 [Burn(lp, shares), IntegerEntry(keyPendingWithdrawals(baseAssetId), (pendingWithdrawals + withdrawalAmount)), IntegerEntry(keyMappingsUserToWithdrawal(baseAssetId, userAddress, toBase58String(i.transactionId)), withdrawalAmount)]
165165 }
166166 else throw("Strict value is not equal to itself.")
167167 }
168168
169169
170170
171171 @Callable(i)
172172 func executeGetRequest (assetId,userAddress,submitTxId) = {
173173 let withdrawalAmount = valueOrElse(getInteger(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId)), 0)
174174 let checks = [if (valueOrElse(getBoolean(keyCreated(assetId)), false))
175175 then true
176176 else throwErr("asset must be registered in the contract"), if ((withdrawalAmount > 0))
177177 then true
178178 else throwErr("no corresponding withdrawal request")]
179179 if ((checks == checks))
180180 then {
181181 let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(assetId)), 0)
182182 [ScriptTransfer(addressFromStringValue(userAddress), withdrawalAmount, fromBase58String(assetId)), DeleteEntry(keyMappingsUserToWithdrawal(assetId, userAddress, submitTxId)), IntegerEntry(keyPendingWithdrawals(assetId), (pendingWithdrawals - withdrawalAmount))]
183183 }
184184 else throw("Strict value is not equal to itself.")
185185 }
186186
187187
188188
189189 @Callable(i)
190190 func registerAsset (assetId,lpName,lpDescription,lpLogo,delayInBlocks,proxyAddress,otherChainAssetDecimals) = {
191191 let checks = [mustManager(i), if ((delayInBlocks >= 0))
192192 then true
193193 else throwErr("invalid delayInBlocks"), if ((addressFromString(proxyAddress) != unit))
194194 then true
195195 else throwErr("invalid proxyAddress"), if ((valueOrElse(getBoolean(keyCreated(assetId)), false) == false))
196196 then true
197197 else throwErr("asset already registered")]
198198 if ((checks == checks))
199199 then {
200200 let decimals = value(assetInfo(fromBase58String(assetId))).decimals
201201 let lpIssue = Issue(lpName, lpDescription, 1, decimals, true)
202202 let lp = calculateAssetId(lpIssue)
203203 let lpId = toBase58String(lp)
204204 let createOrUpdate = invoke(assetsStoreContract(), "createOrUpdate", [lpId, lpLogo, false], nil)
205205 if ((createOrUpdate == createOrUpdate))
206206 then {
207207 let addLabel = invoke(assetsStoreContract(), "addLabel", [lpId, "DEFI"], nil)
208208 if ((addLabel == addLabel))
209209 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)]
210210 else throw("Strict value is not equal to itself.")
211211 }
212212 else throw("Strict value is not equal to itself.")
213213 }
214214 else throw("Strict value is not equal to itself.")
215215 }
216216
217217
218218
219219 @Callable(i)
220220 func topUpBalance () = {
221221 let pmt = valueOrErrorMessage(i.payments[0], (contract + "payment must be attached"))
222222 let assetId = toBase58String(value(pmt.assetId))
223223 let amount = pmt.amount
224224 let pendingWithdrawals = valueOrElse(getInteger(keyPendingWithdrawals(assetId)), 0)
225225 let checks = [mustProxyAddress(i, assetId), if ((size(i.payments) == 1))
226226 then true
227227 else throwErr("only one payment must be attached"), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
228228 then true
229229 else throwErr("attached payment asset must be registered in the contract"), if ((pendingWithdrawals != 0))
230230 then true
231231 else throwErr("zero pendingWithdrawals, nothing to top up"), if ((pendingWithdrawals >= amount))
232232 then true
233233 else "amount to top up must be less or equal than pendingWithdrawals"]
234234 if ((checks == checks))
235235 then [IntegerEntry(keyPendingWithdrawals(assetId), (pendingWithdrawals - amount))]
236236 else throw("Strict value is not equal to itself.")
237237 }
238238
239239
240240
241241 @Callable(i)
242-func setTVL (assetId,newRawTVL) = {
242+func setTVL (assetId,newStrTVL) = {
243243 let checks = [mustProxyAddress(i, assetId), if (valueOrElse(getBoolean(keyCreated(assetId)), false))
244244 then true
245245 else throwErr("asset must be registered in the contract")]
246246 if ((checks == checks))
247247 then {
248+ let newBigIntTVL = parseBigIntValue(newStrTVL)
249+ let ten = parseBigIntValue("10")
248250 let assetDecimals = value(assetInfo(fromBase58String(assetId))).decimals
249251 let otherChainAssetDecimals = value(getInteger(keyOtherChainAssetDecimals(assetId)))
250- let newTVL = if ((otherChainAssetDecimals > assetDecimals))
252+ let newTVLWavesDecimals = if ((otherChainAssetDecimals > assetDecimals))
251253 then {
252- let diff = (otherChainAssetDecimals - assetDecimals)
253- (newRawTVL / pow(10, 0, diff, 0, 0, DOWN))
254+ let diff = parseBigIntValue(toString((otherChainAssetDecimals - assetDecimals)))
255+ (newBigIntTVL / pow(ten, 0, diff, 0, 0, DOWN))
254256 }
255257 else if ((assetDecimals > otherChainAssetDecimals))
256258 then {
257- let diff = (assetDecimals - otherChainAssetDecimals)
258- (newRawTVL * pow(10, 0, diff, 0, 0, DOWN))
259+ let diff = parseBigIntValue(toString((assetDecimals - otherChainAssetDecimals)))
260+ (newBigIntTVL * pow(ten, 0, diff, 0, 0, DOWN))
259261 }
260- else newRawTVL
262+ else newBigIntTVL
263+ let newTVL = toInt(newTVLWavesDecimals)
261264 [IntegerEntry(keyTVL(assetId), newTVL), IntegerEntry(keyTVLHistory(assetId, height), newTVL)]
262265 }
263266 else throw("Strict value is not equal to itself.")
264267 }
265268
266269
267270
268271 @Callable(i)
269272 func setManager (pendingManagerPublicKey) = {
270273 let checkCaller = mustManager(i)
271274 if ((checkCaller == checkCaller))
272275 then {
273276 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
274277 if ((checkManagerPublicKey == checkManagerPublicKey))
275278 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
276279 else throw("Strict value is not equal to itself.")
277280 }
278281 else throw("Strict value is not equal to itself.")
279282 }
280283
281284
282285
283286 @Callable(i)
284287 func confirmManager () = {
285288 let pm = pendingManagerPublicKeyOrUnit()
286289 let hasPM = if (isDefined(pm))
287290 then true
288291 else throwErr("no pending manager")
289292 if ((hasPM == hasPM))
290293 then {
291294 let checkPM = if ((i.callerPublicKey == value(pm)))
292295 then true
293296 else throwErr("you are not pending manager")
294297 if ((checkPM == checkPM))
295298 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
296299 else throw("Strict value is not equal to itself.")
297300 }
298301 else throw("Strict value is not equal to itself.")
299302 }
300303
301304
302305 @Verifier(tx)
303306 func verify () = {
304307 let targetPublicKey = match managerPublicKeyOrUnit() {
305308 case pk: ByteVector =>
306309 pk
307310 case _: Unit =>
308311 tx.senderPublicKey
309312 case _ =>
310313 throw("Match error")
311314 }
312315 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
313316 }
314317

github/deemru/w8io/169f3d6 
45.97 ms