Skip to content

Commit

Permalink
revert: should have done a PR
Browse files Browse the repository at this point in the history
will add protections to main
  • Loading branch information
AlbertoCentonze committed Oct 10, 2024
1 parent 56f6c93 commit bc976fc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 230 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ requires-python = ">=3.10"
dependencies = [
"vyper>=0.4.0",
"snekmate==0.1.0",
"titanoboa",
"plyvel-ci==1.5.1",
# Keep this as a placeholder in the dependencies array
"titanoboa", # Keep this as a placeholder in the dependencies array
]

[tool.uv.sources]
Expand Down
7 changes: 1 addition & 6 deletions tests/integration/address_book.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# yearn vaults 3.0.3 factory
yearn_vault_factory = "0x5577EdcB8A856582297CdBbB07055E6a6E38eb5f"
factory = "0x5577EdcB8A856582297CdBbB07055E6a6E38eb5f"
crvusd = "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E"
crvusd_controller_factory = "0xC9332fdCB1C491Dcc683bAe86Fe3cb70360738BC"
crvusd_fee_collector = "0xa2Bcd1a4Efbd04B63cd03f5aFf2561106ebCCE00"
fee_splitter = "0x22556558419eed2d0a1af2e7fd60e63f3199aca3"
dao_agent = "0x40907540d8a6C65c637785e8f8B742ae6b0b9968"
vault_original = "0xcA78AF7443f3F8FA0148b746Cb18FF67383CDF3f"
55 changes: 3 additions & 52 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,23 @@
boa.set_etherscan(api_key=os.getenv("ETHERSCAN_API_KEY"))


@pytest.fixture(autouse=True, scope="module")
def better_traces(forked_env):
# contains contracts that are not necessarily called
# but appear in the traces
boa.from_etherscan(ab.vault_original, "vault_original")


@pytest.fixture(scope="module")
def rpc_url():
return os.getenv("ETH_RPC_URL") or "https://rpc.ankr.com/eth"


@pytest.fixture(scope="module", autouse=True)
def forked_env(rpc_url):
block_to_fork = 20928372
block_to_fork = 20826753
with boa.swap_env(boa.Env()):
boa.fork(url=rpc_url, block_identifier=block_to_fork)
# use this to disable caching
# boa.fork(url=rpc_url, block_identifier=block_to_fork, cache_file=None)
boa.env.enable_fast_mode()
yield


@pytest.fixture(scope="module")
def controller_factory():
return boa.from_etherscan(ab.crvusd_controller_factory, "controller_factory")
return boa.from_etherscan("0xC9332fdCB1C491Dcc683bAe86Fe3cb70360738BC", "controller_factory")


@pytest.fixture(scope="module")
Expand All @@ -42,49 +33,9 @@ def lens(controller_factory):

@pytest.fixture(scope="module")
def vault_factory():
return boa.from_etherscan(ab.yearn_vault_factory, "vault_factory")


@pytest.fixture(scope="module")
def fee_splitter(scope="module"):
_factory = boa.load_vyi("tests/integration/interfaces/IFeeSplitter.vyi")
return _factory.at(ab.fee_splitter)
return boa.from_etherscan("0x5577EdcB8A856582297CdBbB07055E6a6E38eb5f", "vault_factory")


@pytest.fixture(scope="module")
def crvusd():
return boa.from_etherscan(ab.crvusd, "crvusd")


@pytest.fixture(scope="module")
def vault(vault_factory):
_vault_abi = boa.load_partial("contracts/yearn/VaultV3.vy")

_vault_addy = vault_factory.deploy_new_vault(
ab.crvusd,
"Savings crvUSD",
"scrvUSD",
# TODO figure out who's going to be the role manager
ab.dao_agent,
86400 * 7, # 1 week
)

_vault = _vault_abi.at(_vault_addy)

# give the dao total control over the vault
_vault.set_role(ab.dao_agent, int("11111111111111", 2), sender=ab.dao_agent)
_vault.set_deposit_limit(2**256 - 1, sender=ab.dao_agent)
return _vault


@pytest.fixture(scope="module")
def rewards_handler(vault):
return boa.load(
"contracts/RewardsHandler.vy",
ab.crvusd,
vault,
500, # 5%
10_000, # 1
ab.crvusd_controller_factory,
ab.dao_agent,
)
80 changes: 0 additions & 80 deletions tests/integration/interfaces/IFeeSplitter.vyi

This file was deleted.

52 changes: 0 additions & 52 deletions tests/integration/test_fee_splitter.py

This file was deleted.

39 changes: 2 additions & 37 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc976fc

Please sign in to comment.