tx · 3bxs3NaozKasSL6Tkpo8fvbPTEHdRgXuDyBvp5nZYsaA 3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE: -0.03700000 Waves 2023.03.04 14:27 [2475245] smart account 3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE > SELF 0.00000000 Waves
{ "type": 13, "id": "3bxs3NaozKasSL6Tkpo8fvbPTEHdRgXuDyBvp5nZYsaA", "fee": 3700000, "feeAssetId": null, "timestamp": 1677929233557, "version": 2, "chainId": 84, "sender": "3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE", "senderPublicKey": "2xKeXbdM9foVwuYZuNRHgp8YW7g3LowcCAg4pp6yu2Es", "proofs": [ "83m3cZP6qEMLHRZvdX9K1UgVr9R1w9WQVjV8ZRuFARBBYnHwvgVAbgC64828qLTXqnsiwNmGp6tndhtSGxELToF" ], "script": "base64:BgIPCAISAwoBCBIGCgQEBAQIDQANa19pbml0aWFsaXplZAINa19pbml0aWFsaXplZAAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwAPa192YXVsdF9hZGRyZXNzAg9rX3ZhdWx0X2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAQlzdHJUb0xpc3QBBF9zdHIDCQAAAgUEX3N0cgIABQNuaWwJALUJAgUEX3N0cgIBLAELY29vcmRpbmF0b3IACQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKYIAQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFBHRoaXMFFGtfY29vcmRpbmF0b3JBZGRyZXNzAhZDb29yZGluYXRvciBub3Qgc2V0IEhDAhtDb29yZGluYXRvciBhZGRyZXNzIGludmFsaWQBDGFkbWluQWRkcmVzcwAJAKYI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AgFAnR4D3NlbmRlclB1YmxpY0tlea2sWp8=", "height": 2475245, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F1tpRJsnLHJgYBhZHmp5yCh2whXLT6ahEhyQpKkKNSja Next: 7gwCjBecAVxf5RQScBGuezGiTAQqhWd4LExtpjx4fPcS Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = "k_farming_address" | |
11 | 11 | ||
12 | - | let e = "k_ | |
12 | + | let e = "k_vault_address" | |
13 | 13 | ||
14 | - | let f = "k_ | |
14 | + | let f = "k_admin_address" | |
15 | 15 | ||
16 | - | let g = "k_admin_public_key" | |
17 | - | ||
18 | - | let h = "k_admin_address" | |
19 | - | ||
20 | - | func i (j) = if ((j == "")) | |
16 | + | func g (h) = if ((h == "")) | |
21 | 17 | then nil | |
22 | - | else split( | |
18 | + | else split(h, ",") | |
23 | 19 | ||
24 | 20 | ||
25 | - | func | |
21 | + | func i () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set HC")), "Coordinator address invalid") | |
26 | 22 | ||
27 | 23 | ||
28 | - | func | |
24 | + | func j () = addressFromString(valueOrErrorMessage(getString(i(), f), "Admin address not set")) | |
29 | 25 | ||
30 | 26 | ||
31 | - | func | |
27 | + | func k () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), c), "Staking address not set")), "Staking address invalid") | |
32 | 28 | ||
33 | 29 | ||
34 | - | func | |
30 | + | func l () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), d), "Farming address not set")), "Farming address invalid") | |
35 | 31 | ||
36 | 32 | ||
37 | - | func | |
33 | + | func m () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), e), "Vault address not set")), "Vault address invalid") | |
38 | 34 | ||
39 | 35 | ||
40 | - | func | |
36 | + | func n () = valueOrElse(getBoolean(this, a), false) | |
41 | 37 | ||
42 | 38 | ||
43 | - | func q () = valueOrErrorMessage(addressFromString(getStringValue(k(), d)), "Staking not set") | |
44 | - | ||
45 | - | ||
46 | - | func r () = valueOrElse(getBoolean(this, a), false) | |
47 | - | ||
48 | - | ||
49 | - | @Callable(s) | |
50 | - | func initialize (t) = if (r()) | |
51 | - | then throw("Already initialized") | |
52 | - | else [StringEntry(b, t), BooleanEntry(a, true)] | |
39 | + | @Callable(o) | |
40 | + | func initialize (p) = if (if (n()) | |
41 | + | then true | |
42 | + | else (o.caller != this)) | |
43 | + | then throw("Unable to initialize") | |
44 | + | else [StringEntry(b, toString(addressFromStringValue(p))), BooleanEntry(a, true)] | |
53 | 45 | ||
54 | 46 | ||
55 | 47 | ||
56 | - | @Callable(s) | |
57 | - | func performHousekeeping (u) = { | |
58 | - | let v = invoke(p(), "ackRewards", nil, nil) | |
59 | - | if ((v == v)) | |
48 | + | @Callable(o) | |
49 | + | func performHousekeeping (q,r,s,t) = { | |
50 | + | let u = if (s) | |
51 | + | then invoke(k(), "ackRewards", nil, nil) | |
52 | + | else nil | |
53 | + | if ((u == u)) | |
60 | 54 | then { | |
61 | - | let w = invoke(q(), "ackRewards", nil, nil) | |
62 | - | if ((w == w)) | |
55 | + | let v = if (r) | |
56 | + | then invoke(l(), "ackRewards", nil, nil) | |
57 | + | else nil | |
58 | + | if ((v == v)) | |
63 | 59 | then { | |
64 | - | let x = i(u) | |
65 | - | func y (z,A) = { | |
66 | - | let B = invoke(addressFromStringValue(A), "payFunding", nil, nil) | |
67 | - | if ((B == B)) | |
68 | - | then z | |
69 | - | else throw("Strict value is not equal to itself.") | |
70 | - | } | |
60 | + | let w = if (q) | |
61 | + | then invoke(m(), "ackRewards", nil, nil) | |
62 | + | else nil | |
63 | + | if ((w == w)) | |
64 | + | then { | |
65 | + | let x = g(t) | |
66 | + | func y (z,A) = { | |
67 | + | let B = invoke(addressFromStringValue(A), "payFunding", nil, nil) | |
68 | + | if ((B == B)) | |
69 | + | then z | |
70 | + | else throw("Strict value is not equal to itself.") | |
71 | + | } | |
71 | 72 | ||
72 | - | let C = x | |
73 | - | let D = size(C) | |
74 | - | let E = nil | |
75 | - | func F (G,H) = if ((H >= D)) | |
76 | - | then G | |
77 | - | else y(G, C[H]) | |
73 | + | let C = x | |
74 | + | let D = size(C) | |
75 | + | let E = nil | |
76 | + | func F (G,H) = if ((H >= D)) | |
77 | + | then G | |
78 | + | else y(G, C[H]) | |
78 | 79 | ||
79 | - | func I (G,H) = if ((H >= D)) | |
80 | - | then G | |
81 | - | else throw("List size exceeds 20") | |
80 | + | func I (G,H) = if ((H >= D)) | |
81 | + | then G | |
82 | + | else throw("List size exceeds 20") | |
82 | 83 | ||
83 | - | I(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(E, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
84 | + | I(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(E, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
85 | + | } | |
86 | + | else throw("Strict value is not equal to itself.") | |
84 | 87 | } | |
85 | 88 | else throw("Strict value is not equal to itself.") | |
86 | 89 | } | |
89 | 92 | ||
90 | 93 | ||
91 | 94 | @Verifier(J) | |
92 | - | func K () = sigVerify(J.bodyBytes, J.proofs[0], m()) | |
95 | + | func K () = { | |
96 | + | let L = getString(this, b) | |
97 | + | if (isDefined(L)) | |
98 | + | then { | |
99 | + | let M = getString(addressFromStringValue(value(L)), f) | |
100 | + | if (isDefined(M)) | |
101 | + | then valueOrElse(getBoolean(addressFromStringValue(value(M)), ((("status_" + toString(this)) + "_") + toBase58String(J.id))), false) | |
102 | + | else throw("unable to verify: admin not set in coordinator") | |
103 | + | } | |
104 | + | else sigVerify(J.bodyBytes, J.proofs[0], J.senderPublicKey) | |
105 | + | } | |
93 | 106 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_initialized" | |
5 | 5 | ||
6 | 6 | let b = "k_coordinatorAddress" | |
7 | 7 | ||
8 | 8 | let c = "k_staking_address" | |
9 | 9 | ||
10 | 10 | let d = "k_farming_address" | |
11 | 11 | ||
12 | - | let e = "k_ | |
12 | + | let e = "k_vault_address" | |
13 | 13 | ||
14 | - | let f = "k_ | |
14 | + | let f = "k_admin_address" | |
15 | 15 | ||
16 | - | let g = "k_admin_public_key" | |
17 | - | ||
18 | - | let h = "k_admin_address" | |
19 | - | ||
20 | - | func i (j) = if ((j == "")) | |
16 | + | func g (h) = if ((h == "")) | |
21 | 17 | then nil | |
22 | - | else split( | |
18 | + | else split(h, ",") | |
23 | 19 | ||
24 | 20 | ||
25 | - | func | |
21 | + | func i () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set HC")), "Coordinator address invalid") | |
26 | 22 | ||
27 | 23 | ||
28 | - | func | |
24 | + | func j () = addressFromString(valueOrErrorMessage(getString(i(), f), "Admin address not set")) | |
29 | 25 | ||
30 | 26 | ||
31 | - | func | |
27 | + | func k () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), c), "Staking address not set")), "Staking address invalid") | |
32 | 28 | ||
33 | 29 | ||
34 | - | func | |
30 | + | func l () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), d), "Farming address not set")), "Farming address invalid") | |
35 | 31 | ||
36 | 32 | ||
37 | - | func | |
33 | + | func m () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(i(), e), "Vault address not set")), "Vault address invalid") | |
38 | 34 | ||
39 | 35 | ||
40 | - | func | |
36 | + | func n () = valueOrElse(getBoolean(this, a), false) | |
41 | 37 | ||
42 | 38 | ||
43 | - | func q () = valueOrErrorMessage(addressFromString(getStringValue(k(), d)), "Staking not set") | |
44 | - | ||
45 | - | ||
46 | - | func r () = valueOrElse(getBoolean(this, a), false) | |
47 | - | ||
48 | - | ||
49 | - | @Callable(s) | |
50 | - | func initialize (t) = if (r()) | |
51 | - | then throw("Already initialized") | |
52 | - | else [StringEntry(b, t), BooleanEntry(a, true)] | |
39 | + | @Callable(o) | |
40 | + | func initialize (p) = if (if (n()) | |
41 | + | then true | |
42 | + | else (o.caller != this)) | |
43 | + | then throw("Unable to initialize") | |
44 | + | else [StringEntry(b, toString(addressFromStringValue(p))), BooleanEntry(a, true)] | |
53 | 45 | ||
54 | 46 | ||
55 | 47 | ||
56 | - | @Callable(s) | |
57 | - | func performHousekeeping (u) = { | |
58 | - | let v = invoke(p(), "ackRewards", nil, nil) | |
59 | - | if ((v == v)) | |
48 | + | @Callable(o) | |
49 | + | func performHousekeeping (q,r,s,t) = { | |
50 | + | let u = if (s) | |
51 | + | then invoke(k(), "ackRewards", nil, nil) | |
52 | + | else nil | |
53 | + | if ((u == u)) | |
60 | 54 | then { | |
61 | - | let w = invoke(q(), "ackRewards", nil, nil) | |
62 | - | if ((w == w)) | |
55 | + | let v = if (r) | |
56 | + | then invoke(l(), "ackRewards", nil, nil) | |
57 | + | else nil | |
58 | + | if ((v == v)) | |
63 | 59 | then { | |
64 | - | let x = i(u) | |
65 | - | func y (z,A) = { | |
66 | - | let B = invoke(addressFromStringValue(A), "payFunding", nil, nil) | |
67 | - | if ((B == B)) | |
68 | - | then z | |
69 | - | else throw("Strict value is not equal to itself.") | |
70 | - | } | |
60 | + | let w = if (q) | |
61 | + | then invoke(m(), "ackRewards", nil, nil) | |
62 | + | else nil | |
63 | + | if ((w == w)) | |
64 | + | then { | |
65 | + | let x = g(t) | |
66 | + | func y (z,A) = { | |
67 | + | let B = invoke(addressFromStringValue(A), "payFunding", nil, nil) | |
68 | + | if ((B == B)) | |
69 | + | then z | |
70 | + | else throw("Strict value is not equal to itself.") | |
71 | + | } | |
71 | 72 | ||
72 | - | let C = x | |
73 | - | let D = size(C) | |
74 | - | let E = nil | |
75 | - | func F (G,H) = if ((H >= D)) | |
76 | - | then G | |
77 | - | else y(G, C[H]) | |
73 | + | let C = x | |
74 | + | let D = size(C) | |
75 | + | let E = nil | |
76 | + | func F (G,H) = if ((H >= D)) | |
77 | + | then G | |
78 | + | else y(G, C[H]) | |
78 | 79 | ||
79 | - | func I (G,H) = if ((H >= D)) | |
80 | - | then G | |
81 | - | else throw("List size exceeds 20") | |
80 | + | func I (G,H) = if ((H >= D)) | |
81 | + | then G | |
82 | + | else throw("List size exceeds 20") | |
82 | 83 | ||
83 | - | I(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(E, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
84 | + | I(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(E, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
85 | + | } | |
86 | + | else throw("Strict value is not equal to itself.") | |
84 | 87 | } | |
85 | 88 | else throw("Strict value is not equal to itself.") | |
86 | 89 | } | |
87 | 90 | else throw("Strict value is not equal to itself.") | |
88 | 91 | } | |
89 | 92 | ||
90 | 93 | ||
91 | 94 | @Verifier(J) | |
92 | - | func K () = sigVerify(J.bodyBytes, J.proofs[0], m()) | |
95 | + | func K () = { | |
96 | + | let L = getString(this, b) | |
97 | + | if (isDefined(L)) | |
98 | + | then { | |
99 | + | let M = getString(addressFromStringValue(value(L)), f) | |
100 | + | if (isDefined(M)) | |
101 | + | then valueOrElse(getBoolean(addressFromStringValue(value(M)), ((("status_" + toString(this)) + "_") + toBase58String(J.id))), false) | |
102 | + | else throw("unable to verify: admin not set in coordinator") | |
103 | + | } | |
104 | + | else sigVerify(J.bodyBytes, J.proofs[0], J.senderPublicKey) | |
105 | + | } | |
93 | 106 |
github/deemru/w8io/169f3d6 53.42 ms ◑