tx · GAa2UkbzkBrgzJeyMtneBhLmRADWSoywUCimqGYsQdxA

3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx:  -0.01000000 Waves

2023.06.08 10:09 [2613372] smart account 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx > SELF 0.00000000 Waves

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

github/deemru/w8io/026f985 
22.60 ms