tx · BNGMkPZLkhYECYhGHcco6G5vXRcKNeH2ZUBre3LhVGVF 3N1Dhq5ZZyoojQisuTLusYjnGisqrxDwGLy: -0.01000000 Waves 2022.04.14 18:20 [2008409] smart account 3N1Dhq5ZZyoojQisuTLusYjnGisqrxDwGLy > SELF 0.00000000 Waves
{ "type": 13, "id": "BNGMkPZLkhYECYhGHcco6G5vXRcKNeH2ZUBre3LhVGVF", "fee": 1000000, "feeAssetId": null, "timestamp": 1649949716480, "version": 2, "chainId": 84, "sender": "3N1Dhq5ZZyoojQisuTLusYjnGisqrxDwGLy", "senderPublicKey": "4ogfEQE7KGDWQR7Vd5VThqBebZ47NxrMLmAApR3sFuXW", "proofs": [ "3ptDeg67MHjqznL2bbQ8u94kDqcKzZgXHfEZedDmvDoexgbVHX8TTKqGE7jw2pSMAwQdhS4DFaMgK9N3jpdU2DQ3" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgUKAwgICBIHCgUICAgICAAAAA0BAAAADWtleUNvbGxlY3Rpb24AAAACAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAC2NvbGxlY3Rpb25fBQAAAAxjb2xsZWN0aW9uSWQCAAAAAV8FAAAABmNhbGxlcgEAAAAaa2V5U3ViY29sbGVjdGlvbkNvbGxlY3Rpb24AAAADAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQAAAAKY29sbGVjdGlvbgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAGXN1YmNvbGxlY3Rpb25fY29sbGVjdGlvbl8FAAAADGNvbGxlY3Rpb25JZAIAAAABXwUAAAAGY2FsbGVyAgAAAAFfBQAAAApjb2xsZWN0aW9uAQAAAAlrZXlPblNhbGUAAAACAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAC2FydF9vbnNhbGVfBQAAAAxjb2xsZ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wJAAROAAAAAgUAAAANZGVsZXRlRW50cmllcwkBAAAAC2NvbGxlY3Rpb25zAAAABQUAAAAFYXJ0SWQFAAAAAWkFAAAACmNvbGxlY3Rpb24FAAAADXN1YmNvbGxlY3Rpb24FAAAABmNhbGxlcgAAAADHyU+B", "height": 2008409, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 38PrUFiT1pKYmiPUM2zVKa2YKxdz69eJorT8BmCzEXLw Next: 95wTSev8Wc3gweysvp8eLefmabWsAFEFmihB8FuzX86M Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
4 | + | func a (b,c) = ((("collection_" + c) + "_") + b) | |
5 | 5 | ||
6 | - | func b (c) = { | |
7 | - | let d = getString(this, c) | |
8 | - | if ($isInstanceOf(d, "String")) | |
6 | + | ||
7 | + | func d (b,c,e) = ((((("subcollection_collection_" + c) + "_") + b) + "_") + e) | |
8 | + | ||
9 | + | ||
10 | + | func f (b,c) = ((("art_onsale_" + c) + "_") + b) | |
11 | + | ||
12 | + | ||
13 | + | let g = "sconexDapp" | |
14 | + | ||
15 | + | let h = "oracleKey" | |
16 | + | ||
17 | + | func i (j) = { | |
18 | + | let k = getString(this, j) | |
19 | + | if ($isInstanceOf(k, "String")) | |
9 | 20 | then { | |
10 | - | let | |
11 | - | | |
21 | + | let l = k | |
22 | + | l | |
12 | 23 | } | |
13 | 24 | else "" | |
14 | 25 | } | |
15 | 26 | ||
16 | 27 | ||
17 | - | func f (c) = { | |
18 | - | let d = getInteger(this, c) | |
19 | - | if ($isInstanceOf(d, "Int")) | |
20 | - | then { | |
21 | - | let e = d | |
22 | - | e | |
23 | - | } | |
24 | - | else 0 | |
25 | - | } | |
28 | + | let m = i(h) | |
29 | + | ||
30 | + | let n = valueOrErrorMessage(addressFromString(m), "Collections dapp doesnt have oracle defined") | |
31 | + | ||
32 | + | let o = getStringValue(n, g) | |
33 | + | ||
34 | + | func p (j) = valueOrElse(getBoolean(addressFromStringValue(o), j), false) | |
26 | 35 | ||
27 | 36 | ||
28 | - | let g = b(a) | |
37 | + | func q (r) = if ((r == addressFromString(o))) | |
38 | + | then true | |
39 | + | else throw("Only the sconex dapp can invoke this") | |
29 | 40 | ||
30 | - | let h = value(addressFromString(g)) | |
31 | 41 | ||
32 | - | ||
42 | + | func s (t,j) = valueOrElse(getString(t, j), "") | |
33 | 43 | ||
34 | - | let j = valueOrErrorMessage(getString(h, "feeReceiver"), "feeReceiver not found") | |
35 | 44 | ||
36 | - | let k = [i] | |
45 | + | func u (c,v,e,w,x) = if ((e == "")) | |
46 | + | then throw("Collections can not be empty!") | |
47 | + | else if ((w == "")) | |
48 | + | then [StringEntry(a(x, c), e)] | |
49 | + | else [StringEntry(a(x, c), e), StringEntry(d(x, c, e), w)] | |
37 | 50 | ||
38 | - | @Callable(l) | |
39 | - | func initDapp (m) = if ((l.caller != this)) | |
51 | + | ||
52 | + | @Callable(v) | |
53 | + | func initDapp (y) = if ((v.caller != this)) | |
40 | 54 | then throw("You cannot do this action") | |
41 | - | else if (( | |
55 | + | else if ((m != "")) | |
42 | 56 | then throw("oracle already set, you can't override!") | |
43 | - | else [StringEntry( | |
57 | + | else [StringEntry(h, y)] | |
44 | 58 | ||
45 | 59 | ||
46 | 60 | ||
47 | - | @Callable(l) | |
48 | - | func teamSplitFee (n,o,p,q,r,s,t) = if (!(containsElement(k, l.caller))) | |
49 | - | then throw("Not allowed") | |
50 | - | else if ((0 > r)) | |
51 | - | then throw("Share 1 can't be negative") | |
52 | - | else if (if (if ((r != 0)) | |
53 | - | then true | |
54 | - | else (o != "")) | |
55 | - | then !(isDefined(addressFromString(o))) | |
56 | - | else false) | |
57 | - | then throw("Address 1 is invalid") | |
58 | - | else if ((0 > s)) | |
59 | - | then throw("Share 2 can't be negative") | |
60 | - | else if (if (if ((s != 0)) | |
61 | - | then true | |
62 | - | else (p != "")) | |
63 | - | then !(isDefined(addressFromString(p))) | |
64 | - | else false) | |
65 | - | then throw("Address 2 is invalid") | |
66 | - | else if ((0 > t)) | |
67 | - | then throw("Share 3 can't be negative") | |
68 | - | else if (if (if ((t != 0)) | |
69 | - | then true | |
70 | - | else (q != "")) | |
71 | - | then !(isDefined(addressFromString(q))) | |
72 | - | else false) | |
73 | - | then throw("Address 3 is invalid") | |
74 | - | else if ((((r + s) + t) != 15)) | |
75 | - | then throw("Sum of shares should be equal to 15") | |
76 | - | else [StringEntry((n + "_team_address1"), o), StringEntry((n + "_team_address2"), p), StringEntry((n + "_team_address3"), q), IntegerEntry((n + "_team_share1"), r), IntegerEntry((n + "_team_share2"), s), IntegerEntry((n + "_team_share3"), t)] | |
61 | + | @Callable(v) | |
62 | + | func collectionProcess (e,w,x) = if (if (q(v.caller)) | |
63 | + | then true | |
64 | + | else (v.caller == this)) | |
65 | + | then $Tuple2(u(toBase58String(v.transactionId), v, e, w, x), toBase58String(v.transactionId)) | |
66 | + | else throw("Wrong invoker") | |
77 | 67 | ||
78 | 68 | ||
79 | 69 | ||
80 | - | @Callable(l) | |
81 | - | func creatorSplitFee (n,o,p,q,r,s,t) = if (!(containsElement(k, l.caller))) | |
82 | - | then throw("Not allowed") | |
83 | - | else if ((0 > r)) | |
84 | - | then throw("Share 1 can't be negative") | |
85 | - | else if (if (if ((r != 0)) | |
86 | - | then true | |
87 | - | else (o != "")) | |
88 | - | then !(isDefined(addressFromString(o))) | |
89 | - | else false) | |
90 | - | then throw("Address 1 is invalid") | |
91 | - | else if ((0 > s)) | |
92 | - | then throw("Share 2 can't be negative") | |
93 | - | else if (if (if ((s != 0)) | |
94 | - | then true | |
95 | - | else (p != "")) | |
96 | - | then !(isDefined(addressFromString(p))) | |
97 | - | else false) | |
98 | - | then throw("Address 2 is invalid") | |
99 | - | else if ((0 > t)) | |
100 | - | then throw("Share 3 can't be negative") | |
101 | - | else if (if (if ((t != 0)) | |
102 | - | then true | |
103 | - | else (q != "")) | |
104 | - | then !(isDefined(addressFromString(q))) | |
105 | - | else false) | |
106 | - | then throw("Address 3 is invalid") | |
107 | - | else if ((((r + s) + t) > 85)) | |
108 | - | then throw("Sum of shares should be smaller or equal then 85") | |
109 | - | else [StringEntry((n + "_creator_address1"), o), StringEntry((n + "_creator_address2"), p), StringEntry((n + "_creator_address3"), q), IntegerEntry((n + "_creator_share1"), r), IntegerEntry((n + "_creator_share2"), s), IntegerEntry((n + "_creator_share3"), t)] | |
110 | - | ||
111 | - | ||
112 | - | ||
113 | - | @Callable(l) | |
114 | - | func payFeeResell (u,v) = if (!(containsElement(k, l.caller))) | |
115 | - | then throw("Not allowed") | |
116 | - | else { | |
117 | - | let w = 3 | |
118 | - | let x = value(l.payments[0].amount) | |
119 | - | let y = value(l.payments[0].assetId) | |
120 | - | let z = f((u + "_creator_share1")) | |
121 | - | let A = f((u + "_creator_share2")) | |
122 | - | let B = f((u + "_creator_share3")) | |
123 | - | let C = b((u + "_creator_address1")) | |
124 | - | let D = b((u + "_creator_address2")) | |
125 | - | let E = b((u + "_creator_address3")) | |
126 | - | let F = if ((C == "")) | |
127 | - | then 0 | |
128 | - | else fraction(x, z, 100) | |
129 | - | let G = if ((D == "")) | |
130 | - | then 0 | |
131 | - | else fraction(x, A, 100) | |
132 | - | let H = if ((E == "")) | |
133 | - | then 0 | |
134 | - | else fraction(x, B, 100) | |
135 | - | let I = fraction(x, w, 100) | |
136 | - | let J = ((((x - F) - G) - H) - I) | |
137 | - | let K = [ScriptTransfer(addressFromStringValue(j), I, l.payments[0].assetId)] | |
138 | - | let L = if ((C == "")) | |
139 | - | then nil | |
140 | - | else [ScriptTransfer(addressFromStringValue(C), F, l.payments[0].assetId)] | |
141 | - | let M = if ((D == "")) | |
142 | - | then nil | |
143 | - | else [ScriptTransfer(addressFromStringValue(D), G, l.payments[0].assetId)] | |
144 | - | let N = if ((E == "")) | |
145 | - | then nil | |
146 | - | else [ScriptTransfer(addressFromStringValue(E), H, l.payments[0].assetId)] | |
147 | - | let O = if ((v == "")) | |
148 | - | then nil | |
149 | - | else [ScriptTransfer(addressFromStringValue(v), J, l.payments[0].assetId)] | |
150 | - | ((((L ++ M) ++ N) ++ K) ++ O) | |
151 | - | } | |
152 | - | ||
153 | - | ||
154 | - | ||
155 | - | @Callable(l) | |
156 | - | func payFee (u,v) = if (!(containsElement(k, l.caller))) | |
157 | - | then throw("Not allowed") | |
158 | - | else { | |
159 | - | let x = value(l.payments[0].amount) | |
160 | - | let y = value(l.payments[0].assetId) | |
161 | - | let P = f((u + "_team_share1")) | |
162 | - | let Q = f((u + "_team_share2")) | |
163 | - | let R = f((u + "_team_share3")) | |
164 | - | let S = b((u + "_team_address1")) | |
165 | - | let T = b((u + "_team_address2")) | |
166 | - | let U = b((u + "_team_address3")) | |
167 | - | let z = f((u + "_creator_address1")) | |
168 | - | let A = f((u + "_creator_address2")) | |
169 | - | let B = f((u + "_creator_address3")) | |
170 | - | let C = b((u + "_creator_address1")) | |
171 | - | let D = b((u + "_creator_address2")) | |
172 | - | let E = b((u + "_creator_address3")) | |
173 | - | let V = if ((S == "")) | |
174 | - | then 0 | |
175 | - | else fraction(x, P, 100) | |
176 | - | let W = if ((T == "")) | |
177 | - | then 0 | |
178 | - | else fraction(x, Q, 100) | |
179 | - | let X = if ((U == "")) | |
180 | - | then 0 | |
181 | - | else fraction(x, R, 100) | |
182 | - | let F = if ((C == "")) | |
183 | - | then 0 | |
184 | - | else fraction(x, z, 100) | |
185 | - | let G = if ((D == "")) | |
186 | - | then 0 | |
187 | - | else fraction(x, A, 100) | |
188 | - | let H = if ((E == "")) | |
189 | - | then 0 | |
190 | - | else fraction(x, B, 100) | |
191 | - | let Y = if ((S == "")) | |
192 | - | then nil | |
193 | - | else [ScriptTransfer(addressFromStringValue(S), V, l.payments[0].assetId)] | |
194 | - | let Z = if ((T == "")) | |
195 | - | then nil | |
196 | - | else [ScriptTransfer(addressFromStringValue(T), W, l.payments[0].assetId)] | |
197 | - | let aa = if ((U == "")) | |
198 | - | then nil | |
199 | - | else [ScriptTransfer(addressFromStringValue(U), X, l.payments[0].assetId)] | |
200 | - | let L = if ((C == "")) | |
201 | - | then nil | |
202 | - | else [ScriptTransfer(addressFromStringValue(C), F, l.payments[0].assetId)] | |
203 | - | let M = if ((D == "")) | |
204 | - | then nil | |
205 | - | else [ScriptTransfer(addressFromStringValue(D), G, l.payments[0].assetId)] | |
206 | - | let N = if ((E == "")) | |
207 | - | then nil | |
208 | - | else [ScriptTransfer(addressFromStringValue(E), H, l.payments[0].assetId)] | |
209 | - | let J = ((((((x - F) - G) - H) - V) - W) - X) | |
210 | - | let O = if ((v == "")) | |
211 | - | then nil | |
212 | - | else [ScriptTransfer(addressFromStringValue(v), J, l.payments[0].assetId)] | |
213 | - | ((((((Y ++ Z) ++ aa) ++ L) ++ M) ++ N) ++ O) | |
214 | - | } | |
70 | + | @Callable(v) | |
71 | + | func updateCollection (z,A,B,e,w) = { | |
72 | + | let b = toBase58String(v.caller.bytes) | |
73 | + | let C = f(B, b) | |
74 | + | if (p(C)) | |
75 | + | then throw("Can not update collection from artwork for sale") | |
76 | + | else { | |
77 | + | let D = if (if ((z != e)) | |
78 | + | then true | |
79 | + | else (A != w)) | |
80 | + | then [DeleteEntry(d(b, B, e))] | |
81 | + | else nil | |
82 | + | (D ++ u(B, v, e, w, b)) | |
83 | + | } | |
84 | + | } | |
215 | 85 | ||
216 | 86 |
github/deemru/w8io/169f3d6 35.13 ms ◑