tx · 2b1HweFDzDAUkGzFThayThXbg4J2fyqsxppSrxBjKVsJ

3MxFYk97QYdeHRMTu51rVyHqvFEVB4UtmBX:  -0.01700000 Waves

2022.09.14 18:18 [2228945] smart account 3MxFYk97QYdeHRMTu51rVyHqvFEVB4UtmBX > SELF 0.00000000 Waves

{ "type": 13, "id": "2b1HweFDzDAUkGzFThayThXbg4J2fyqsxppSrxBjKVsJ", "fee": 1700000, "feeAssetId": null, "timestamp": 1663168710777, "version": 2, "chainId": 84, "sender": "3MxFYk97QYdeHRMTu51rVyHqvFEVB4UtmBX", "senderPublicKey": "2panvMtE3s1p1oCdVqRGMuBYaZJV3AZ6zpdmZ6vHkDaL", "proofs": [ "4c7vgZKqE7MkBaygkiAXCi5bEsMYNd5CEWuPzNYfMgebyM74D9Hu6FbYtiavM3tu7Vc9mV29tMW14Z7b8HLuc4ED", "5FZazJdtb1YUWpJU2eb4cvJMSzRnNQDXs4fUPKv4bEKfJZHiCcMj8n99kpCHneRZKfQ4rAPzWtdZKL5aCEM6VEZB" ], "script": "base64:BgISCAISABIDCgEBEgMKAQgSABIAIAAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlABZrTGFzdFBvb2xUb2tlbkludGVyZXN0AhNfcG9vbF9sYXN0X2ludGVyZXN0ABFrVXNlckxhc3RJbnRlcmVzdAITX3VzZXJfbGFzdF9pbnRlcmVzdAATa1VzZXJDbGFpbUF2YWlsYWJsZQIYX3VzZXJfYXZhaWxhYmxlX3RvX2NsYWltABZrVXNlclNoYXJlVG9rZW5zTG9ja2VkAhRfc2hhcmVfdG9rZW5zX2xvY2tlZAASa1NoYXJlVG9rZW5zTG9ja2VkAhpfdG90YWxfc2hhcmVfdG9rZW5zX2xvY2tlZAALa09yYWNsZVBvb2wCBXBvb2xfAA1rUG9vbEFzc2V0SWRzAglhc3NldF9pZHMADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAg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eXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAs4x/3g=", "height": 2228945, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DfKhkihVhFrQmyXj3CapTDXiWZRSKgE2DTXZ1CuMwhWu Next: 998GTpcEfvuZn33A2s39oMv81gypA2XgXt7ygiBjT6M5 Diff:
OldNewDifferences
138138 else false)
139139 then fraction(pmtAmount, scaleValue, totalShareTokensLocked)
140140 else 0))
141-[IntegerEntry(kLastPoolTokenInterest, interestNew)]
141+[IntegerEntry((((pool + "_") + getStrAssetId(pmtAssetId)) + kLastPoolTokenInterest), interestNew)]
142142 }))
143143
144144
150150 let pool = toString(poolAddr)
151151 let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",")
152152 func calcNewUserInterestAndClaimAmountEtries (acc,assetId) = {
153- let $t044034473 = calcClaimAmount(pool, assetId, user)
154- let claimAmount = $t044034473._1
155- let lastInterest = $t044034473._2
153+ let $t044454515 = calcClaimAmount(pool, assetId, user)
154+ let claimAmount = $t044454515._1
155+ let lastInterest = $t044454515._2
156156 (acc :+ [IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), claimAmount), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)])
157157 }
158158
178178 let user = toString(i.caller)
179179 let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",")
180180 func calcClaimAmountEtries (acc,assetId) = {
181- let $t051265150 = acc
182- let entries = $t051265150._1
183- let sum = $t051265150._2
184- let $t051575227 = calcClaimAmount(pool, assetId, user)
185- let claimAmount = $t051575227._1
186- let lastInterest = $t051575227._2
181+ let $t051685192 = acc
182+ let entries = $t051685192._1
183+ let sum = $t051685192._2
184+ let $t051995269 = calcClaimAmount(pool, assetId, user)
185+ let claimAmount = $t051995269._1
186+ let lastInterest = $t051995269._2
187187 $Tuple2((entries :+ [ScriptTransfer(i.caller, claimAmount, fromBase58String(assetId)), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), 0), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)]), claimAmount)
188188 }
189189
190- let $t055275609 = {
190+ let $t055695651 = {
191191 let $l = assetIds
192192 let $s = size($l)
193193 let $acc0 = $Tuple2(nil, 0)
201201
202202 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
203203 }
204- let claimEntries = $t055275609._1
205- let sumTokens = $t055275609._2
204+ let claimEntries = $t055695651._1
205+ let sumTokens = $t055695651._2
206206 if ((sumTokens == 0))
207207 then throw("You have no tokens for claim")
208208 else claimEntries
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kActive = "active"
55
66 let kCause = "shutdown_cause"
77
88 let kLastPoolTokenInterest = "_pool_last_interest"
99
1010 let kUserLastInterest = "_user_last_interest"
1111
1212 let kUserClaimAvailable = "_user_available_to_claim"
1313
1414 let kUserShareTokensLocked = "_share_tokens_locked"
1515
1616 let kShareTokensLocked = "_total_share_tokens_locked"
1717
1818 let kOraclePool = "pool_"
1919
2020 let kPoolAssetIds = "asset_ids"
2121
2222 let kAdminPubKey1 = "admin_pub_1"
2323
2424 let kAdminPubKey2 = "admin_pub_2"
2525
2626 let kAdminPubKey3 = "admin_pub_3"
2727
2828 let kFarmingAddr = "farming_address"
2929
3030 let scaleValue = 100000000
3131
3232 let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
3333
3434 func getBase58FromOracle (key) = match getString(oracle, key) {
3535 case string: String =>
3636 fromBase58String(string)
3737 case nothing =>
3838 throw((key + "is empty"))
3939 }
4040
4141
4242 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
4343
4444 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
4545
4646 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
4747
4848 let farmingAddr = Address(getBase58FromOracle(kFarmingAddr))
4949
5050 let active = valueOrElse(getBoolean(this, kActive), true)
5151
5252 func isActive () = if (active)
5353 then unit
5454 else throw("DApp is inactive at this moment")
5555
5656
5757 func isPoolCall (caller) = if (isDefined(getString(oracle, (kOraclePool + toString(caller)))))
5858 then unit
5959 else throw("Only pool can call this function")
6060
6161
6262 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
6363
6464
6565 func getUserShareTokensLocked (pool,userAddress) = valueOrElse(getInteger(farmingAddr, (((pool + "_") + userAddress) + kUserShareTokensLocked)), 0)
6666
6767
6868 func getTotalShareTokensLocked (pool) = valueOrElse(getInteger(farmingAddr, (pool + kShareTokensLocked)), 0)
6969
7070
7171 func getUserLastInterest (user,pool,assetId) = valueOrElse(getInteger(this, (((((user + "_") + pool) + "_") + assetId) + kUserLastInterest)), 0)
7272
7373
7474 func getPoolTokenLastInterest (pool,assetId) = valueOrElse(getInteger(this, (((pool + "_") + assetId) + kLastPoolTokenInterest)), 0)
7575
7676
7777 func getUserClaimAvailable (user,pool,assetId) = valueOrElse(getInteger(this, (((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable)), 0)
7878
7979
8080 func getStrAssetId (assetId) = match assetId {
8181 case id: ByteVector =>
8282 toBase58String(id)
8383 case waves: Unit =>
8484 "WAVES"
8585 case _ =>
8686 throw("Match error")
8787 }
8888
8989
9090 func calcClaimAmount (pool,assetId,user) = {
9191 let lastInterest = getPoolTokenLastInterest(pool, assetId)
9292 let userLastInterest = getUserLastInterest(user, pool, assetId)
9393 let userShareTokensLocked = getUserShareTokensLocked(pool, user)
9494 let userClaimAvailable = getUserClaimAvailable(user, pool, assetId)
9595 let newUserClaimAvailable = fraction(userShareTokensLocked, (lastInterest - userLastInterest), scaleValue)
9696 $Tuple2((userClaimAvailable + newUserClaimAvailable), lastInterest)
9797 }
9898
9999
100100 func calcClaimAmountEvaluate (pool,user) = {
101101 let poolAddr = Address(fromBase58String(pool))
102102 let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",")
103103 func calcClaimAmounts (acc,assetId) = {
104104 let $t032053275 = calcClaimAmount(pool, assetId, user)
105105 let claimAmount = $t032053275._1
106106 let lastInterest = $t032053275._2
107107 (acc :+ [claimAmount])
108108 }
109109
110110 let claimAmounts = {
111111 let $l = assetIds
112112 let $s = size($l)
113113 let $acc0 = nil
114114 func $f0_1 ($a,$i) = if (($i >= $s))
115115 then $a
116116 else calcClaimAmounts($a, $l[$i])
117117
118118 func $f0_2 ($a,$i) = if (($i >= $s))
119119 then $a
120120 else throw("List size exceeds 15")
121121
122122 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
123123 }
124124 $Tuple2(assetIds, claimAmounts)
125125 }
126126
127127
128128 @Callable(i)
129129 func airDrop () = valueOrElse(isActive(), valueOrElse(isPoolCall(i.caller), {
130130 let $t034883563 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
131131 let pmtAmount = $t034883563._1
132132 let pmtAssetId = $t034883563._2
133133 let pool = toString(i.caller)
134134 let totalShareTokensLocked = getTotalShareTokensLocked(pool)
135135 let lastInterest = getPoolTokenLastInterest(pool, getStrAssetId(pmtAssetId))
136136 let interestNew = (lastInterest + (if (if ((totalShareTokensLocked > 0))
137137 then (pmtAmount > 0)
138138 else false)
139139 then fraction(pmtAmount, scaleValue, totalShareTokensLocked)
140140 else 0))
141-[IntegerEntry(kLastPoolTokenInterest, interestNew)]
141+[IntegerEntry((((pool + "_") + getStrAssetId(pmtAssetId)) + kLastPoolTokenInterest), interestNew)]
142142 }))
143143
144144
145145
146146 @Callable(i)
147147 func updateUserInterest (newUserShareTokensLocked) = valueOrElse(isActive(), valueOrElse(isPoolCall(i.caller), {
148148 let poolAddr = i.caller
149149 let user = toString(i.originCaller)
150150 let pool = toString(poolAddr)
151151 let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",")
152152 func calcNewUserInterestAndClaimAmountEtries (acc,assetId) = {
153- let $t044034473 = calcClaimAmount(pool, assetId, user)
154- let claimAmount = $t044034473._1
155- let lastInterest = $t044034473._2
153+ let $t044454515 = calcClaimAmount(pool, assetId, user)
154+ let claimAmount = $t044454515._1
155+ let lastInterest = $t044454515._2
156156 (acc :+ [IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), claimAmount), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)])
157157 }
158158
159159 let $l = assetIds
160160 let $s = size($l)
161161 let $acc0 = nil
162162 func $f0_1 ($a,$i) = if (($i >= $s))
163163 then $a
164164 else calcNewUserInterestAndClaimAmountEtries($a, $l[$i])
165165
166166 func $f0_2 ($a,$i) = if (($i >= $s))
167167 then $a
168168 else throw("List size exceeds 15")
169169
170170 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
171171 }))
172172
173173
174174
175175 @Callable(i)
176176 func claim (pool) = valueOrElse(isActive(), {
177177 let poolAddr = Address(fromBase58String(pool))
178178 let user = toString(i.caller)
179179 let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",")
180180 func calcClaimAmountEtries (acc,assetId) = {
181- let $t051265150 = acc
182- let entries = $t051265150._1
183- let sum = $t051265150._2
184- let $t051575227 = calcClaimAmount(pool, assetId, user)
185- let claimAmount = $t051575227._1
186- let lastInterest = $t051575227._2
181+ let $t051685192 = acc
182+ let entries = $t051685192._1
183+ let sum = $t051685192._2
184+ let $t051995269 = calcClaimAmount(pool, assetId, user)
185+ let claimAmount = $t051995269._1
186+ let lastInterest = $t051995269._2
187187 $Tuple2((entries :+ [ScriptTransfer(i.caller, claimAmount, fromBase58String(assetId)), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), 0), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)]), claimAmount)
188188 }
189189
190- let $t055275609 = {
190+ let $t055695651 = {
191191 let $l = assetIds
192192 let $s = size($l)
193193 let $acc0 = $Tuple2(nil, 0)
194194 func $f0_1 ($a,$i) = if (($i >= $s))
195195 then $a
196196 else calcClaimAmountEtries($a, $l[$i])
197197
198198 func $f0_2 ($a,$i) = if (($i >= $s))
199199 then $a
200200 else throw("List size exceeds 15")
201201
202202 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
203203 }
204- let claimEntries = $t055275609._1
205- let sumTokens = $t055275609._2
204+ let claimEntries = $t055695651._1
205+ let sumTokens = $t055695651._2
206206 if ((sumTokens == 0))
207207 then throw("You have no tokens for claim")
208208 else claimEntries
209209 })
210210
211211
212212
213213 @Callable(i)
214214 func shutdown () = if (!(active))
215215 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
216216 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
217217 then throw("Only admin can call this function")
218218 else suspend("Paused by admin")
219219
220220
221221
222222 @Callable(i)
223223 func activate () = if (active)
224224 then throw("DApp is already active")
225225 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
226226 then throw("Only admin can call this function")
227227 else [BooleanEntry(kActive, true), DeleteEntry(kCause)]
228228
229229
230230 @Verifier(tx)
231231 func verify () = {
232232 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
233233 then 1
234234 else 0
235235 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
236236 then 1
237237 else 0
238238 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
239239 then 1
240240 else 0
241241 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
242242 }
243243

github/deemru/w8io/026f985 
38.62 ms