tx · 2HihmDocLeyTiR7kShy6wCwEj4Ma5zHWuYAJBtp6FQiF 3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt: -0.00400000 Waves 2022.11.18 18:06 [2322714] smart account 3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt > SELF 0.00000000 Waves
{ "type": 13, "id": "2HihmDocLeyTiR7kShy6wCwEj4Ma5zHWuYAJBtp6FQiF", "fee": 400000, "feeAssetId": null, "timestamp": 1668784056086, "version": 1, "sender": "3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt", "senderPublicKey": "3xUNfrYKuaZmnMzb6e9tKC4azGnvWZyLzeKdUgAeFFpV", "proofs": [ "2Ti9vKXPnNJj9WZqmVV7T6svMyqTYLVbe3M2tXzMCCxipNZvJX433eKtBEFNmto7jPPbxeManmyDnTPSVQQPtxpj" ], "script": "base64:BgIVCAISAwoBCBIDCgEIEgcKBQgICAEBEwABUwICX18AA0RFQwDAhD0BDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJAKwCAgkArAICCQCsAgIJAKUIAQUHYWRkcmVzcwIBLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBDGdldFN0ck9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJAKwCAgkArAICCQCsAgIJAKUIAQUHYWRkcmVzcwIBLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBBmdldEludAMHYWRkcmVzcwNrZXkHZGVmYXVsdAkBC3ZhbHVlT3JFbHNlAgkAmggCBQdhZGRyZXNzBQNrZXkFB2RlZmF1bHQBBmdldFN0cgMHYWRkcmVzcwNrZXkHZGVmYXVsdAkBC3ZhbHVlT3JFbHNlAgkAnQgCBQdhZGRyZXNzBQNrZXkFB2RlZmF1bHQBEmtleUNmZ1ByaWNlQXNzZXRJZ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rbgAACQBrAwUHdGVhbUNhcAUDREVDBQd0ZWFtVGtuBQNERUMEDnRlYW1Ua25Gb3JVc2VyCQBrAwUGcG10QW10BQNERUMFBXByaWNlCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEKa2V5VGVhbUNhcAEFCHRlYW1Db2RlCQBkAgUHdGVhbUNhcAUGcG10QW10CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEKa2V5VGVhbVRrbgEFCHRlYW1Db2RlCQBkAgUHdGVhbVRrbgUOdGVhbVRrbkZvclVzZXIJAMwIAgkBFXVwZGF0ZVVzZXJTaGFyZUluVGVhbQQFBHVzZXIFCHRlYW1Db2RlBQ50ZWFtVGtuRm9yVXNlcgUGcG10QW10CQDMCAIJARN1cGRhdGVUZWFtUmlza09uQnV5AgUIdGVhbUNvZGUFBnBtdEFtdAUDbmlsAWkBBXNjb3JlBQVyb3VuZAxob21lVGVhbUNvZGUMYXdheVRlYW1Db2RlDWhvbWVUZWFtR29hbHMNYXdheVRlYW1Hb2FscwUDbmlsABV3hto=", "chainId": 84, "height": 2322714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BL8eoWqZtiChsm5EpinXgLTFJnGa6HHgSXe14uEPLJmX Next: 6z9Cgr8TuTMgUjKTpFiE9G5FZTvs8NxdokNtxJLcx5xA Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = 1000000 | |
7 | 7 | ||
8 | - | let c = fromBase58String(valueOrElse(getString(this, "cfg__usdnId"), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ")) | |
9 | - | ||
10 | - | func d (e,f) = valueOrErrorMessage(getInteger(e, f), (((toString(e) + ".") + f) + " is not defined")) | |
8 | + | func c (d,e) = valueOrErrorMessage(getInteger(d, e), (((toString(d) + ".") + e) + " is not defined")) | |
11 | 9 | ||
12 | 10 | ||
13 | - | func | |
11 | + | func f (d,e) = valueOrErrorMessage(getString(d, e), (((toString(d) + ".") + e) + " is not defined")) | |
14 | 12 | ||
15 | 13 | ||
16 | - | func | |
14 | + | func g (d,e,h) = valueOrElse(getInteger(d, e), h) | |
17 | 15 | ||
18 | 16 | ||
19 | - | func | |
17 | + | func i (d,e,h) = valueOrElse(getString(d, e), h) | |
20 | 18 | ||
21 | 19 | ||
22 | - | func | |
20 | + | func j () = "%s%s__cfg__priceAsset" | |
23 | 21 | ||
24 | 22 | ||
25 | - | func m (l) = makeString(["%s%s__teamTokens", l], a) | |
23 | + | let k = fromBase58String(i(this, j(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ")) | |
24 | + | ||
25 | + | func l (m) = makeString(["%s%s__teamCapitalization", m], a) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func n ( | |
28 | + | func n (m) = makeString(["%s%s__teamTokens", m], a) | |
29 | 29 | ||
30 | 30 | ||
31 | - | func o ( | |
31 | + | func o (m) = makeString(["%s%s__teamRound", m], a) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func p ( | |
34 | + | func p (m) = makeString(["%s%s__teamRisks", m], a) | |
35 | 35 | ||
36 | 36 | ||
37 | - | func | |
37 | + | func q (r,m) = makeString(["%s%s%s__userTeam", m, r], a) | |
38 | 38 | ||
39 | 39 | ||
40 | - | func | |
40 | + | func s (t,u,v,w) = makeString(["%d%d%d%d", t, u, v, w], a) | |
41 | 41 | ||
42 | 42 | ||
43 | - | func x (y,z) = if ((y == 1)) | |
44 | - | then $Tuple4((z / 3), (z / 3), (z / 3), 0) | |
45 | - | else if ((y == 2)) | |
46 | - | then $Tuple4(0, (z / 2), (z / 2), 0) | |
47 | - | else if ((y == 3)) | |
48 | - | then $Tuple4(0, 0, z, 0) | |
49 | - | else $Tuple4(0, 0, 0, z) | |
43 | + | func x (m) = g(this, o(m), 1) | |
50 | 44 | ||
51 | 45 | ||
52 | - | func A (l,z) = { | |
53 | - | let B = o(l) | |
54 | - | let C = j(this, B, r("0", "0", "0", "0")) | |
55 | - | let D = split(C, a) | |
56 | - | let E = w(l) | |
57 | - | let F = x(E, z) | |
58 | - | let s = toString((parseIntValue(D[1]) + F._1)) | |
59 | - | let t = toString((parseIntValue(D[2]) + F._2)) | |
60 | - | let u = toString((parseIntValue(D[3]) + F._3)) | |
61 | - | let v = toString((parseIntValue(D[4]) + F._4)) | |
62 | - | StringEntry(B, r(s, t, u, v)) | |
46 | + | func y (z) = if ((this != z.caller)) | |
47 | + | then throw("not allowed") | |
48 | + | else true | |
49 | + | ||
50 | + | ||
51 | + | func A (B,C) = if ((B == 1)) | |
52 | + | then $Tuple4((C / 3), (C / 3), (C / 3), 0) | |
53 | + | else if ((B == 2)) | |
54 | + | then $Tuple4(0, (C / 2), (C / 2), 0) | |
55 | + | else if ((B == 3)) | |
56 | + | then $Tuple4(0, 0, C, 0) | |
57 | + | else $Tuple4(0, 0, 0, C) | |
58 | + | ||
59 | + | ||
60 | + | func D (m,C) = { | |
61 | + | let E = p(m) | |
62 | + | let F = i(this, E, s("0", "0", "0", "0")) | |
63 | + | let G = split(F, a) | |
64 | + | let H = x(m) | |
65 | + | let I = A(H, C) | |
66 | + | let t = toString((parseIntValue(G[1]) + I._1)) | |
67 | + | let u = toString((parseIntValue(G[2]) + I._2)) | |
68 | + | let v = toString((parseIntValue(G[3]) + I._3)) | |
69 | + | let w = toString((parseIntValue(G[4]) + I._4)) | |
70 | + | StringEntry(E, s(t, u, v, w)) | |
63 | 71 | } | |
64 | 72 | ||
65 | 73 | ||
66 | - | func | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | StringEntry( | |
74 | + | func J (K,m,L,C) = { | |
75 | + | let e = q(K, m) | |
76 | + | let M = split(i(this, e, "%d%d__0__0"), a) | |
77 | + | let N = toString((parseIntValue(M[1]) + L)) | |
78 | + | let O = toString((parseIntValue(M[2]) + C)) | |
79 | + | StringEntry(e, makeString(["%d%d", N, O], a)) | |
72 | 80 | } | |
73 | 81 | ||
74 | 82 | ||
75 | - | @Callable(M) | |
76 | - | func buyTeam (l) = { | |
77 | - | let q = toString(M.caller) | |
78 | - | let z = M.payments[0] | |
79 | - | let N = z.amount | |
80 | - | let O = z.assetId | |
81 | - | if ((size(M.payments) != 1)) | |
83 | + | @Callable(z) | |
84 | + | func init (P) = { | |
85 | + | let Q = [y(z)] | |
86 | + | if ((Q == Q)) | |
87 | + | then [StringEntry("cfg__priceAsset", P)] | |
88 | + | else throw("Strict value is not equal to itself.") | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | @Callable(z) | |
94 | + | func buyTeam (m) = { | |
95 | + | let r = toString(z.caller) | |
96 | + | let C = z.payments[0] | |
97 | + | let R = C.amount | |
98 | + | let S = C.assetId | |
99 | + | if ((size(z.payments) != 1)) | |
82 | 100 | then throw("1 payment is expected") | |
83 | - | else if (( | |
101 | + | else if ((S != k)) | |
84 | 102 | then throw("invalid payment asset id") | |
85 | 103 | else { | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | then fraction( | |
104 | + | let T = c(this, l(m)) | |
105 | + | let U = c(this, n(m)) | |
106 | + | let V = if ((U != 0)) | |
107 | + | then fraction(T, b, U) | |
90 | 108 | else b | |
91 | - | let | |
92 | - | [IntegerEntry( | |
109 | + | let W = fraction(R, b, V) | |
110 | + | [IntegerEntry(l(m), (T + R)), IntegerEntry(n(m), (U + W)), J(r, m, W, R), D(m, R)] | |
93 | 111 | } | |
94 | 112 | } | |
95 | 113 | ||
96 | 114 | ||
97 | 115 | ||
98 | - | @Callable( | |
99 | - | func score ( | |
116 | + | @Callable(z) | |
117 | + | func score (B,X,Y,Z,aa) = nil | |
100 | 118 | ||
101 | 119 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 1000000 | |
7 | 7 | ||
8 | - | let c = fromBase58String(valueOrElse(getString(this, "cfg__usdnId"), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ")) | |
9 | - | ||
10 | - | func d (e,f) = valueOrErrorMessage(getInteger(e, f), (((toString(e) + ".") + f) + " is not defined")) | |
8 | + | func c (d,e) = valueOrErrorMessage(getInteger(d, e), (((toString(d) + ".") + e) + " is not defined")) | |
11 | 9 | ||
12 | 10 | ||
13 | - | func | |
11 | + | func f (d,e) = valueOrErrorMessage(getString(d, e), (((toString(d) + ".") + e) + " is not defined")) | |
14 | 12 | ||
15 | 13 | ||
16 | - | func | |
14 | + | func g (d,e,h) = valueOrElse(getInteger(d, e), h) | |
17 | 15 | ||
18 | 16 | ||
19 | - | func | |
17 | + | func i (d,e,h) = valueOrElse(getString(d, e), h) | |
20 | 18 | ||
21 | 19 | ||
22 | - | func | |
20 | + | func j () = "%s%s__cfg__priceAsset" | |
23 | 21 | ||
24 | 22 | ||
25 | - | func m (l) = makeString(["%s%s__teamTokens", l], a) | |
23 | + | let k = fromBase58String(i(this, j(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ")) | |
24 | + | ||
25 | + | func l (m) = makeString(["%s%s__teamCapitalization", m], a) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func n ( | |
28 | + | func n (m) = makeString(["%s%s__teamTokens", m], a) | |
29 | 29 | ||
30 | 30 | ||
31 | - | func o ( | |
31 | + | func o (m) = makeString(["%s%s__teamRound", m], a) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func p ( | |
34 | + | func p (m) = makeString(["%s%s__teamRisks", m], a) | |
35 | 35 | ||
36 | 36 | ||
37 | - | func | |
37 | + | func q (r,m) = makeString(["%s%s%s__userTeam", m, r], a) | |
38 | 38 | ||
39 | 39 | ||
40 | - | func | |
40 | + | func s (t,u,v,w) = makeString(["%d%d%d%d", t, u, v, w], a) | |
41 | 41 | ||
42 | 42 | ||
43 | - | func x (y,z) = if ((y == 1)) | |
44 | - | then $Tuple4((z / 3), (z / 3), (z / 3), 0) | |
45 | - | else if ((y == 2)) | |
46 | - | then $Tuple4(0, (z / 2), (z / 2), 0) | |
47 | - | else if ((y == 3)) | |
48 | - | then $Tuple4(0, 0, z, 0) | |
49 | - | else $Tuple4(0, 0, 0, z) | |
43 | + | func x (m) = g(this, o(m), 1) | |
50 | 44 | ||
51 | 45 | ||
52 | - | func A (l,z) = { | |
53 | - | let B = o(l) | |
54 | - | let C = j(this, B, r("0", "0", "0", "0")) | |
55 | - | let D = split(C, a) | |
56 | - | let E = w(l) | |
57 | - | let F = x(E, z) | |
58 | - | let s = toString((parseIntValue(D[1]) + F._1)) | |
59 | - | let t = toString((parseIntValue(D[2]) + F._2)) | |
60 | - | let u = toString((parseIntValue(D[3]) + F._3)) | |
61 | - | let v = toString((parseIntValue(D[4]) + F._4)) | |
62 | - | StringEntry(B, r(s, t, u, v)) | |
46 | + | func y (z) = if ((this != z.caller)) | |
47 | + | then throw("not allowed") | |
48 | + | else true | |
49 | + | ||
50 | + | ||
51 | + | func A (B,C) = if ((B == 1)) | |
52 | + | then $Tuple4((C / 3), (C / 3), (C / 3), 0) | |
53 | + | else if ((B == 2)) | |
54 | + | then $Tuple4(0, (C / 2), (C / 2), 0) | |
55 | + | else if ((B == 3)) | |
56 | + | then $Tuple4(0, 0, C, 0) | |
57 | + | else $Tuple4(0, 0, 0, C) | |
58 | + | ||
59 | + | ||
60 | + | func D (m,C) = { | |
61 | + | let E = p(m) | |
62 | + | let F = i(this, E, s("0", "0", "0", "0")) | |
63 | + | let G = split(F, a) | |
64 | + | let H = x(m) | |
65 | + | let I = A(H, C) | |
66 | + | let t = toString((parseIntValue(G[1]) + I._1)) | |
67 | + | let u = toString((parseIntValue(G[2]) + I._2)) | |
68 | + | let v = toString((parseIntValue(G[3]) + I._3)) | |
69 | + | let w = toString((parseIntValue(G[4]) + I._4)) | |
70 | + | StringEntry(E, s(t, u, v, w)) | |
63 | 71 | } | |
64 | 72 | ||
65 | 73 | ||
66 | - | func | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | StringEntry( | |
74 | + | func J (K,m,L,C) = { | |
75 | + | let e = q(K, m) | |
76 | + | let M = split(i(this, e, "%d%d__0__0"), a) | |
77 | + | let N = toString((parseIntValue(M[1]) + L)) | |
78 | + | let O = toString((parseIntValue(M[2]) + C)) | |
79 | + | StringEntry(e, makeString(["%d%d", N, O], a)) | |
72 | 80 | } | |
73 | 81 | ||
74 | 82 | ||
75 | - | @Callable(M) | |
76 | - | func buyTeam (l) = { | |
77 | - | let q = toString(M.caller) | |
78 | - | let z = M.payments[0] | |
79 | - | let N = z.amount | |
80 | - | let O = z.assetId | |
81 | - | if ((size(M.payments) != 1)) | |
83 | + | @Callable(z) | |
84 | + | func init (P) = { | |
85 | + | let Q = [y(z)] | |
86 | + | if ((Q == Q)) | |
87 | + | then [StringEntry("cfg__priceAsset", P)] | |
88 | + | else throw("Strict value is not equal to itself.") | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | @Callable(z) | |
94 | + | func buyTeam (m) = { | |
95 | + | let r = toString(z.caller) | |
96 | + | let C = z.payments[0] | |
97 | + | let R = C.amount | |
98 | + | let S = C.assetId | |
99 | + | if ((size(z.payments) != 1)) | |
82 | 100 | then throw("1 payment is expected") | |
83 | - | else if (( | |
101 | + | else if ((S != k)) | |
84 | 102 | then throw("invalid payment asset id") | |
85 | 103 | else { | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | then fraction( | |
104 | + | let T = c(this, l(m)) | |
105 | + | let U = c(this, n(m)) | |
106 | + | let V = if ((U != 0)) | |
107 | + | then fraction(T, b, U) | |
90 | 108 | else b | |
91 | - | let | |
92 | - | [IntegerEntry( | |
109 | + | let W = fraction(R, b, V) | |
110 | + | [IntegerEntry(l(m), (T + R)), IntegerEntry(n(m), (U + W)), J(r, m, W, R), D(m, R)] | |
93 | 111 | } | |
94 | 112 | } | |
95 | 113 | ||
96 | 114 | ||
97 | 115 | ||
98 | - | @Callable( | |
99 | - | func score ( | |
116 | + | @Callable(z) | |
117 | + | func score (B,X,Y,Z,aa) = nil | |
100 | 118 | ||
101 | 119 |
github/deemru/w8io/169f3d6 49.10 ms ◑