|
| 1 | +""" |
| 2 | +Vote XX/06/2025 [HOLESKY] |
| 3 | +
|
| 4 | +1. Grant SUBMIT_REPORT_HASH_ROLE role to the EasyTrack EVM Script Executor |
| 5 | +2. Connect TRIGGERABLE_WITHDRAWALS_GATEWAY to Dual Governance tiebreaker |
| 6 | +3. Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory to Easy Track |
| 7 | +4. Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory to Easy Track |
| 8 | +""" |
| 9 | +import time |
| 10 | + |
| 11 | +from typing import Any, Dict |
| 12 | +from typing import Tuple, Optional |
| 13 | +from utils.config import ( |
| 14 | + AGENT, |
| 15 | + contracts, |
| 16 | + get_deployer_account, |
| 17 | + get_priority_fee, |
| 18 | + get_is_live |
| 19 | +) |
| 20 | +from utils.dg_decorators import forward_agent, forward_dg_admin, forward_voting, process_voting_items |
| 21 | +from utils.ipfs import upload_vote_ipfs_description, calculate_vote_ipfs_description |
| 22 | +from utils.voting import confirm_vote_script, create_vote, bake_vote_items |
| 23 | +from utils.permissions import encode_oz_grant_role |
| 24 | +from utils.easy_track import ( |
| 25 | + add_evmscript_factory, |
| 26 | + create_permissions, |
| 27 | +) |
| 28 | +from typing import Optional, Tuple, Dict |
| 29 | +from utils.config import contracts |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +TRIGGERABLE_WITHDRAWALS_GATEWAY = "0x4FD4113f2B92856B59BC3be77f2943B7F4eaa9a5" |
| 34 | + |
| 35 | +EASYTRACK_EVMSCRIPT_EXECUTOR = "0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D" |
| 36 | + |
| 37 | +EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x4aB23f409F8F6EdeF321C735e941E4670804a1B4" |
| 38 | +EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x7A1c5af4625dc1160a7c67d00335B6Ad492bE53f" |
| 39 | + |
| 40 | +DESCRIPTION = "Add Triggerable Withdrawals Gateway to Dual Governance and new Easy Tracks (HOLESKY)" |
| 41 | + |
| 42 | +def start_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Optional[Any]]: |
| 43 | + voting_unprepared_items = [ |
| 44 | + ( |
| 45 | + f"Grant SUBMIT_REPORT_HASH_ROLE on Validator Exit Bus Oracle to the EasyTrack EVM Script Executor", |
| 46 | + forward_agent( |
| 47 | + *encode_oz_grant_role( |
| 48 | + contract=contracts.validators_exit_bus_oracle, |
| 49 | + role_name="SUBMIT_REPORT_HASH_ROLE", |
| 50 | + grant_to=EASYTRACK_EVMSCRIPT_EXECUTOR, |
| 51 | + ), |
| 52 | + ), |
| 53 | + ), |
| 54 | + ( |
| 55 | + "Connect TRIGGERABLE_WITHDRAWALS_GATEWAY to Dual Governance tiebreaker", |
| 56 | + forward_dg_admin( |
| 57 | + contracts.dual_governance.address, |
| 58 | + contracts.dual_governance.addTiebreakerSealableWithdrawalBlocker.encode_input( |
| 59 | + TRIGGERABLE_WITHDRAWALS_GATEWAY |
| 60 | + ), |
| 61 | + ) |
| 62 | + ), |
| 63 | + ( |
| 64 | + f"Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory with address `{EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY}` to Easy Track `{contracts.easy_track.address}`", |
| 65 | + forward_voting( |
| 66 | + *add_evmscript_factory( |
| 67 | + factory=EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY, |
| 68 | + permissions=(create_permissions(contracts.validators_exit_bus_oracle, "submitExitRequestsHash")), |
| 69 | + ) |
| 70 | + ) |
| 71 | + ), |
| 72 | + ( |
| 73 | + f"Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory with address `{EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY}` to Easy Track `{contracts.easy_track.address}`", |
| 74 | + forward_voting( |
| 75 | + *add_evmscript_factory( |
| 76 | + factory=EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY, |
| 77 | + permissions=(create_permissions(contracts.validators_exit_bus_oracle, "submitExitRequestsHash")), |
| 78 | + ) |
| 79 | + ) |
| 80 | + ) |
| 81 | + ] |
| 82 | + |
| 83 | + if silent: |
| 84 | + desc_ipfs = calculate_vote_ipfs_description(DESCRIPTION) |
| 85 | + else: |
| 86 | + desc_ipfs = upload_vote_ipfs_description(DESCRIPTION) |
| 87 | + |
| 88 | + |
| 89 | + vote_items = process_voting_items(voting_unprepared_items) |
| 90 | + assert confirm_vote_script(vote_items, silent, desc_ipfs) |
| 91 | + |
| 92 | + return create_vote(vote_items, tx_params, desc_ipfs=desc_ipfs) |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +def main(): |
| 97 | + tx_params = {"from": get_deployer_account()} |
| 98 | + if get_is_live(): |
| 99 | + tx_params["priority_fee"] = get_priority_fee() |
| 100 | + |
| 101 | + vote_id, _ = start_vote(tx_params=tx_params, silent=False) |
| 102 | + |
| 103 | + vote_id >= 0 and print(f"Vote created: {vote_id}.") |
| 104 | + |
| 105 | + time.sleep(5) # hack for waiting thread #2. |
0 commit comments