From 5749d3da607da85c3c5011b879bb5549adf7c38b Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 20 Nov 2023 18:41:43 -0500 Subject: [PATCH] Update mainnet root deployment to properly deploy taco application. --- .../constructor_params/mainnet/root.yml | 13 +++++---- scripts/mainnet/deploy_root.py | 28 ++++++------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/deployment/constructor_params/mainnet/root.yml b/deployment/constructor_params/mainnet/root.yml index 743ea643..f09e81ba 100644 --- a/deployment/constructor_params/mainnet/root.yml +++ b/deployment/constructor_params/mainnet/root.yml @@ -9,16 +9,16 @@ artifacts: constants: # Threshold Network - References: # - https://docs.threshold.network/resources/contract-addresses/mainnet/threshold-dao - T_TOKEN_ETH_MAINNET: 0xCdF7028ceAB81fA0C6971208e83fa7872994beE5 - T_STAKING_CONTRACT: 0x01B67b1194C75264d06F808A921228a95C765dd7 - THRESHOLD_COUNCIL_ETH_MAINNET: 0x9F6e831c8F8939DC0C830C6e492e7cEf4f9C2F5f + T_TOKEN_ETH_MAINNET: "0xCdF7028ceAB81fA0C6971208e83fa7872994beE5" + T_STAKING_CONTRACT: "0x01B67b1194C75264d06F808A921228a95C765dd7" # FxPortal addresses - References: # - https://github.com/0xPolygon/fx-portal#deployment-addresses # - https://github.com/0xPolygon/fx-portal/blob/main/config/config.json # - https://wiki.polygon.technology/docs/pos/design/bridge/l1-l2-communication/state-transfer/#prerequisites - FXPORTAL_CHECKPOINT_MANAGER: 0x86e4dc95c7fbdbf52e33d563bbdb00823894c287 - FXPORTAL_FXROOT: 0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2 + FXPORTAL_CHECKPOINT_MANAGER: "0x86e4dc95c7fbdbf52e33d563bbdb00823894c287" + FXPORTAL_FXROOT: "0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2" + FXPORTAL_FXCHILD: "0x8397259c983751DAf40400790063935a11afa28a" # TODO is this correct? # TACo specific constants: IN_SECONDS_1_HOUR: 3600 @@ -32,7 +32,7 @@ contracts: - TACoApplication: proxy: constructor: - initialOwner: $THRESHOLD_COUNCIL_ETH_MAINNET + _data: $encode:initialize constructor: _token: $T_TOKEN_ETH_MAINNET _tStaking: $T_STAKING_CONTRACT @@ -46,3 +46,4 @@ contracts: _checkpointManager: $FXPORTAL_CHECKPOINT_MANAGER _fxRoot: $FXPORTAL_FXROOT _rootApplication: $TACoApplication + _fxChildTunnel: $FXPORTAL_FXCHILD diff --git a/scripts/mainnet/deploy_root.py b/scripts/mainnet/deploy_root.py index d8ffaae6..5b807d7f 100644 --- a/scripts/mainnet/deploy_root.py +++ b/scripts/mainnet/deploy_root.py @@ -2,37 +2,27 @@ from ape import project -from deployment.constants import ( - CONSTRUCTOR_PARAMS_DIR, - OZ_DEPENDENCY, -) +from deployment.constants import CONSTRUCTOR_PARAMS_DIR from deployment.params import Deployer -VERIFY = True +VERIFY = False # TODO enable for mainnet? CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "mainnet" / "root.yml" +THRESHOLD_COUNCIL_ETH_MAINNET = "0x9F6e831c8F8939DC0C830C6e492e7cEf4f9C2F5f" -def main(): - - deployer = Deployer.from_yaml( - filepath=CONSTRUCTOR_PARAMS_FILEPATH, - verify=VERIFY - ) - - _ = deployer.deploy(project.TACoApplication) # FIXME - proxy = deployer.deploy(OZ_DEPENDENCY.TransparentUpgradeableProxy) - taco_application = deployer.proxy(project.TACoApplication, proxy) +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) - deployer.transact(taco_application.initialize) + taco_application = deployer.deploy(project.TACoApplication) polygon_root = deployer.deploy(project.PolygonRoot) - deployer.transact(taco_application.setChildApplication, polygon_root.address) - deployer.transact(taco_application.transferOwnership, deployer.constants["THRESHOLD_COUNCIL"]) + # Need to set child application before transferring ownership + deployer.transact(taco_application.setChildApplication, polygon_root.address) + deployer.transact(taco_application.transferOwnership, THRESHOLD_COUNCIL_ETH_MAINNET) deployments = [ - # proxy only (implementation has same contract name so not included) taco_application, polygon_root, ]