tx · 3j4sC8PjvcAqGKV9Znf6DEYrnNUiqTKC1sHnkfizoPcN

3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo:  -0.04000000 Waves

2021.09.05 20:25 [1690054] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves

{ "type": 13, "id": "3j4sC8PjvcAqGKV9Znf6DEYrnNUiqTKC1sHnkfizoPcN", "fee": 4000000, "feeAssetId": null, "timestamp": 1630862763766, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "2AfXQBGTa2FdfZcoSwNFTrHVAQESk4oKzqtZMSFT6VCD44S3dW8J5r6NoDHTSCgvxhWGu4FaZPotzTk7XhBD6Xso" ], "script": "base64:AAIFAAAAAAAAADMIAhIDCgEIEgUKAwgIARIECgIIGBIDCgEIEgMKAQgSBAoCCAQSAwoBCBIDCgEIEgMKAQgAAAAMAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABmNvbmZpZwIAAAAAAAAAAAVhZG1pbgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAVwb29scwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAFcG9vbHMCAAAAAAEAAAAHaXNBZG1pbgAAAAEAAAANY2FsbGVyQWRkcmVzcwMJAAAAAAAAAgUAAAANY2FsbGVyQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQU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AAAAAAAgkAAlkAAAABBQAAAAhkVG9rZW5JZAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAHYXNzZXRJZAMJAABmAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAEdXNlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAANtc2cJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAALcG9vbEFkZHJlc3MCAAAAEGxvY2tBc0NvbGxhdGVyYWwJAARMAAAAAgUAAAAEdXNlcgUAAAADbmlsCAUAAAABaQAAAAhwYXltZW50cwMJAAAAAAAAAgUAAAADbXNnBQAAAANtc2cEAAAAByRtYXRjaDAFAAAAA21zZwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAF0BQAAAAckbWF0Y2gwBQAAAANuaWwJAAACAAAAAQIAAAAYSW5jb3JyZWN0IGludm9rZSByZXN1bHQhCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAABRObyBwYXltZW50IGF0dGFjaGVkIQkAAAIAAAABAgAAABdBc3NldElkcyBkb2VzIG5vdCBtYXRjaAkAAAIAAAABAgAAABdQb29sIGFkZHJlc3Mgbm90IGZvdW5kIQAAAAFpAQAAAApkZWxldGVEYXRhAAAAAQAAAARuYW1lCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABG5hbWUFAAAAA25pbAAAAABvyFR7", "height": 1690054, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BRtswwF8yTWd1ggCvDoanT9mNh1mvGsNkJNK3fr6L1Wq Next: BXe4xkbsyqYZcukriWez3gfhvtJdyY4iHxkDNMthG8fe Diff:
OldNewDifferences
9999 then if ((size(i.payments) > 0))
100100 then {
101101 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- }
102+ let amount = invoke(addressFromStringValue(poolAddress), "repay", [user], i.payments)
103+ if ((amount == amount))
104+ then {
105+ let assetId = getStringValue(addressFromStringValue(poolAddress), "assetId")
106+ match amount {
107+ case t: Int =>
108+ if ((assetId == "WAVES"))
109+ then [ScriptTransfer(i.caller, t, unit)]
110+ else [ScriptTransfer(i.caller, t, fromBase58String(assetId))]
111+ case t: String =>
112+ nil
113+ case _ =>
114+ throw("Incorrect invoke result!")
115+ }
116+ }
110117 else throw("Strict value is not equal to itself.")
111118 }
112119 else throw("No payment attached!")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let config = valueOrElse(getStringValue(this, "config"), "")
55
66 let admin = valueOrElse(getStringValue(addressFromStringValue(config), "admin"), "")
77
88 let pools = valueOrElse(getStringValue(this, "pools"), "")
99
1010 func isAdmin (callerAddress) = if ((callerAddress == addressFromStringValue(admin)))
1111 then true
1212 else false
1313
1414
1515 func checkPool (poolAdd) = if (contains(pools, poolAdd))
1616 then true
1717 else false
1818
1919
2020 func writeString (key,stringValue) = StringEntry(key, stringValue)
2121
2222
2323 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
2424
2525
2626 func checkPoolLiquidity (poolAddress,amount) = {
2727 let totalSupply = getIntegerValue(addressFromStringValue(poolAddress), "totalSupply")
2828 let totalBorrow = getIntegerValue(addressFromStringValue(poolAddress), "totalBorrow")
2929 let availableLiquidity = (totalSupply - totalBorrow)
3030 if ((availableLiquidity >= amount))
3131 then true
3232 else false
3333 }
3434
3535
3636 func getHealthParameter (user,poolAddress,newDebtAmount,newDebtId,collateralAmount,collateralId) = {
3737 let result = invoke(addressFromStringValue(poolAddress), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil)
3838 match result {
3939 case t: (Int, Int) =>
4040 t
4141 case _ =>
4242 throw("Return value has the wrong data type")
4343 }
4444 }
4545
4646
4747 func calcHealthFactor (borrowCapacity,borrowCapacityUsed) = fraction((borrowCapacity - borrowCapacityUsed), 1000, borrowCapacity)
4848
4949
5050 func calcBorrowCBorrowCU (user,newDebtAmount,newDebtId,collateralAmount,collateralId) = {
5151 let poolList = split(pools, ";")
5252 let listSize = size(poolList)
5353 func foldPools (accum,next) = {
5454 let healthParams = getHealthParameter(user, next, newDebtAmount, newDebtId, collateralAmount, collateralId)
5555 match healthParams {
5656 case t: (Int, Int) =>
5757 $Tuple2((accum._1 + healthParams._1), (accum._2 + healthParams._1))
5858 case e =>
5959 throw("Test")
6060 }
6161 }
6262
6363 let $list23122346 = poolList
6464 let $size23122346 = size($list23122346)
6565 let $acc023122346 = $Tuple2(0, 0)
6666 if (($size23122346 == 0))
6767 then $acc023122346
6868 else {
6969 let $acc123122346 = foldPools($acc023122346, $list23122346[0])
7070 if (($size23122346 == 1))
7171 then $acc123122346
7272 else {
7373 let $acc223122346 = foldPools($acc123122346, $list23122346[1])
7474 if (($size23122346 == 2))
7575 then $acc223122346
7676 else {
7777 let $acc323122346 = foldPools($acc223122346, $list23122346[2])
7878 throw("List size exceed 2")
7979 }
8080 }
8181 }
8282 }
8383
8484
8585 func checkUserHealth (user,newDebtAmount,newDebtId,collateralAmount,collateralId) = {
8686 let bcBcu = calcBorrowCBorrowCU(user, newDebtAmount, newDebtId, collateralAmount, collateralId)
8787 let userHealth = calcHealthFactor(bcBcu._1, bcBcu._2)
8888 if ((userHealth >= 0))
8989 then true
9090 else false
9191 }
9292
9393
9494 @Callable(i)
9595 func repayTo (poolAddress) = if (checkPool(poolAddress))
9696 then {
9797 let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
9898 if ((fromBase58String(poolAsset) == i.payments[0].assetId))
9999 then if ((size(i.payments) > 0))
100100 then {
101101 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- }
102+ let amount = invoke(addressFromStringValue(poolAddress), "repay", [user], i.payments)
103+ if ((amount == amount))
104+ then {
105+ let assetId = getStringValue(addressFromStringValue(poolAddress), "assetId")
106+ match amount {
107+ case t: Int =>
108+ if ((assetId == "WAVES"))
109+ then [ScriptTransfer(i.caller, t, unit)]
110+ else [ScriptTransfer(i.caller, t, fromBase58String(assetId))]
111+ case t: String =>
112+ nil
113+ case _ =>
114+ throw("Incorrect invoke result!")
115+ }
116+ }
110117 else throw("Strict value is not equal to itself.")
111118 }
112119 else throw("No payment attached!")
113120 else throw("AssetIds does not match")
114121 }
115122 else throw("Pool address not found!")
116123
117124
118125
119126 @Callable(i)
120127 func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress))
121128 then {
122129 let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
123130 if ((poolAsset == assetId))
124131 then if (checkPoolLiquidity(poolAddress, amount))
125132 then {
126133 let user = toBase58String(i.caller.bytes)
127134 if (checkUserHealth(user, amount, assetId, 0, ""))
128135 then {
129136 let tokenAmount = invoke(addressFromStringValue(poolAddress), "borrow", [user, amount], nil)
130137 if ((tokenAmount == tokenAmount))
131138 then match tokenAmount {
132139 case t: Int =>
133140 if ((poolAsset == "WAVES"))
134141 then [ScriptTransfer(i.caller, t, unit)]
135142 else [ScriptTransfer(i.caller, t, fromBase58String(poolAsset))]
136143 case t: String =>
137144 nil
138145 case _ =>
139146 throw("Incorrect invoke result!")
140147 }
141148 else throw("Strict value is not equal to itself.")
142149 }
143150 else throw("Borrow exceeds user health!")
144151 }
145152 else throw("Pool liquidity is not sufficient!")
146153 else throw("AssetIds does not match")
147154 }
148155 else throw("Pool address not found!")
149156
150157
151158
152159 @Callable(i)
153160 func setup (configAddress,pools) = if (if (!(isDefined(getString(this, "config"))))
154161 then !(isDefined(getString(this, "pools")))
155162 else false)
156163 then [writeString("config", configAddress), writeString("pools", makeString(pools, ";"))]
157164 else throw("Admin and config address already definied!")
158165
159166
160167
161168 @Callable(i)
162169 func addPool (poolAddress) = if (isAdmin(i.caller))
163170 then {
164171 let poolList = split(pools, ";")
165172 if ((containsElement(poolList, poolAddress) == false))
166173 then {
167174 let newPools = (poolList :+ poolAddress)
168175 [writeString("pools", makeString(newPools, ";"))]
169176 }
170177 else throw("Pool already exists!")
171178 }
172179 else throw("Address does not match with admin address!")
173180
174181
175182
176183 @Callable(i)
177184 func updateConfig (configAddress) = if (isAdmin(i.caller))
178185 then [writeString("config", configAddress)]
179186 else throw("Address does not match with admin address!")
180187
181188
182189
183190 @Callable(i)
184191 func depositAt (poolAddress,isCollateral) = if (checkPool(poolAddress))
185192 then if ((size(i.payments) > 0))
186193 then {
187194 let user = toBase58String(i.caller.bytes)
188195 let tokenAmount = invoke(addressFromStringValue(poolAddress), "deposit", [user, isCollateral], i.payments)
189196 if ((tokenAmount == tokenAmount))
190197 then {
191198 let tokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
192199 match tokenAmount {
193200 case t: Int =>
194201 [ScriptTransfer(i.caller, t, fromBase58String(tokenId))]
195202 case t: String =>
196203 nil
197204 case _ =>
198205 throw("Incorrect invoke result!")
199206 }
200207 }
201208 else throw("Strict value is not equal to itself.")
202209 }
203210 else throw("No payment attached!")
204211 else throw("Pool address not found!")
205212
206213
207214
208215 @Callable(i)
209216 func withdrawFrom (poolAddress) = if (checkPool(poolAddress))
210217 then {
211218 let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
212219 if ((fromBase58String(dTokenId) == i.payments[0].assetId))
213220 then if ((size(i.payments) > 0))
214221 then {
215222 let user = toBase58String(i.caller.bytes)
216223 let tokenAmount = invoke(addressFromStringValue(poolAddress), "withdraw", [user], i.payments)
217224 if ((tokenAmount == tokenAmount))
218225 then {
219226 let tokenId = getStringValue(addressFromStringValue(poolAddress), "assetId")
220227 match tokenAmount {
221228 case t: Int =>
222229 if ((tokenId == "WAVES"))
223230 then [ScriptTransfer(i.caller, t, unit)]
224231 else [ScriptTransfer(i.caller, t, fromBase58String(tokenId))]
225232 case t: String =>
226233 nil
227234 case _ =>
228235 throw("Incorrect invoke result!")
229236 }
230237 }
231238 else throw("Strict value is not equal to itself.")
232239 }
233240 else throw("No payment attached!")
234241 else throw("AssetIds does not match")
235242 }
236243 else throw("Pool address not found!")
237244
238245
239246
240247 @Callable(i)
241248 func lockAsCollateralAt (poolAddress) = if (checkPool(poolAddress))
242249 then {
243250 let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
244251 if ((fromBase58String(dTokenId) == i.payments[0].assetId))
245252 then if ((size(i.payments) > 0))
246253 then {
247254 let user = toBase58String(i.caller.bytes)
248255 let msg = invoke(addressFromStringValue(poolAddress), "lockAsCollateral", [user], i.payments)
249256 if ((msg == msg))
250257 then match msg {
251258 case t: String =>
252259 nil
253260 case _ =>
254261 throw("Incorrect invoke result!")
255262 }
256263 else throw("Strict value is not equal to itself.")
257264 }
258265 else throw("No payment attached!")
259266 else throw("AssetIds does not match")
260267 }
261268 else throw("Pool address not found!")
262269
263270
264271
265272 @Callable(i)
266273 func deleteData (name) = [DeleteEntry(name)]
267274
268275

github/deemru/w8io/026f985 
36.04 ms