tx · 6UzAfASQVx6Ecb3dsUB23K3RdxiobYfiwWjAXX1MSv9x 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx: -0.01000000 Waves 2023.07.03 18:30 [2649912] smart account 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx > SELF 0.00000000 Waves
{ "type": 13, "id": "6UzAfASQVx6Ecb3dsUB23K3RdxiobYfiwWjAXX1MSv9x", "fee": 1000000, "feeAssetId": null, "timestamp": 1688398209666, "version": 1, "sender": "3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx", "senderPublicKey": "62CHk4MqTdq3LqeUycy7TPnpvwrjgerSa2FqAY2EafXn", "proofs": [ "3skiUfdi6RHrjxUS2yDWXhmweEtwPZh3Vv4EL8M2Zk7xG74Pmy2dq9PKoXsbwLJrNHGa2gjLbG1uQYjwnE1tkUet" ], "script": "base64:BwJVCAISBAoCCAgSBAoCCAESBAoCCAQSBAoCCAISAwoBCBIDCgEBEgMKAQESBQoDAgECEgQKAgIBEgQKAgIBEgUKAwEBARIAEgMKAQgSABIAEgMKAQgSAB4AA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCDGZhY3RvcnkucmlkZQEHd3JhcEVycgEBcwkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzAQh0aHJvd0VycgEBcwkAAgEJAQd3cmFwRXJyAQUBcwEUa2V5Q2FsY3VsYXRvckFkZHJlc3MAAg4lc19fY2FsY3VsYXRvcgEXa2V5UHJveHlUcmVhc3VyeUFkZHJlc3MAAhElc19fcHJveHlUcmVhc3VyeQEPa2V5Q2hpbGRBZGRyZXNzAAIJJXNfX2NoaWxkARhrZXlCbG9ja1Byb2Nlc3NpbmdSZXdhcmQAAhklc19fYmxvY2tQcm9jZXNzaW5nUmV3YXJkARVrZXlOZXh0QmxvY2tUb1Byb2Nlc3MAAhYlc19fbmV4dEJsb2NrVG9Qcm9jZXNzAQxrZXlMcEFzc2V0SWQAAg0lc19f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W5kZXJQdWJsaWNLZXkDCQECIT0CBRl2b3RpbmdSZXN1bHRBZGRyZXNzT3B0aW9uBQR1bml0AwUKYnlQcm9wb3NhbAYFB2J5T3duZXIFB2J5T3duZXL+G7Xb", "chainId": 84, "height": 2649912, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8po6AV1JjYfPx8dQvUyfngpxxLdjaUkecPFBhDgVXsvF Next: HV3fFkUaikCTs9gUWtc5M4sitXDqQq2W9fdnPuw917Ti Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | func keyCalculatorAddress () = "%s__calculator" | |
15 | 15 | ||
16 | 16 | ||
17 | - | func | |
17 | + | func keyProxyTreasuryAddress () = "%s__proxyTreasury" | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func keyChildAddress () = "%s__child" | |
40 | 40 | ||
41 | 41 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
42 | 42 | ||
43 | - | let | |
43 | + | let proxyTreasuryAddressOption = match getString(this, keyProxyTreasuryAddress()) { | |
44 | 44 | case s: String => | |
45 | 45 | addressFromString(s) | |
46 | 46 | case _: Unit => | |
49 | 49 | throw("Match error") | |
50 | 50 | } | |
51 | 51 | ||
52 | - | let | |
52 | + | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
53 | 53 | ||
54 | 54 | func keyConfigAddress () = "%s__config" | |
55 | 55 | ||
200 | 200 | ||
201 | 201 | @Callable(i) | |
202 | 202 | func transferFromProxyTreasury (recipientBytes,rewardsAmount) = if (onlyCalculator(i)) | |
203 | - | then $Tuple2(nil, invoke( | |
203 | + | then $Tuple2(nil, invoke(proxyTreasuryAddressOrFail, "transferWaves", [recipientBytes, rewardsAmount], nil)) | |
204 | 204 | else $Tuple2(nil, unit) | |
205 | 205 | ||
206 | 206 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let contractFilename = "factory.ride" | |
7 | 7 | ||
8 | 8 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func throwErr (s) = throw(wrapErr(s)) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyCalculatorAddress () = "%s__calculator" | |
15 | 15 | ||
16 | 16 | ||
17 | - | func | |
17 | + | func keyProxyTreasuryAddress () = "%s__proxyTreasury" | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func keyChildAddress () = "%s__child" | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyLpAssetId () = "%s__lpAssetId" | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
33 | 33 | case s: String => | |
34 | 34 | addressFromString(s) | |
35 | 35 | case _: Unit => | |
36 | 36 | unit | |
37 | 37 | case _ => | |
38 | 38 | throw("Match error") | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
42 | 42 | ||
43 | - | let | |
43 | + | let proxyTreasuryAddressOption = match getString(this, keyProxyTreasuryAddress()) { | |
44 | 44 | case s: String => | |
45 | 45 | addressFromString(s) | |
46 | 46 | case _: Unit => | |
47 | 47 | unit | |
48 | 48 | case _ => | |
49 | 49 | throw("Match error") | |
50 | 50 | } | |
51 | 51 | ||
52 | - | let | |
52 | + | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
53 | 53 | ||
54 | 54 | func keyConfigAddress () = "%s__config" | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func keyChildrenAddress () = "contract_children" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyVotingResultAddress () = "contract_voting_result" | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyInvestedByUser (childAddress,userAddress) = makeString(["investor", toString(childAddress), toString(userAddress)], "_") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | let configAddressOption = match getString(this, keyConfigAddress()) { | |
70 | 70 | case s: String => | |
71 | 71 | addressFromString(s) | |
72 | 72 | case _: Unit => | |
73 | 73 | unit | |
74 | 74 | case _ => | |
75 | 75 | throw("Match error") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | let configAddressOrFail = valueOrErrorMessage(configAddressOption, wrapErr("invalid config address")) | |
79 | 79 | ||
80 | 80 | let votingResultAddressOption = match configAddressOption { | |
81 | 81 | case a: Address => | |
82 | 82 | match getString(a, keyVotingResultAddress()) { | |
83 | 83 | case s: String => | |
84 | 84 | addressFromString(s) | |
85 | 85 | case _: Unit => | |
86 | 86 | unit | |
87 | 87 | case _ => | |
88 | 88 | throw("Match error") | |
89 | 89 | } | |
90 | 90 | case _: Unit => | |
91 | 91 | unit | |
92 | 92 | case _ => | |
93 | 93 | throw("Match error") | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | let votingResultAddressOrFail = valueOrErrorMessage(votingResultAddressOption, wrapErr("invalid voting result address")) | |
97 | 97 | ||
98 | 98 | let childrenAddressOption = match configAddressOption { | |
99 | 99 | case a: Address => | |
100 | 100 | match getString(a, keyChildrenAddress()) { | |
101 | 101 | case s: String => | |
102 | 102 | addressFromString(s) | |
103 | 103 | case _: Unit => | |
104 | 104 | unit | |
105 | 105 | case _ => | |
106 | 106 | throw("Match error") | |
107 | 107 | } | |
108 | 108 | case _: Unit => | |
109 | 109 | unit | |
110 | 110 | case _ => | |
111 | 111 | throw("Match error") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | let childrenAddressOrFail = valueOrErrorMessage(childrenAddressOption, wrapErr("invalid children address")) | |
115 | 115 | ||
116 | 116 | let lpAssetIdOption = match getString(this, keyLpAssetId()) { | |
117 | 117 | case s: String => | |
118 | 118 | fromBase58String(s) | |
119 | 119 | case _: Unit => | |
120 | 120 | unit | |
121 | 121 | case _ => | |
122 | 122 | throw("Match error") | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
126 | 126 | ||
127 | 127 | func onlyAddress (i,address) = if ((i.caller == address)) | |
128 | 128 | then true | |
129 | 129 | else throwErr("permission denied") | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func onlyThis (i) = onlyAddress(i, this) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func onlyCalculator (i) = onlyAddress(i, calculatorAddressOrFail) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(i) | |
139 | 139 | func stringEntry (key,val) = if (onlyCalculator(i)) | |
140 | 140 | then $Tuple2([StringEntry(key, val)], key) | |
141 | 141 | else $Tuple2(nil, unit) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | ||
145 | 145 | @Callable(i) | |
146 | 146 | func integerEntry (key,val) = if (onlyCalculator(i)) | |
147 | 147 | then $Tuple2([IntegerEntry(key, val)], key) | |
148 | 148 | else $Tuple2(nil, unit) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func booleanEntry (key,val) = if (onlyCalculator(i)) | |
154 | 154 | then $Tuple2([BooleanEntry(key, val)], key) | |
155 | 155 | else $Tuple2(nil, unit) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(i) | |
160 | 160 | func binaryEntry (key,val) = if (onlyCalculator(i)) | |
161 | 161 | then $Tuple2([BinaryEntry(key, val)], key) | |
162 | 162 | else $Tuple2(nil, unit) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | ||
166 | 166 | @Callable(i) | |
167 | 167 | func deleteEntry (key) = if (onlyCalculator(i)) | |
168 | 168 | then $Tuple2([DeleteEntry(key)], key) | |
169 | 169 | else $Tuple2(nil, unit) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(i) | |
174 | 174 | func reissue (amount) = if (onlyCalculator(i)) | |
175 | 175 | then $Tuple2([Reissue(lpAssetIdOrFail, amount, true)], amount) | |
176 | 176 | else $Tuple2(nil, unit) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | ||
180 | 180 | @Callable(i) | |
181 | 181 | func burn (amount) = if (onlyCalculator(i)) | |
182 | 182 | then $Tuple2([Burn(lpAssetIdOrFail, amount)], amount) | |
183 | 183 | else $Tuple2(nil, unit) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func transferAsset (recepientBytes,amount,assetId) = if (onlyCalculator(i)) | |
189 | 189 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, assetId)], amount) | |
190 | 190 | else $Tuple2(nil, unit) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func transferWaves (recepientBytes,amount) = if (onlyCalculator(i)) | |
196 | 196 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, unit)], amount) | |
197 | 197 | else $Tuple2(nil, unit) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Callable(i) | |
202 | 202 | func transferFromProxyTreasury (recipientBytes,rewardsAmount) = if (onlyCalculator(i)) | |
203 | - | then $Tuple2(nil, invoke( | |
203 | + | then $Tuple2(nil, invoke(proxyTreasuryAddressOrFail, "transferWaves", [recipientBytes, rewardsAmount], nil)) | |
204 | 204 | else $Tuple2(nil, unit) | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func finalize (newTreasuryVolumeInWaves,pwrManagersBonusInWaves,treasuryVolumeDiffAllocationCoef) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalize", [i.caller.bytes, newTreasuryVolumeInWaves, pwrManagersBonusInWaves, treasuryVolumeDiffAllocationCoef], i.payments)) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | ||
213 | 213 | @Callable(i) | |
214 | 214 | func claimLP () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimLP", [i.caller.bytes], i.payments)) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | 218 | @Callable(i) | |
219 | 219 | func claimWaves (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimWaves", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func invest () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "invest", [i.caller.bytes], i.payments)) | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | ||
228 | 228 | @Callable(i) | |
229 | 229 | func withdraw () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "withdraw", [i.caller.bytes], i.payments)) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | ||
233 | 233 | @Callable(i) | |
234 | 234 | func cancelWithdraw (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "cancelWithdraw", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | ||
238 | 238 | @Callable(i) | |
239 | 239 | func processBlocks () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "processBlocks", [i.caller.bytes], i.payments)) | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Verifier(tx) | |
243 | 243 | func verify () = { | |
244 | 244 | let byProposal = valueOrElse(getBoolean(votingResultAddressOrFail, keyProposalAllowBroadcast(this, tx.id)), false) | |
245 | 245 | let byOwner = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
246 | 246 | if ((votingResultAddressOption != unit)) | |
247 | 247 | then if (byProposal) | |
248 | 248 | then true | |
249 | 249 | else byOwner | |
250 | 250 | else byOwner | |
251 | 251 | } | |
252 | 252 |
github/deemru/w8io/026f985 57.68 ms ◑