tx · EgR72zW5AVazXcXRMMTG27dEZ3681ZKQazCoYHvThLPn

3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N:  -0.01100000 Waves

2023.11.16 12:47 [2845767] smart account 3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N > SELF 0.00000000 Waves

{ "type": 13, "id": "EgR72zW5AVazXcXRMMTG27dEZ3681ZKQazCoYHvThLPn", "fee": 1100000, "feeAssetId": null, "timestamp": 1700128089630, "version": 2, "chainId": 84, "sender": "3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N", "senderPublicKey": "41THq9VrFxHEvVGJyz2oMpJQErnSkkqJXpBypSDxa5Mv", "proofs": [ "5zipaBuP3NZG2bpZi3k9C5ibmmve1ozYf2DYJ9rvV1CjSFi5iQYKggey6sGKBZkEkG7XsZAqkTD7Aoq9ZYsUSeQ5" ], "script": "base64:BgIeCAISAwoBGBIDCgEYEgQKAgIYEgQKAgIYEgQKAgIYIQAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAAIBAhFwZXJtaXNzaW9uIGRlbmllZAEIbXVzdFRoaXMBAWkJAQttdXN0QWRkcmVzcwIFAWkFBHRoaXMAA1NFUAICX18ABVdBVkVTAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIVd3hkYW9fY2FsY3VsYXRvci5yaWRlAAVtdWx0OACAwtcvAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzARBrZXlDdXJyZW50UGVyaW9kAAkAuQkCCQDMCAICAiVzCQDMCAICDWN1cnJlbnRQZXJpb2QFA25pbAUDU0VQARZrZX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AABQtwd3JQcmljZVJhdwkBCHRocm93RXJyAQIRaW52YWxpZCBQV1IgcHJpY2UEBXByaWNlAwkAZgIAAAURdHJlYXN1cnlWYWx1ZURpZmYJAGkCBQhwd3JQcmljZQBkCQBpAgkAZAIJAGsDBRF0cmVhc3VyeVZhbHVlRGlmZgACAJBOBQhwd3JQcmljZQBkCQCUCgIFA25pbAUFcHJpY2UBaQEQZ2V0VHJlYXN1cnlWYWx1ZQIPY2FsbGVyUHVibGljS2V5BGFyZ3MEDmZhY3RvcnlBZGRyZXNzCAUBaQZjYWxsZXIEDXRyZWFzdXJ5VmFsdWUJARFjYWxjVHJlYXN1cnlWYWx1ZQEFDmZhY3RvcnlBZGRyZXNzCQCUCgIFA25pbAUNdHJlYXN1cnlWYWx1ZQECdHgBBnZlcmlmeQAJAAACBQdjaGFpbklkBQhjaGFpbklkVGQ49os=", "height": 2845767, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CaqBX449oHEdueMRrQmTPCUVDrq7tY9fTmcGJZLAvXon Next: 9WzgvqcCxRSBPRa9QiZstfGGNY4MmkqsGYAD47KMPHMi Diff:
OldNewDifferences
278278 }
279279 usdcUsdtPrice
280280 }
281- else throwErr("invalid asset id")
281+ else if (("8Q6SE2ANebufw8JuPjJVRjZD6drD8ihjNjM8xaGUSfdR" == $match0))
282+ then {
283+ let price = 100000000
284+ price
285+ }
286+ else throwErr("invalid asset id")
282287 }
283288 (acc :+ price)
284289 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let chainId = take(drop(this.bytes, 1), 1)
77
88 let chainIdT = base58'2T'
99
1010 let chainIdW = base58'2W'
1111
1212 func mustAddress (i,address) = if ((i.caller == address))
1313 then true
1414 else throw("permission denied")
1515
1616
1717 func mustThis (i) = mustAddress(i, this)
1818
1919
2020 let SEP = "__"
2121
2222 let WAVES = "WAVES"
2323
2424 let contractFilename = "wxdao_calculator.ride"
2525
2626 let mult8 = 100000000
2727
2828 func wrapErr (s) = ((contractFilename + ": ") + s)
2929
3030
3131 func throwErr (s) = throw(wrapErr(s))
3232
3333
3434 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
3535
3636
3737 func keyStartHeightByPeriod (period) = makeString(["%s%d", "startHeight", toString(period)], SEP)
3838
3939
4040 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
4141
4242
4343 func keyTreasuryValueByPeriod (period) = makeString(["%s%d", "treasuryValue", toString(period)], SEP)
4444
4545
4646 func keyPowerConfigAddress () = "%s__powerConfigAddress"
4747
4848
4949 func powerConfigAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPowerConfigAddress()) {
5050 case s: String =>
5151 addressFromString(s)
5252 case _: Unit =>
5353 unit
5454 case _ =>
5555 throw("Match error")
5656 }, wrapErr("invalid power config address"))
5757
5858
5959 func keyPowerAssetId () = "powerAssetId"
6060
6161
6262 func getPowerAssetId (factoryAddress) = fromBase58String(valueOrErrorMessage(getString(powerConfigAddress(factoryAddress), keyPowerAssetId()), wrapErr("invalid power asset id")))
6363
6464
6565 func keyPowerContractAddress () = "%s__powerContractAddress"
6666
6767
6868 func powerContractAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPowerContractAddress()) {
6969 case s: String =>
7070 addressFromString(s)
7171 case _: Unit =>
7272 unit
7373 case _ =>
7474 throw("Match error")
7575 }, wrapErr("invalid power contract address"))
7676
7777
7878 func keyPoolsFactoryAddress () = "%s__poolsFactoryAddress"
7979
8080
8181 func getPoolsFactoryAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPoolsFactoryAddress()) {
8282 case s: String =>
8383 addressFromString(s)
8484 case _: Unit =>
8585 unit
8686 case _ =>
8787 throw("Match error")
8888 }, wrapErr("invalid pools factory address"))
8989
9090
9191 func keyTreasuryAddress () = "%s__treasuryAddress"
9292
9393
9494 func getTreasuryAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyTreasuryAddress()) {
9595 case s: String =>
9696 addressFromString(s)
9797 case _: Unit =>
9898 unit
9999 case _ =>
100100 throw("Match error")
101101 }, wrapErr("invalid treasury address"))
102102
103103
104104 func keyAssets () = "%s__assets"
105105
106106
107107 func getAssetsStr (factoryAddress) = valueOrErrorMessage(getString(factoryAddress, keyAssets()), wrapErr("invalid assets"))
108108
109109
110110 func keyLpAssetId () = "%s__lpAssetId"
111111
112112
113113 func getLpAssetId (factoryAddress) = fromBase58String(valueOrErrorMessage(getString(factoryAddress, keyLpAssetId()), wrapErr("invalid lp asset id")))
114114
115115
116116 func getAssetsBalances (targetAddress,assetIdList) = {
117117 func map (acc,nextAssetIdStr) = {
118118 let balance = if ((nextAssetIdStr == WAVES))
119119 then wavesBalance(targetAddress)
120120 else assetBalance(targetAddress, fromBase58String(nextAssetIdStr))
121121 (acc :+ balance)
122122 }
123123
124124 let $l = assetIdList
125125 let $s = size($l)
126126 let $acc0 = nil
127127 func $f0_1 ($a,$i) = if (($i >= $s))
128128 then $a
129129 else map($a, $l[$i])
130130
131131 func $f0_2 ($a,$i) = if (($i >= $s))
132132 then $a
133133 else throw("List size exceeds 10")
134134
135135 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
136136 }
137137
138138
139139 func getAssetsPrices (poolsFactoryAddress,assetIdList) = if ((chainId == chainIdW))
140140 then {
141141 let wavesUsdtAddressStr = "3PKfrupEydU2nZAghVjZAfvCwMBkzuR1F52"
142142 let wavesUsdtPrice = {
143143 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesUsdtAddressStr], nil)
144144 if ($isInstanceOf(@, "Int"))
145145 then @
146146 else throw(($getType(@) + " couldn't be cast to Int"))
147147 }
148148 let wavesXtnAddressStr = "3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g"
149149 let wavesXtnPrice = {
150150 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesXtnAddressStr], nil)
151151 if ($isInstanceOf(@, "Int"))
152152 then @
153153 else throw(($getType(@) + " couldn't be cast to Int"))
154154 }
155155 let xtnUsdtPrice = fraction(wavesUsdtPrice, mult8, wavesXtnPrice)
156156 func map (acc,nextAssetId) = {
157157 let price = match nextAssetId {
158158 case _ =>
159159 if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match0))
160160 then {
161161 let pwrWavesAddressStr = "3PDi7Qq8pLQYvtKyTfQuqqPUWyhoYbU957t"
162162 let pwrWavesPrice = {
163163 let @ = invoke(poolsFactoryAddress, "getPrice", [pwrWavesAddressStr], nil)
164164 if ($isInstanceOf(@, "Int"))
165165 then @
166166 else throw(($getType(@) + " couldn't be cast to Int"))
167167 }
168168 fraction(pwrWavesPrice, wavesUsdtPrice, mult8)
169169 }
170170 else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match0))
171171 then {
172172 let wxWavesAddressStr = "3PFzaH2ghpwANHFgjeva83N1yxzErELx2eh"
173173 let wxWavesPrice = {
174174 let @ = invoke(poolsFactoryAddress, "getPrice", [wxWavesAddressStr], nil)
175175 if ($isInstanceOf(@, "Int"))
176176 then @
177177 else throw(($getType(@) + " couldn't be cast to Int"))
178178 }
179179 fraction(wxWavesPrice, wavesUsdtPrice, mult8)
180180 }
181181 else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match0))
182182 then {
183183 let usdtwxgXtnAddressStr = "3P8KMyAJCPWNcyedqrmymxaeWonvmkhGauz"
184184 let usdtwxgXtnPrice = {
185185 let @ = invoke(poolsFactoryAddress, "getPrice", [usdtwxgXtnAddressStr], nil)
186186 if ($isInstanceOf(@, "Int"))
187187 then @
188188 else throw(($getType(@) + " couldn't be cast to Int"))
189189 }
190190 fraction(usdtwxgXtnPrice, xtnUsdtPrice, mult8)
191191 }
192192 else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match0))
193193 then {
194194 let wavesUsdcwxgAddressStr = "3P3g3eipfG2NZKKQE8DZXt2E9tRJqii9jcX"
195195 let usdcwxgXtnPrice = {
196196 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesUsdcwxgAddressStr], nil)
197197 if ($isInstanceOf(@, "Int"))
198198 then @
199199 else throw(($getType(@) + " couldn't be cast to Int"))
200200 }
201201 fraction(wavesUsdtPrice, mult8, usdcwxgXtnPrice)
202202 }
203203 else if (("HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" == $match0))
204204 then {
205205 let ltcwxgXtnAddressStr = "3P94wvu5gA7VhjPgAB3twaeqdwHCwNK2vsn"
206206 let ltcwxgXtnPrice = {
207207 let @ = invoke(poolsFactoryAddress, "getPrice", [ltcwxgXtnAddressStr], nil)
208208 if ($isInstanceOf(@, "Int"))
209209 then @
210210 else throw(($getType(@) + " couldn't be cast to Int"))
211211 }
212212 fraction(ltcwxgXtnPrice, xtnUsdtPrice, mult8)
213213 }
214214 else if (("HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" == $match0))
215215 then {
216216 let ethwxgXtnAddressStr = "3P3XGTN6s292g9iwYhs3TEqJqHiffQYojuE"
217217 let ethwxgXtnPrice = {
218218 let @ = invoke(poolsFactoryAddress, "getPrice", [ethwxgXtnAddressStr], nil)
219219 if ($isInstanceOf(@, "Int"))
220220 then @
221221 else throw(($getType(@) + " couldn't be cast to Int"))
222222 }
223223 fraction(ethwxgXtnPrice, wavesUsdtPrice, mult8)
224224 }
225225 else if (("HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" == $match0))
226226 then {
227227 let btcwxgXtnAddressStr = "3PCBWDTA6jrFswd7gQgaE3Xk7gLM5RKofvp"
228228 let btcwxgXtnPrice = {
229229 let @ = invoke(poolsFactoryAddress, "getPrice", [btcwxgXtnAddressStr], nil)
230230 if ($isInstanceOf(@, "Int"))
231231 then @
232232 else throw(($getType(@) + " couldn't be cast to Int"))
233233 }
234234 fraction(btcwxgXtnPrice, wavesUsdtPrice, mult8)
235235 }
236236 else throwErr("invalid asset id")
237237 }
238238 (acc :+ price)
239239 }
240240
241241 let $l = assetIdList
242242 let $s = size($l)
243243 let $acc0 = nil
244244 func $f0_1 ($a,$i) = if (($i >= $s))
245245 then $a
246246 else map($a, $l[$i])
247247
248248 func $f0_2 ($a,$i) = if (($i >= $s))
249249 then $a
250250 else throw("List size exceeds 10")
251251
252252 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
253253 }
254254 else if ((chainId == chainIdT))
255255 then {
256256 func map (acc,nextAssetId) = {
257257 let price = match nextAssetId {
258258 case _ =>
259259 if (("EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc" == $match0))
260260 then {
261261 let wxUsdtAddressStr = "3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt"
262262 let wxUsdtPrice = {
263263 let @ = invoke(poolsFactoryAddress, "getPrice", [wxUsdtAddressStr], nil)
264264 if ($isInstanceOf(@, "Int"))
265265 then @
266266 else throw(($getType(@) + " couldn't be cast to Int"))
267267 }
268268 wxUsdtPrice
269269 }
270270 else if (("A7Ksh7fXyqm1KhKAiK3bAB2aiPSitQQF6v1pyu9SS3FR" == $match0))
271271 then {
272272 let usdcUsdtAddressStr = "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA"
273273 let usdcUsdtPrice = {
274274 let @ = invoke(poolsFactoryAddress, "getPrice", [usdcUsdtAddressStr], nil)
275275 if ($isInstanceOf(@, "Int"))
276276 then @
277277 else throw(($getType(@) + " couldn't be cast to Int"))
278278 }
279279 usdcUsdtPrice
280280 }
281- else throwErr("invalid asset id")
281+ else if (("8Q6SE2ANebufw8JuPjJVRjZD6drD8ihjNjM8xaGUSfdR" == $match0))
282+ then {
283+ let price = 100000000
284+ price
285+ }
286+ else throwErr("invalid asset id")
282287 }
283288 (acc :+ price)
284289 }
285290
286291 let $l = assetIdList
287292 let $s = size($l)
288293 let $acc0 = nil
289294 func $f0_1 ($a,$i) = if (($i >= $s))
290295 then $a
291296 else map($a, $l[$i])
292297
293298 func $f0_2 ($a,$i) = if (($i >= $s))
294299 then $a
295300 else throw("List size exceeds 10")
296301
297302 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
298303 }
299304 else throwErr("invalid chain id")
300305
301306
302307 func calcTreasuryValue (factoryAddress) = {
303308 let treasuryAddress = getTreasuryAddress(factoryAddress)
304309 let poolsFactoryAddress = getPoolsFactoryAddress(factoryAddress)
305310 let assetsStr = split(getAssetsStr(factoryAddress), SEP)
306311 let assetsBalances = getAssetsBalances(treasuryAddress, assetsStr)
307312 let assetsPrices = getAssetsPrices(poolsFactoryAddress, assetsStr)
308313 func reduce (acc,nextAssetIdStr) = {
309314 let assetId = fromBase58String(nextAssetIdStr)
310315 let index = valueOrErrorMessage(indexOf(assetsStr, nextAssetIdStr), wrapErr("invalid asset id"))
311316 let balance = assetsBalances[index]
312317 let price = assetsPrices[index]
313318 let assetValue = fraction(balance, price, mult8)
314319 (acc + assetValue)
315320 }
316321
317322 let treasuryValue = {
318323 let $l = assetsStr
319324 let $s = size($l)
320325 let $acc0 = 0
321326 func $f0_1 ($a,$i) = if (($i >= $s))
322327 then $a
323328 else reduce($a, $l[$i])
324329
325330 func $f0_2 ($a,$i) = if (($i >= $s))
326331 then $a
327332 else throw("List size exceeds 10")
328333
329334 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
330335 }
331336 treasuryValue
332337 }
333338
334339
335340 @Callable(i)
336341 func withdraw (args) = {
337342 let recipient = addressFromStringValue(args[0])
338343 let amount = parseIntValue(args[1])
339344 let result = invoke(i.caller, "transferWaves", [recipient.bytes, amount], nil)
340345 $Tuple2(nil, result)
341346 }
342347
343348
344349
345350 @Callable(i)
346351 func setIntParam (args) = {
347352 let key = args[0]
348353 let val = parseIntValue(args[1])
349354 let result = invoke(i.caller, "integerEntry", [key, val], nil)
350355 $Tuple2(nil, result)
351356 }
352357
353358
354359
355360 @Callable(i)
356361 func swap (callerPublicKey,args) = {
357362 let factoryAddress = i.caller
358363 let userAddress = addressFromPublicKey(callerPublicKey)
359364 let payment = if ((size(i.payments) == 1))
360365 then i.payments[0]
361366 else throwErr("1 payment is required")
362367 let err = wrapErr("invalid payment asset id")
363368 let paymentAssetId = if ((valueOrErrorMessage(payment.assetId, err) == getLpAssetId(factoryAddress)))
364369 then value(payment.assetId)
365370 else throwErr(err)
366371 let pwrPrice = 100
367372 let pwrAmount = (payment.amount / pwrPrice)
368373 let assetsStr = split(getAssetsStr(factoryAddress), SEP)
369374 let pwrBalance = assetBalance(factoryAddress, getPowerAssetId(factoryAddress))
370375 if ((pwrBalance == pwrBalance))
371376 then {
372377 let treasuryAddress = getTreasuryAddress(factoryAddress)
373378 let assetsBalances = getAssetsBalances(treasuryAddress, assetsStr)
374379 func map (acc,nextAssetIdStr) = {
375380 let assetId = fromBase58String(nextAssetIdStr)
376381 let index = valueOrErrorMessage(indexOf(assetsStr, nextAssetIdStr), wrapErr("invalid asset balance"))
377382 let balance = assetsBalances[index]
378383 let amount = fraction(balance, pwrAmount, pwrBalance)
379384 if ((amount > 0))
380385 then $Tuple2((acc._1 :+ assetId), (acc._2 :+ amount))
381386 else acc
382387 }
383388
384389 let transfers = {
385390 let $l = assetsStr
386391 let $s = size($l)
387392 let $acc0 = $Tuple2(nil, nil)
388393 func $f0_1 ($a,$i) = if (($i >= $s))
389394 then $a
390395 else map($a, $l[$i])
391396
392397 func $f0_2 ($a,$i) = if (($i >= $s))
393398 then $a
394399 else throw("List size exceeds 6")
395400
396401 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
397402 }
398403 if ((transfers == transfers))
399404 then {
400405 let additionalLockRounds = 0
401406 let factoryActions = ([invoke(factoryAddress, "commitAfterStartWithLockRoundFor", [toString(powerContractAddress(factoryAddress)), toString(factoryAddress), toString(userAddress), additionalLockRounds, getPowerAssetId(factoryAddress), pwrAmount], nil)] ++ (if ((size(transfers._1) == 0))
402407 then nil
403408 else [invoke(factoryAddress, "transferAssets", [userAddress.bytes, transfers._1, transfers._2], nil)]))
404409 $Tuple2([Burn(paymentAssetId, payment.amount)], factoryActions)
405410 }
406411 else throw("Strict value is not equal to itself.")
407412 }
408413 else throw("Strict value is not equal to itself.")
409414 }
410415
411416
412417
413418 @Callable(i)
414419 func price (callerPublicKey,args) = {
415420 let factoryAddress = i.caller
416421 let currentPeriod = valueOrErrorMessage(getInteger(factoryAddress, keyCurrentPeriod()), wrapErr("invalid current period"))
417422 let startTreasuryValue = valueOrErrorMessage(getInteger(factoryAddress, keyTreasuryValueByPeriod(currentPeriod)), wrapErr(("invalid treasury value for period " + toString(currentPeriod))))
418423 let treasuryValue = calcTreasuryValue(factoryAddress)
419424 let treasuryValueDiff = (treasuryValue - startTreasuryValue)
420425 let pwrPriceRaw = getAssetsPrices(factoryAddress, [toBase58String(getPowerAssetId(factoryAddress))])[0]
421426 let pwrPrice = if ((pwrPriceRaw > 0))
422427 then pwrPriceRaw
423428 else throwErr("invalid PWR price")
424429 let price = if ((0 > treasuryValueDiff))
425430 then (pwrPrice / 100)
426431 else ((fraction(treasuryValueDiff, 2, 10000) + pwrPrice) / 100)
427432 $Tuple2(nil, price)
428433 }
429434
430435
431436
432437 @Callable(i)
433438 func getTreasuryValue (callerPublicKey,args) = {
434439 let factoryAddress = i.caller
435440 let treasuryValue = calcTreasuryValue(factoryAddress)
436441 $Tuple2(nil, treasuryValue)
437442 }
438443
439444
440445 @Verifier(tx)
441446 func verify () = (chainId == chainIdT)
442447

github/deemru/w8io/026f985 
43.58 ms