tx · GM1FVExrPjNA5bS8USvRpBb7zYLggZyP61dQ6UzFzpDY

3P3qCUfvbDUjRnjrfM5XFMrXrzxxiad94Ez:  -0.01000000 Waves

2023.02.11 15:51 [3510563] smart account 3P3qCUfvbDUjRnjrfM5XFMrXrzxxiad94Ez > SELF 0.00000000 Waves

{ "type": 13, "id": "GM1FVExrPjNA5bS8USvRpBb7zYLggZyP61dQ6UzFzpDY", "fee": 1000000, "feeAssetId": null, "timestamp": 1676119914599, "version": 2, "chainId": 87, "sender": "3P3qCUfvbDUjRnjrfM5XFMrXrzxxiad94Ez", "senderPublicKey": "3zaQerEjh4SK1xhin9zzs5qr337aLRFhz7z1ckjFGhMz", "proofs": [ "2UcRBCMoswybD26NSXvSwfoiknqkFY4WvZzo7qATLxcwS9FspGaK8GQX98USnRb6avS8PXgDKhxUdNjGLvRnpWET" ], "script": "base64:BgKoBwgCEgMKAQESAwoBCCIOZnJlZV90b19ib3Jyb20iDVVTRE5fQVNTRVRfSUQiBGJvc3MiDmFkbWluUHVibGljS2V5IglnZXRQdXRHZXQiCWlzX3N0YWJsZSIHcHV0RnVuYyIHZ2V0RnVuYyIKZ2V0QmFsYW5jZSIHYXNzZXRJZCIHJG1hdGNoMCIBYiIIZ2V0QmFzZTEiBGRhdGEiBnBfZGF0YSIBYSICYTIiB2Fzc2V0SW4iCGFtb3VudEluIghhbW91bnRfMSIIYW1vdW50XzIiCGFtb3VudF8zIghnZXRCYXNlMiICcDEiACIDbHAxIgtpc19zdGFibGVfMSIBdCINZ2V0QXNzZXRCeXRlcyIHc3dhcF93eCIBcCICbHAiBWFzc2V0IgZhbW91bnQiCHB1dEZ1bmMxIghnZXRGdW5jMSIEcHV0MSILbHAxX2Fzc2V0aWQiC2xwQmFsYW5jZV8xIgRnZXQxIglzd2FwX3N3b3AiBnN0YWJsZSIDZXN0IgNtaW4iBXN3YXAxIgVzd2FwMiILc3dhcF9wdXp6bGUiCGFzc2V0T3V0IgRzd2FwIg9nZXRNaW5Ub1J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gCQCkAwEFAmFBAgwsIG5ld0JhbF8xOiAJAKQDAQUCYUwCDCwgbmV3QmFsXzI6IAkApAMBBQJhTgIMLCBuZXdCYWxfMzogCQCkAwEFAmFRCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJhUgECYVMAAwkAyBMDCAUCYVIJYm9keUJ5dGVzCQCRAwIIBQJhUgZwcm9vZnMAAAgFAmFSD3NlbmRlclB1YmxpY0tleQYJAMgTAwgFAmFSCWJvZHlCeXRlcwkAkQMCCAUCYVIGcHJvb2ZzAAAFAWS0gJDx", "height": 3510563, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5mkDUmBPgzP7mkJJVhCYxznoJuQmDL2v3JY6j81fMCdT Next: 4i4iHVkzA71FtQCN6f31FAkeo1zVe57zfshRUV68Jskh Diff:
OldNewDifferences
100100
101101 func getMinToReceive (amountWithoutFee) = {
102102 let amountWithFee = (amountWithoutFee - fraction(amountWithoutFee, 6, 1000))
103- let minToReceiveWithSleepage = (amountWithFee - fraction(amountWithFee, 9, 1000))
103+ let minToReceiveWithSleepage = 1
104104 $Tuple2(amountWithFee, minToReceiveWithSleepage)
105105 }
106106
126126 then throw("you are not allowed to arb!")
127127 else {
128128 let data_array = split_4C(data, "|")
129- let $t037213807 = getBase1(data_array[0])
130- let a = $t037213807._1
131- let a2 = $t037213807._2
132- let assetIn = $t037213807._3
133- let amountIn = $t037213807._4
134- let amount_1 = $t037213807._5
135- let amount_2 = $t037213807._6
136- let amount_3 = $t037213807._7
137- let $t038123868 = getBase2(data_array[1])
138- let p1 = $t038123868._1
139- let lp1 = $t038123868._2
140- let is_stable_1 = $t038123868._3
141- let t1 = $t038123868._4
142- let $t038733929 = getBase2(data_array[2])
143- let p2 = $t038733929._1
144- let lp2 = $t038733929._2
145- let is_stable_2 = $t038733929._3
146- let t2 = $t038733929._4
147- let $t039343990 = getBase2(data_array[3])
148- let p3 = $t039343990._1
149- let lp3 = $t039343990._2
150- let is_stable_3 = $t039343990._3
151- let t3 = $t039343990._4
152- let $t039964062 = getPutGet(value(parseInt(is_stable_1)))
153- let putFunc1 = $t039964062._1
154- let getFunc1 = $t039964062._2
155- let $t040674133 = getPutGet(value(parseInt(is_stable_2)))
156- let putFunc2 = $t040674133._1
157- let getFunc2 = $t040674133._2
158- let $t041384204 = getPutGet(value(parseInt(is_stable_3)))
159- let putFunc3 = $t041384204._1
160- let getFunc3 = $t041384204._2
129+ let $t037243810 = getBase1(data_array[0])
130+ let a = $t037243810._1
131+ let a2 = $t037243810._2
132+ let assetIn = $t037243810._3
133+ let amountIn = $t037243810._4
134+ let amount_1 = $t037243810._5
135+ let amount_2 = $t037243810._6
136+ let amount_3 = $t037243810._7
137+ let $t038153871 = getBase2(data_array[1])
138+ let p1 = $t038153871._1
139+ let lp1 = $t038153871._2
140+ let is_stable_1 = $t038153871._3
141+ let t1 = $t038153871._4
142+ let $t038763932 = getBase2(data_array[2])
143+ let p2 = $t038763932._1
144+ let lp2 = $t038763932._2
145+ let is_stable_2 = $t038763932._3
146+ let t2 = $t038763932._4
147+ let $t039373993 = getBase2(data_array[3])
148+ let p3 = $t039373993._1
149+ let lp3 = $t039373993._2
150+ let is_stable_3 = $t039373993._3
151+ let t3 = $t039373993._4
152+ let $t039994065 = getPutGet(value(parseInt(is_stable_1)))
153+ let putFunc1 = $t039994065._1
154+ let getFunc1 = $t039994065._2
155+ let $t040704136 = getPutGet(value(parseInt(is_stable_2)))
156+ let putFunc2 = $t040704136._1
157+ let getFunc2 = $t040704136._2
158+ let $t041414207 = getPutGet(value(parseInt(is_stable_3)))
159+ let putFunc3 = $t041414207._1
160+ let getFunc3 = $t041414207._2
161161 let amount_bef_assetIn = getBalance(getAssetBytes(assetIn))
162162 if ((amount_bef_assetIn == amount_bef_assetIn))
163163 then {
166166 else value(parseInt(amountIn))
167167 if ((new_amountIn == new_amountIn))
168168 then {
169- let $t044104540 = if (if ((t1 == "S"))
169+ let $t044134543 = if (if ((t1 == "S"))
170170 then (value(parseInt(is_stable_1)) == 1)
171171 else false)
172172 then getMinToReceive(value(parseInt(amount_1)))
173173 else $Tuple2(0, 0)
174- let est_1 = $t044104540._1
175- let min_1 = $t044104540._2
176- let $t045454675 = if (if ((t2 == "S"))
174+ let est_1 = $t044134543._1
175+ let min_1 = $t044134543._2
176+ let $t045484678 = if (if ((t2 == "S"))
177177 then (value(parseInt(is_stable_2)) == 1)
178178 else false)
179179 then getMinToReceive(value(parseInt(amount_2)))
180180 else $Tuple2(0, 0)
181- let est_2 = $t045454675._1
182- let min_2 = $t045454675._2
183- let $t046804810 = if (if ((t3 == "S"))
181+ let est_2 = $t045484678._1
182+ let min_2 = $t045484678._2
183+ let $t046834813 = if (if ((t3 == "S"))
184184 then (value(parseInt(is_stable_3)) == 1)
185185 else false)
186186 then getMinToReceive(value(parseInt(amount_3)))
187187 else $Tuple2(0, 0)
188- let est_3 = $t046804810._1
189- let min_3 = $t046804810._2
188+ let est_3 = $t046834813._1
189+ let min_3 = $t046834813._2
190190 let amount_bef_asset1 = getBalance(getAssetBytes(a))
191191 if ((amount_bef_asset1 == amount_bef_asset1))
192192 then {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let free_to_borrom = addressFromStringValue("3PG7CHvBatHpChwm8reH74wfEwk1PHc8Rqy")
55
66 let USDN_ASSET_ID = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
77
88 let boss = addressFromStringValue("3PRE5KH9oPGfFPs7fGnQcJ4wNshEDUPGj1t")
99
1010 let adminPublicKey = base58'Cr1ybL2JGg9GwJHA2JwqxBPfSW6Q7Jg4HvNrsEiCsHu6'
1111
1212 func getPutGet (is_stable) = {
1313 let putFunc = if ((is_stable == 1))
1414 then "putOneTknV2"
1515 else "putOneTkn"
1616 let getFunc = if ((is_stable == 1))
1717 then "getOneTknV2"
1818 else "getOneTkn"
1919 $Tuple2(putFunc, getFunc)
2020 }
2121
2222
2323 func getBalance (assetId) = match assetId {
2424 case b: ByteVector =>
2525 assetBalance(this, b)
2626 case _ =>
2727 wavesBalance(this).available
2828 }
2929
3030
3131 func getBase1 (data) = {
3232 let p_data = split(data, "_")
3333 let a = p_data[0]
3434 let a2 = p_data[1]
3535 let assetIn = p_data[2]
3636 let amountIn = p_data[3]
3737 let amount_1 = p_data[4]
3838 let amount_2 = p_data[5]
3939 let amount_3 = p_data[6]
4040 $Tuple7(a, a2, assetIn, amountIn, amount_1, amount_2, amount_3)
4141 }
4242
4343
4444 func getBase2 (data) = {
4545 let p_data = split(data, "_")
4646 let p1 = p_data[0]
4747 let lp1 = p_data[1]
4848 let is_stable_1 = p_data[2]
4949 let t = p_data[3]
5050 $Tuple4(p1, lp1, is_stable_1, t)
5151 }
5252
5353
5454 func getAssetBytes (assetId) = if ((assetId == "WAVES"))
5555 then unit
5656 else fromBase58String(assetId)
5757
5858
5959 func swap_wx (p,lp,asset,amount,putFunc1,getFunc1,a) = {
6060 let put1 = invoke(Address(fromBase58String(p)), putFunc1, [1, false], [AttachedPayment(getAssetBytes(asset), amount)])
6161 if ((put1 == put1))
6262 then {
6363 let lp1_assetid = fromBase58String(lp)
6464 let lpBalance_1 = getBalance(lp1_assetid)
6565 if ((lpBalance_1 == lpBalance_1))
6666 then {
6767 let get1 = invoke(Address(fromBase58String(p)), getFunc1, [a, 1], [AttachedPayment(lp1_assetid, lpBalance_1)])
6868 if ((get1 == get1))
6969 then nil
7070 else throw("Strict value is not equal to itself.")
7171 }
7272 else throw("Strict value is not equal to itself.")
7373 }
7474 else throw("Strict value is not equal to itself.")
7575 }
7676
7777
7878 func swap_swop (p,asset,amount,stable,est,min) = if ((stable == 1))
7979 then {
8080 let swap1 = invoke(Address(fromBase58String(p)), "exchange", [est, min], [AttachedPayment(getAssetBytes(asset), amount)])
8181 if ((swap1 == swap1))
8282 then nil
8383 else throw("Strict value is not equal to itself.")
8484 }
8585 else {
8686 let swap2 = invoke(Address(fromBase58String(p)), "exchange", [1], [AttachedPayment(getAssetBytes(asset), amount)])
8787 if ((swap2 == swap2))
8888 then nil
8989 else throw("Strict value is not equal to itself.")
9090 }
9191
9292
9393 func swap_puzzle (p,asset,amount,assetOut) = {
9494 let swap = invoke(Address(fromBase58String(p)), "swap", [assetOut, 1], [AttachedPayment(getAssetBytes(asset), amount)])
9595 if ((swap == swap))
9696 then nil
9797 else throw("Strict value is not equal to itself.")
9898 }
9999
100100
101101 func getMinToReceive (amountWithoutFee) = {
102102 let amountWithFee = (amountWithoutFee - fraction(amountWithoutFee, 6, 1000))
103- let minToReceiveWithSleepage = (amountWithFee - fraction(amountWithFee, 9, 1000))
103+ let minToReceiveWithSleepage = 1
104104 $Tuple2(amountWithFee, minToReceiveWithSleepage)
105105 }
106106
107107
108108 @Callable(i)
109109 func borrow (amnt) = if (if ((i.caller != boss))
110110 then (i.caller != free_to_borrom)
111111 else false)
112112 then throw("you are not allowed to borrow!")
113113 else {
114114 let currentBal = getBalance(USDN_ASSET_ID)
115115 if ((amnt > currentBal))
116116 then throw("You cannnot borrow that much")
117117 else [ScriptTransfer(i.caller, amnt, USDN_ASSET_ID)]
118118 }
119119
120120
121121
122122 @Callable(i)
123123 func y (data) = if (if ((i.caller != this))
124124 then (i.caller != boss)
125125 else false)
126126 then throw("you are not allowed to arb!")
127127 else {
128128 let data_array = split_4C(data, "|")
129- let $t037213807 = getBase1(data_array[0])
130- let a = $t037213807._1
131- let a2 = $t037213807._2
132- let assetIn = $t037213807._3
133- let amountIn = $t037213807._4
134- let amount_1 = $t037213807._5
135- let amount_2 = $t037213807._6
136- let amount_3 = $t037213807._7
137- let $t038123868 = getBase2(data_array[1])
138- let p1 = $t038123868._1
139- let lp1 = $t038123868._2
140- let is_stable_1 = $t038123868._3
141- let t1 = $t038123868._4
142- let $t038733929 = getBase2(data_array[2])
143- let p2 = $t038733929._1
144- let lp2 = $t038733929._2
145- let is_stable_2 = $t038733929._3
146- let t2 = $t038733929._4
147- let $t039343990 = getBase2(data_array[3])
148- let p3 = $t039343990._1
149- let lp3 = $t039343990._2
150- let is_stable_3 = $t039343990._3
151- let t3 = $t039343990._4
152- let $t039964062 = getPutGet(value(parseInt(is_stable_1)))
153- let putFunc1 = $t039964062._1
154- let getFunc1 = $t039964062._2
155- let $t040674133 = getPutGet(value(parseInt(is_stable_2)))
156- let putFunc2 = $t040674133._1
157- let getFunc2 = $t040674133._2
158- let $t041384204 = getPutGet(value(parseInt(is_stable_3)))
159- let putFunc3 = $t041384204._1
160- let getFunc3 = $t041384204._2
129+ let $t037243810 = getBase1(data_array[0])
130+ let a = $t037243810._1
131+ let a2 = $t037243810._2
132+ let assetIn = $t037243810._3
133+ let amountIn = $t037243810._4
134+ let amount_1 = $t037243810._5
135+ let amount_2 = $t037243810._6
136+ let amount_3 = $t037243810._7
137+ let $t038153871 = getBase2(data_array[1])
138+ let p1 = $t038153871._1
139+ let lp1 = $t038153871._2
140+ let is_stable_1 = $t038153871._3
141+ let t1 = $t038153871._4
142+ let $t038763932 = getBase2(data_array[2])
143+ let p2 = $t038763932._1
144+ let lp2 = $t038763932._2
145+ let is_stable_2 = $t038763932._3
146+ let t2 = $t038763932._4
147+ let $t039373993 = getBase2(data_array[3])
148+ let p3 = $t039373993._1
149+ let lp3 = $t039373993._2
150+ let is_stable_3 = $t039373993._3
151+ let t3 = $t039373993._4
152+ let $t039994065 = getPutGet(value(parseInt(is_stable_1)))
153+ let putFunc1 = $t039994065._1
154+ let getFunc1 = $t039994065._2
155+ let $t040704136 = getPutGet(value(parseInt(is_stable_2)))
156+ let putFunc2 = $t040704136._1
157+ let getFunc2 = $t040704136._2
158+ let $t041414207 = getPutGet(value(parseInt(is_stable_3)))
159+ let putFunc3 = $t041414207._1
160+ let getFunc3 = $t041414207._2
161161 let amount_bef_assetIn = getBalance(getAssetBytes(assetIn))
162162 if ((amount_bef_assetIn == amount_bef_assetIn))
163163 then {
164164 let new_amountIn = if ((value(parseInt(amountIn)) > amount_bef_assetIn))
165165 then amount_bef_assetIn
166166 else value(parseInt(amountIn))
167167 if ((new_amountIn == new_amountIn))
168168 then {
169- let $t044104540 = if (if ((t1 == "S"))
169+ let $t044134543 = if (if ((t1 == "S"))
170170 then (value(parseInt(is_stable_1)) == 1)
171171 else false)
172172 then getMinToReceive(value(parseInt(amount_1)))
173173 else $Tuple2(0, 0)
174- let est_1 = $t044104540._1
175- let min_1 = $t044104540._2
176- let $t045454675 = if (if ((t2 == "S"))
174+ let est_1 = $t044134543._1
175+ let min_1 = $t044134543._2
176+ let $t045484678 = if (if ((t2 == "S"))
177177 then (value(parseInt(is_stable_2)) == 1)
178178 else false)
179179 then getMinToReceive(value(parseInt(amount_2)))
180180 else $Tuple2(0, 0)
181- let est_2 = $t045454675._1
182- let min_2 = $t045454675._2
183- let $t046804810 = if (if ((t3 == "S"))
181+ let est_2 = $t045484678._1
182+ let min_2 = $t045484678._2
183+ let $t046834813 = if (if ((t3 == "S"))
184184 then (value(parseInt(is_stable_3)) == 1)
185185 else false)
186186 then getMinToReceive(value(parseInt(amount_3)))
187187 else $Tuple2(0, 0)
188- let est_3 = $t046804810._1
189- let min_3 = $t046804810._2
188+ let est_3 = $t046834813._1
189+ let min_3 = $t046834813._2
190190 let amount_bef_asset1 = getBalance(getAssetBytes(a))
191191 if ((amount_bef_asset1 == amount_bef_asset1))
192192 then {
193193 let swap1 = if ((t1 == "W"))
194194 then swap_wx(p1, lp1, assetIn, new_amountIn, putFunc1, getFunc1, a)
195195 else if ((t1 == "S"))
196196 then swap_swop(p1, assetIn, new_amountIn, value(parseInt(is_stable_1)), est_1, min_1)
197197 else swap_puzzle(p1, assetIn, new_amountIn, a)
198198 if ((swap1 == swap1))
199199 then {
200200 let nb = (getBalance(getAssetBytes(a)) - amount_bef_asset1)
201201 if ((nb == nb))
202202 then {
203203 let amount_bef_asset2 = getBalance(getAssetBytes(a2))
204204 if ((amount_bef_asset2 == amount_bef_asset2))
205205 then {
206206 let swap2 = if ((t2 == "W"))
207207 then swap_wx(p2, lp2, a, nb, putFunc2, getFunc2, a2)
208208 else if ((t2 == "S"))
209209 then swap_swop(p2, a, nb, value(parseInt(is_stable_2)), est_2, min_2)
210210 else swap_puzzle(p2, a, nb, a2)
211211 if ((swap2 == swap2))
212212 then {
213213 let nb2 = (getBalance(getAssetBytes(a2)) - amount_bef_asset2)
214214 if ((nb2 == nb2))
215215 then {
216216 let amount_bef_base_asset = getBalance(getAssetBytes(assetIn))
217217 if ((amount_bef_base_asset == amount_bef_base_asset))
218218 then {
219219 let swap3 = if ((t3 == "W"))
220220 then swap_wx(p3, lp3, a2, nb2, putFunc3, getFunc3, assetIn)
221221 else if ((t3 == "S"))
222222 then swap_swop(p3, a2, nb2, value(parseInt(is_stable_3)), est_3, min_3)
223223 else swap_puzzle(p3, a2, nb2, assetIn)
224224 if ((swap3 == swap3))
225225 then {
226226 let nb3 = (getBalance(getAssetBytes(assetIn)) - amount_bef_base_asset)
227227 if ((nb3 == nb3))
228228 then if ((nb3 > (new_amountIn + 50000)))
229229 then [ScriptTransfer(i.caller, (nb3 - new_amountIn), getAssetBytes(assetIn))]
230230 else throw(((((((((("origin amountIn = " + amountIn) + ", new_amountIn = ") + toString(new_amountIn)) + ", newBal_1: ") + toString(nb)) + ", newBal_2: ") + toString(nb2)) + ", newBal_3: ") + toString(nb3)))
231231 else throw("Strict value is not equal to itself.")
232232 }
233233 else throw("Strict value is not equal to itself.")
234234 }
235235 else throw("Strict value is not equal to itself.")
236236 }
237237 else throw("Strict value is not equal to itself.")
238238 }
239239 else throw("Strict value is not equal to itself.")
240240 }
241241 else throw("Strict value is not equal to itself.")
242242 }
243243 else throw("Strict value is not equal to itself.")
244244 }
245245 else throw("Strict value is not equal to itself.")
246246 }
247247 else throw("Strict value is not equal to itself.")
248248 }
249249 else throw("Strict value is not equal to itself.")
250250 }
251251 else throw("Strict value is not equal to itself.")
252252 }
253253
254254
255255 @Verifier(tx)
256256 func verify () = if (sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
257257 then true
258258 else sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], adminPublicKey)
259259

github/deemru/w8io/3ef1775 
53.01 ms