tx · GdWsah4qtLcmN4Jy59ZYBJhAbtk6H7Kcx9feyVdsTrbZ 3N52MWKVyjSGb7LSFJfKJbP6oqNAWbarS89: -0.03400000 Waves 2023.04.17 20:10 [2538845] smart account 3N52MWKVyjSGb7LSFJfKJbP6oqNAWbarS89 > SELF 0.00000000 Waves
{ "type": 13, "id": "GdWsah4qtLcmN4Jy59ZYBJhAbtk6H7Kcx9feyVdsTrbZ", "fee": 3400000, "feeAssetId": null, "timestamp": 1681751520621, "version": 2, "chainId": 84, "sender": "3N52MWKVyjSGb7LSFJfKJbP6oqNAWbarS89", "senderPublicKey": "6ow25tPvLtuFPk2tjV7sGZ7veojRu8cM1qYEUiyKokvY", "proofs": [ "3S5phaFimDSbUUm1QxTtpvy2Z858pF7KjJ7sUS1hVJRfG6Ux2zosdvefjsaB8GPqrPfWzkE3dHBQb4D4193ANZVH" ], "script": "base64:BgIPCAISAwoBCBIGCgQEBAQIDQANa19pbml0aWFsaXplZAINa19pbml0aWFsaXplZAAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwAPa192YXVsdF9hZGRyZXNzAg9rX3ZhdWx0X2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAQlzdHJUb0xpc3QBBF9zdHIDCQAAAgUEX3N0cgIABQNuaWwJALUJAgUEX3N0cgIBLAELY29vcmRpbmF0b3IACQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKYIAQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFBHRoaXMFFGtfY29vcmRpbmF0b3JBZGRyZXNzAhZDb29yZGluYXRvciBub3Qgc2V0IEhDAhtDb29yZGluYXRvciBhZGRyZXNzIGludmFsaWQBDGFkbWluQWRkcmVzcwAJA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MAAAgFAnR4D3NlbmRlclB1YmxpY0tlea2sWp8=", "height": 2538845, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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_vault_address = "k_vault_address" | |
13 | + | ||
14 | + | let k_admin_address = "k_admin_address" | |
15 | + | ||
16 | + | func strToList (_str) = if ((_str == "")) | |
17 | + | then nil | |
18 | + | else split(_str, ",") | |
19 | + | ||
20 | + | ||
21 | + | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set HC")), "Coordinator address invalid") | |
22 | + | ||
23 | + | ||
24 | + | func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set")) | |
25 | + | ||
26 | + | ||
27 | + | func stakingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_staking_address), "Staking address not set")), "Staking address invalid") | |
28 | + | ||
29 | + | ||
30 | + | func farmingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_farming_address), "Farming address not set")), "Farming address invalid") | |
31 | + | ||
32 | + | ||
33 | + | func vaultAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_vault_address), "Vault address not set")), "Vault address invalid") | |
34 | + | ||
35 | + | ||
36 | + | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
37 | + | ||
38 | + | ||
39 | + | @Callable(i) | |
40 | + | func initialize (_coordinator) = if (if (initialized()) | |
41 | + | then true | |
42 | + | else (i.caller != this)) | |
43 | + | then throw("Unable to initialize") | |
44 | + | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)] | |
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | @Callable(i) | |
49 | + | func performHousekeeping (_vault,_farming,_staking,_payFunding) = { | |
50 | + | let doAckRewardsStaking = if (_staking) | |
51 | + | then invoke(stakingAddress(), "ackRewards", nil, nil) | |
52 | + | else nil | |
53 | + | if ((doAckRewardsStaking == doAckRewardsStaking)) | |
54 | + | then { | |
55 | + | let doAckRewardsFarming = if (_farming) | |
56 | + | then invoke(farmingAddress(), "ackRewards", nil, nil) | |
57 | + | else nil | |
58 | + | if ((doAckRewardsFarming == doAckRewardsFarming)) | |
59 | + | then { | |
60 | + | let doAckRewardsVault = if (_vault) | |
61 | + | then invoke(vaultAddress(), "ackRewards", nil, nil) | |
62 | + | else nil | |
63 | + | if ((doAckRewardsVault == doAckRewardsVault)) | |
64 | + | then { | |
65 | + | let amms = strToList(_payFunding) | |
66 | + | func compute (_acc,_amm) = { | |
67 | + | let doPayFunding = invoke(addressFromStringValue(_amm), "payFunding", nil, nil) | |
68 | + | if ((doPayFunding == doPayFunding)) | |
69 | + | then _acc | |
70 | + | else throw("Strict value is not equal to itself.") | |
71 | + | } | |
72 | + | ||
73 | + | let $l = amms | |
74 | + | let $s = size($l) | |
75 | + | let $acc0 = nil | |
76 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
77 | + | then $a | |
78 | + | else compute($a, $l[$i]) | |
79 | + | ||
80 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
81 | + | then $a | |
82 | + | else throw("List size exceeds 20") | |
83 | + | ||
84 | + | $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) | |
85 | + | } | |
86 | + | else throw("Strict value is not equal to itself.") | |
87 | + | } | |
88 | + | else throw("Strict value is not equal to itself.") | |
89 | + | } | |
90 | + | else throw("Strict value is not equal to itself.") | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | @Verifier(tx) | |
95 | + | func verify () = { | |
96 | + | let coordinatorStr = getString(this, k_coordinatorAddress) | |
97 | + | if (isDefined(coordinatorStr)) | |
98 | + | then { | |
99 | + | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
100 | + | if (isDefined(admin)) | |
101 | + | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
102 | + | else throw("unable to verify: admin not set in coordinator") | |
103 | + | } | |
104 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
105 | + | } | |
106 | + |
github/deemru/w8io/169f3d6 17.89 ms ◑