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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Id2l0aGRyYXcJAMwIAgUKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfd2l0aGRyZXdfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleWIEPoc=", "height": 2640187, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Tk3kEk3bUcx9qck43bkFG6Nu35f8aY8iQx9VmNLky45 Next: Aom3dkb579sVZY17NZRSxcsMS3eHJXUBZ9HXcB4htMmf Diff:
Old | New | Differences | |
---|---|---|---|
51 | 51 | ||
52 | 52 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
53 | 53 | } | |
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')] | |
55 | 55 | } | |
56 | 56 | else throw("Error!") | |
57 | 57 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let arr = [1, 2, 3, 4, 5] | |
5 | 5 | ||
6 | 6 | let arr2 = [1, 2] | |
7 | 7 | ||
8 | 8 | func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES")) | |
12 | 12 | then 2 | |
13 | 13 | else throw("Error") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES")) | |
17 | 17 | then wavesBalance(address).available | |
18 | 18 | else assetBalance(address, fromBase58String(assetIdStr)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func long2x (assetAmount) = { | |
23 | 23 | let address = toString(i.caller) | |
24 | 24 | let currentAmount = getBalance("WAVES", i.caller) | |
25 | 25 | if ((currentAmount > assetAmount)) | |
26 | 26 | then { | |
27 | 27 | func repeatFunc (accum,next) = { | |
28 | 28 | let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)]) | |
29 | 29 | if ((supplyResult == supplyResult)) | |
30 | 30 | then { | |
31 | 31 | let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (assetAmount * getCurrentPrice("WAVES"))], nil) | |
32 | 32 | if ((borrowResult == borrowResult)) | |
33 | 33 | then (accum + next) | |
34 | 34 | else throw("Strict value is not equal to itself.") | |
35 | 35 | } | |
36 | 36 | else throw("Strict value is not equal to itself.") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | let array = [assetAmount, assetAmount] | |
40 | 40 | let res = { | |
41 | 41 | let $l = array | |
42 | 42 | let $s = size($l) | |
43 | 43 | let $acc0 = 0 | |
44 | 44 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
45 | 45 | then $a | |
46 | 46 | else repeatFunc($a, $l[$i]) | |
47 | 47 | ||
48 | 48 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
49 | 49 | then $a | |
50 | 50 | else throw("List size exceeds 2") | |
51 | 51 | ||
52 | 52 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
53 | 53 | } | |
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')] | |
55 | 55 | } | |
56 | 56 | else throw("Error!") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(i) | |
62 | 62 | func borrow (assetAmount) = { | |
63 | 63 | let address = toString(i.caller) | |
64 | 64 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
65 | 65 | if ((res == res)) | |
66 | 66 | then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)] | |
67 | 67 | else throw("Strict value is not equal to itself.") | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func borrow2 (assetAmount) = { | |
74 | 74 | let address = toString(i.caller) | |
75 | 75 | func repeatFunc (accum,next) = { | |
76 | 76 | let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
77 | 77 | if ((result == result)) | |
78 | 78 | then (accum + next) | |
79 | 79 | else throw("Strict value is not equal to itself.") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | let array = [assetAmount, assetAmount] | |
83 | 83 | let res = { | |
84 | 84 | let $l = array | |
85 | 85 | let $s = size($l) | |
86 | 86 | let $acc0 = 0 | |
87 | 87 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
88 | 88 | then $a | |
89 | 89 | else repeatFunc($a, $l[$i]) | |
90 | 90 | ||
91 | 91 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
92 | 92 | then $a | |
93 | 93 | else throw("List size exceeds 2") | |
94 | 94 | ||
95 | 95 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
96 | 96 | } | |
97 | 97 | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func borrow5 (assetIdStr,assetAmount) = { | |
104 | 104 | let address = toString(i.caller) | |
105 | 105 | let res = { | |
106 | 106 | let $l = arr | |
107 | 107 | let $s = size($l) | |
108 | 108 | let $acc0 = 0 | |
109 | 109 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
110 | 110 | then $a | |
111 | 111 | else sum($a, $l[$i]) | |
112 | 112 | ||
113 | 113 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
114 | 114 | then $a | |
115 | 115 | else throw("List size exceeds 5") | |
116 | 116 | ||
117 | 117 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
118 | 118 | } | |
119 | 119 | if ((res == res)) | |
120 | 120 | then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)] | |
121 | 121 | else throw("Strict value is not equal to itself.") | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | 127 | func deposit () = { | |
128 | 128 | let address = toString(i.caller) | |
129 | 129 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
130 | 130 | if ((res == res)) | |
131 | 131 | then [IntegerEntry((address + "supply_waves"), 1000000)] | |
132 | 132 | else throw("Strict value is not equal to itself.") | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Callable(i) | |
138 | 138 | func withdraw (assetIdStr,assetAmount) = { | |
139 | 139 | let address = toString(i.caller) | |
140 | 140 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil) | |
141 | 141 | if ((res == res)) | |
142 | 142 | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
143 | 143 | else throw("Strict value is not equal to itself.") | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(i) | |
149 | 149 | func checkBalance (assetIdStr) = { | |
150 | 150 | let address = i.caller | |
151 | 151 | if ((assetIdStr == "WAVES")) | |
152 | 152 | then [IntegerEntry("Waves Balance", wavesBalance(address).available)] | |
153 | 153 | else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))] | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Verifier(tx) | |
158 | 158 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
159 | 159 |
github/deemru/w8io/026f985 77.20 ms ◑