tx · 8VYiPgTcfPyxtLhcZmUoP5EU8ApKT7v2d2BhMa4cMREH

3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq:  -0.01000000 Waves

2023.06.27 00:50 [2640187] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves

{ "type": 13, "id": "8VYiPgTcfPyxtLhcZmUoP5EU8ApKT7v2d2BhMa4cMREH", "fee": 1000000, "feeAssetId": null, "timestamp": 1687816280025, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "2FWAji86JbF8T8838nEgrZPh9frQYBoAinNKneiMYbC7VhEGxbr46wno7qnPFXC48nJfk7zbk7tat3YVFxvzk3h3" ], "script": "base64:BgIkCAISAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBQADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQ9nZXRDdXJyZW50UHJpY2UBCmFzc2V0SWRTdHIDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMAAgkAAgECBUVycm9yAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgcBaQEGbG9uZzJ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IId2l0aGRyYXcJAMwIAgUKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfd2l0aGRyZXdfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleWIEPoc=", "height": 2640187, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Tk3kEk3bUcx9qck43bkFG6Nu35f8aY8iQx9VmNLky45 Next: Aom3dkb579sVZY17NZRSxcsMS3eHJXUBZ9HXcB4htMmf Diff:
OldNewDifferences
5151
5252 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
5353 }
54-[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, (res * getCurrentPrice("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
54+[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, ((res * getCurrentPrice("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
5555 }
5656 else throw("Error!")
5757 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let arr = [1, 2, 3, 4, 5]
55
66 let arr2 = [1, 2]
77
88 func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil)
99
1010
1111 func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES"))
1212 then 2
1313 else throw("Error")
1414
1515
1616 func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES"))
1717 then wavesBalance(address).available
1818 else assetBalance(address, fromBase58String(assetIdStr))
1919
2020
2121 @Callable(i)
2222 func long2x (assetAmount) = {
2323 let address = toString(i.caller)
2424 let currentAmount = getBalance("WAVES", i.caller)
2525 if ((currentAmount > assetAmount))
2626 then {
2727 func repeatFunc (accum,next) = {
2828 let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
2929 if ((supplyResult == supplyResult))
3030 then {
3131 let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (assetAmount * getCurrentPrice("WAVES"))], nil)
3232 if ((borrowResult == borrowResult))
3333 then (accum + next)
3434 else throw("Strict value is not equal to itself.")
3535 }
3636 else throw("Strict value is not equal to itself.")
3737 }
3838
3939 let array = [assetAmount, assetAmount]
4040 let res = {
4141 let $l = array
4242 let $s = size($l)
4343 let $acc0 = 0
4444 func $f0_1 ($a,$i) = if (($i >= $s))
4545 then $a
4646 else repeatFunc($a, $l[$i])
4747
4848 func $f0_2 ($a,$i) = if (($i >= $s))
4949 then $a
5050 else throw("List size exceeds 2")
5151
5252 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
5353 }
54-[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, (res * getCurrentPrice("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
54+[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, ((res * getCurrentPrice("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
5555 }
5656 else throw("Error!")
5757 }
5858
5959
6060
6161 @Callable(i)
6262 func borrow (assetAmount) = {
6363 let address = toString(i.caller)
6464 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
6565 if ((res == res))
6666 then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)]
6767 else throw("Strict value is not equal to itself.")
6868 }
6969
7070
7171
7272 @Callable(i)
7373 func borrow2 (assetAmount) = {
7474 let address = toString(i.caller)
7575 func repeatFunc (accum,next) = {
7676 let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
7777 if ((result == result))
7878 then (accum + next)
7979 else throw("Strict value is not equal to itself.")
8080 }
8181
8282 let array = [assetAmount, assetAmount]
8383 let res = {
8484 let $l = array
8585 let $s = size($l)
8686 let $acc0 = 0
8787 func $f0_1 ($a,$i) = if (($i >= $s))
8888 then $a
8989 else repeatFunc($a, $l[$i])
9090
9191 func $f0_2 ($a,$i) = if (($i >= $s))
9292 then $a
9393 else throw("List size exceeds 2")
9494
9595 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
9696 }
9797 [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
9898 }
9999
100100
101101
102102 @Callable(i)
103103 func borrow5 (assetIdStr,assetAmount) = {
104104 let address = toString(i.caller)
105105 let res = {
106106 let $l = arr
107107 let $s = size($l)
108108 let $acc0 = 0
109109 func $f0_1 ($a,$i) = if (($i >= $s))
110110 then $a
111111 else sum($a, $l[$i])
112112
113113 func $f0_2 ($a,$i) = if (($i >= $s))
114114 then $a
115115 else throw("List size exceeds 5")
116116
117117 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
118118 }
119119 if ((res == res))
120120 then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)]
121121 else throw("Strict value is not equal to itself.")
122122 }
123123
124124
125125
126126 @Callable(i)
127127 func deposit () = {
128128 let address = toString(i.caller)
129129 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)])
130130 if ((res == res))
131131 then [IntegerEntry((address + "supply_waves"), 1000000)]
132132 else throw("Strict value is not equal to itself.")
133133 }
134134
135135
136136
137137 @Callable(i)
138138 func withdraw (assetIdStr,assetAmount) = {
139139 let address = toString(i.caller)
140140 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil)
141141 if ((res == res))
142142 then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)]
143143 else throw("Strict value is not equal to itself.")
144144 }
145145
146146
147147
148148 @Callable(i)
149149 func checkBalance (assetIdStr) = {
150150 let address = i.caller
151151 if ((assetIdStr == "WAVES"))
152152 then [IntegerEntry("Waves Balance", wavesBalance(address).available)]
153153 else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))]
154154 }
155155
156156
157157 @Verifier(tx)
158158 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
159159

github/deemru/w8io/026f985 
34.64 ms