Skip to content

Commit

Permalink
Add tapir scripts for approving Fee Models
Browse files Browse the repository at this point in the history
  • Loading branch information
theref committed Aug 19, 2024
1 parent fc8fd43 commit d8911fb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
32 changes: 32 additions & 0 deletions scripts/tapir/coordinator_approve_bqeth_fee_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/python3

from ape import project, networks

from deployment.constants import ARTIFACTS_DIR
from deployment.params import Transactor
from deployment.registry import contracts_from_registry

TAPIR_REGISTRY_FILEPATH = ARTIFACTS_DIR / "tapir.json"

def main():
"""
Coordinator approves the fee model for BqETHSubscription
ape run tapir coordinator_approve_fee_model --network polygon:amoy:infura
"""

transactor = Transactor()
deployments = contracts_from_registry(
filepath=TAPIR_REGISTRY_FILEPATH, chain_id=networks.active_provider.chain_id
)
coordinator = deployments[project.Coordinator.contract_type.name]
bqeth_subscription = deployments[project.BqETHSubscription.contract_type.name]

# Grant TREASURY_ROLE
TREASURY_ROLE = coordinator.TREASURY_ROLE()
transactor.transact(
coordinator.grantRole,
TREASURY_ROLE,
transactor.get_account().address
)
transactor.transact(coordinator.approveFeeModel, bqeth_subscription.address)
25 changes: 25 additions & 0 deletions scripts/tapir/coordinator_approve_free_fee_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python3

from ape import project, networks

from deployment.constants import ARTIFACTS_DIR
from deployment.params import Transactor
from deployment.registry import contracts_from_registry

TAPIR_REGISTRY_FILEPATH = ARTIFACTS_DIR / "tapir.json"

def main():
"""
Coordinator approves the fee model for Free Fee Model
ape run tapir coordinator_approve_free_fee_model --network polygon:amoy:infura
"""

transactor = Transactor()
deployments = contracts_from_registry(
filepath=TAPIR_REGISTRY_FILEPATH, chain_id=networks.active_provider.chain_id
)
coordinator = deployments[project.Coordinator.contract_type.name]
free_fee_model = deployments[project.FreeFeeModel.contract_type.name]

transactor.transact(coordinator.approveFeeModel, free_fee_model.address)

0 comments on commit d8911fb

Please sign in to comment.