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/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAphc3NldElkU3ViCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAA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AAA5kVG9rZW5EZWNpbWFscwAAAAAAAAAACAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMZFRva2VuU3VwcGx5AAAAAAAAAAAABQAAAANuaWwJAAACAAAAAQIAAAATUG9vbCBhbHJlYWR5IHNldHVwIQAAAAFpAQAAABF3cml0ZUludGVnZXJFbnRyeQAAAAIAAAADa2V5AAAABWVudHJ5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAANrZXkFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAAXQ2FsbGVyIGlzIG5vdCBhbiBhZG1pbiEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleaiJuQw=", "height": 1687248, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5iAVKj56dUnqCGbofVFBKpPip5tSFBM6zMgZgN1ZsZv9 Next: 35be9FbRqrz9KCkjbGSAYMwi1UxRwJ6a3FF72WKjueqU Diff:
Old | New | Differences | |
---|---|---|---|
172 | 172 | else throw("Pool already setup!") | |
173 | 173 | ||
174 | 174 | ||
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 | + | ||
175 | 182 | @Verifier(tx) | |
176 | 183 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
177 | 184 |
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 baseExchangeRate = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found") | |
29 | 29 | ||
30 | 30 | let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found")) | |
31 | 31 | ||
32 | 32 | let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
33 | 33 | ||
34 | 34 | let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0) | |
35 | 35 | ||
36 | 36 | let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0) | |
37 | 37 | ||
38 | 38 | let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
39 | 39 | ||
40 | 40 | let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
41 | 41 | ||
42 | 42 | let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
43 | 43 | ||
44 | 44 | let dTokenName = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found") | |
45 | 45 | ||
46 | 46 | let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height) | |
47 | 47 | ||
48 | 48 | let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000) | |
49 | 49 | ||
50 | 50 | func isAdminAddress (address) = if ((addressFromStringValue(admin) == address)) | |
51 | 51 | then true | |
52 | 52 | else false | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address)) | |
56 | 56 | then true | |
57 | 57 | else false | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub)) | |
61 | 61 | then true | |
62 | 62 | else false | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let utilization = if ((totalSupply > 0)) | |
75 | 75 | then fraction(totalBorrow, baseFactor, totalSupply) | |
76 | 76 | else 0 | |
77 | 77 | ||
78 | 78 | let apr = { | |
79 | 79 | let minValue = [utilization, kink] | |
80 | 80 | let minValueItem = min(minValue) | |
81 | 81 | let maxValue = [0, (utilization - kink)] | |
82 | 82 | let maxValueItem = max(maxValue) | |
83 | 83 | ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate) | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor) | |
87 | 87 | ||
88 | 88 | let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor)) | |
89 | 89 | ||
90 | 90 | let deltaBlocks = (height - storedHeight) | |
91 | 91 | ||
92 | 92 | let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING) | |
93 | 93 | ||
94 | 94 | let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex) | |
95 | 95 | ||
96 | 96 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
97 | 97 | ||
98 | 98 | let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
99 | 99 | ||
100 | 100 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
101 | 101 | ||
102 | 102 | let exchangeRate = if ((dTokenSupply > 0)) | |
103 | 103 | then { | |
104 | 104 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
105 | 105 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
106 | 106 | fraction(currentTotalSupply, mantissa, dTokenSupply) | |
107 | 107 | } | |
108 | 108 | else baseExchangeRate | |
109 | 109 | ||
110 | 110 | func calcDTokenAmount (assetAmount) = { | |
111 | 111 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
112 | 112 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
113 | 113 | fraction(assetAmount, mantissa, exchangeRate) | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func calcAssetAmount (dTokenAmount) = { | |
118 | 118 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
119 | 119 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
120 | 120 | fraction(dTokenAmount, exchangeRate, mantissa) | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | @Callable(i) | |
125 | 125 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
126 | 126 | then { | |
127 | 127 | let userTokenAmount = calcDTokenAmount(i.payments[0].amount) | |
128 | 128 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
129 | 129 | if (isCollateral) | |
130 | 130 | then { | |
131 | 131 | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
132 | 132 | $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")) | |
133 | 133 | } | |
134 | 134 | 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) | |
135 | 135 | } | |
136 | 136 | else throw("Address does not match with wavetroller address!") | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | 140 | @Callable(i) | |
141 | 141 | func withdraw (user) = if (isWavetroller(i.caller)) | |
142 | 142 | then { | |
143 | 143 | let availableLiquidity = (currentTotalSupply - currentTotalBorrow) | |
144 | 144 | let requestedAssetAmount = calcAssetAmount(i.payments[0].amount) | |
145 | 145 | if ((availableLiquidity >= requestedAssetAmount)) | |
146 | 146 | 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")) | |
147 | 147 | then ScriptTransfer(i.caller, requestedAssetAmount, unit) | |
148 | 148 | else ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount) | |
149 | 149 | else throw("Pool liquidity is not sufficient!") | |
150 | 150 | } | |
151 | 151 | else throw("Address does not match with wavetroller address!") | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | ||
155 | 155 | @Callable(i) | |
156 | 156 | func lockAsCollateral (user) = if (isWavetroller(i.caller)) | |
157 | 157 | then { | |
158 | 158 | let newLockedBalance = (userlockedBalance(user) + i.payments[0].amount) | |
159 | 159 | $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")) | |
160 | 160 | } | |
161 | 161 | else throw("Address does not match with wavetroller address!") | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | @Callable(i) | |
166 | 166 | func setup (aId,configAdd,baseExchangeRate,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress")))) | |
167 | 167 | then { | |
168 | 168 | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
169 | 169 | let tokenId = calculateAssetId(asset) | |
170 | 170 | [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)] | |
171 | 171 | } | |
172 | 172 | else throw("Pool already setup!") | |
173 | 173 | ||
174 | 174 | ||
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 | + | ||
175 | 182 | @Verifier(tx) | |
176 | 183 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
177 | 184 |
github/deemru/w8io/026f985 38.54 ms ◑