Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
feat: deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Nov 28, 2023
1 parent 4234632 commit 3ef2e76
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
30 changes: 30 additions & 0 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from ape import project, accounts, chain
import click

deployer = accounts.load("v3_deployer")


def deploy():
print(f"You are using: 'deployer' [{deployer.address}]")
print("Deploying a new strategy on ChainID", chain.chain_id)

if input("Do you want to continue? [y/N]: ").lower() != "y":
return

publish_source = click.confirm("Verify source on etherscan?")

# Address of the underlying asset to use
asset = ""
# Name for your strategy
name = ""

if input(f"Deploy strategy for {asset}, called {name}? [y/N]: ").lower() != "y":
return

strategy = deployer.deploy(project.Strategy, asset, name, publish=publish_source)

print(f"Deployed new strategy to: {strategy.address}")


def main():
deploy()
12 changes: 7 additions & 5 deletions tests/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test__operation(
# Deposit to the strategy
deposit()

# TODO: Implement logic so totalDebt ends > 0
# TODO: Implement logic so total_debt ends > 0
check_strategy_totals(
strategy, total_assets=amount, total_debt=0, total_idle=amount
)
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_profitable_report(
# Deposit to the strategy
deposit()

# TODO: Implement logic so totalDebt ends > 0
# TODO: Implement logic so total_debt ends > 0
check_strategy_totals(
strategy, total_assets=amount, total_debt=0, total_idle=amount
)
Expand All @@ -73,14 +73,15 @@ def test_profitable_report(

assert profit >= to_airdrop

# TODO: Implement logic so totalDebt == amount + profit
# TODO: Implement logic so total_debt == amount + profit
check_strategy_totals(
strategy, total_assets=amount + profit, total_debt=0, total_idle=amount + profit
)

# needed for profits to unlock
increase_time(chain, strategy.profitMaxUnlockTime() - 1)

# TODO: Implement logic so total_debt == amount + profit
check_strategy_totals(
strategy, total_assets=amount + profit, total_debt=0, total_idle=amount + profit
)
Expand Down Expand Up @@ -116,7 +117,7 @@ def test__profitable_report__with_fee(
# Deposit to the strategy
deposit()

# TODO: Implement logic so totalDebt ends > 0
# TODO: Implement logic so total_debt ends > 0
check_strategy_totals(
strategy, total_assets=amount, total_debt=0, total_idle=amount
)
Expand All @@ -142,14 +143,15 @@ def test__profitable_report__with_fee(
(profit * performance_fee // MAX_BPS) * (10_000 - protocol_fee) // MAX_BPS
)

# TODO: Implement logic so totalDebt == amount + profit
# TODO: Implement logic so total_debt == amount + profit
check_strategy_totals(
strategy, total_assets=amount + profit, total_debt=0, total_idle=amount + profit
)

# needed for profits to unlock
increase_time(chain, strategy.profitMaxUnlockTime() - 1)

# TODO: Implement logic so total_debt == amount + profit
check_strategy_totals(
strategy, total_assets=amount + profit, total_debt=0, total_idle=amount + profit
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def test__oracle(create_oracle, strategy, user):

oracle = create_oracle()

check_oracle(oracle, strategy, strategy)
check_oracle(oracle, strategy, user)

0 comments on commit 3ef2e76

Please sign in to comment.