From 4a8806e136b3784ed6b2de79bfbe3424c7b970f4 Mon Sep 17 00:00:00 2001 From: zuzueeka Date: Mon, 25 Dec 2023 14:33:14 +0300 Subject: [PATCH 1/2] add holesky configs --- network-config.yaml | 22 +++++++++++++++++++ ...te_reward_programs_to_allowed_recipient.py | 13 ++++++----- utils/config.py | 1 + utils/deployed_date_time.py | 2 ++ utils/deployed_easy_track.py | 21 +++++++++++++++++- utils/lido.py | 22 +++++++++++++++++-- 6 files changed, 73 insertions(+), 8 deletions(-) diff --git a/network-config.yaml b/network-config.yaml index 9d13ac9b..18ce6472 100644 --- a/network-config.yaml +++ b/network-config.yaml @@ -1,3 +1,14 @@ +live: +- name: Ethereum + networks: + - chainid: 17000 + explorer: https://api-holesky.etherscan.io/api + host: $HOLESKY_RPC_URL + id: holesky + # New backward-compatible multicall contract. multicall2 is missing on Holesky. See https://github.com/mds1/multicall + multicall2: "0xcA11bde05977b3631167028862bE2a173976CA11" + name: Holesky (Infura) + provider: infura development: - cmd: ./ganache.sh cmd_settings: @@ -22,3 +33,14 @@ development: host: http://127.0.0.1 id: goerli-fork name: goerli-fork + - cmd: ./ganache.sh + cmd_settings: + accounts: 10 + chain_id: 17000 + fork: $HOLESKY_RPC_URL + gas_limit: 12000000 + mnemonic: brownie + port: 8545 + host: http://127.0.0.1 + id: holesky-fork + name: holesky-fork diff --git a/scripts/migrate_reward_programs_to_allowed_recipient.py b/scripts/migrate_reward_programs_to_allowed_recipient.py index 8f59842d..efd451a5 100644 --- a/scripts/migrate_reward_programs_to_allowed_recipient.py +++ b/scripts/migrate_reward_programs_to_allowed_recipient.py @@ -22,6 +22,9 @@ def main(): if (not (network_name == "goerli" or network_name == "goerli-fork")): raise EnvironmentError("network is not supported") + if (not (network_name == "holesky" or network_name == "holesky-fork")): + raise EnvironmentError("network is not supported") + recipients = [ "0xbbe8dDEf5BF31b71Ff5DbE89635f9dB4DeFC667E", "0x07fC01f46dC1348d7Ce43787b5Bbd52d8711a92D", @@ -62,7 +65,7 @@ def main(): log.ok("Limit", limit) log.ok("Period", period) log.ok("Spent amount", spent_amount) - + log.ok("Aragon Finance", contracts.aragon.finance) log.ok("Aragon Agent", contracts.aragon.agent) log.ok("EasyTrack", easy_track) @@ -76,7 +79,7 @@ def main(): log.nb("Aborting") return - tx_params = { + tx_params = { "from": deployer, "priority_fee": "2 gwei", "max_fee": "50 gwei" @@ -84,10 +87,10 @@ def main(): tx = allowed_recipients_builder.deployFullSetup( trusted_caller, - contracts.ldo, - limit, + contracts.ldo, + limit, period, - recipients, + recipients, titles, spent_amount, tx_params diff --git a/utils/config.py b/utils/config.py index 736b0f18..e74aaf38 100644 --- a/utils/config.py +++ b/utils/config.py @@ -22,6 +22,7 @@ def get_is_live(): "hardhat", "hardhat-fork", "mainnet-fork", + "holesky-fork", "goerli-fork" ] return network.show_active() not in dev_networks diff --git a/utils/deployed_date_time.py b/utils/deployed_date_time.py index 273bd9df..6a62a34d 100644 --- a/utils/deployed_date_time.py +++ b/utils/deployed_date_time.py @@ -3,4 +3,6 @@ def date_time_contract(network: str = "mainnet") -> str: return "0x75100bd564415731b5936a4a94d0dc29dde5db3c" if network == "goerli" or network == "goerli-fork": return "0xb1e4de1092D0D32613e4BbFBf4D68650862f43A6" + if network == "holesky" or network == "holesky-fork": + return "0xd6237FecDF9C1D9b023A5205C17549E3037EeEec" raise NameError(f"""Unknown network "{network}". Supported networks: mainnet, goerli.""") diff --git a/utils/deployed_easy_track.py b/utils/deployed_easy_track.py index 9c556402..ea1a8544 100644 --- a/utils/deployed_easy_track.py +++ b/utils/deployed_easy_track.py @@ -32,6 +32,25 @@ def addresses(network="mainnet"): reward_programs_registry="0xfCaD241D9D2A2766979A2de208E8210eDf7b7D4F", ), ) + if network == "holesky" or network == "holesky-fork": + return EasyTrackSetup( + easy_track="0x1763b9ED3586B08AE796c7787811a2E1bc16163a", + evm_script_executor="0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D", + increase_node_operator_staking_limit="", + top_up_lego_program="", + reward_programs=RewardPrograms( + add_reward_program="", + remove_reward_program="", + top_up_reward_programs="", + reward_programs_registry="", + ), + referral_partners=RewardPrograms( + add_reward_program="", + remove_reward_program="", + top_up_reward_programs="", + reward_programs_registry="", + ), + ) if network == "goerli" or network == "goerli-fork": return EasyTrackSetup( easy_track="0xAf072C8D368E4DD4A9d4fF6A76693887d6ae92Af", @@ -52,7 +71,7 @@ def addresses(network="mainnet"): ), ) raise NameError( - f"""Unknown network "{network}". Supported networks: mainnet, goerli.""" + f"""Unknown network "{network}". Supported networks: mainnet, holesky, goerli.""" ) diff --git a/utils/lido.py b/utils/lido.py index 55f4fe64..31544743 100644 --- a/utils/lido.py +++ b/utils/lido.py @@ -18,6 +18,20 @@ def addresses(network=DEFAULT_NETWORK): steth="0xae7ab96520de3a18e5e111b5eaab095312d7fe84", node_operators_registry="0x55032650b14df07b85bf18a3a3ec8e0af2e028d5", ) + if network == "holesky" or network == "holesky-fork": + return LidoAddressesSetup( + aragon=AragonSetup( + acl="0xfd1E42595CeC3E83239bf8dFc535250e7F48E0bC", + agent="0xE92329EC7ddB11D25e25b3c21eeBf11f15eB325d", + voting="0xdA7d2573Df555002503F29aA4003e398d28cc00f", + finance="0xf0F281E5d7FBc54EAFcE0dA225CDbde04173AB16", + gov_token="0x14ae7daeecdf57034f3E9db8564e46Dba8D97344", + calls_script="0xAa8B4F258a4817bfb0058b861447878168ddf7B0", + token_manager="0xFaa1692c6eea8eeF534e7819749aD93a1420379A", + ), + steth="0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034", + node_operators_registry="0x595F64Ddc3856a3b5Ff4f4CC1d1fb4B46cFd2bAC", + ) if network == "goerli" or network == "goerli-fork": return LidoAddressesSetup( aragon=AragonSetup( @@ -33,7 +47,7 @@ def addresses(network=DEFAULT_NETWORK): node_operators_registry="0x9d4af1ee19dad8857db3a45b0374c81c8a1c6320", ) raise NameError( - f"""Unknown network "{network}". Supported networks: mainnet, mainnet-fork goerli, goerli-fork""" + f"""Unknown network "{network}". Supported networks: mainnet, mainnet-fork, holesky, holesky-fork, goerli, goerli-fork""" ) @@ -46,12 +60,16 @@ def allowed_recipients_builder(network=DEFAULT_NETWORK): return brownie.AllowedRecipientsBuilder.at( "0x958e0D946D014F377421a53AB5f9180d4485e63B" ) + if network == "holesky" or network == "holesky-fork": + return brownie.AllowedRecipientsBuilder.at( + "0xeC3785b13b21c226D66B5bC2E82BB2f4226f715e" + ) if network == "goerli" or network == "goerli-fork": return brownie.AllowedRecipientsBuilder.at( "0x1082512D1d60a0480445353eb55de451D261b684" ) raise NameError( - f"""Unknown network "{network}". Supported networks: mainnet, mainnet-fork goerli, goerli-fork""" + f"""Unknown network "{network}". Supported networks: mainnet, mainnet-fork, holesky, holesky-fork, goerli, goerli-fork""" ) From a23f6a5f7c6aa3fd24835e039d00aa4a26d1c27f Mon Sep 17 00:00:00 2001 From: zuzueeka Date: Tue, 26 Dec 2023 15:24:36 +0300 Subject: [PATCH 2/2] add more acceptance tests --- scripts/acceptance_test_full_setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/acceptance_test_full_setup.py b/scripts/acceptance_test_full_setup.py index 1a754b88..03c142b9 100644 --- a/scripts/acceptance_test_full_setup.py +++ b/scripts/acceptance_test_full_setup.py @@ -10,7 +10,7 @@ from utils.config import ( get_network_name, ) -from utils import lido, deployed_easy_track, log, deployment +from utils import lido, deployed_easy_track, deployed_date_time, log, deployment from hexbytes import HexBytes ADD_RECIPIENT_TO_ALLOWED_LIST_ROLE = ( @@ -52,6 +52,7 @@ def main(): contracts = lido.contracts(network=network_name) et_contracts = deployed_easy_track.contracts(network=network_name) + date_time_contract = deployed_date_time.date_time_contract(network=network_name) evm_script_executor = et_contracts.evm_script_executor @@ -97,6 +98,9 @@ def main(): remove_allowed_recipient_address ) + assert registry.bokkyPooBahsDateTimeContract() == date_time_contract + assert top_up_allowed_recipients.easyTrack() == et_contracts.easy_track + assert top_up_allowed_recipients.finance() == contracts.aragon.finance assert top_up_allowed_recipients.token() == deploy_config.token assert top_up_allowed_recipients.allowedRecipientsRegistry() == registry assert top_up_allowed_recipients.trustedCaller() == deploy_config.trusted_caller