tx · VwToUbpMaF3Ja1Vg88oE5hU8wf8vkT93ZSqYonPGzWK 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.06.27 13:46 [2640968] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "VwToUbpMaF3Ja1Vg88oE5hU8wf8vkT93ZSqYonPGzWK", "fee": 1000000, "feeAssetId": null, "timestamp": 1687862788545, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "2VJAY1PHbjQ1svn8oy2D6xzyav66MVsRYHMfAbbaj47omcZJ7cfWQqQFWzrNwq2b8zpZK9mkiVGupHSjuVscHaNn" ], "script": "base64:BgI4CAISBAoCAQgSABIFCgMIAQgSAwoBARIDCgEBEgMKAQESAwoBARIECgIIARIAEgQKAggBEgMKAQgGAANhcnIJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQUDbmlsAARhcnIyCQDMCAIAAQkAzAgCAAIFA25pbAEDc3VtAgFhAWIJAPwHBAkBEUBleHRyTmF0aXZlKDEwNjIpAQIjM04zRG5WZmZuVXladHoyTVJiazVVN2dpTjExMldlbXBNTmQCBmJvcnJvdwkAzAgCAiwyNUZFcUVqUmtxSzZ5Q2tpVDdMejZTQVl6N2dVRkN0eGZDQ2huclZGRDVBVAkAzAgCAMCEPQUDbmlsBQNuaWwBD2dldEN1cnJlbnRQcmljZQEKYXNzZXRJZFN0cgMJAAACBQphc3NldElkU3RyAgVXQVZFUwACCQACAQIFRXJyb3IBCmdldEJhbGFuY2UCCmFzc2V0SWRTdHIHYWRkcmVzcwMJAAACBQphc3NldElkU3RyAgVXQVZFUwgJAO8HAQUHYWRkcmVzcwlhdmFpbGFibGUJAPAHAgUHYWRkcmVzcwkA2QQBBQphc3NldElkU3R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MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleY2QSzk=", "height": 2640968, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 65i9ZrN5bhnN63h5N8mpSpGWNrhZeATdyxNkH1cRXBts Next: FyGRmirLtAHHbCKgmYnj2imEf4kLYUYJ1RwHZ2uw46v7 Diff:
Old | New | Differences | |
---|---|---|---|
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(l) | |
45 | + | func transferWavesTest2 (g,k,i) = [IntegerEntry(((i + "_deposited_") + g), k)] | |
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | @Callable(l) | |
50 | + | func long1x (k) = { | |
51 | + | let n = invoke(this, "transferWavesTest2", ["WAVES", k, toString(l.caller)], [AttachedPayment(unit, k)]) | |
52 | + | if ((n == n)) | |
53 | + | then nil | |
54 | + | else throw("Strict value is not equal to itself.") | |
55 | + | } | |
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | @Callable(l) | |
45 | 60 | func long2x (k) = { | |
46 | 61 | let i = toString(l.caller) | |
47 | - | let | |
48 | - | if (( | |
62 | + | let o = h("WAVES", l.caller) | |
63 | + | if ((o > k)) | |
49 | 64 | then { | |
50 | - | func | |
51 | - | let | |
52 | - | if (( | |
65 | + | func p (q,r) = { | |
66 | + | let s = invoke(this, "transferWaves", [k, l.caller], nil) | |
67 | + | if ((s == s)) | |
53 | 68 | then { | |
54 | - | let | |
55 | - | if (( | |
69 | + | let t = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, k)]) | |
70 | + | if ((t == t)) | |
56 | 71 | then { | |
57 | - | let | |
58 | - | if (( | |
59 | - | then ( | |
72 | + | let u = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((k * f("WAVES")) / 100)], nil) | |
73 | + | if ((u == u)) | |
74 | + | then (q + r) | |
60 | 75 | else throw("Strict value is not equal to itself.") | |
61 | 76 | } | |
62 | 77 | else throw("Strict value is not equal to itself.") | |
64 | 79 | else throw("Strict value is not equal to itself.") | |
65 | 80 | } | |
66 | 81 | ||
67 | - | let | |
68 | - | let | |
69 | - | let w = | |
82 | + | let v = [k, k] | |
83 | + | let n = { | |
84 | + | let w = v | |
70 | 85 | let x = size(w) | |
71 | 86 | let y = 0 | |
72 | 87 | func z (A,B) = if ((B >= x)) | |
73 | 88 | then A | |
74 | - | else | |
89 | + | else p(A, w[B]) | |
75 | 90 | ||
76 | 91 | func C (A,B) = if ((B >= x)) | |
77 | 92 | then A | |
79 | 94 | ||
80 | 95 | C(z(z(y, 0), 1), 2) | |
81 | 96 | } | |
82 | - | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(l.caller, (( | |
97 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(l.caller, ((n * f("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), ScriptTransfer(this, n, unit)] | |
83 | 98 | } | |
84 | 99 | else throw("Error!") | |
85 | 100 | } | |
89 | 104 | @Callable(l) | |
90 | 105 | func borrow (k) = { | |
91 | 106 | let i = toString(l.caller) | |
92 | - | let | |
93 | - | if (( | |
107 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) | |
108 | + | if ((n == n)) | |
94 | 109 | then [ScriptTransfer(l.caller, k, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k)] | |
95 | 110 | else throw("Strict value is not equal to itself.") | |
96 | 111 | } | |
100 | 115 | @Callable(l) | |
101 | 116 | func borrow2 (k) = { | |
102 | 117 | let i = toString(l.caller) | |
103 | - | func | |
118 | + | func p (q,r) = { | |
104 | 119 | let D = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) | |
105 | 120 | if ((D == D)) | |
106 | - | then ( | |
121 | + | then (q + r) | |
107 | 122 | else throw("Strict value is not equal to itself.") | |
108 | 123 | } | |
109 | 124 | ||
110 | - | let | |
111 | - | let | |
112 | - | let w = | |
125 | + | let v = [k, k] | |
126 | + | let n = { | |
127 | + | let w = v | |
113 | 128 | let x = size(w) | |
114 | 129 | let y = 0 | |
115 | 130 | func z (A,B) = if ((B >= x)) | |
116 | 131 | then A | |
117 | - | else | |
132 | + | else p(A, w[B]) | |
118 | 133 | ||
119 | 134 | func C (A,B) = if ((B >= x)) | |
120 | 135 | then A | |
122 | 137 | ||
123 | 138 | C(z(z(y, 0), 1), 2) | |
124 | 139 | } | |
125 | - | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(l.caller, | |
140 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(l.caller, n, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
126 | 141 | } | |
127 | 142 | ||
128 | 143 | ||
130 | 145 | @Callable(l) | |
131 | 146 | func borrow5 (g,k) = { | |
132 | 147 | let i = toString(l.caller) | |
133 | - | let | |
148 | + | let n = { | |
134 | 149 | let w = a | |
135 | 150 | let x = size(w) | |
136 | 151 | let y = 0 | |
144 | 159 | ||
145 | 160 | C(z(z(z(z(z(y, 0), 1), 2), 3), 4), 5) | |
146 | 161 | } | |
147 | - | if (( | |
162 | + | if ((n == n)) | |
148 | 163 | then [IntegerEntry(((i + "_borrowed_") + g), k)] | |
149 | 164 | else throw("Strict value is not equal to itself.") | |
150 | 165 | } | |
154 | 169 | @Callable(l) | |
155 | 170 | func deposit () = { | |
156 | 171 | let i = toString(l.caller) | |
157 | - | let | |
158 | - | if (( | |
172 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
173 | + | if ((n == n)) | |
159 | 174 | then [IntegerEntry((i + "supply_waves"), 1000000)] | |
160 | 175 | else throw("Strict value is not equal to itself.") | |
161 | 176 | } | |
165 | 180 | @Callable(l) | |
166 | 181 | func withdraw (g,k) = { | |
167 | 182 | let i = toString(l.caller) | |
168 | - | let | |
169 | - | if (( | |
183 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, k], nil) | |
184 | + | if ((n == n)) | |
170 | 185 | then [IntegerEntry(((i + "_withdrew_") + g), k)] | |
171 | 186 | else throw("Strict value is not equal to itself.") | |
172 | 187 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = [1, 2, 3, 4, 5] | |
5 | 5 | ||
6 | 6 | let b = [1, 2] | |
7 | 7 | ||
8 | 8 | func c (d,e) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func f (g) = if ((g == "WAVES")) | |
12 | 12 | then 2 | |
13 | 13 | else throw("Error") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func h (g,i) = if ((g == "WAVES")) | |
17 | 17 | then wavesBalance(i).available | |
18 | 18 | else assetBalance(i, fromBase58String(g)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func j (g,k,i) = [IntegerEntry(((i + "_deposited_") + g), k)] | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(l) | |
25 | 25 | func transferWaves (k,m) = if ((l.caller != this)) | |
26 | 26 | then throw("only for internal smart contract invocations") | |
27 | 27 | else [ScriptTransfer(this, k, unit), IntegerEntry((m + "_deposited_WAVES"), k)] | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(l) | |
32 | 32 | func transferWavesTest () = if (if ((size(l.payments) != 1)) | |
33 | 33 | then true | |
34 | 34 | else (l.payments[0].amount == 0)) | |
35 | 35 | then throw("1 payment has to be attached") | |
36 | 36 | else { | |
37 | 37 | let g = "WAVES" | |
38 | 38 | let k = l.payments[0].amount | |
39 | 39 | j(g, k, toString(l.caller)) | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(l) | |
45 | + | func transferWavesTest2 (g,k,i) = [IntegerEntry(((i + "_deposited_") + g), k)] | |
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | @Callable(l) | |
50 | + | func long1x (k) = { | |
51 | + | let n = invoke(this, "transferWavesTest2", ["WAVES", k, toString(l.caller)], [AttachedPayment(unit, k)]) | |
52 | + | if ((n == n)) | |
53 | + | then nil | |
54 | + | else throw("Strict value is not equal to itself.") | |
55 | + | } | |
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | @Callable(l) | |
45 | 60 | func long2x (k) = { | |
46 | 61 | let i = toString(l.caller) | |
47 | - | let | |
48 | - | if (( | |
62 | + | let o = h("WAVES", l.caller) | |
63 | + | if ((o > k)) | |
49 | 64 | then { | |
50 | - | func | |
51 | - | let | |
52 | - | if (( | |
65 | + | func p (q,r) = { | |
66 | + | let s = invoke(this, "transferWaves", [k, l.caller], nil) | |
67 | + | if ((s == s)) | |
53 | 68 | then { | |
54 | - | let | |
55 | - | if (( | |
69 | + | let t = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, k)]) | |
70 | + | if ((t == t)) | |
56 | 71 | then { | |
57 | - | let | |
58 | - | if (( | |
59 | - | then ( | |
72 | + | let u = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((k * f("WAVES")) / 100)], nil) | |
73 | + | if ((u == u)) | |
74 | + | then (q + r) | |
60 | 75 | else throw("Strict value is not equal to itself.") | |
61 | 76 | } | |
62 | 77 | else throw("Strict value is not equal to itself.") | |
63 | 78 | } | |
64 | 79 | else throw("Strict value is not equal to itself.") | |
65 | 80 | } | |
66 | 81 | ||
67 | - | let | |
68 | - | let | |
69 | - | let w = | |
82 | + | let v = [k, k] | |
83 | + | let n = { | |
84 | + | let w = v | |
70 | 85 | let x = size(w) | |
71 | 86 | let y = 0 | |
72 | 87 | func z (A,B) = if ((B >= x)) | |
73 | 88 | then A | |
74 | - | else | |
89 | + | else p(A, w[B]) | |
75 | 90 | ||
76 | 91 | func C (A,B) = if ((B >= x)) | |
77 | 92 | then A | |
78 | 93 | else throw("List size exceeds 2") | |
79 | 94 | ||
80 | 95 | C(z(z(y, 0), 1), 2) | |
81 | 96 | } | |
82 | - | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(l.caller, (( | |
97 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(l.caller, ((n * f("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), ScriptTransfer(this, n, unit)] | |
83 | 98 | } | |
84 | 99 | else throw("Error!") | |
85 | 100 | } | |
86 | 101 | ||
87 | 102 | ||
88 | 103 | ||
89 | 104 | @Callable(l) | |
90 | 105 | func borrow (k) = { | |
91 | 106 | let i = toString(l.caller) | |
92 | - | let | |
93 | - | if (( | |
107 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) | |
108 | + | if ((n == n)) | |
94 | 109 | then [ScriptTransfer(l.caller, k, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k)] | |
95 | 110 | else throw("Strict value is not equal to itself.") | |
96 | 111 | } | |
97 | 112 | ||
98 | 113 | ||
99 | 114 | ||
100 | 115 | @Callable(l) | |
101 | 116 | func borrow2 (k) = { | |
102 | 117 | let i = toString(l.caller) | |
103 | - | func | |
118 | + | func p (q,r) = { | |
104 | 119 | let D = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) | |
105 | 120 | if ((D == D)) | |
106 | - | then ( | |
121 | + | then (q + r) | |
107 | 122 | else throw("Strict value is not equal to itself.") | |
108 | 123 | } | |
109 | 124 | ||
110 | - | let | |
111 | - | let | |
112 | - | let w = | |
125 | + | let v = [k, k] | |
126 | + | let n = { | |
127 | + | let w = v | |
113 | 128 | let x = size(w) | |
114 | 129 | let y = 0 | |
115 | 130 | func z (A,B) = if ((B >= x)) | |
116 | 131 | then A | |
117 | - | else | |
132 | + | else p(A, w[B]) | |
118 | 133 | ||
119 | 134 | func C (A,B) = if ((B >= x)) | |
120 | 135 | then A | |
121 | 136 | else throw("List size exceeds 2") | |
122 | 137 | ||
123 | 138 | C(z(z(y, 0), 1), 2) | |
124 | 139 | } | |
125 | - | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(l.caller, | |
140 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(l.caller, n, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
126 | 141 | } | |
127 | 142 | ||
128 | 143 | ||
129 | 144 | ||
130 | 145 | @Callable(l) | |
131 | 146 | func borrow5 (g,k) = { | |
132 | 147 | let i = toString(l.caller) | |
133 | - | let | |
148 | + | let n = { | |
134 | 149 | let w = a | |
135 | 150 | let x = size(w) | |
136 | 151 | let y = 0 | |
137 | 152 | func z (A,B) = if ((B >= x)) | |
138 | 153 | then A | |
139 | 154 | else c(A, w[B]) | |
140 | 155 | ||
141 | 156 | func C (A,B) = if ((B >= x)) | |
142 | 157 | then A | |
143 | 158 | else throw("List size exceeds 5") | |
144 | 159 | ||
145 | 160 | C(z(z(z(z(z(y, 0), 1), 2), 3), 4), 5) | |
146 | 161 | } | |
147 | - | if (( | |
162 | + | if ((n == n)) | |
148 | 163 | then [IntegerEntry(((i + "_borrowed_") + g), k)] | |
149 | 164 | else throw("Strict value is not equal to itself.") | |
150 | 165 | } | |
151 | 166 | ||
152 | 167 | ||
153 | 168 | ||
154 | 169 | @Callable(l) | |
155 | 170 | func deposit () = { | |
156 | 171 | let i = toString(l.caller) | |
157 | - | let | |
158 | - | if (( | |
172 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
173 | + | if ((n == n)) | |
159 | 174 | then [IntegerEntry((i + "supply_waves"), 1000000)] | |
160 | 175 | else throw("Strict value is not equal to itself.") | |
161 | 176 | } | |
162 | 177 | ||
163 | 178 | ||
164 | 179 | ||
165 | 180 | @Callable(l) | |
166 | 181 | func withdraw (g,k) = { | |
167 | 182 | let i = toString(l.caller) | |
168 | - | let | |
169 | - | if (( | |
183 | + | let n = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, k], nil) | |
184 | + | if ((n == n)) | |
170 | 185 | then [IntegerEntry(((i + "_withdrew_") + g), k)] | |
171 | 186 | else throw("Strict value is not equal to itself.") | |
172 | 187 | } | |
173 | 188 | ||
174 | 189 | ||
175 | 190 | ||
176 | 191 | @Callable(l) | |
177 | 192 | func checkBalance (g) = { | |
178 | 193 | let i = l.caller | |
179 | 194 | if ((g == "WAVES")) | |
180 | 195 | then [IntegerEntry("Waves Balance", wavesBalance(i).available)] | |
181 | 196 | else [IntegerEntry("Asset Balance", assetBalance(i, fromBase58String(g)))] | |
182 | 197 | } | |
183 | 198 | ||
184 | 199 | ||
185 | 200 | @Verifier(E) | |
186 | 201 | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
187 | 202 |
github/deemru/w8io/169f3d6 58.27 ms ◑