Skip to content

Commit

Permalink
Update mainnet root deployment to properly deploy taco application.
Browse files Browse the repository at this point in the history
  • Loading branch information
derekpierre committed Nov 21, 2023
1 parent 45ea900 commit 5749d3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
13 changes: 7 additions & 6 deletions deployment/constructor_params/mainnet/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -46,3 +46,4 @@ contracts:
_checkpointManager: $FXPORTAL_CHECKPOINT_MANAGER
_fxRoot: $FXPORTAL_FXROOT
_rootApplication: $TACoApplication
_fxChildTunnel: $FXPORTAL_FXCHILD
28 changes: 9 additions & 19 deletions scripts/mainnet/deploy_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Expand Down

0 comments on commit 5749d3d

Please sign in to comment.