tx · 4yjhaehSSSKwF8CpjdkAqrXRmRPShNM4x8JLWvx3iatG

3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq:  -0.01000000 Waves

2023.06.27 11:12 [2640797] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves

{ "type": 13, "id": "4yjhaehSSSKwF8CpjdkAqrXRmRPShNM4x8JLWvx3iatG", "fee": 1000000, "feeAssetId": null, "timestamp": 1687853530749, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "5BeswQXpjzrcEqUEoqPhoeqsBNiYHyVprNcZCvQbCCd82viKXRRWnwbhTx5UYZJco3hahNvE5hzKxEgxrMvwbAuf" ], "script": "base64:BgIqCAISBAoCAQgSAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBQADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQ9nZXRDdXJyZW50UHJpY2UBCmFzc2V0SWRTdHIDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMAAgkAAgECBUVycm9yAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cggBaQEN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O8HAQUHYWRkcmVzcwlhdmFpbGFibGUFA25pbAkAzAgCCQEMSW50ZWdlckVudHJ5AgINQXNzZXQgQmFsYW5jZQkA8AcCBQdhZGRyZXNzCQDZBAEFCmFzc2V0SWRTdHIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXk+o2wI", "height": 2640797, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3GRdukLdzBj5FT5SjVzMEBWhxEHUVPfEeuujmqoA4qwX Next: BLkAVQsubnWRZRfXW2ye8WAzFx7G25tMjhJ2mP36hT2T Diff:
OldNewDifferences
1919
2020
2121 @Callable(i)
22+func transferToken (assetAmount,recipientAddress) = if ((i.caller != this))
23+ then throw("only for internal smart contract invocations")
24+ else [ScriptTransfer(this, assetAmount, unit), IntegerEntry((recipientAddress + "_deposited_WAVES"), assetAmount)]
25+
26+
27+
28+@Callable(i)
2229 func long2x (assetAmount) = {
2330 let address = toString(i.caller)
2431 let currentAmount = getBalance("WAVES", i.caller)
2532 if ((currentAmount > assetAmount))
2633 then {
2734 func repeatFunc (accum,next) = {
28- let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
29- if ((supplyResult == supplyResult))
35+ let transferResult = invoke(this, "transferToken", [assetAmount, i.caller], nil)
36+ if ((transferResult == transferResult))
3037 then {
31- let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((assetAmount * getCurrentPrice("WAVES")) / 100)], nil)
32- if ((borrowResult == borrowResult))
33- then (accum + next)
38+ let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
39+ if ((supplyResult == supplyResult))
40+ then {
41+ let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((assetAmount * getCurrentPrice("WAVES")) / 100)], nil)
42+ if ((borrowResult == borrowResult))
43+ then (accum + next)
44+ else throw("Strict value is not equal to itself.")
45+ }
3446 else throw("Strict value is not equal to itself.")
3547 }
3648 else throw("Strict value is not equal to itself.")
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)
22+func transferToken (assetAmount,recipientAddress) = if ((i.caller != this))
23+ then throw("only for internal smart contract invocations")
24+ else [ScriptTransfer(this, assetAmount, unit), IntegerEntry((recipientAddress + "_deposited_WAVES"), assetAmount)]
25+
26+
27+
28+@Callable(i)
2229 func long2x (assetAmount) = {
2330 let address = toString(i.caller)
2431 let currentAmount = getBalance("WAVES", i.caller)
2532 if ((currentAmount > assetAmount))
2633 then {
2734 func repeatFunc (accum,next) = {
28- let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
29- if ((supplyResult == supplyResult))
35+ let transferResult = invoke(this, "transferToken", [assetAmount, i.caller], nil)
36+ if ((transferResult == transferResult))
3037 then {
31- let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((assetAmount * getCurrentPrice("WAVES")) / 100)], nil)
32- if ((borrowResult == borrowResult))
33- then (accum + next)
38+ let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)])
39+ if ((supplyResult == supplyResult))
40+ then {
41+ let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((assetAmount * getCurrentPrice("WAVES")) / 100)], nil)
42+ if ((borrowResult == borrowResult))
43+ then (accum + next)
44+ else throw("Strict value is not equal to itself.")
45+ }
3446 else throw("Strict value is not equal to itself.")
3547 }
3648 else throw("Strict value is not equal to itself.")
3749 }
3850
3951 let array = [assetAmount, assetAmount]
4052 let res = {
4153 let $l = array
4254 let $s = size($l)
4355 let $acc0 = 0
4456 func $f0_1 ($a,$i) = if (($i >= $s))
4557 then $a
4658 else repeatFunc($a, $l[$i])
4759
4860 func $f0_2 ($a,$i) = if (($i >= $s))
4961 then $a
5062 else throw("List size exceeds 2")
5163
5264 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
5365 }
5466 [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, ((res * getCurrentPrice("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), ScriptTransfer(this, res, unit)]
5567 }
5668 else throw("Error!")
5769 }
5870
5971
6072
6173 @Callable(i)
6274 func borrow (assetAmount) = {
6375 let address = toString(i.caller)
6476 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
6577 if ((res == res))
6678 then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)]
6779 else throw("Strict value is not equal to itself.")
6880 }
6981
7082
7183
7284 @Callable(i)
7385 func borrow2 (assetAmount) = {
7486 let address = toString(i.caller)
7587 func repeatFunc (accum,next) = {
7688 let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil)
7789 if ((result == result))
7890 then (accum + next)
7991 else throw("Strict value is not equal to itself.")
8092 }
8193
8294 let array = [assetAmount, assetAmount]
8395 let res = {
8496 let $l = array
8597 let $s = size($l)
8698 let $acc0 = 0
8799 func $f0_1 ($a,$i) = if (($i >= $s))
88100 then $a
89101 else repeatFunc($a, $l[$i])
90102
91103 func $f0_2 ($a,$i) = if (($i >= $s))
92104 then $a
93105 else throw("List size exceeds 2")
94106
95107 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
96108 }
97109 [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')]
98110 }
99111
100112
101113
102114 @Callable(i)
103115 func borrow5 (assetIdStr,assetAmount) = {
104116 let address = toString(i.caller)
105117 let res = {
106118 let $l = arr
107119 let $s = size($l)
108120 let $acc0 = 0
109121 func $f0_1 ($a,$i) = if (($i >= $s))
110122 then $a
111123 else sum($a, $l[$i])
112124
113125 func $f0_2 ($a,$i) = if (($i >= $s))
114126 then $a
115127 else throw("List size exceeds 5")
116128
117129 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
118130 }
119131 if ((res == res))
120132 then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)]
121133 else throw("Strict value is not equal to itself.")
122134 }
123135
124136
125137
126138 @Callable(i)
127139 func deposit () = {
128140 let address = toString(i.caller)
129141 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)])
130142 if ((res == res))
131143 then [IntegerEntry((address + "supply_waves"), 1000000)]
132144 else throw("Strict value is not equal to itself.")
133145 }
134146
135147
136148
137149 @Callable(i)
138150 func withdraw (assetIdStr,assetAmount) = {
139151 let address = toString(i.caller)
140152 let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil)
141153 if ((res == res))
142154 then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)]
143155 else throw("Strict value is not equal to itself.")
144156 }
145157
146158
147159
148160 @Callable(i)
149161 func checkBalance (assetIdStr) = {
150162 let address = i.caller
151163 if ((assetIdStr == "WAVES"))
152164 then [IntegerEntry("Waves Balance", wavesBalance(address).available)]
153165 else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))]
154166 }
155167
156168
157169 @Verifier(tx)
158170 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
159171

github/deemru/w8io/026f985 
51.17 ms