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