Skip to content

Commit

Permalink
Add script to configure lynx stakes on goerli root application.
Browse files Browse the repository at this point in the history
  • Loading branch information
derekpierre committed Sep 26, 2023
1 parent 7b576a0 commit 45004cd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions scripts/configure_lynx_staking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from ape import project
from ape.cli import get_user_selected_account
from scripts.constants import ARTIFACTS_DIR
from scripts.registry import read_registry

REGISTRY_FILEPATH = ARTIFACTS_DIR / "lynx" / "lynx-alpha-13-root-registry.json"


def main():
registry_entries = read_registry(filepath=REGISTRY_FILEPATH)

registry_contracts_dict = {
registry_entry.contract_name: registry_entry for registry_entry in registry_entries
}

taco_application_entry = registry_contracts_dict[project.TACoApplication.contract_type.name]
threshold_staking_entry = registry_contracts_dict[
project.TestnetThresholdStaking.contract_type.name
]

taco_application_contract = project.TACoApplication.at(taco_application_entry.contract_address)
threshold_staking_contract = project.TestnetThresholdStaking.at(
threshold_staking_entry.contract_address
)

deployer_account = get_user_selected_account()

# Set up lynx stakes
lynx_nodes = {
"0xb15d5a4e2be34f4be154a1b08a94ab920ffd8a41": "0x890069745E9497C6f99Db68C4588deC5669F3d3E",
"0x210eeac07542f815ebb6fd6689637d8ca2689392": "0xf48F720A2Ed237c24F5A7686543D90596bb8D44D",
"0x48C8039c32F4c6f5cb206A5911C8Ae814929C16B": "0xce057adc39dcD1b3eA28661194E8963481CC48b2",
}

min_stake_size = taco_application_contract.minimumAuthorization()
for staking_provider, operator in lynx_nodes.items():
threshold_staking_contract.setRoles(staking_provider, sender=deployer_account)

threshold_staking_contract.authorizationIncreased(
staking_provider, 0, min_stake_size, sender=deployer_account
)

0 comments on commit 45004cd

Please sign in to comment.