Skip to content

Commit

Permalink
Use deployer semantics for lynx contract depoyment script.
Browse files Browse the repository at this point in the history
  • Loading branch information
KPrasch committed Sep 18, 2023
1 parent 2c9980e commit 60f49be
Showing 1 changed file with 47 additions and 18 deletions.
65 changes: 47 additions & 18 deletions scripts/testnet/deploy_lynx.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
#!/usr/bin/python3
import os

from ape import project
from ape.cli import get_user_selected_account
from web3 import Web3

PUBLISH = True
PUBLISH = False


def main():
"""
This script deploys the Lynx TACo Root Application,
Lynx TACo Child Application, Lynx Ritual Token, and Lynx Coordinator.
usage: `ape run testnet deploy_lynx --network ethereum:goerli:https://goerli.infura.io/v3/<API_KEY>`
September 18, 2023, Deployment:
'LynxRootApplication' deployed to: 0x39F1061d68540F7eb57545C4C731E0945c167016
'LynxTACoChildApplication' deployed to: 0x892a548592bA66dc3860F75d76cDDb488a838c35
'Coordinator' deployed to: 0x18566d4590be23e4cb0a8476C80C22096C8c3418
"""

try:
import ape_etherscan # noqa: F401
except ImportError:
raise ImportError("Please install the ape-etherscan plugin to use this script.")
if not os.environ.get("ETHERSCAN_API_KEY"):
raise ValueError("ETHERSCAN_API_KEY is not set.")

def main(account_id=None):
deployer = get_user_selected_account()

# Lynx TACo Root Application
taco_app = project.LynxRootApplication.deploy(
sender=deployer,
publish=PUBLISH,
taco_app = deployer.deploy(
project.LynxRootApplication,
publish=PUBLISH
)

# Lynx TACo Child Application
taco_child_app = project.LynxTACoChildApplication.deploy(
taco_child_app = deployer.deploy(
project.LynxTACoChildApplication,
taco_app.address,
sender=deployer,
publish=PUBLISH,
)

Expand All @@ -29,20 +50,28 @@ def main(account_id=None):
)

# Lynx Ritual Token
ritual_token = project.LynxRitualToken.deploy(
Web3.to_wei(10_000_000, "ether"), sender=deployer, publish=PUBLISH
ritual_token = deployer.deploy(
project.LynxRitualToken,
Web3.to_wei(
10_000_000,
"ether"
),
publish=PUBLISH
)

# Lynx Coordinator
coordinator = project.Coordinator.deploy(
taco_child_app.address,
3600, # 1hr
4,
deployer.address,
ritual_token.address,
1, # 1 Wei per second
sender=deployer,
coordinator = deployer.deploy(
project.Coordinator, # coordinator
taco_child_app.address, # root_app
3600, # timeout (seconds)
4, # max_dkg_size
deployer.address, # admin
ritual_token.address, # currency
1, # fee_rate (wei per second)
publish=PUBLISH,
)

taco_child_app.setCoordinator(coordinator.address, sender=deployer)
taco_child_app.setCoordinator(
coordinator.address,
sender=deployer
)

0 comments on commit 60f49be

Please sign in to comment.