tx · 44vcH6UD2Su3C9yWRWt5W6JbbHT1Yfmk3j7RoMkVw1Fg

3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU:  -0.04000000 Waves

2021.09.02 00:10 [1684490] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves

{ "type": 13, "id": "44vcH6UD2Su3C9yWRWt5W6JbbHT1Yfmk3j7RoMkVw1Fg", "fee": 4000000, "feeAssetId": null, "timestamp": 1630530602794, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "3mWmoLo6j1BGFeXkDaw1NNz6SMfckfirZ56vV8TesEVAiZHgqEEQ4XwfcpBJSeiQKnjKG2aMCFKqadkuPCUtCepZ" ], "script": "base64:AAIFAAAAAAAAABoIAhIECgIIBBIDCgEIEgYKBAgICAgSAwoBCAAAACgAAAAACmJhc2VGYWN0b3IAAAAAAAAAA+gAAAAACWJhc2VJbmRleAAAI4byb8EAAAAAAAANYmxvY2tzUGVyWWVhcgAAAAAAAAgFIAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAADWNvbmZpZ0FkZHJlc3MCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAt3YXZldHJvbGxlcgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAAC3dhdmV0cm9sbGVyAgAAAAAAAAAACmFzc2V0SWRTdWIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlz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AAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMdG90YWxSZXNlcnZlAAAAAAAAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAtzdG9yZWRJbmRleAUAAAAJYmFzZUluZGV4CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxzdG9yZWRIZWlnaHQFAAAABmhlaWdodAkABEwAAAACCQEAAAALd3JpdGVTdHJpbmcAAAACAgAAAApkVG9rZW5OYW1lBQAAAAl0b2tlbk5hbWUJAARMAAAAAgkBAAAAC3dyaXRlU3RyaW5nAAAAAgIAAAAIZFRva2VuSWQJAAJYAAAAAQUAAAAHdG9rZW5JZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOZFRva2VuRGVjaW1hbHMAAAAAAAAAAAgJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGRUb2tlblN1cHBseQAAAAAAAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAE1Bvb2wgYWxyZWFkeSBzZXR1cCEAAAABaQEAAAAKZGVsZXRFbnRyeQAAAAEAAAADa2V5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsCQAAAgAAAAECAAAAF0NhbGxlciBpcyBub3QgYW4gYWRtaW4hAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmTkwGk", "height": 1684490, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz Next: 9VFxopaCPNrovAcoN8WL8HDfNEb72qt7sAiUFSXRLDxW Diff:
OldNewDifferences
137137 func withdraw (user) = if (isWavetroller(i.caller))
138138 then {
139139 let availableLiquidity = (currentTotalSupply - currentTotalBorrow)
140- if ((i.payments[0].amount > 0))
141- then {
142- let requestedAssetAmount = calcAssetAmount(i.payments[0].amount)
143- if ((availableLiquidity >= requestedAssetAmount))
144- then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount)
145- else throw("Pool liquidity is not sufficient!")
146- }
147- else throw("Token amount must be greater than 0!")
140+ let requestedAssetAmount = calcAssetAmount(i.payments[0].amount)
141+ if ((availableLiquidity >= requestedAssetAmount))
142+ then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount)
143+ else throw("Pool liquidity is not sufficient!")
148144 }
149145 else throw("Address does not match with wavetroller address!")
150146
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let baseFactor = 1000
55
66 let baseIndex = 10000000000000000
77
88 let blocksPerYear = 525600
99
1010 let config = valueOrElse(getString(this, "configAddress"), "")
1111
1212 let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "")
1313
1414 let wavetroller = valueOrElse(getString(addressFromStringValue(config), "wavetroller"), "")
1515
1616 let assetIdSub = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1717
1818 let assetDecimals = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Decimals")), (("No key " + (assetIdSub + "_Decimals")) + " was found"))
1919
2020 let multiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Multiplier")), (("No key " + (assetIdSub + "_Multiplier")) + " was found"))
2121
2222 let kink = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Kink")), (("No key " + (assetIdSub + "_Kink")) + " was found"))
2323
2424 let jumpMultiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_JumpMultiplier")), (("No key " + (assetIdSub + "_JumpMultiplier")) + " was found"))
2525
2626 let baseRate = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_BaseRate")), (("No key " + (assetIdSub + "_BaseRate")) + " was found"))
2727
2828 let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found"))
2929
3030 let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0)
3131
3232 let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0)
3333
3434 let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0)
3535
3636 let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
3737
3838 let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
3939
4040 let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4141
4242 let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height)
4343
4444 let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
4545
4646 func isAdminAddress (address) = if ((addressFromStringValue(admin) == address))
4747 then true
4848 else false
4949
5050
5151 func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address))
5252 then true
5353 else false
5454
5555
5656 func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub))
5757 then true
5858 else false
5959
6060
6161 func writeString (key,stringValue) = StringEntry(key, stringValue)
6262
6363
6464 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
6565
6666
6767 func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0)
6868
6969
7070 let utilization = if ((totalSupply > 0))
7171 then fraction(totalBorrow, baseFactor, totalSupply)
7272 else 0
7373
7474 let apr = {
7575 let minValue = [utilization, kink]
7676 let minValueItem = min(minValue)
7777 let maxValue = [0, (utilization - kink)]
7878 let maxValueItem = max(maxValue)
7979 ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate)
8080 }
8181
8282 let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor)
8383
8484 let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor))
8585
8686 let deltaBlocks = (height - storedHeight)
8787
8888 let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING)
8989
9090 let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex)
9191
9292 let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex)
9393
9494 let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor))
9595
9696 let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor))
9797
9898 let exchangeRate = if ((dTokenSupply > 0))
9999 then {
100100 let exponent = ((18 - dTokenDecimals) + assetDecimals)
101101 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
102102 fraction(currentTotalSupply, mantissa, dTokenSupply)
103103 }
104104 else 20000000000000000
105105
106106 func calcDTokenAmount (assetAmount) = {
107107 let exponent = ((18 - dTokenDecimals) + assetDecimals)
108108 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
109109 fraction(assetAmount, mantissa, exchangeRate)
110110 }
111111
112112
113113 func calcAssetAmount (dTokenAmount) = {
114114 let exponent = ((18 - dTokenDecimals) + assetDecimals)
115115 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
116116 fraction(dTokenAmount, exchangeRate, mantissa)
117117 }
118118
119119
120120 @Callable(i)
121121 func deposit (user,isCollateral) = if (isWavetroller(i.caller))
122122 then {
123123 let userTokenAmount = calcDTokenAmount(i.payments[0].amount)
124124 let currentDTokenSupply = (dTokenSupply + userTokenAmount)
125125 if (isCollateral)
126126 then {
127127 let lockedUserBalance = (userlockedBalance(user) + userTokenAmount)
128128 $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true)], (toString(i.payments[0].amount) + "were successfully locked"))
129129 }
130130 else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount)
131131 }
132132 else throw("Address does not match with wavetroller address!")
133133
134134
135135
136136 @Callable(i)
137137 func withdraw (user) = if (isWavetroller(i.caller))
138138 then {
139139 let availableLiquidity = (currentTotalSupply - currentTotalBorrow)
140- if ((i.payments[0].amount > 0))
141- then {
142- let requestedAssetAmount = calcAssetAmount(i.payments[0].amount)
143- if ((availableLiquidity >= requestedAssetAmount))
144- then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount)
145- else throw("Pool liquidity is not sufficient!")
146- }
147- else throw("Token amount must be greater than 0!")
140+ let requestedAssetAmount = calcAssetAmount(i.payments[0].amount)
141+ if ((availableLiquidity >= requestedAssetAmount))
142+ then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount)
143+ else throw("Pool liquidity is not sufficient!")
148144 }
149145 else throw("Address does not match with wavetroller address!")
150146
151147
152148
153149 @Callable(i)
154150 func setup (aId,configAdd,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress"))))
155151 then {
156152 let asset = Issue(tokenName, tokenDescription, 0, 8, true)
157153 let tokenId = calculateAssetId(asset)
158154 [asset, writeString("assetId", aId), writeString("configAddress", configAdd), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", baseIndex), IntegerEntry("storedHeight", height), writeString("dTokenName", tokenName), writeString("dTokenId", toBase58String(tokenId)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
159155 }
160156 else throw("Pool already setup!")
161157
162158
163159
164160 @Callable(i)
165161 func deletEntry (key) = if (isAdminAddress(i.caller))
166162 then [DeleteEntry(key)]
167163 else throw("Caller is not an admin!")
168164
169165
170166 @Verifier(tx)
171167 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
172168

github/deemru/w8io/026f985 
40.28 ms