tx · GEhenWYsgEV4FrAT9kf8XLsjEe1HP27Ssj5Abs1KdWKe

3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU:  -0.04000000 Waves

2021.09.03 21:52 [1687248] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves

{ "type": 13, "id": "GEhenWYsgEV4FrAT9kf8XLsjEe1HP27Ssj5Abs1KdWKe", "fee": 4000000, "feeAssetId": null, "timestamp": 1630695185608, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "5r8trnGU7oiAjdsT3A29SwSqzu1svbkqXxpircsX6TTd5uoUMwitG9arvNPzmXJvYLi5DdtN2fpget76TBenEnHP" ], "script": "base64:AAIFAAAAAAAAACEIAhIECgIIBBIDCgEIEgMKAQgSBwoFCAgBCAgSBAoCCAEAAAAqAAAAAApiYXNlRmFjdG9yAAAAAAAAAAPoAAAAAAliYXNlSW5kZXgAACOG8m/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAphc3NldElkU3ViCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAA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AAAA5kVG9rZW5EZWNpbWFscwAAAAAAAAAACAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMZFRva2VuU3VwcGx5AAAAAAAAAAAABQAAAANuaWwJAAACAAAAAQIAAAATUG9vbCBhbHJlYWR5IHNldHVwIQAAAAFpAQAAABF3cml0ZUludGVnZXJFbnRyeQAAAAIAAAADa2V5AAAABWVudHJ5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAANrZXkFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAAXQ2FsbGVyIGlzIG5vdCBhbiBhZG1pbiEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleaiJuQw=", "height": 1687248, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5iAVKj56dUnqCGbofVFBKpPip5tSFBM6zMgZgN1ZsZv9 Next: 35be9FbRqrz9KCkjbGSAYMwi1UxRwJ6a3FF72WKjueqU Diff:
OldNewDifferences
172172 else throw("Pool already setup!")
173173
174174
175+
176+@Callable(i)
177+func writeIntegerEntry (key,entry) = if (isAdminAddress(i.caller))
178+ then [IntegerEntry(key, entry)]
179+ else throw("Caller is not an admin!")
180+
181+
175182 @Verifier(tx)
176183 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
177184
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 baseExchangeRate = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
2929
3030 let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found"))
3131
3232 let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0)
3333
3434 let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0)
3535
3636 let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0)
3737
3838 let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
3939
4040 let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4141
4242 let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4343
4444 let dTokenName = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
4545
4646 let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height)
4747
4848 let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
4949
5050 func isAdminAddress (address) = if ((addressFromStringValue(admin) == address))
5151 then true
5252 else false
5353
5454
5555 func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address))
5656 then true
5757 else false
5858
5959
6060 func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub))
6161 then true
6262 else false
6363
6464
6565 func writeString (key,stringValue) = StringEntry(key, stringValue)
6666
6767
6868 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
6969
7070
7171 func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0)
7272
7373
7474 let utilization = if ((totalSupply > 0))
7575 then fraction(totalBorrow, baseFactor, totalSupply)
7676 else 0
7777
7878 let apr = {
7979 let minValue = [utilization, kink]
8080 let minValueItem = min(minValue)
8181 let maxValue = [0, (utilization - kink)]
8282 let maxValueItem = max(maxValue)
8383 ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate)
8484 }
8585
8686 let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor)
8787
8888 let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor))
8989
9090 let deltaBlocks = (height - storedHeight)
9191
9292 let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING)
9393
9494 let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex)
9595
9696 let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex)
9797
9898 let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor))
9999
100100 let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor))
101101
102102 let exchangeRate = if ((dTokenSupply > 0))
103103 then {
104104 let exponent = ((18 - dTokenDecimals) + assetDecimals)
105105 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
106106 fraction(currentTotalSupply, mantissa, dTokenSupply)
107107 }
108108 else baseExchangeRate
109109
110110 func calcDTokenAmount (assetAmount) = {
111111 let exponent = ((18 - dTokenDecimals) + assetDecimals)
112112 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
113113 fraction(assetAmount, mantissa, exchangeRate)
114114 }
115115
116116
117117 func calcAssetAmount (dTokenAmount) = {
118118 let exponent = ((18 - dTokenDecimals) + assetDecimals)
119119 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
120120 fraction(dTokenAmount, exchangeRate, mantissa)
121121 }
122122
123123
124124 @Callable(i)
125125 func deposit (user,isCollateral) = if (isWavetroller(i.caller))
126126 then {
127127 let userTokenAmount = calcDTokenAmount(i.payments[0].amount)
128128 let currentDTokenSupply = (dTokenSupply + userTokenAmount)
129129 if (isCollateral)
130130 then {
131131 let lockedUserBalance = (userlockedBalance(user) + userTokenAmount)
132132 $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) + dTokenName) + "were successfully locked"))
133133 }
134134 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)
135135 }
136136 else throw("Address does not match with wavetroller address!")
137137
138138
139139
140140 @Callable(i)
141141 func withdraw (user) = if (isWavetroller(i.caller))
142142 then {
143143 let availableLiquidity = (currentTotalSupply - currentTotalBorrow)
144144 let requestedAssetAmount = calcAssetAmount(i.payments[0].amount)
145145 if ((availableLiquidity >= requestedAssetAmount))
146146 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), if ((assetIdSub == "WAVES"))
147147 then ScriptTransfer(i.caller, requestedAssetAmount, unit)
148148 else ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount)
149149 else throw("Pool liquidity is not sufficient!")
150150 }
151151 else throw("Address does not match with wavetroller address!")
152152
153153
154154
155155 @Callable(i)
156156 func lockAsCollateral (user) = if (isWavetroller(i.caller))
157157 then {
158158 let newLockedBalance = (userlockedBalance(user) + i.payments[0].amount)
159159 $Tuple2([writeInteger((user + "_locked"), newLockedBalance), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", currentTotalSupply), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height)], ((toString(i.payments[0].amount) + dTokenName) + "were successfully locked"))
160160 }
161161 else throw("Address does not match with wavetroller address!")
162162
163163
164164
165165 @Callable(i)
166166 func setup (aId,configAdd,baseExchangeRate,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress"))))
167167 then {
168168 let asset = Issue(tokenName, tokenDescription, 0, 8, true)
169169 let tokenId = calculateAssetId(asset)
170170 [asset, writeString("assetId", aId), writeString("configAddress", configAdd), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", baseIndex), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", baseExchangeRate), writeString("dTokenName", tokenName), writeString("dTokenId", toBase58String(tokenId)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
171171 }
172172 else throw("Pool already setup!")
173173
174174
175+
176+@Callable(i)
177+func writeIntegerEntry (key,entry) = if (isAdminAddress(i.caller))
178+ then [IntegerEntry(key, entry)]
179+ else throw("Caller is not an admin!")
180+
181+
175182 @Verifier(tx)
176183 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
177184

github/deemru/w8io/026f985 
38.54 ms