tx · BRtswwF8yTWd1ggCvDoanT9mNh1mvGsNkJNK3fr6L1Wq 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo: -0.04000000 Waves 2021.09.05 20:13 [1690041] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves
{ "type": 13, "id": "BRtswwF8yTWd1ggCvDoanT9mNh1mvGsNkJNK3fr6L1Wq", "fee": 4000000, "feeAssetId": null, "timestamp": 1630861997545, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "5bYQhUJWgWwBWzDJC6QMLwioqJRLMCpA87BjdDgsz6SF1WTBtSTYrPAtX3D2sAnqsiVpoqdgW31akXgw6DoVzRnJ" ], "script": "base64:AAIFAAAAAAAAADMIAhIDCgEIEgUKAwgIARIECgIIGBIDCgEIEgMKAQgSBAoCCAQSAwoBCBIDCgEIEgMKAQgAAAAMAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABmNvbmZpZwIAAAAAAAAAAAVhZG1pbgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAVwb29scwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAFcG9vbHMCAAAAAAEAAAAHaXNBZG1pbgAAAAEAAAANY2FsbGVyQWRkcmVzcwMJAAAAAAAAAgUAAAANY2FsbGVyQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAA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gUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAF0BQAAAAckbWF0Y2gwBQAAAANuaWwJAAACAAAAAQIAAAAYSW5jb3JyZWN0IGludm9rZSByZXN1bHQhCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAABRObyBwYXltZW50IGF0dGFjaGVkIQkAAAIAAAABAgAAABdBc3NldElkcyBkb2VzIG5vdCBtYXRjaAkAAAIAAAABAgAAABdQb29sIGFkZHJlc3Mgbm90IGZvdW5kIQAAAAFpAQAAAApkZWxldGVEYXRhAAAAAQAAAARuYW1lCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABG5hbWUFAAAAA25pbAAAAAAx52F2", "height": 1690041, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FiGwZg5tEJAyQc7f5pKaVSUUqPGLwSFFHLshGDA59anM Next: 3j4sC8PjvcAqGKV9Znf6DEYrnNUiqTKC1sHnkfizoPcN Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | case t: (Int, Int) => | |
40 | 40 | t | |
41 | 41 | case _ => | |
42 | - | throw(" | |
42 | + | throw("Return value has the wrong data type") | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | ||
60 | 60 | } | |
61 | 61 | } | |
62 | 62 | ||
63 | - | let $ | |
64 | - | let $ | |
65 | - | let $ | |
66 | - | if (($ | |
67 | - | then $ | |
63 | + | let $list23122346 = poolList | |
64 | + | let $size23122346 = size($list23122346) | |
65 | + | let $acc023122346 = $Tuple2(0, 0) | |
66 | + | if (($size23122346 == 0)) | |
67 | + | then $acc023122346 | |
68 | 68 | else { | |
69 | - | let $ | |
70 | - | if (($ | |
71 | - | then $ | |
69 | + | let $acc123122346 = foldPools($acc023122346, $list23122346[0]) | |
70 | + | if (($size23122346 == 1)) | |
71 | + | then $acc123122346 | |
72 | 72 | else { | |
73 | - | let $ | |
74 | - | if (($ | |
75 | - | then $ | |
73 | + | let $acc223122346 = foldPools($acc123122346, $list23122346[1]) | |
74 | + | if (($size23122346 == 2)) | |
75 | + | then $acc223122346 | |
76 | 76 | else { | |
77 | - | let $ | |
77 | + | let $acc323122346 = foldPools($acc223122346, $list23122346[2]) | |
78 | 78 | throw("List size exceed 2") | |
79 | 79 | } | |
80 | 80 | } | |
89 | 89 | then true | |
90 | 90 | else false | |
91 | 91 | } | |
92 | + | ||
93 | + | ||
94 | + | @Callable(i) | |
95 | + | func repayTo (poolAddress) = if (checkPool(poolAddress)) | |
96 | + | then { | |
97 | + | let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId") | |
98 | + | if ((fromBase58String(poolAsset) == i.payments[0].assetId)) | |
99 | + | then if ((size(i.payments) > 0)) | |
100 | + | then { | |
101 | + | let user = toBase58String(i.caller.bytes) | |
102 | + | let msg = invoke(addressFromStringValue(poolAddress), "repay", [user], i.payments) | |
103 | + | if ((msg == msg)) | |
104 | + | then match msg { | |
105 | + | case t: String => | |
106 | + | nil | |
107 | + | case _ => | |
108 | + | throw("Incorrect invoke result!") | |
109 | + | } | |
110 | + | else throw("Strict value is not equal to itself.") | |
111 | + | } | |
112 | + | else throw("No payment attached!") | |
113 | + | else throw("AssetIds does not match") | |
114 | + | } | |
115 | + | else throw("Pool address not found!") | |
116 | + | ||
92 | 117 | ||
93 | 118 | ||
94 | 119 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let config = valueOrElse(getStringValue(this, "config"), "") | |
5 | 5 | ||
6 | 6 | let admin = valueOrElse(getStringValue(addressFromStringValue(config), "admin"), "") | |
7 | 7 | ||
8 | 8 | let pools = valueOrElse(getStringValue(this, "pools"), "") | |
9 | 9 | ||
10 | 10 | func isAdmin (callerAddress) = if ((callerAddress == addressFromStringValue(admin))) | |
11 | 11 | then true | |
12 | 12 | else false | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func checkPool (poolAdd) = if (contains(pools, poolAdd)) | |
16 | 16 | then true | |
17 | 17 | else false | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func checkPoolLiquidity (poolAddress,amount) = { | |
27 | 27 | let totalSupply = getIntegerValue(addressFromStringValue(poolAddress), "totalSupply") | |
28 | 28 | let totalBorrow = getIntegerValue(addressFromStringValue(poolAddress), "totalBorrow") | |
29 | 29 | let availableLiquidity = (totalSupply - totalBorrow) | |
30 | 30 | if ((availableLiquidity >= amount)) | |
31 | 31 | then true | |
32 | 32 | else false | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getHealthParameter (user,poolAddress,newDebtAmount,newDebtId,collateralAmount,collateralId) = { | |
37 | 37 | let result = invoke(addressFromStringValue(poolAddress), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil) | |
38 | 38 | match result { | |
39 | 39 | case t: (Int, Int) => | |
40 | 40 | t | |
41 | 41 | case _ => | |
42 | - | throw(" | |
42 | + | throw("Return value has the wrong data type") | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func calcHealthFactor (borrowCapacity,borrowCapacityUsed) = fraction((borrowCapacity - borrowCapacityUsed), 1000, borrowCapacity) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func calcBorrowCBorrowCU (user,newDebtAmount,newDebtId,collateralAmount,collateralId) = { | |
51 | 51 | let poolList = split(pools, ";") | |
52 | 52 | let listSize = size(poolList) | |
53 | 53 | func foldPools (accum,next) = { | |
54 | 54 | let healthParams = getHealthParameter(user, next, newDebtAmount, newDebtId, collateralAmount, collateralId) | |
55 | 55 | match healthParams { | |
56 | 56 | case t: (Int, Int) => | |
57 | 57 | $Tuple2((accum._1 + healthParams._1), (accum._2 + healthParams._1)) | |
58 | 58 | case e => | |
59 | 59 | throw("Test") | |
60 | 60 | } | |
61 | 61 | } | |
62 | 62 | ||
63 | - | let $ | |
64 | - | let $ | |
65 | - | let $ | |
66 | - | if (($ | |
67 | - | then $ | |
63 | + | let $list23122346 = poolList | |
64 | + | let $size23122346 = size($list23122346) | |
65 | + | let $acc023122346 = $Tuple2(0, 0) | |
66 | + | if (($size23122346 == 0)) | |
67 | + | then $acc023122346 | |
68 | 68 | else { | |
69 | - | let $ | |
70 | - | if (($ | |
71 | - | then $ | |
69 | + | let $acc123122346 = foldPools($acc023122346, $list23122346[0]) | |
70 | + | if (($size23122346 == 1)) | |
71 | + | then $acc123122346 | |
72 | 72 | else { | |
73 | - | let $ | |
74 | - | if (($ | |
75 | - | then $ | |
73 | + | let $acc223122346 = foldPools($acc123122346, $list23122346[1]) | |
74 | + | if (($size23122346 == 2)) | |
75 | + | then $acc223122346 | |
76 | 76 | else { | |
77 | - | let $ | |
77 | + | let $acc323122346 = foldPools($acc223122346, $list23122346[2]) | |
78 | 78 | throw("List size exceed 2") | |
79 | 79 | } | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func checkUserHealth (user,newDebtAmount,newDebtId,collateralAmount,collateralId) = { | |
86 | 86 | let bcBcu = calcBorrowCBorrowCU(user, newDebtAmount, newDebtId, collateralAmount, collateralId) | |
87 | 87 | let userHealth = calcHealthFactor(bcBcu._1, bcBcu._2) | |
88 | 88 | if ((userHealth >= 0)) | |
89 | 89 | then true | |
90 | 90 | else false | |
91 | 91 | } | |
92 | + | ||
93 | + | ||
94 | + | @Callable(i) | |
95 | + | func repayTo (poolAddress) = if (checkPool(poolAddress)) | |
96 | + | then { | |
97 | + | let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId") | |
98 | + | if ((fromBase58String(poolAsset) == i.payments[0].assetId)) | |
99 | + | then if ((size(i.payments) > 0)) | |
100 | + | then { | |
101 | + | let user = toBase58String(i.caller.bytes) | |
102 | + | let msg = invoke(addressFromStringValue(poolAddress), "repay", [user], i.payments) | |
103 | + | if ((msg == msg)) | |
104 | + | then match msg { | |
105 | + | case t: String => | |
106 | + | nil | |
107 | + | case _ => | |
108 | + | throw("Incorrect invoke result!") | |
109 | + | } | |
110 | + | else throw("Strict value is not equal to itself.") | |
111 | + | } | |
112 | + | else throw("No payment attached!") | |
113 | + | else throw("AssetIds does not match") | |
114 | + | } | |
115 | + | else throw("Pool address not found!") | |
116 | + | ||
92 | 117 | ||
93 | 118 | ||
94 | 119 | @Callable(i) | |
95 | 120 | func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress)) | |
96 | 121 | then { | |
97 | 122 | let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId") | |
98 | 123 | if ((poolAsset == assetId)) | |
99 | 124 | then if (checkPoolLiquidity(poolAddress, amount)) | |
100 | 125 | then { | |
101 | 126 | let user = toBase58String(i.caller.bytes) | |
102 | 127 | if (checkUserHealth(user, amount, assetId, 0, "")) | |
103 | 128 | then { | |
104 | 129 | let tokenAmount = invoke(addressFromStringValue(poolAddress), "borrow", [user, amount], nil) | |
105 | 130 | if ((tokenAmount == tokenAmount)) | |
106 | 131 | then match tokenAmount { | |
107 | 132 | case t: Int => | |
108 | 133 | if ((poolAsset == "WAVES")) | |
109 | 134 | then [ScriptTransfer(i.caller, t, unit)] | |
110 | 135 | else [ScriptTransfer(i.caller, t, fromBase58String(poolAsset))] | |
111 | 136 | case t: String => | |
112 | 137 | nil | |
113 | 138 | case _ => | |
114 | 139 | throw("Incorrect invoke result!") | |
115 | 140 | } | |
116 | 141 | else throw("Strict value is not equal to itself.") | |
117 | 142 | } | |
118 | 143 | else throw("Borrow exceeds user health!") | |
119 | 144 | } | |
120 | 145 | else throw("Pool liquidity is not sufficient!") | |
121 | 146 | else throw("AssetIds does not match") | |
122 | 147 | } | |
123 | 148 | else throw("Pool address not found!") | |
124 | 149 | ||
125 | 150 | ||
126 | 151 | ||
127 | 152 | @Callable(i) | |
128 | 153 | func setup (configAddress,pools) = if (if (!(isDefined(getString(this, "config")))) | |
129 | 154 | then !(isDefined(getString(this, "pools"))) | |
130 | 155 | else false) | |
131 | 156 | then [writeString("config", configAddress), writeString("pools", makeString(pools, ";"))] | |
132 | 157 | else throw("Admin and config address already definied!") | |
133 | 158 | ||
134 | 159 | ||
135 | 160 | ||
136 | 161 | @Callable(i) | |
137 | 162 | func addPool (poolAddress) = if (isAdmin(i.caller)) | |
138 | 163 | then { | |
139 | 164 | let poolList = split(pools, ";") | |
140 | 165 | if ((containsElement(poolList, poolAddress) == false)) | |
141 | 166 | then { | |
142 | 167 | let newPools = (poolList :+ poolAddress) | |
143 | 168 | [writeString("pools", makeString(newPools, ";"))] | |
144 | 169 | } | |
145 | 170 | else throw("Pool already exists!") | |
146 | 171 | } | |
147 | 172 | else throw("Address does not match with admin address!") | |
148 | 173 | ||
149 | 174 | ||
150 | 175 | ||
151 | 176 | @Callable(i) | |
152 | 177 | func updateConfig (configAddress) = if (isAdmin(i.caller)) | |
153 | 178 | then [writeString("config", configAddress)] | |
154 | 179 | else throw("Address does not match with admin address!") | |
155 | 180 | ||
156 | 181 | ||
157 | 182 | ||
158 | 183 | @Callable(i) | |
159 | 184 | func depositAt (poolAddress,isCollateral) = if (checkPool(poolAddress)) | |
160 | 185 | then if ((size(i.payments) > 0)) | |
161 | 186 | then { | |
162 | 187 | let user = toBase58String(i.caller.bytes) | |
163 | 188 | let tokenAmount = invoke(addressFromStringValue(poolAddress), "deposit", [user, isCollateral], i.payments) | |
164 | 189 | if ((tokenAmount == tokenAmount)) | |
165 | 190 | then { | |
166 | 191 | let tokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId") | |
167 | 192 | match tokenAmount { | |
168 | 193 | case t: Int => | |
169 | 194 | [ScriptTransfer(i.caller, t, fromBase58String(tokenId))] | |
170 | 195 | case t: String => | |
171 | 196 | nil | |
172 | 197 | case _ => | |
173 | 198 | throw("Incorrect invoke result!") | |
174 | 199 | } | |
175 | 200 | } | |
176 | 201 | else throw("Strict value is not equal to itself.") | |
177 | 202 | } | |
178 | 203 | else throw("No payment attached!") | |
179 | 204 | else throw("Pool address not found!") | |
180 | 205 | ||
181 | 206 | ||
182 | 207 | ||
183 | 208 | @Callable(i) | |
184 | 209 | func withdrawFrom (poolAddress) = if (checkPool(poolAddress)) | |
185 | 210 | then { | |
186 | 211 | let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId") | |
187 | 212 | if ((fromBase58String(dTokenId) == i.payments[0].assetId)) | |
188 | 213 | then if ((size(i.payments) > 0)) | |
189 | 214 | then { | |
190 | 215 | let user = toBase58String(i.caller.bytes) | |
191 | 216 | let tokenAmount = invoke(addressFromStringValue(poolAddress), "withdraw", [user], i.payments) | |
192 | 217 | if ((tokenAmount == tokenAmount)) | |
193 | 218 | then { | |
194 | 219 | let tokenId = getStringValue(addressFromStringValue(poolAddress), "assetId") | |
195 | 220 | match tokenAmount { | |
196 | 221 | case t: Int => | |
197 | 222 | if ((tokenId == "WAVES")) | |
198 | 223 | then [ScriptTransfer(i.caller, t, unit)] | |
199 | 224 | else [ScriptTransfer(i.caller, t, fromBase58String(tokenId))] | |
200 | 225 | case t: String => | |
201 | 226 | nil | |
202 | 227 | case _ => | |
203 | 228 | throw("Incorrect invoke result!") | |
204 | 229 | } | |
205 | 230 | } | |
206 | 231 | else throw("Strict value is not equal to itself.") | |
207 | 232 | } | |
208 | 233 | else throw("No payment attached!") | |
209 | 234 | else throw("AssetIds does not match") | |
210 | 235 | } | |
211 | 236 | else throw("Pool address not found!") | |
212 | 237 | ||
213 | 238 | ||
214 | 239 | ||
215 | 240 | @Callable(i) | |
216 | 241 | func lockAsCollateralAt (poolAddress) = if (checkPool(poolAddress)) | |
217 | 242 | then { | |
218 | 243 | let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId") | |
219 | 244 | if ((fromBase58String(dTokenId) == i.payments[0].assetId)) | |
220 | 245 | then if ((size(i.payments) > 0)) | |
221 | 246 | then { | |
222 | 247 | let user = toBase58String(i.caller.bytes) | |
223 | 248 | let msg = invoke(addressFromStringValue(poolAddress), "lockAsCollateral", [user], i.payments) | |
224 | 249 | if ((msg == msg)) | |
225 | 250 | then match msg { | |
226 | 251 | case t: String => | |
227 | 252 | nil | |
228 | 253 | case _ => | |
229 | 254 | throw("Incorrect invoke result!") | |
230 | 255 | } | |
231 | 256 | else throw("Strict value is not equal to itself.") | |
232 | 257 | } | |
233 | 258 | else throw("No payment attached!") | |
234 | 259 | else throw("AssetIds does not match") | |
235 | 260 | } | |
236 | 261 | else throw("Pool address not found!") | |
237 | 262 | ||
238 | 263 | ||
239 | 264 | ||
240 | 265 | @Callable(i) | |
241 | 266 | func deleteData (name) = [DeleteEntry(name)] | |
242 | 267 | ||
243 | 268 |
github/deemru/w8io/026f985 69.96 ms ◑