Skip to content

Commit

Permalink
Final renames StakeInfo -> TACoChildApp
Browse files Browse the repository at this point in the history
  • Loading branch information
vzotova committed Sep 1, 2023
1 parent 5bce831 commit ff36f5b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 38 deletions.
2 changes: 2 additions & 0 deletions ape-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ deployments:
address: "0xC1379866Fb0c100DCBFAb7b470009C4827D47DD8"
- contract_type: fx_child
address: "0xCf73231F28B7331BBe3124B907840A94851f9f11"
- contract_type: TACoChildApplication
address: "0x68E95C2548363Bf5856667065Bc1B89CC498969F"
ethereum:
local:
- nu_token_supply: 1_000_000_000
Expand Down
10 changes: 6 additions & 4 deletions scripts/check_xchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
print("WARNING: This script will take 40 mins to run to allow messages to sync from L1 to L2")
print("*******")
with networks.ethereum.goerli.use_provider("infura"):
root = project.PolygonRoot.at("0x55D1E362b81FDC6BaA359630bf3Ffa5900F66777")
root = project.PolygonRoot.at("0xD2Cb2A8fbE29adBa1C287b2A0b49f5C4fDc1f5BE")
root.updateOperator(
"0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600",
"0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600",
Expand All @@ -21,10 +21,12 @@ def main():
time.sleep(60 * i * 5)
print("Now: {}".format(time.time()))
with networks.polygon.mumbai.use_provider("infura"):
stake_info = project.StakeInfo.at("0x96e7dBa88f79e5CCAEBf0c7678539F6C0d719c99")
taco_child = project.TACoChildApplication.at(
"0x68E95C2548363Bf5856667065Bc1B89CC498969F"
)
print(
stake_info.stakingProviderFromOperator("0xAe87D865F3A507185656aD0ef52a8E0B9f3d58f8")
taco_child.stakingProviderFromOperator("0xAe87D865F3A507185656aD0ef52a8E0B9f3d58f8")
)
print(
stake_info.stakingProviderFromOperator("0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600")
taco_child.stakingProviderFromOperator("0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600")
)
5 changes: 2 additions & 3 deletions scripts/deploy_coordinator.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/python3
from ape import project
from ape.cli import get_user_selected_account

from scripts.utils import DEPLOYMENTS_CONFIG, get_account
from scripts.utils import DEPLOYMENTS_CONFIG


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

coordinator = project.Coordinator.deploy(
deployments_config.get("stake_info_contract"),
deployments_config.get("taco_child_contract"),
deployments_config.get("ritual_timeout"),
deployments_config.get("max_dkg_size"),
sender=deployer,
Expand Down
34 changes: 17 additions & 17 deletions scripts/deploy_coordinator_with_fee_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@

import os

from ape import config, project, networks
from ape.cli import account_option, network_option, NetworkBoundCommand
import click
from ape import config, networks, project
from ape.cli import NetworkBoundCommand, account_option, network_option
from ape.utils import ZERO_ADDRESS

from ape_etherscan.utils import API_KEY_ENV_KEY_MAP

import click


@click.command(cls=NetworkBoundCommand)
@network_option()
@account_option()
@click.option('--currency', default=ZERO_ADDRESS)
@click.option('--rate', default=None)
@click.option('--timeout', default=None)
@click.option('--admin', default=None)
@click.option('--max_size', default=None)
@click.option('--verify/--no-verify', default=True)
@click.option("--currency", default=ZERO_ADDRESS)
@click.option("--rate", default=None)
@click.option("--timeout", default=None)
@click.option("--admin", default=None)
@click.option("--max_size", default=None)
@click.option("--verify/--no-verify", default=True)
def cli(network, account, currency, rate, timeout, admin, max_size, verify):

deployer = account
click.echo(f"Deployer: {deployer}")

if rate and currency == ZERO_ADDRESS:
raise ValueError("ERC20 contract address needed for currency")

# Network
ecosystem_name = networks.provider.network.ecosystem.name
network_name = networks.provider.network.name
Expand All @@ -38,6 +36,7 @@ def cli(network, account, currency, rate, timeout, admin, max_size, verify):
# Validate Etherscan verification parameters.
# This import fails if called before the click network options are evaluated
from scripts.utils import LOCAL_BLOCKCHAIN_ENVIRONMENTS

is_public_deployment = network_name not in LOCAL_BLOCKCHAIN_ENVIRONMENTS
if not is_public_deployment:
verify = False
Expand All @@ -59,19 +58,20 @@ def cli(network, account, currency, rate, timeout, admin, max_size, verify):
currency = next(d for d in deployments if d["contract_type"] == currency)["address"]
except StopIteration:
pass

try:
stakes = next(d for d in deployments if d["contract_type"] == "StakeInfo")["address"]
stakes = next(d for d in deployments if d["contract_type"] == "TACoChildApplication")[
"address"
]
except StopIteration:
raise ValueError("StakeInfo deployment needed")
raise ValueError("TACoChildApplication deployment needed")

# Parameter defaults
admin = admin or deployer
rate = rate or 1
timeout = timeout or 60*60
timeout = timeout or 60 * 60
max_size = max_size or 64

params = (stakes, timeout, max_size, admin, currency, rate)
print("Deployment parameters:", params)
return project.Coordinator.deploy(*params, sender=deployer, publish=verify)

29 changes: 15 additions & 14 deletions scripts/deploy_flat_rate_fee_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@

import os

from ape import config, project, networks
from ape.cli import account_option, network_option, NetworkBoundCommand
import click
from ape import config, networks, project
from ape.cli import NetworkBoundCommand, account_option, network_option
from ape.utils import ZERO_ADDRESS

from ape_etherscan.utils import API_KEY_ENV_KEY_MAP

import click


@click.command(cls=NetworkBoundCommand)
@network_option()
@account_option()
@click.option('--currency', default=ZERO_ADDRESS)
@click.option('--rate', default=0)
@click.option('--verify/--no-verify', default=True)
@click.option("--currency", default=ZERO_ADDRESS)
@click.option("--rate", default=0)
@click.option("--verify/--no-verify", default=True)
def cli(network, account, currency, rate, verify):
deployer = account #get_account(account_id)
deployer = account # get_account(account_id)
click.echo(f"Deployer: {deployer}")

if rate and currency == ZERO_ADDRESS:
raise ValueError("ERC20 contract address needed for currency")

# Network
ecosystem_name = networks.provider.network.ecosystem.name
network_name = networks.provider.network.name
Expand All @@ -34,6 +32,7 @@ def cli(network, account, currency, rate, verify):
# Validate Etherscan verification parameters.
# This import fails if called before the click network options are evaluated
from scripts.utils import LOCAL_BLOCKCHAIN_ENVIRONMENTS

is_public_deployment = network_name not in LOCAL_BLOCKCHAIN_ENVIRONMENTS
if not is_public_deployment:
verify = False
Expand All @@ -53,11 +52,13 @@ def cli(network, account, currency, rate, verify):
currency = next(d for d in deployments if d["contract_type"] == currency)["address"]
except StopIteration:
pass

try:
stakes = next(d for d in deployments if d["contract_type"] == "StakeInfo")["address"]
stakes = next(d for d in deployments if d["contract_type"] == "TACoChildApplication")[
"address"
]
except StopIteration:
raise ValueError("StakeInfo deployment needed")
raise ValueError("TACoChildApplication deployment needed")

flat_rate_fee_model = project.FlatRateFeeModel.deploy(
currency,
Expand All @@ -66,4 +67,4 @@ def cli(network, account, currency, rate, verify):
sender=deployer,
publish=verify,
)
return flat_rate_fee_model
return flat_rate_fee_model

0 comments on commit ff36f5b

Please sign in to comment.