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+gAAAAACWJhc2VJbmRleAAAI4byb8EAAAAAAAANYmxvY2tzUGVyWWVhcgAAAAAAAAgFIAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAADWNvbmZpZ0FkZHJlc3MCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAt3YXZldHJvbGxlcgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAAC3dhdmV0cm9sbGVyAgAAAAAAAAAACmFzc2V0SWRTdWIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzA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AkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMdG90YWxSZXNlcnZlAAAAAAAAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAtzdG9yZWRJbmRleAUAAAAJYmFzZUluZGV4CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxzdG9yZWRIZWlnaHQFAAAABmhlaWdodAkABEwAAAACCQEAAAALd3JpdGVTdHJpbmcAAAACAgAAAApkVG9rZW5OYW1lBQAAAAl0b2tlbk5hbWUJAARMAAAAAgkBAAAAC3dyaXRlU3RyaW5nAAAAAgIAAAAIZFRva2VuSWQJAAJYAAAAAQUAAAAHdG9rZW5JZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOZFRva2VuRGVjaW1hbHMAAAAAAAAAAAgJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGRUb2tlblN1cHBseQAAAAAAAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAE1Bvb2wgYWxyZWFkeSBzZXR1cCEAAAABaQEAAAAKZGVsZXRFbnRyeQAAAAEAAAADa2V5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsCQAAAgAAAAECAAAAF0NhbGxlciBpcyBub3QgYW4gYWRtaW4hAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmTkwGk", "height": 1684490, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz Next: 9VFxopaCPNrovAcoN8WL8HDfNEb72qt7sAiUFSXRLDxW Diff:
Old | New | Differences | |
---|---|---|---|
137 | 137 | func withdraw (user) = if (isWavetroller(i.caller)) | |
138 | 138 | then { | |
139 | 139 | 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!") | |
148 | 144 | } | |
149 | 145 | else throw("Address does not match with wavetroller address!") | |
150 | 146 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let baseFactor = 1000 | |
5 | 5 | ||
6 | 6 | let baseIndex = 10000000000000000 | |
7 | 7 | ||
8 | 8 | let blocksPerYear = 525600 | |
9 | 9 | ||
10 | 10 | let config = valueOrElse(getString(this, "configAddress"), "") | |
11 | 11 | ||
12 | 12 | let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "") | |
13 | 13 | ||
14 | 14 | let wavetroller = valueOrElse(getString(addressFromStringValue(config), "wavetroller"), "") | |
15 | 15 | ||
16 | 16 | let assetIdSub = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!") | |
17 | 17 | ||
18 | 18 | let assetDecimals = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Decimals")), (("No key " + (assetIdSub + "_Decimals")) + " was found")) | |
19 | 19 | ||
20 | 20 | let multiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Multiplier")), (("No key " + (assetIdSub + "_Multiplier")) + " was found")) | |
21 | 21 | ||
22 | 22 | let kink = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Kink")), (("No key " + (assetIdSub + "_Kink")) + " was found")) | |
23 | 23 | ||
24 | 24 | let jumpMultiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_JumpMultiplier")), (("No key " + (assetIdSub + "_JumpMultiplier")) + " was found")) | |
25 | 25 | ||
26 | 26 | let baseRate = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_BaseRate")), (("No key " + (assetIdSub + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | 28 | let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found")) | |
29 | 29 | ||
30 | 30 | let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
31 | 31 | ||
32 | 32 | let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0) | |
33 | 33 | ||
34 | 34 | let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0) | |
35 | 35 | ||
36 | 36 | let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
37 | 37 | ||
38 | 38 | let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
39 | 39 | ||
40 | 40 | let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
41 | 41 | ||
42 | 42 | let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height) | |
43 | 43 | ||
44 | 44 | let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000) | |
45 | 45 | ||
46 | 46 | func isAdminAddress (address) = if ((addressFromStringValue(admin) == address)) | |
47 | 47 | then true | |
48 | 48 | else false | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address)) | |
52 | 52 | then true | |
53 | 53 | else false | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub)) | |
57 | 57 | then true | |
58 | 58 | else false | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let utilization = if ((totalSupply > 0)) | |
71 | 71 | then fraction(totalBorrow, baseFactor, totalSupply) | |
72 | 72 | else 0 | |
73 | 73 | ||
74 | 74 | let apr = { | |
75 | 75 | let minValue = [utilization, kink] | |
76 | 76 | let minValueItem = min(minValue) | |
77 | 77 | let maxValue = [0, (utilization - kink)] | |
78 | 78 | let maxValueItem = max(maxValue) | |
79 | 79 | ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate) | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor) | |
83 | 83 | ||
84 | 84 | let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor)) | |
85 | 85 | ||
86 | 86 | let deltaBlocks = (height - storedHeight) | |
87 | 87 | ||
88 | 88 | let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING) | |
89 | 89 | ||
90 | 90 | let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex) | |
91 | 91 | ||
92 | 92 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
93 | 93 | ||
94 | 94 | let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
95 | 95 | ||
96 | 96 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
97 | 97 | ||
98 | 98 | let exchangeRate = if ((dTokenSupply > 0)) | |
99 | 99 | then { | |
100 | 100 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
101 | 101 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
102 | 102 | fraction(currentTotalSupply, mantissa, dTokenSupply) | |
103 | 103 | } | |
104 | 104 | else 20000000000000000 | |
105 | 105 | ||
106 | 106 | func calcDTokenAmount (assetAmount) = { | |
107 | 107 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
108 | 108 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
109 | 109 | fraction(assetAmount, mantissa, exchangeRate) | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func calcAssetAmount (dTokenAmount) = { | |
114 | 114 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
115 | 115 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
116 | 116 | fraction(dTokenAmount, exchangeRate, mantissa) | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(i) | |
121 | 121 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
122 | 122 | then { | |
123 | 123 | let userTokenAmount = calcDTokenAmount(i.payments[0].amount) | |
124 | 124 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
125 | 125 | if (isCollateral) | |
126 | 126 | then { | |
127 | 127 | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
128 | 128 | $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")) | |
129 | 129 | } | |
130 | 130 | 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) | |
131 | 131 | } | |
132 | 132 | else throw("Address does not match with wavetroller address!") | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | 136 | @Callable(i) | |
137 | 137 | func withdraw (user) = if (isWavetroller(i.caller)) | |
138 | 138 | then { | |
139 | 139 | 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!") | |
148 | 144 | } | |
149 | 145 | else throw("Address does not match with wavetroller address!") | |
150 | 146 | ||
151 | 147 | ||
152 | 148 | ||
153 | 149 | @Callable(i) | |
154 | 150 | func setup (aId,configAdd,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress")))) | |
155 | 151 | then { | |
156 | 152 | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
157 | 153 | let tokenId = calculateAssetId(asset) | |
158 | 154 | [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)] | |
159 | 155 | } | |
160 | 156 | else throw("Pool already setup!") | |
161 | 157 | ||
162 | 158 | ||
163 | 159 | ||
164 | 160 | @Callable(i) | |
165 | 161 | func deletEntry (key) = if (isAdminAddress(i.caller)) | |
166 | 162 | then [DeleteEntry(key)] | |
167 | 163 | else throw("Caller is not an admin!") | |
168 | 164 | ||
169 | 165 | ||
170 | 166 | @Verifier(tx) | |
171 | 167 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
172 | 168 |
github/deemru/w8io/026f985 40.28 ms ◑