tx · 8Tk3kEk3bUcx9qck43bkFG6Nu35f8aY8iQx9VmNLky45

3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq:  -0.01000000 Waves

2023.06.27 00:43 [2640178] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves

{ "type": 13, "id": "8Tk3kEk3bUcx9qck43bkFG6Nu35f8aY8iQx9VmNLky45", "fee": 1000000, "feeAssetId": null, "timestamp": 1687815810059, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "5joRK317FqdbTMPTBNjza94HN8w2Sn12UNxj6WL7Gnav2XP2N6TYqQdXmcK9VNS7DLKntmFB5HcqH1vQVot5LLZ6" ], "script": "base64:BgIkCAISAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBQADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQ9nZXRDdXJyZW50UHJpY2UBCmFzc2V0SWRTdHIDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMAAgkAAgECBUVycm9yAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgcBaQEGbG9uZz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XcJAMwIAgUKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfd2l0aGRyZXdfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleXChX+c=", "height": 2640178, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CSmsEmACzyHN2SjaN9isY3zN5kj7MCy6CKxSb9pgL4DB Next: 8VYiPgTcfPyxtLhcZmUoP5EU8ApKT7v2d2BhMa4cMREH Diff:
OldNewDifferences
66 let arr2 = [1, 2]
77
88 func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil)
9+
10+
11+func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES"))
12+ then 2
13+ else throw("Error")
914
1015
1116 func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES"))
1924 let currentAmount = getBalance("WAVES", i.caller)
2025 if ((currentAmount > assetAmount))
2126 then {
22- let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
23- if ((supplyResult == supplyResult))
24- then {
25- func repeatFunc (accum,next) = {
26- let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
27- if ((result == result))
27+ func repeatFunc (accum,next) = {
28+ let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
29+ if ((supplyResult == supplyResult))
30+ then {
31+ let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (assetAmount * getCurrentPrice("WAVES"))], nil)
32+ if ((borrowResult == borrowResult))
2833 then (accum + next)
2934 else throw("Strict value is not equal to itself.")
3035 }
36+ else throw("Strict value is not equal to itself.")
37+ }
3138
32- let array = [assetAmount, assetAmount]
33- let res = {
34- let $l = array
35- let $s = size($l)
36- let $acc0 = 0
37- func $f0_1 ($a,$i) = if (($i >= $s))
38- then $a
39- else repeatFunc($a, $l[$i])
39+ let array = [assetAmount, assetAmount]
40+ let res = {
41+ let $l = array
42+ let $s = size($l)
43+ let $acc0 = 0
44+ func $f0_1 ($a,$i) = if (($i >= $s))
45+ then $a
46+ else repeatFunc($a, $l[$i])
4047
41- func $f0_2 ($a,$i) = if (($i >= $s))
42- then $a
43- else throw("List size exceeds 2")
48+ func $f0_2 ($a,$i) = if (($i >= $s))
49+ then $a
50+ else throw("List size exceeds 2")
4451
45- $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
46- }
47-[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
48- }
49- else throw("Strict value is not equal to itself.")
52+ $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
53+ }
54+[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, (res * getCurrentPrice("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
5055 }
5156 else throw("Error!")
5257 }
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)
9+
10+
11+func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES"))
12+ then 2
13+ else throw("Error")
914
1015
1116 func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES"))
1217 then wavesBalance(address).available
1318 else assetBalance(address, fromBase58String(assetIdStr))
1419
1520
1621 @Callable(i)
1722 func long2x (assetAmount) = {
1823 let address = toString(i.caller)
1924 let currentAmount = getBalance("WAVES", i.caller)
2025 if ((currentAmount > assetAmount))
2126 then {
22- let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
23- if ((supplyResult == supplyResult))
24- then {
25- func repeatFunc (accum,next) = {
26- let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
27- if ((result == result))
27+ func repeatFunc (accum,next) = {
28+ let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
29+ if ((supplyResult == supplyResult))
30+ then {
31+ let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (assetAmount * getCurrentPrice("WAVES"))], nil)
32+ if ((borrowResult == borrowResult))
2833 then (accum + next)
2934 else throw("Strict value is not equal to itself.")
3035 }
36+ else throw("Strict value is not equal to itself.")
37+ }
3138
32- let array = [assetAmount, assetAmount]
33- let res = {
34- let $l = array
35- let $s = size($l)
36- let $acc0 = 0
37- func $f0_1 ($a,$i) = if (($i >= $s))
38- then $a
39- else repeatFunc($a, $l[$i])
39+ let array = [assetAmount, assetAmount]
40+ let res = {
41+ let $l = array
42+ let $s = size($l)
43+ let $acc0 = 0
44+ func $f0_1 ($a,$i) = if (($i >= $s))
45+ then $a
46+ else repeatFunc($a, $l[$i])
4047
41- func $f0_2 ($a,$i) = if (($i >= $s))
42- then $a
43- else throw("List size exceeds 2")
48+ func $f0_2 ($a,$i) = if (($i >= $s))
49+ then $a
50+ else throw("List size exceeds 2")
4451
45- $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
46- }
47-[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
48- }
49- else throw("Strict value is not equal to itself.")
52+ $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
53+ }
54+[IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, (res * getCurrentPrice("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
5055 }
5156 else throw("Error!")
5257 }
5358
5459
5560
5661 @Callable(i)
5762 func borrow (assetAmount) = {
5863 let address = toString(i.caller)
5964 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
6065 if ((res == res))
6166 then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)]
6267 else throw("Strict value is not equal to itself.")
6368 }
6469
6570
6671
6772 @Callable(i)
6873 func borrow2 (assetAmount) = {
6974 let address = toString(i.caller)
7075 func repeatFunc (accum,next) = {
7176 let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
7277 if ((result == result))
7378 then (accum + next)
7479 else throw("Strict value is not equal to itself.")
7580 }
7681
7782 let array = [assetAmount, assetAmount]
7883 let res = {
7984 let $l = array
8085 let $s = size($l)
8186 let $acc0 = 0
8287 func $f0_1 ($a,$i) = if (($i >= $s))
8388 then $a
8489 else repeatFunc($a, $l[$i])
8590
8691 func $f0_2 ($a,$i) = if (($i >= $s))
8792 then $a
8893 else throw("List size exceeds 2")
8994
9095 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
9196 }
9297 [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
9398 }
9499
95100
96101
97102 @Callable(i)
98103 func borrow5 (assetIdStr,assetAmount) = {
99104 let address = toString(i.caller)
100105 let res = {
101106 let $l = arr
102107 let $s = size($l)
103108 let $acc0 = 0
104109 func $f0_1 ($a,$i) = if (($i >= $s))
105110 then $a
106111 else sum($a, $l[$i])
107112
108113 func $f0_2 ($a,$i) = if (($i >= $s))
109114 then $a
110115 else throw("List size exceeds 5")
111116
112117 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
113118 }
114119 if ((res == res))
115120 then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)]
116121 else throw("Strict value is not equal to itself.")
117122 }
118123
119124
120125
121126 @Callable(i)
122127 func deposit () = {
123128 let address = toString(i.caller)
124129 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)])
125130 if ((res == res))
126131 then [IntegerEntry((address + "supply_waves"), 1000000)]
127132 else throw("Strict value is not equal to itself.")
128133 }
129134
130135
131136
132137 @Callable(i)
133138 func withdraw (assetIdStr,assetAmount) = {
134139 let address = toString(i.caller)
135140 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil)
136141 if ((res == res))
137142 then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)]
138143 else throw("Strict value is not equal to itself.")
139144 }
140145
141146
142147
143148 @Callable(i)
144149 func checkBalance (assetIdStr) = {
145150 let address = i.caller
146151 if ((assetIdStr == "WAVES"))
147152 then [IntegerEntry("Waves Balance", wavesBalance(address).available)]
148153 else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))]
149154 }
150155
151156
152157 @Verifier(tx)
153158 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
154159

github/deemru/w8io/026f985 
77.54 ms