From 805af9a3396614fc0efb238c0d09122cffaa0099 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 22 Aug 2024 16:53:51 -0400 Subject: [PATCH] Add deployment script to use for CI tests in order to test deployments. --- deployment/constructor_params/ci/child.yml | 33 ++++++++++++++++++ scripts/ci/deploy_child.py | 39 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 deployment/constructor_params/ci/child.yml create mode 100644 scripts/ci/deploy_child.py diff --git a/deployment/constructor_params/ci/child.yml b/deployment/constructor_params/ci/child.yml new file mode 100644 index 00000000..6da512f4 --- /dev/null +++ b/deployment/constructor_params/ci/child.yml @@ -0,0 +1,33 @@ +deployment: + name: ci-child + chain_id: 80002 + +artifacts: + dir: ./deployment/artifacts/ + filename: ci.json + +constants: + ONE_HOUR_IN_SECONDS: 3600 + FORTY_THOUSAND_TOKENS_IN_WEI_UNITS: 40000000000000000000000 + TEN_MILLION_TOKENS_IN_WEI_UNITS: 10000000000000000000000000 # https://www.youtube.com/watch?v=EJR1H5tf5wE + MAX_DKG_SIZE: 4 + +contracts: + - MockPolygonChild + - TACoChildApplication: + proxy: + constructor: + _rootApplication: $MockPolygonChild + _minimumAuthorization: $FORTY_THOUSAND_TOKENS_IN_WEI_UNITS + - LynxRitualToken: + constructor: + _totalSupplyOfTokens: $TEN_MILLION_TOKENS_IN_WEI_UNITS + - Coordinator: + proxy: + constructor: + _data: $encode:initialize,$ONE_HOUR_IN_SECONDS,$MAX_DKG_SIZE,$deployer + constructor: + _application: $TACoChildApplication + - GlobalAllowList: + constructor: + _coordinator: $Coordinator diff --git a/scripts/ci/deploy_child.py b/scripts/ci/deploy_child.py new file mode 100644 index 00000000..9d76b026 --- /dev/null +++ b/scripts/ci/deploy_child.py @@ -0,0 +1,39 @@ +#!/usr/bin/python3 +from ape import accounts, networks, project + +from deployment.constants import CONSTRUCTOR_PARAMS_DIR +from deployment.params import Deployer + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "ci" / "child.yml" + + +def main(): + with networks.ethereum.local.use_provider("test"): + test_account = accounts.test_accounts[0] + + deployer = Deployer.from_yaml( + filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY, account=test_account, force=True + ) + + mock_polygon_child = deployer.deploy(project.MockPolygonChild) + + taco_child_application = deployer.deploy(project.TACoChildApplication) + + deployer.transact(mock_polygon_child.setChildApplication, taco_child_application.address) + + ritual_token = deployer.deploy(project.LynxRitualToken) + + coordinator = deployer.deploy(project.Coordinator) + + global_allow_list = deployer.deploy(project.GlobalAllowList) + + deployments = [ + mock_polygon_child, + taco_child_application, + ritual_token, + coordinator, + global_allow_list, + ] + + deployer.finalize(deployments=deployments)