tx · F1tpRJsnLHJgYBhZHmp5yCh2whXLT6ahEhyQpKkKNSja 3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE: -0.03400000 Waves 2022.10.20 21:53 [2281118] smart account 3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE > SELF 0.00000000 Waves
{ "type": 13, "id": "F1tpRJsnLHJgYBhZHmp5yCh2whXLT6ahEhyQpKkKNSja", "fee": 3400000, "feeAssetId": null, "timestamp": 1666292007890, "version": 2, "chainId": 84, "sender": "3N8AfuCywsTjJgFTnEzY6AVQwaB84sQTKRE", "senderPublicKey": "2xKeXbdM9foVwuYZuNRHgp8YW7g3LowcCAg4pp6yu2Es", "proofs": [ "5TfjSVdoYKfYCcho3MAmMU1bEnd7JVbuMLezcm5W6s8SLsbbfQ7Hn1qCvg3ZRtvX9AsAgkPSyL2akmtKixqyawTV" ], "script": "base64:BgIMCAISAwoBCBIDCgEIEQANa19pbml0aWFsaXplZAINa19pbml0aWFsaXplZAAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwASa19nb3Zlcm5hbmNlX2Fzc2V0AgtrX2dvdl9hc3NldAANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAASa19hZG1pbl9wdWJsaWNfa2V5AhJrX2FkbWluX3B1YmxpY19rZXkAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAQlzdHJUb0xpc3QBBF9zdHIDCQAAAgUEX3N0cgIABQNuaWwJALUJAgUEX3N0cgIBLAELY29vcmRpbmF0b3IACQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKYIAQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwUUa19jb29yZGluYXRvckFkZHJlc3MCE0Nvb3JkaW5hdG9yIG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wAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AMoM6Yw=", "height": 2281118, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3bxs3NaozKasSL6Tkpo8fvbPTEHdRgXuDyBvp5nZYsaA Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let k_initialized = "k_initialized" | |
5 | + | ||
6 | + | let k_coordinatorAddress = "k_coordinatorAddress" | |
7 | + | ||
8 | + | let k_staking_address = "k_staking_address" | |
9 | + | ||
10 | + | let k_farming_address = "k_farming_address" | |
11 | + | ||
12 | + | let k_governance_asset = "k_gov_asset" | |
13 | + | ||
14 | + | let k_quote_asset = "k_quote_asset" | |
15 | + | ||
16 | + | let k_admin_public_key = "k_admin_public_key" | |
17 | + | ||
18 | + | let k_admin_address = "k_admin_address" | |
19 | + | ||
20 | + | func strToList (_str) = if ((_str == "")) | |
21 | + | then nil | |
22 | + | else split(_str, ",") | |
23 | + | ||
24 | + | ||
25 | + | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
26 | + | ||
27 | + | ||
28 | + | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
29 | + | ||
30 | + | ||
31 | + | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
32 | + | ||
33 | + | ||
34 | + | func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset)) | |
35 | + | ||
36 | + | ||
37 | + | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
38 | + | ||
39 | + | ||
40 | + | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
41 | + | ||
42 | + | ||
43 | + | func farmingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_farming_address)), "Staking not set") | |
44 | + | ||
45 | + | ||
46 | + | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
47 | + | ||
48 | + | ||
49 | + | @Callable(i) | |
50 | + | func initialize (_coordinator) = if (initialized()) | |
51 | + | then throw("Already initialized") | |
52 | + | else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)] | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func performHousekeeping (_payFunding) = { | |
58 | + | let doAckRewardsStaking = invoke(stakingAddress(), "ackRewards", nil, nil) | |
59 | + | if ((doAckRewardsStaking == doAckRewardsStaking)) | |
60 | + | then { | |
61 | + | let doAckRewardsFarming = invoke(farmingAddress(), "ackRewards", nil, nil) | |
62 | + | if ((doAckRewardsFarming == doAckRewardsFarming)) | |
63 | + | then { | |
64 | + | let amms = strToList(_payFunding) | |
65 | + | func compute (_acc,_amm) = { | |
66 | + | let doPayFunding = invoke(addressFromStringValue(_amm), "payFunding", nil, nil) | |
67 | + | if ((doPayFunding == doPayFunding)) | |
68 | + | then _acc | |
69 | + | else throw("Strict value is not equal to itself.") | |
70 | + | } | |
71 | + | ||
72 | + | let $l = amms | |
73 | + | let $s = size($l) | |
74 | + | let $acc0 = nil | |
75 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
76 | + | then $a | |
77 | + | else compute($a, $l[$i]) | |
78 | + | ||
79 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
80 | + | then $a | |
81 | + | else throw("List size exceeds 20") | |
82 | + | ||
83 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
84 | + | } | |
85 | + | else throw("Strict value is not equal to itself.") | |
86 | + | } | |
87 | + | else throw("Strict value is not equal to itself.") | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | @Verifier(tx) | |
92 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
93 | + |
github/deemru/w8io/169f3d6 26.52 ms ◑