tx · G8rXyivHFiyBJ7BgnrrUQ23P1hjdkn1HDxoBQ7LxM2Ww

3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU:  -0.04000000 Waves

2021.09.01 23:39 [1684456] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves

{ "type": 13, "id": "G8rXyivHFiyBJ7BgnrrUQ23P1hjdkn1HDxoBQ7LxM2Ww", "fee": 4000000, "feeAssetId": null, "timestamp": 1630528791988, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "5f9bG6j8bwvY3Cpe8jbqoYzUHmTHhdtj6jHmWateFSCgzv9PWErkuuqmkPm1u16gPNNwa6AmPZN6yFJvEX74NoJ1" ], "script": "base64:AAIFAAAAAAAAABUIAhIECgIIBBIGCgQICAgIEgMKAQgAAAAnAAAAAApiYXNlRmFjdG9yAAAAAAAAAAPoAAAAAAliYXNlSW5kZXgAACOG8m/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAphc3NldElkU3ViCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAH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AAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADa2V5BQAAAANuaWwJAAACAAAAAQIAAAAXQ2FsbGVyIGlzIG5vdCBhbiBhZG1pbiEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledLHavQ=", "height": 1684456, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FY3LcmAJKzwe7hV8UHrTfZiPCjpbidDsowYP3xJ7LTK8 Next: 2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz Diff:
OldNewDifferences
5353 else false
5454
5555
56+func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub))
57+ then true
58+ else false
59+
60+
5661 func writeString (key,stringValue) = StringEntry(key, stringValue)
5762
5863
5964 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
6065
6166
62-func userTokenBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_tokenBalance")), 0)
67+func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0)
6368
6469
6570 let utilization = if ((totalSupply > 0))
110115 then {
111116 let userTokenAmount = calcTokenAmount(i.payments[0].amount)
112117 let currentDTokenSupply = (dTokenSupply + userTokenAmount)
113- let userBalance = (userTokenBalance(user) + userTokenAmount)
114- $Tuple2([Reissue(fromBase58String(dTokenId), userTokenAmount, true), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger((user + "_tokenBalance"), userBalance), BooleanEntry((user + "_useAsCollateral"), isCollateral), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount)
118+ if (isCollateral)
119+ then {
120+ let lockedUserBalance = (userlockedBalance(user) + userTokenAmount)
121+ $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + 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"))
122+ }
123+ else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + 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)
115124 }
116125 else throw("Address does not match with wavetroller address!")
117126
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
56+func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub))
57+ then true
58+ else false
59+
60+
5661 func writeString (key,stringValue) = StringEntry(key, stringValue)
5762
5863
5964 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
6065
6166
62-func userTokenBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_tokenBalance")), 0)
67+func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0)
6368
6469
6570 let utilization = if ((totalSupply > 0))
6671 then fraction(totalBorrow, baseFactor, totalSupply)
6772 else 0
6873
6974 let apr = {
7075 let minValue = [utilization, kink]
7176 let minValueItem = min(minValue)
7277 let maxValue = [0, (utilization - kink)]
7378 let maxValueItem = max(maxValue)
7479 ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate)
7580 }
7681
7782 let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor)
7883
7984 let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor))
8085
8186 let deltaBlocks = (height - storedHeight)
8287
8388 let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING)
8489
8590 let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex)
8691
8792 let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex)
8893
8994 let currentSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor))
9095
9196 let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor))
9297
9398 let dTokenExchangeRate = if ((dTokenSupply > 0))
9499 then {
95100 let exponent = ((18 - dTokenDecimals) + assetDecimals)
96101 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
97102 fraction(currentSupply, mantissa, dTokenSupply)
98103 }
99104 else 20000000000000000
100105
101106 func calcTokenAmount (assetAmount) = {
102107 let exponent = ((18 - dTokenDecimals) + assetDecimals)
103108 let mantissa = pow(10, 0, exponent, 0, 0, CEILING)
104109 fraction(assetAmount, mantissa, dTokenExchangeRate)
105110 }
106111
107112
108113 @Callable(i)
109114 func deposit (user,isCollateral) = if (isWavetroller(i.caller))
110115 then {
111116 let userTokenAmount = calcTokenAmount(i.payments[0].amount)
112117 let currentDTokenSupply = (dTokenSupply + userTokenAmount)
113- let userBalance = (userTokenBalance(user) + userTokenAmount)
114- $Tuple2([Reissue(fromBase58String(dTokenId), userTokenAmount, true), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger((user + "_tokenBalance"), userBalance), BooleanEntry((user + "_useAsCollateral"), isCollateral), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount)
118+ if (isCollateral)
119+ then {
120+ let lockedUserBalance = (userlockedBalance(user) + userTokenAmount)
121+ $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + 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"))
122+ }
123+ else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + 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)
115124 }
116125 else throw("Address does not match with wavetroller address!")
117126
118127
119128
120129 @Callable(i)
121130 func setup (aId,configAdd,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress"))))
122131 then {
123132 let asset = Issue(tokenName, tokenDescription, 0, 8, true)
124133 let tokenId = calculateAssetId(asset)
125134 [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)]
126135 }
127136 else throw("Pool already setup!")
128137
129138
130139
131140 @Callable(i)
132141 func deletEntry (key) = if (isAdminAddress(i.caller))
133142 then [DeleteEntry(key)]
134143 else throw("Caller is not an admin!")
135144
136145
137146 @Verifier(tx)
138147 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
139148

github/deemru/w8io/026f985 
39.63 ms