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