Skip to content

Commit

Permalink
Add deployment script to use for CI tests in order to test deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
derekpierre committed Aug 22, 2024
1 parent f01d285 commit 805af9a
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
33 changes: 33 additions & 0 deletions deployment/constructor_params/ci/child.yml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions scripts/ci/deploy_child.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 805af9a

Please sign in to comment.