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:BgIkCAISAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBQADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQ9nZXRDdXJyZW50UHJpY2UBCmFzc2V0SWRTdHIDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMAAgkAAgECBUVycm9yAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgcBa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Id2l0aGRyYXcJAMwIAgUKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfd2l0aGRyZXdfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleXChX+c=",
"height": 2640178,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CSmsEmACzyHN2SjaN9isY3zN5kj7MCy6CKxSb9pgL4DB
Next: 8VYiPgTcfPyxtLhcZmUoP5EU8ApKT7v2d2BhMa4cMREH
Diff:
Old | New | | Differences |
---|
8 | 8 | | func c (d,e) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | | - | func f (g,h) = if ((g == "WAVES")) |
---|
12 | | - | then wavesBalance(h).available |
---|
13 | | - | else assetBalance(h, fromBase58String(g)) |
---|
| 11 | + | func f (g) = if ((g == "WAVES")) |
---|
| 12 | + | then 2 |
---|
| 13 | + | else throw("Error") |
---|
14 | 14 | | |
---|
15 | 15 | | |
---|
16 | | - | @Callable(i) |
---|
17 | | - | func long2x (j) = { |
---|
18 | | - | let h = toString(i.caller) |
---|
19 | | - | let k = f("WAVES", i.caller) |
---|
20 | | - | if ((k > j)) |
---|
| 16 | + | func h (g,i) = if ((g == "WAVES")) |
---|
| 17 | + | then wavesBalance(i).available |
---|
| 18 | + | else assetBalance(i, fromBase58String(g)) |
---|
| 19 | + | |
---|
| 20 | + | |
---|
| 21 | + | @Callable(j) |
---|
| 22 | + | func long2x (k) = { |
---|
| 23 | + | let i = toString(j.caller) |
---|
| 24 | + | let l = h("WAVES", j.caller) |
---|
| 25 | + | if ((l > k)) |
---|
21 | 26 | | then { |
---|
22 | | - | let l = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, j)]) |
---|
23 | | - | if ((l == l)) |
---|
24 | | - | then { |
---|
25 | | - | func m (n,o) = { |
---|
26 | | - | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
27 | | - | if ((p == p)) |
---|
| 27 | + | func m (n,o) = { |
---|
| 28 | + | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, k)]) |
---|
| 29 | + | if ((p == p)) |
---|
| 30 | + | then { |
---|
| 31 | + | let q = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (k * f("WAVES"))], nil) |
---|
| 32 | + | if ((q == q)) |
---|
28 | 33 | | then (n + o) |
---|
29 | 34 | | else throw("Strict value is not equal to itself.") |
---|
30 | 35 | | } |
---|
| 36 | + | else throw("Strict value is not equal to itself.") |
---|
| 37 | + | } |
---|
31 | 38 | | |
---|
32 | | - | let q = [j, j] |
---|
33 | | - | let r = { |
---|
34 | | - | let s = q |
---|
35 | | - | let t = size(s) |
---|
36 | | - | let u = 0 |
---|
37 | | - | func v (w,x) = if ((x >= t)) |
---|
38 | | - | then w |
---|
39 | | - | else m(w, s[x]) |
---|
| 39 | + | let r = [k, k] |
---|
| 40 | + | let s = { |
---|
| 41 | + | let t = r |
---|
| 42 | + | let u = size(t) |
---|
| 43 | + | let v = 0 |
---|
| 44 | + | func w (x,y) = if ((y >= u)) |
---|
| 45 | + | then x |
---|
| 46 | + | else m(x, t[y]) |
---|
40 | 47 | | |
---|
41 | | - | func y (w,x) = if ((x >= t)) |
---|
42 | | - | then w |
---|
43 | | - | else throw("List size exceeds 2") |
---|
| 48 | + | func z (x,y) = if ((y >= u)) |
---|
| 49 | + | then x |
---|
| 50 | + | else throw("List size exceeds 2") |
---|
44 | 51 | | |
---|
45 | | - | y(v(v(u, 0), 1), 2) |
---|
46 | | - | } |
---|
47 | | - | [IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j), ScriptTransfer(i.caller, r, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
48 | | - | } |
---|
49 | | - | else throw("Strict value is not equal to itself.") |
---|
| 52 | + | z(w(w(v, 0), 1), 2) |
---|
| 53 | + | } |
---|
| 54 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(j.caller, (s * f("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
50 | 55 | | } |
---|
51 | 56 | | else throw("Error!") |
---|
52 | 57 | | } |
---|
53 | 58 | | |
---|
54 | 59 | | |
---|
55 | 60 | | |
---|
56 | | - | @Callable(i) |
---|
57 | | - | func borrow (j) = { |
---|
58 | | - | let h = toString(i.caller) |
---|
59 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
60 | | - | if ((r == r)) |
---|
61 | | - | then [ScriptTransfer(i.caller, j, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j)] |
---|
| 61 | + | @Callable(j) |
---|
| 62 | + | func borrow (k) = { |
---|
| 63 | + | let i = toString(j.caller) |
---|
| 64 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) |
---|
| 65 | + | if ((s == s)) |
---|
| 66 | + | then [ScriptTransfer(j.caller, k, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k)] |
---|
62 | 67 | | else throw("Strict value is not equal to itself.") |
---|
63 | 68 | | } |
---|
64 | 69 | | |
---|
65 | 70 | | |
---|
66 | 71 | | |
---|
67 | | - | @Callable(i) |
---|
68 | | - | func borrow2 (j) = { |
---|
69 | | - | let h = toString(i.caller) |
---|
| 72 | + | @Callable(j) |
---|
| 73 | + | func borrow2 (k) = { |
---|
| 74 | + | let i = toString(j.caller) |
---|
70 | 75 | | func m (n,o) = { |
---|
71 | | - | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
72 | | - | if ((p == p)) |
---|
| 76 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) |
---|
| 77 | + | if ((A == A)) |
---|
73 | 78 | | then (n + o) |
---|
74 | 79 | | else throw("Strict value is not equal to itself.") |
---|
75 | 80 | | } |
---|
76 | 81 | | |
---|
77 | | - | let q = [j, j] |
---|
78 | | - | let r = { |
---|
79 | | - | let s = q |
---|
80 | | - | let t = size(s) |
---|
81 | | - | let u = 0 |
---|
82 | | - | func v (w,x) = if ((x >= t)) |
---|
83 | | - | then w |
---|
84 | | - | else m(w, s[x]) |
---|
| 82 | + | let r = [k, k] |
---|
| 83 | + | let s = { |
---|
| 84 | + | let t = r |
---|
| 85 | + | let u = size(t) |
---|
| 86 | + | let v = 0 |
---|
| 87 | + | func w (x,y) = if ((y >= u)) |
---|
| 88 | + | then x |
---|
| 89 | + | else m(x, t[y]) |
---|
85 | 90 | | |
---|
86 | | - | func y (w,x) = if ((x >= t)) |
---|
87 | | - | then w |
---|
| 91 | + | func z (x,y) = if ((y >= u)) |
---|
| 92 | + | then x |
---|
88 | 93 | | else throw("List size exceeds 2") |
---|
89 | 94 | | |
---|
90 | | - | y(v(v(u, 0), 1), 2) |
---|
| 95 | + | z(w(w(v, 0), 1), 2) |
---|
91 | 96 | | } |
---|
92 | | - | [IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j), ScriptTransfer(i.caller, r, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
| 97 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(j.caller, s, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
93 | 98 | | } |
---|
94 | 99 | | |
---|
95 | 100 | | |
---|
96 | 101 | | |
---|
97 | | - | @Callable(i) |
---|
98 | | - | func borrow5 (g,j) = { |
---|
99 | | - | let h = toString(i.caller) |
---|
100 | | - | let r = { |
---|
101 | | - | let s = a |
---|
102 | | - | let t = size(s) |
---|
103 | | - | let u = 0 |
---|
104 | | - | func v (w,x) = if ((x >= t)) |
---|
105 | | - | then w |
---|
106 | | - | else c(w, s[x]) |
---|
| 102 | + | @Callable(j) |
---|
| 103 | + | func borrow5 (g,k) = { |
---|
| 104 | + | let i = toString(j.caller) |
---|
| 105 | + | let s = { |
---|
| 106 | + | let t = a |
---|
| 107 | + | let u = size(t) |
---|
| 108 | + | let v = 0 |
---|
| 109 | + | func w (x,y) = if ((y >= u)) |
---|
| 110 | + | then x |
---|
| 111 | + | else c(x, t[y]) |
---|
107 | 112 | | |
---|
108 | | - | func y (w,x) = if ((x >= t)) |
---|
109 | | - | then w |
---|
| 113 | + | func z (x,y) = if ((y >= u)) |
---|
| 114 | + | then x |
---|
110 | 115 | | else throw("List size exceeds 5") |
---|
111 | 116 | | |
---|
112 | | - | y(v(v(v(v(v(u, 0), 1), 2), 3), 4), 5) |
---|
| 117 | + | z(w(w(w(w(w(v, 0), 1), 2), 3), 4), 5) |
---|
113 | 118 | | } |
---|
114 | | - | if ((r == r)) |
---|
115 | | - | then [IntegerEntry(((h + "_borrowed_") + g), j)] |
---|
| 119 | + | if ((s == s)) |
---|
| 120 | + | then [IntegerEntry(((i + "_borrowed_") + g), k)] |
---|
116 | 121 | | else throw("Strict value is not equal to itself.") |
---|
117 | 122 | | } |
---|
118 | 123 | | |
---|
119 | 124 | | |
---|
120 | 125 | | |
---|
121 | | - | @Callable(i) |
---|
| 126 | + | @Callable(j) |
---|
122 | 127 | | func deposit () = { |
---|
123 | | - | let h = toString(i.caller) |
---|
124 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) |
---|
125 | | - | if ((r == r)) |
---|
126 | | - | then [IntegerEntry((h + "supply_waves"), 1000000)] |
---|
| 128 | + | let i = toString(j.caller) |
---|
| 129 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) |
---|
| 130 | + | if ((s == s)) |
---|
| 131 | + | then [IntegerEntry((i + "supply_waves"), 1000000)] |
---|
127 | 132 | | else throw("Strict value is not equal to itself.") |
---|
128 | 133 | | } |
---|
129 | 134 | | |
---|
130 | 135 | | |
---|
131 | 136 | | |
---|
132 | | - | @Callable(i) |
---|
133 | | - | func withdraw (g,j) = { |
---|
134 | | - | let h = toString(i.caller) |
---|
135 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, j], nil) |
---|
136 | | - | if ((r == r)) |
---|
137 | | - | then [IntegerEntry(((h + "_withdrew_") + g), j)] |
---|
| 137 | + | @Callable(j) |
---|
| 138 | + | func withdraw (g,k) = { |
---|
| 139 | + | let i = toString(j.caller) |
---|
| 140 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, k], nil) |
---|
| 141 | + | if ((s == s)) |
---|
| 142 | + | then [IntegerEntry(((i + "_withdrew_") + g), k)] |
---|
138 | 143 | | else throw("Strict value is not equal to itself.") |
---|
139 | 144 | | } |
---|
140 | 145 | | |
---|
141 | 146 | | |
---|
142 | 147 | | |
---|
143 | | - | @Callable(i) |
---|
| 148 | + | @Callable(j) |
---|
144 | 149 | | func checkBalance (g) = { |
---|
145 | | - | let h = i.caller |
---|
| 150 | + | let i = j.caller |
---|
146 | 151 | | if ((g == "WAVES")) |
---|
147 | | - | then [IntegerEntry("Waves Balance", wavesBalance(h).available)] |
---|
148 | | - | else [IntegerEntry("Asset Balance", assetBalance(h, fromBase58String(g)))] |
---|
| 152 | + | then [IntegerEntry("Waves Balance", wavesBalance(i).available)] |
---|
| 153 | + | else [IntegerEntry("Asset Balance", assetBalance(i, fromBase58String(g)))] |
---|
149 | 154 | | } |
---|
150 | 155 | | |
---|
151 | 156 | | |
---|
152 | | - | @Verifier(z) |
---|
153 | | - | func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey) |
---|
| 157 | + | @Verifier(B) |
---|
| 158 | + | func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey) |
---|
154 | 159 | | |
---|
Full:
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 | | - | func f (g,h) = if ((g == "WAVES")) |
---|
12 | | - | then wavesBalance(h).available |
---|
13 | | - | else assetBalance(h, fromBase58String(g)) |
---|
| 11 | + | func f (g) = if ((g == "WAVES")) |
---|
| 12 | + | then 2 |
---|
| 13 | + | else throw("Error") |
---|
14 | 14 | | |
---|
15 | 15 | | |
---|
16 | | - | @Callable(i) |
---|
17 | | - | func long2x (j) = { |
---|
18 | | - | let h = toString(i.caller) |
---|
19 | | - | let k = f("WAVES", i.caller) |
---|
20 | | - | if ((k > j)) |
---|
| 16 | + | func h (g,i) = if ((g == "WAVES")) |
---|
| 17 | + | then wavesBalance(i).available |
---|
| 18 | + | else assetBalance(i, fromBase58String(g)) |
---|
| 19 | + | |
---|
| 20 | + | |
---|
| 21 | + | @Callable(j) |
---|
| 22 | + | func long2x (k) = { |
---|
| 23 | + | let i = toString(j.caller) |
---|
| 24 | + | let l = h("WAVES", j.caller) |
---|
| 25 | + | if ((l > k)) |
---|
21 | 26 | | then { |
---|
22 | | - | let l = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, j)]) |
---|
23 | | - | if ((l == l)) |
---|
24 | | - | then { |
---|
25 | | - | func m (n,o) = { |
---|
26 | | - | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
27 | | - | if ((p == p)) |
---|
| 27 | + | func m (n,o) = { |
---|
| 28 | + | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, k)]) |
---|
| 29 | + | if ((p == p)) |
---|
| 30 | + | then { |
---|
| 31 | + | let q = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", (k * f("WAVES"))], nil) |
---|
| 32 | + | if ((q == q)) |
---|
28 | 33 | | then (n + o) |
---|
29 | 34 | | else throw("Strict value is not equal to itself.") |
---|
30 | 35 | | } |
---|
| 36 | + | else throw("Strict value is not equal to itself.") |
---|
| 37 | + | } |
---|
31 | 38 | | |
---|
32 | | - | let q = [j, j] |
---|
33 | | - | let r = { |
---|
34 | | - | let s = q |
---|
35 | | - | let t = size(s) |
---|
36 | | - | let u = 0 |
---|
37 | | - | func v (w,x) = if ((x >= t)) |
---|
38 | | - | then w |
---|
39 | | - | else m(w, s[x]) |
---|
| 39 | + | let r = [k, k] |
---|
| 40 | + | let s = { |
---|
| 41 | + | let t = r |
---|
| 42 | + | let u = size(t) |
---|
| 43 | + | let v = 0 |
---|
| 44 | + | func w (x,y) = if ((y >= u)) |
---|
| 45 | + | then x |
---|
| 46 | + | else m(x, t[y]) |
---|
40 | 47 | | |
---|
41 | | - | func y (w,x) = if ((x >= t)) |
---|
42 | | - | then w |
---|
43 | | - | else throw("List size exceeds 2") |
---|
| 48 | + | func z (x,y) = if ((y >= u)) |
---|
| 49 | + | then x |
---|
| 50 | + | else throw("List size exceeds 2") |
---|
44 | 51 | | |
---|
45 | | - | y(v(v(u, 0), 1), 2) |
---|
46 | | - | } |
---|
47 | | - | [IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j), ScriptTransfer(i.caller, r, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
48 | | - | } |
---|
49 | | - | else throw("Strict value is not equal to itself.") |
---|
| 52 | + | z(w(w(v, 0), 1), 2) |
---|
| 53 | + | } |
---|
| 54 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (k * f("WAVES"))), ScriptTransfer(j.caller, (s * f("WAVES")), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
50 | 55 | | } |
---|
51 | 56 | | else throw("Error!") |
---|
52 | 57 | | } |
---|
53 | 58 | | |
---|
54 | 59 | | |
---|
55 | 60 | | |
---|
56 | | - | @Callable(i) |
---|
57 | | - | func borrow (j) = { |
---|
58 | | - | let h = toString(i.caller) |
---|
59 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
60 | | - | if ((r == r)) |
---|
61 | | - | then [ScriptTransfer(i.caller, j, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j)] |
---|
| 61 | + | @Callable(j) |
---|
| 62 | + | func borrow (k) = { |
---|
| 63 | + | let i = toString(j.caller) |
---|
| 64 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) |
---|
| 65 | + | if ((s == s)) |
---|
| 66 | + | then [ScriptTransfer(j.caller, k, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k)] |
---|
62 | 67 | | else throw("Strict value is not equal to itself.") |
---|
63 | 68 | | } |
---|
64 | 69 | | |
---|
65 | 70 | | |
---|
66 | 71 | | |
---|
67 | | - | @Callable(i) |
---|
68 | | - | func borrow2 (j) = { |
---|
69 | | - | let h = toString(i.caller) |
---|
| 72 | + | @Callable(j) |
---|
| 73 | + | func borrow2 (k) = { |
---|
| 74 | + | let i = toString(j.caller) |
---|
70 | 75 | | func m (n,o) = { |
---|
71 | | - | let p = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", j], nil) |
---|
72 | | - | if ((p == p)) |
---|
| 76 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", k], nil) |
---|
| 77 | + | if ((A == A)) |
---|
73 | 78 | | then (n + o) |
---|
74 | 79 | | else throw("Strict value is not equal to itself.") |
---|
75 | 80 | | } |
---|
76 | 81 | | |
---|
77 | | - | let q = [j, j] |
---|
78 | | - | let r = { |
---|
79 | | - | let s = q |
---|
80 | | - | let t = size(s) |
---|
81 | | - | let u = 0 |
---|
82 | | - | func v (w,x) = if ((x >= t)) |
---|
83 | | - | then w |
---|
84 | | - | else m(w, s[x]) |
---|
| 82 | + | let r = [k, k] |
---|
| 83 | + | let s = { |
---|
| 84 | + | let t = r |
---|
| 85 | + | let u = size(t) |
---|
| 86 | + | let v = 0 |
---|
| 87 | + | func w (x,y) = if ((y >= u)) |
---|
| 88 | + | then x |
---|
| 89 | + | else m(x, t[y]) |
---|
85 | 90 | | |
---|
86 | | - | func y (w,x) = if ((x >= t)) |
---|
87 | | - | then w |
---|
| 91 | + | func z (x,y) = if ((y >= u)) |
---|
| 92 | + | then x |
---|
88 | 93 | | else throw("List size exceeds 2") |
---|
89 | 94 | | |
---|
90 | | - | y(v(v(u, 0), 1), 2) |
---|
| 95 | + | z(w(w(v, 0), 1), 2) |
---|
91 | 96 | | } |
---|
92 | | - | [IntegerEntry(((h + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), j), ScriptTransfer(i.caller, r, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
| 97 | + | [IntegerEntry(((i + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), k), ScriptTransfer(j.caller, s, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] |
---|
93 | 98 | | } |
---|
94 | 99 | | |
---|
95 | 100 | | |
---|
96 | 101 | | |
---|
97 | | - | @Callable(i) |
---|
98 | | - | func borrow5 (g,j) = { |
---|
99 | | - | let h = toString(i.caller) |
---|
100 | | - | let r = { |
---|
101 | | - | let s = a |
---|
102 | | - | let t = size(s) |
---|
103 | | - | let u = 0 |
---|
104 | | - | func v (w,x) = if ((x >= t)) |
---|
105 | | - | then w |
---|
106 | | - | else c(w, s[x]) |
---|
| 102 | + | @Callable(j) |
---|
| 103 | + | func borrow5 (g,k) = { |
---|
| 104 | + | let i = toString(j.caller) |
---|
| 105 | + | let s = { |
---|
| 106 | + | let t = a |
---|
| 107 | + | let u = size(t) |
---|
| 108 | + | let v = 0 |
---|
| 109 | + | func w (x,y) = if ((y >= u)) |
---|
| 110 | + | then x |
---|
| 111 | + | else c(x, t[y]) |
---|
107 | 112 | | |
---|
108 | | - | func y (w,x) = if ((x >= t)) |
---|
109 | | - | then w |
---|
| 113 | + | func z (x,y) = if ((y >= u)) |
---|
| 114 | + | then x |
---|
110 | 115 | | else throw("List size exceeds 5") |
---|
111 | 116 | | |
---|
112 | | - | y(v(v(v(v(v(u, 0), 1), 2), 3), 4), 5) |
---|
| 117 | + | z(w(w(w(w(w(v, 0), 1), 2), 3), 4), 5) |
---|
113 | 118 | | } |
---|
114 | | - | if ((r == r)) |
---|
115 | | - | then [IntegerEntry(((h + "_borrowed_") + g), j)] |
---|
| 119 | + | if ((s == s)) |
---|
| 120 | + | then [IntegerEntry(((i + "_borrowed_") + g), k)] |
---|
116 | 121 | | else throw("Strict value is not equal to itself.") |
---|
117 | 122 | | } |
---|
118 | 123 | | |
---|
119 | 124 | | |
---|
120 | 125 | | |
---|
121 | | - | @Callable(i) |
---|
| 126 | + | @Callable(j) |
---|
122 | 127 | | func deposit () = { |
---|
123 | | - | let h = toString(i.caller) |
---|
124 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) |
---|
125 | | - | if ((r == r)) |
---|
126 | | - | then [IntegerEntry((h + "supply_waves"), 1000000)] |
---|
| 128 | + | let i = toString(j.caller) |
---|
| 129 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) |
---|
| 130 | + | if ((s == s)) |
---|
| 131 | + | then [IntegerEntry((i + "supply_waves"), 1000000)] |
---|
127 | 132 | | else throw("Strict value is not equal to itself.") |
---|
128 | 133 | | } |
---|
129 | 134 | | |
---|
130 | 135 | | |
---|
131 | 136 | | |
---|
132 | | - | @Callable(i) |
---|
133 | | - | func withdraw (g,j) = { |
---|
134 | | - | let h = toString(i.caller) |
---|
135 | | - | let r = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, j], nil) |
---|
136 | | - | if ((r == r)) |
---|
137 | | - | then [IntegerEntry(((h + "_withdrew_") + g), j)] |
---|
| 137 | + | @Callable(j) |
---|
| 138 | + | func withdraw (g,k) = { |
---|
| 139 | + | let i = toString(j.caller) |
---|
| 140 | + | let s = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [g, k], nil) |
---|
| 141 | + | if ((s == s)) |
---|
| 142 | + | then [IntegerEntry(((i + "_withdrew_") + g), k)] |
---|
138 | 143 | | else throw("Strict value is not equal to itself.") |
---|
139 | 144 | | } |
---|
140 | 145 | | |
---|
141 | 146 | | |
---|
142 | 147 | | |
---|
143 | | - | @Callable(i) |
---|
| 148 | + | @Callable(j) |
---|
144 | 149 | | func checkBalance (g) = { |
---|
145 | | - | let h = i.caller |
---|
| 150 | + | let i = j.caller |
---|
146 | 151 | | if ((g == "WAVES")) |
---|
147 | | - | then [IntegerEntry("Waves Balance", wavesBalance(h).available)] |
---|
148 | | - | else [IntegerEntry("Asset Balance", assetBalance(h, fromBase58String(g)))] |
---|
| 152 | + | then [IntegerEntry("Waves Balance", wavesBalance(i).available)] |
---|
| 153 | + | else [IntegerEntry("Asset Balance", assetBalance(i, fromBase58String(g)))] |
---|
149 | 154 | | } |
---|
150 | 155 | | |
---|
151 | 156 | | |
---|
152 | | - | @Verifier(z) |
---|
153 | | - | func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey) |
---|
| 157 | + | @Verifier(B) |
---|
| 158 | + | func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey) |
---|
154 | 159 | | |
---|