tx · 5TmJ2Pvb3wS4uU1iG5s531vznwJMfu8CYGRbpKKxP34E

3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo:  -0.04000000 Waves

2021.09.05 01:45 [1688918] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves

{ "type": 13, "id": "5TmJ2Pvb3wS4uU1iG5s531vznwJMfu8CYGRbpKKxP34E", "fee": 4000000, "feeAssetId": null, "timestamp": 1630795547349, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "3tAqGm4SKbxjsNENTH42mGG3w5QDA9BBDvNVzRJLSBCo4RAw1Y1VQGXZhedXChgekftzM2CKRGFd5R13hnV7hxwr" ], "script": "base64:AAIFAAAAAAAAACkIAhIFCgMICAESBAoCCBgSAwoBCBIDCgEIEgQKAggEEgMKAQgSAwoBCAAAAAwAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAGY29uZmlnAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAABWFkbWluAgAAAAAAAAAABXBvb2xzCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAVwb29scwIAAAAAAQAAAAdpc0FkbWluAAAAAQAAAA1jYWxsZXJBZGRyZXNzAwkAAAAAAAACBQAAAA1jYWxsZXJBZGRyZXNzCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAVhZG1pbgYHAQAAAAljaGVja1Bvb2wAAAABAAAA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AAQAAAAEdXNlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAANtc2cJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAALcG9vbEFkZHJlc3MCAAAAEGxvY2tBc0NvbGxhdGVyYWwJAARMAAAAAgUAAAAEdXNlcgUAAAADbmlsCAUAAAABaQAAAAhwYXltZW50cwMJAAAAAAAAAgUAAAADbXNnBQAAAANtc2cEAAAAByRtYXRjaDAFAAAAA21zZwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAF0BQAAAAckbWF0Y2gwBQAAAANuaWwJAAACAAAAAQIAAAAYSW5jb3JyZWN0IGludm9rZSByZXN1bHQhCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAABRObyBwYXltZW50IGF0dGFjaGVkIQkAAAIAAAABAgAAABdBc3NldElkcyBkb2VzIG5vdCBtYXRjaAkAAAIAAAABAgAAABdQb29sIGFkZHJlc3Mgbm90IGZvdW5kIQAAAAC2MEeN", "height": 1688918, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DCKGNAwRjGUSt2oyuhKPQrkAcemx85YkmidsrKxPvwPs Next: 7hfGBaXRL47icNMrYuQPK7pFHxRHHQKCHfviXGajDL9U Diff:
OldNewDifferences
3434
3535
3636 func getHealthParameter (user,poolAddress,newDebtAmount,newDebtId,collateralAmount,collateralId) = {
37- let result = invoke(addressFromStringValue(poolAddress), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil)
37+ let result = invoke(addressFromStringValue("3NBG2Nuz2cjtG8wWcKLBGZ1bBpveU56gp77"), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil)
3838 match result {
3939 case t: (Int, Int) =>
4040 t
6060 }
6161 }
6262
63- let $list22902324 = poolList
64- let $size22902324 = size($list22902324)
65- let $acc022902324 = $Tuple2(0, 0)
66- if (($size22902324 == 0))
67- then $acc022902324
63+ let $list24662500 = poolList
64+ let $size24662500 = size($list24662500)
65+ let $acc024662500 = $Tuple2(0, 0)
66+ if (($size24662500 == 0))
67+ then $acc024662500
6868 else {
69- let $acc122902324 = foldPools($acc022902324, $list22902324[0])
70- if (($size22902324 == 1))
71- then $acc122902324
69+ let $acc124662500 = foldPools($acc024662500, $list24662500[0])
70+ if (($size24662500 == 1))
71+ then $acc124662500
7272 else {
73- let $acc222902324 = foldPools($acc122902324, $list22902324[1])
74- if (($size22902324 == 2))
75- then $acc222902324
73+ let $acc224662500 = foldPools($acc124662500, $list24662500[1])
74+ if (($size24662500 == 2))
75+ then $acc224662500
7676 else {
77- let $acc322902324 = foldPools($acc222902324, $list22902324[2])
77+ let $acc324662500 = foldPools($acc224662500, $list24662500[2])
7878 throw("List size exceed 2")
7979 }
8080 }
8989 then true
9090 else false
9191 }
92+
93+
94+@Callable(i)
95+func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress))
96+ then {
97+ let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
98+ if ((poolAsset == assetId))
99+ then if (checkPoolLiquidity(poolAddress, amount))
100+ then {
101+ let user = toBase58String(i.caller.bytes)
102+ if (checkUserHealth(user, amount, assetId, 0, ""))
103+ then nil
104+ else throw("Borrow exceeds user health!")
105+ }
106+ else throw("Pool liquidity is not sufficient!")
107+ else throw("AssetIds does not match")
108+ }
109+ else throw("Pool address not found!")
110+
92111
93112
94113 @Callable(i)
203222 else throw("Pool address not found!")
204223
205224
206-
207-@Callable(i)
208-func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress))
209- then {
210- let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
211- if ((poolAsset == assetId))
212- then if (checkPoolLiquidity(poolAddress, amount))
213- then {
214- let user = toBase58String(i.caller.bytes)
215- if (checkUserHealth(user, amount, assetId, 0, ""))
216- then nil
217- else throw("Borrow exceeds user health!")
218- }
219- else throw("Pool liquidity is not sufficient!")
220- else throw("AssetIds does not match")
221- }
222- else throw("Pool address not found!")
223-
224-
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) = {
37- let result = invoke(addressFromStringValue(poolAddress), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil)
37+ let result = invoke(addressFromStringValue("3NBG2Nuz2cjtG8wWcKLBGZ1bBpveU56gp77"), "getUserHealthParameter", [user, collateralAmount, collateralId, newDebtAmount, newDebtId], nil)
3838 match result {
3939 case t: (Int, Int) =>
4040 t
4141 case _ =>
4242 throw("Wrong Datatyp!")
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
63- let $list22902324 = poolList
64- let $size22902324 = size($list22902324)
65- let $acc022902324 = $Tuple2(0, 0)
66- if (($size22902324 == 0))
67- then $acc022902324
63+ let $list24662500 = poolList
64+ let $size24662500 = size($list24662500)
65+ let $acc024662500 = $Tuple2(0, 0)
66+ if (($size24662500 == 0))
67+ then $acc024662500
6868 else {
69- let $acc122902324 = foldPools($acc022902324, $list22902324[0])
70- if (($size22902324 == 1))
71- then $acc122902324
69+ let $acc124662500 = foldPools($acc024662500, $list24662500[0])
70+ if (($size24662500 == 1))
71+ then $acc124662500
7272 else {
73- let $acc222902324 = foldPools($acc122902324, $list22902324[1])
74- if (($size22902324 == 2))
75- then $acc222902324
73+ let $acc224662500 = foldPools($acc124662500, $list24662500[1])
74+ if (($size24662500 == 2))
75+ then $acc224662500
7676 else {
77- let $acc322902324 = foldPools($acc222902324, $list22902324[2])
77+ let $acc324662500 = foldPools($acc224662500, $list24662500[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 }
92+
93+
94+@Callable(i)
95+func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress))
96+ then {
97+ let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
98+ if ((poolAsset == assetId))
99+ then if (checkPoolLiquidity(poolAddress, amount))
100+ then {
101+ let user = toBase58String(i.caller.bytes)
102+ if (checkUserHealth(user, amount, assetId, 0, ""))
103+ then nil
104+ else throw("Borrow exceeds user health!")
105+ }
106+ else throw("Pool liquidity is not sufficient!")
107+ else throw("AssetIds does not match")
108+ }
109+ else throw("Pool address not found!")
110+
92111
93112
94113 @Callable(i)
95114 func setup (configAddress,pools) = if (if (!(isDefined(getString(this, "config"))))
96115 then !(isDefined(getString(this, "pools")))
97116 else false)
98117 then [writeString("config", configAddress), writeString("pools", makeString(pools, ";"))]
99118 else throw("Admin and config address already definied!")
100119
101120
102121
103122 @Callable(i)
104123 func addPool (poolAddress) = if (isAdmin(i.caller))
105124 then {
106125 let poolList = split(pools, ";")
107126 if ((containsElement(poolList, poolAddress) == false))
108127 then {
109128 let newPools = (poolList :+ poolAddress)
110129 [writeString("pools", makeString(newPools, ";"))]
111130 }
112131 else throw("Pool already exists!")
113132 }
114133 else throw("Address does not match with admin address!")
115134
116135
117136
118137 @Callable(i)
119138 func updateConfig (configAddress) = if (isAdmin(i.caller))
120139 then [writeString("config", configAddress)]
121140 else throw("Address does not match with admin address!")
122141
123142
124143
125144 @Callable(i)
126145 func depositAt (poolAddress,isCollateral) = if (checkPool(poolAddress))
127146 then if ((size(i.payments) > 0))
128147 then {
129148 let user = toBase58String(i.caller.bytes)
130149 let tokenAmount = invoke(addressFromStringValue(poolAddress), "deposit", [user, isCollateral], i.payments)
131150 if ((tokenAmount == tokenAmount))
132151 then {
133152 let tokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
134153 match tokenAmount {
135154 case t: Int =>
136155 [ScriptTransfer(i.caller, t, fromBase58String(tokenId))]
137156 case t: String =>
138157 nil
139158 case _ =>
140159 throw("Incorrect invoke result!")
141160 }
142161 }
143162 else throw("Strict value is not equal to itself.")
144163 }
145164 else throw("No payment attached!")
146165 else throw("Pool address not found!")
147166
148167
149168
150169 @Callable(i)
151170 func withdrawFrom (poolAddress) = if (checkPool(poolAddress))
152171 then {
153172 let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
154173 if ((fromBase58String(dTokenId) == i.payments[0].assetId))
155174 then if ((size(i.payments) > 0))
156175 then {
157176 let user = toBase58String(i.caller.bytes)
158177 let tokenAmount = invoke(addressFromStringValue(poolAddress), "withdraw", [user], i.payments)
159178 if ((tokenAmount == tokenAmount))
160179 then {
161180 let tokenId = getStringValue(addressFromStringValue(poolAddress), "assetId")
162181 match tokenAmount {
163182 case t: Int =>
164183 if ((tokenId == "WAVES"))
165184 then [ScriptTransfer(i.caller, t, unit)]
166185 else [ScriptTransfer(i.caller, t, fromBase58String(tokenId))]
167186 case t: String =>
168187 nil
169188 case _ =>
170189 throw("Incorrect invoke result!")
171190 }
172191 }
173192 else throw("Strict value is not equal to itself.")
174193 }
175194 else throw("No payment attached!")
176195 else throw("AssetIds does not match")
177196 }
178197 else throw("Pool address not found!")
179198
180199
181200
182201 @Callable(i)
183202 func lockAsCollateralAt (poolAddress) = if (checkPool(poolAddress))
184203 then {
185204 let dTokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
186205 if ((fromBase58String(dTokenId) == i.payments[0].assetId))
187206 then if ((size(i.payments) > 0))
188207 then {
189208 let user = toBase58String(i.caller.bytes)
190209 let msg = invoke(addressFromStringValue(poolAddress), "lockAsCollateral", [user], i.payments)
191210 if ((msg == msg))
192211 then match msg {
193212 case t: String =>
194213 nil
195214 case _ =>
196215 throw("Incorrect invoke result!")
197216 }
198217 else throw("Strict value is not equal to itself.")
199218 }
200219 else throw("No payment attached!")
201220 else throw("AssetIds does not match")
202221 }
203222 else throw("Pool address not found!")
204223
205224
206-
207-@Callable(i)
208-func borrowFrom (poolAddress,assetId,amount) = if (checkPool(poolAddress))
209- then {
210- let poolAsset = getStringValue(addressFromStringValue(poolAddress), "assetId")
211- if ((poolAsset == assetId))
212- then if (checkPoolLiquidity(poolAddress, amount))
213- then {
214- let user = toBase58String(i.caller.bytes)
215- if (checkUserHealth(user, amount, assetId, 0, ""))
216- then nil
217- else throw("Borrow exceeds user health!")
218- }
219- else throw("Pool liquidity is not sufficient!")
220- else throw("AssetIds does not match")
221- }
222- else throw("Pool address not found!")
223-
224-

github/deemru/w8io/026f985 
35.47 ms