tx · HxE5qSpgNJmC9ARAUoGDHMaSzDK9VdvDzLk4AKh6h8Cm

3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9:  -0.04000000 Waves

2021.08.25 00:13 [1672926] smart account 3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9 > SELF 0.00000000 Waves

{ "type": 13, "id": "HxE5qSpgNJmC9ARAUoGDHMaSzDK9VdvDzLk4AKh6h8Cm", "fee": 4000000, "feeAssetId": null, "timestamp": 1629839724857, "version": 2, "chainId": 84, "sender": "3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9", "senderPublicKey": "5fe3Hm6UB8fRqvLYhGeeNdy7rEgwpxWjdEFPgnNwSRCz", "proofs": [ "3MNm7Na2P3N3gFcFuhEB6SXwiTEYdWKk9iUNP6QFcaPJCXz5fMyW9DVCz2SssJLhTTnxtFFNAB9UqW4xGojBV4dr" ], "script": "base64:AAIFAAAAAAAAABAIAhIECgIIBBIGCgQICAgIAAAAJgAAAAAKYmFzZUZhY3RvcgAAAAAAAAAD6AAAAAAJYmFzZUluZGV4AAAjhvJvwQAAAAAAAA1ibG9ja3NQZXJZZWFyAAAAAAAACAUgAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAANY29uZmlnQWRkcmVzcwIAAAAAAAAAAAVhZG1pbgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAABWFkbWluAgAAAAAAAAAAC3dhdmV0cm9sbGVyCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAALd2F2ZXRyb2xsZXICAAAAAAAAAAAKYXNzZXRJZFN1YgkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAA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gIAAAALdG90YWxCb3Jyb3cAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAC3RvdGFsU3VwcGx5AAAAAAAAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAx0b3RhbFJlc2VydmUAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAC3N0b3JlZEluZGV4BQAAAAliYXNlSW5kZXgJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADHN0b3JlZEhlaWdodAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAt3cml0ZVN0cmluZwAAAAICAAAACmRUb2tlbk5hbWUFAAAACXRva2VuTmFtZQkABEwAAAACCQEAAAALd3JpdGVTdHJpbmcAAAACAgAAAAhkVG9rZW5JZAkAAlgAAAABBQAAAAd0b2tlbklkCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA5kVG9rZW5EZWNpbWFscwAAAAAAAAAACAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMZFRva2VuU3VwcGx5AAAAAAAAAAAABQAAAANuaWwJAAACAAAAAQIAAAATUG9vbCBhbHJlYWR5IHNldHVwIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5uiiwSw==", "height": 1672926, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AoWCoxJ26T9LSHrydyXi5iTkBKZf2zowoDdm7qNrznM7 Next: CZgYp5qRAT4A4qnvc9EtjuBXqLWEZrYfL2uEGNbYpG9t Diff:
OldNewDifferences
77
88 let blocksPerYear = 525600
99
10-let config = valueOrErrorMessage(getString(this, "configAddress"), "No config address could be found in data storage!")
10+let config = valueOrElse(getString(this, "configAddress"), "")
1111
12-let admin = valueOrErrorMessage(getString(addressFromStringValue(config), "admin"), "No admin address could be found in data storage!")
12+let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "")
1313
14-let wavetroller = valueOrErrorMessage(getString(addressFromStringValue(config), "wavetroller"), "No wavetroller address could be found in data storage!")
14+let wavetroller = valueOrElse(getString(addressFromStringValue(config), "wavetroller"), "")
1515
1616 let assetIdSub = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1717
2727
2828 let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found"))
2929
30-let totalBorrow = valueOrErrorMessage(getInteger(this, "totalBorrow"), "No key totalBorrow was found")
30+let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0)
3131
32-let totalSupply = valueOrErrorMessage(getInteger(this, "totalSupply"), "No key totalSupply was found")
32+let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0)
3333
34-let totalReserve = valueOrErrorMessage(getInteger(this, "totalReserve"), "No key totalReserve was found")
34+let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0)
3535
3636 let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
3737
3939
4040 let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4141
42-let storedHeight = valueOrErrorMessage(getInteger(this, "storedHeight"), "No key storedHeight was found")
42+let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height)
4343
44-let storedIndex = valueOrErrorMessage(getInteger(this, "storedIndex"), "No key storedIndex was found")
44+let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
4545
4646 func isAdminAddress (address) = if ((addressFromStringValue(admin) == address))
4747 then true
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
10-let config = valueOrErrorMessage(getString(this, "configAddress"), "No config address could be found in data storage!")
10+let config = valueOrElse(getString(this, "configAddress"), "")
1111
12-let admin = valueOrErrorMessage(getString(addressFromStringValue(config), "admin"), "No admin address could be found in data storage!")
12+let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "")
1313
14-let wavetroller = valueOrErrorMessage(getString(addressFromStringValue(config), "wavetroller"), "No wavetroller address could be found in data storage!")
14+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
30-let totalBorrow = valueOrErrorMessage(getInteger(this, "totalBorrow"), "No key totalBorrow was found")
30+let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0)
3131
32-let totalSupply = valueOrErrorMessage(getInteger(this, "totalSupply"), "No key totalSupply was found")
32+let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0)
3333
34-let totalReserve = valueOrErrorMessage(getInteger(this, "totalReserve"), "No key totalReserve was found")
34+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
42-let storedHeight = valueOrErrorMessage(getInteger(this, "storedHeight"), "No key storedHeight was found")
42+let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height)
4343
44-let storedIndex = valueOrErrorMessage(getInteger(this, "storedIndex"), "No key storedIndex was found")
44+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 writeString (key,stringValue) = StringEntry(key, stringValue)
5757
5858
5959 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
6060
6161
6262 func userTokenBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_tokenBalance")), 0)
6363
6464
6565 let utilization = fraction(totalBorrow, baseFactor, totalSupply)
6666
6767 let apr = {
6868 let minValue = [utilization, kink]
6969 let minValueItem = min(minValue)
7070 let maxValue = [0, (utilization - kink)]
7171 let maxValueItem = max(maxValue)
7272 ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate)
7373 }
7474
7575 let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor)
7676
7777 let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor))
7878
7979 let deltaBlocks = (height - storedHeight)
8080
8181 let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING)
8282
8383 let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex)
8484
8585 let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex)
8686
8787 let currentSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor))
8888
8989 let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor))
9090
9191 let dTokenExchangeRate = if ((dTokenSupply > 0))
9292 then {
9393 let exponent = ((18 - 8) + assetDecimals)
9494 if ((10 > exponent))
9595 then fraction(currentSupply, (1 * pow(10, 2, exponent, 1, 18, CEILING)), dTokenSupply)
9696 else fraction(currentSupply, (1 * pow(10, 2, exponent, 2, 18, CEILING)), dTokenSupply)
9797 }
9898 else {
9999 let rBaseExponent = (assetDecimals + 6)
100100 if ((10 > rBaseExponent))
101101 then fraction(2, (1 * pow(10, 2, rBaseExponent, 1, 18, CEILING)), 1)
102102 else fraction(2, (1 * pow(10, 2, rBaseExponent, 2, 18, CEILING)), 1)
103103 }
104104
105105 func calcTokenAmout (assetAmount) = {
106106 let exponent = ((18 - 8) + assetDecimals)
107107 let exponentPoint = if ((10 > exponent))
108108 then 1
109109 else 2
110110 fraction(assetAmount, (1 * pow(10, 2, exponent, exponentPoint, 18, CEILING)), dTokenExchangeRate)
111111 }
112112
113113
114114 @Callable(i)
115115 func deposit (user,isCollateral) = if (isWavetroller(i.caller))
116116 then {
117117 let userTokenAmount = calcTokenAmout(i.payments[0].amount)
118118 let currentDTokenSupply = (dTokenSupply + userTokenAmount)
119119 let userBalance = (userTokenBalance(user) + userTokenAmount)
120120 [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))]
121121 }
122122 else throw("Address does not match with wavetroller address!")
123123
124124
125125
126126 @Callable(i)
127127 func setup (aId,configAdd,tokenName,tokenDescription) = if (if (!(isDefined(getString(this, "config"))))
128128 then !(isDefined(getString(this, "admin")))
129129 else false)
130130 then {
131131 let asset = Issue(tokenName, tokenDescription, 0, 8, true)
132132 let tokenId = calculateAssetId(asset)
133133 [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)]
134134 }
135135 else throw("Pool already setup!")
136136
137137
138138 @Verifier(tx)
139139 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
140140

github/deemru/w8io/169f3d6 
35.99 ms