Skip to content

Commit

Permalink
gauge update
Browse files Browse the repository at this point in the history
  • Loading branch information
pata.eth committed May 19, 2022
1 parent 524ed22 commit efea022
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
4 changes: 3 additions & 1 deletion brownie-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# use Ganache's forked mainnet mode as the default network
# NOTE: You don't *have* to do this, but it is often helpful for testing
networks:
default: mainnet-fork
default: ftm-main-fork

dotenv: .env

# automatically fetch contract sources from Etherscan
autofetch_sources: True
Expand Down
2 changes: 1 addition & 1 deletion contracts/StrategyCurveTricrypto.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract contract StrategyCurveBase is BaseStrategy {

// Curve stuff
IGauge public constant gauge =
IGauge(0x00702BbDEaD24C40647f235F15971dB0867F6bdB); // Curve gauge contract, most are tokenized, held by strategy
IGauge(0x319E268f0A4C85D404734ee7958857F5891506d7); // Curve gauge contract, most are tokenized, held by strategy

// keepCRV stuff
uint256 public keepCRV; // the percentage of CRV we re-lock for boost (in basis points)
Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def isolation(fn_isolation):
def whale(accounts):
# Totally in it for the tech
# Update this with a large holder of your want token (the largest EOA holder of LP)
whale = accounts.at("0x4d51B782DA9e2cD073916bd4e9eC6d06916B049e", force=True)
whale = accounts.at("0x7A5ea5F5D1bEB6dD9f9De01487043FD9BCa81996", force=True)
yield whale


# this is the amount of funds we have our whale deposit. adjust this as needed based on their wallet balance
@pytest.fixture(scope="module")
def amount():
amount = 50e18
def amount(token, whale):
amount = token.balanceOf(whale) // 2
yield amount


Expand Down Expand Up @@ -77,7 +77,7 @@ def zero_address():
@pytest.fixture(scope="module")
def gauge():
# this should be the address of the convex deposit token
gauge = "0x00702BbDEaD24C40647f235F15971dB0867F6bdB"
gauge = "0x319E268f0A4C85D404734ee7958857F5891506d7"
yield Contract(gauge)


Expand Down
15 changes: 15 additions & 0 deletions tests/test_liq_gauge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from warnings import warn


def test_gauge_is_properly_setup(gauge, crv):

assert gauge.reward_count() > 0, "No reward tokens setup in the gauge"

reward_tokens = []

for i in range(gauge.reward_count()):
reward_tokens.append(gauge.reward_tokens(i))

assert (
crv.address in reward_tokens
), "CRV is not currently being rewarded by the gauge"
14 changes: 7 additions & 7 deletions tests/test_withdraw_after_donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_withdraw_after_donation_1(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check to make sure that our debtRatio is about half of our previous debt
assert new_params["debtRatio"] == currentDebt / 2
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_withdraw_after_donation_2(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]
Expand Down Expand Up @@ -203,7 +203,7 @@ def test_withdraw_after_donation_3(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]
Expand Down Expand Up @@ -343,7 +343,7 @@ def test_withdraw_after_donation_5(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]
Expand Down Expand Up @@ -405,7 +405,7 @@ def test_withdraw_after_donation_6(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]
Expand Down Expand Up @@ -497,7 +497,7 @@ def test_withdraw_after_donation_7(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]
Expand Down Expand Up @@ -580,7 +580,7 @@ def test_withdraw_after_donation_8(
assert profit > 0

# specifically check that our gain is greater than our donation or confirm we're no more than 5 wei off.
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation

# check that we didn't add any more loss, or at least no more than 2 wei
assert new_params["totalLoss"] == prev_params["totalLoss"]

0 comments on commit efea022

Please sign in to comment.