daomoon / BadgerStratUpToTesting

Had to try and create a blank repo to push to
GNU Affero General Public License v3.0
0 stars 0 forks source link

New unit test complete dump after fixing test_profitable.py #3

Closed St4rgarden closed 3 years ago

St4rgarden commented 3 years ago

tests/test_profitable.py . [ 7%] tests/examples/test_are_you_trying.py F [ 14%] tests/examples/test_basic.py . [ 21%] tests/examples/test_harvest_flow.py .F.FF [ 57%] tests/examples/test_strategy_permissions.py F.FFFF [100%]

========================================================================== FAILURES ========================================================================== ____ test_are_youtrying ____

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xC2f2042DA65Eb5dEE6990C31E1F1659Fd39f1c81'> strategy = <MyStrategy Contract '0x84DC387Ab90D57C7c687aaCaf4423c671D418aE5'>, want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_are_you_trying(deployer, sett, strategy, want):
  """
    Verifies that you set up the Strategy properly
  """
  # Setup
  startingBalance = want.balanceOf(deployer)

  depositAmount = startingBalance // 2
  assert startingBalance >= depositAmount
  assert startingBalance >= 0
  # End Setup

  # Deposit
  assert want.balanceOf(sett) == 0

  want.approve(sett, MaxUint256, {"from": deployer})
  sett.deposit(depositAmount, {"from": deployer})

  available = sett.available()
  assert available > 0

  sett.earn({"from": deployer})

  chain.mine(10000) # Mine so we get some interest

  ## TEST 1: Does the want get used in any way?
  assert want.balanceOf(sett) == depositAmount - available

  # Did the strategy do something with the asset?
  assert want.balanceOf(strategy) < available

  # Use this if it should invest all
  # assert want.balanceOf(strategy) == 0

  # Change to this if the strat is supposed to hodl and do nothing
  #assert strategy.balanceOf(want) = depositAmount

  ## TEST 2: Is the Harvest profitable?
harvest = strategy.harvest({"from": deployer})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_are_you_trying.py:43: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ___ test_single_user_harvest_flow ____

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, vault = <SettV3 Contract '0xb90ED4b0F9163bFE2a961095457461bBC8B4A49D'> sett = <SettV3 Contract '0xb90ED4b0F9163bFE2a961095457461bBC8B4A49D'>, controller = <Controller Contract '0xE1E4D4182aB98D0993532CDBB1E09Bb4c014c1bC'> strategy = <MyStrategy Contract '0xA01037Ae524e4AcBFFB81153c23Ef4A421B4B07A'>, want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'> settKeeper = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, strategyKeeper = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>

def test_single_user_harvest_flow(deployer, vault, sett, controller, strategy, want, settKeeper, strategyKeeper):
    # Setup
    snap = SnapshotManager(vault, strategy, controller, "StrategySnapshot")
    randomUser = accounts[6]
    tendable = strategy.isTendable()
    startingBalance = want.balanceOf(deployer)
    depositAmount = startingBalance // 2
    assert startingBalance >= depositAmount
    assert startingBalance >= 0
    # End Setup

    # Deposit
    want.approve(sett, MaxUint256, {"from": deployer})
    snap.settDeposit(depositAmount, {"from": deployer})
    shares = vault.balanceOf(deployer)

    assert want.balanceOf(sett) > 0
    print("want.balanceOf(sett)", want.balanceOf(sett))

    # Earn
    snap.settEarn({"from": settKeeper})

    if tendable:
        with brownie.reverts("onlyAuthorizedActors"):
            strategy.tend({"from": randomUser})
      snap.settTend({"from": strategyKeeper})

../daomoon/tests/examples/test_harvest_flow.py:70:


helpers/SnapshotManager.py:86: in settTend self.resolver.confirm_tend(before, after, tx) config/StrategyResolver.py:62: in confirm_tend assert after.get("strategy.isTendable") == True


self = <helpers.snapshot.snap.Snap object at 0x104e7fc10>, key = 'strategy.isTendable'

def get(self, key):
    if key not in self.data.keys():
      raise Exception("Key {} not found in snap data".format(key))

E Exception: Key strategy.isTendable not found in snap data

helpers/snapshot/snap.py:17: Exception ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... -------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------- init_resolver wBTC-AAVE-Rewards snap snap === Compare Deposit === === Compare: StrategySnapshot Sett 12741569 -> 12741570 === +--------------------------+-------------+-------------+--------------+ | metric | before | after | diff | +==========================+=============+=============+==============+ | balances.want.sett | 0 | 6.03669e-11 | 6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | balances.want.strategist | 1.20734e-10 | 6.03669e-11 | -6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | balances.want.user | 1.20734e-10 | 6.03669e-11 | -6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | balances.sett.strategist | 0 | 6.03669e-11 | 6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | balances.sett.user | 0 | 6.03669e-11 | 6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | sett.balance | 0 | 6.03669e-11 | 6.03669e-11 | +--------------------------+-------------+-------------+--------------+ | sett.available | 0 | 5.73486e-11 | 5.73486e-11 | +--------------------------+-------------+-------------+--------------+ | sett.totalSupply | 0 | 6.03669e-11 | 6.03669e-11 | +--------------------------+-------------+-------------+--------------+ 60366943 60366943 1 60366943 60366943 1 60366943 60366943 1 60366943 60366943 1 want.balanceOf(sett) 60366943 snap snap === Compare Earn === === Compare: StrategySnapshot Sett 12741570 -> 12741571 === +------------------------+-------------+-------------+--------------+ | metric | before | after | diff | +========================+=============+=============+==============+ | balances.want.sett | 6.03669e-11 | 3.01835e-12 | -5.73486e-11 | +------------------------+-------------+-------------+--------------+ | balances.want.aToken | 3.93299e-06 | 3.93305e-06 | 5.73486e-11 | +------------------------+-------------+-------------+--------------+ | sett.available | 5.73486e-11 | 2.86743e-12 | -5.44812e-11 | +------------------------+-------------+-------------+--------------+ | strategy.balanceOfPool | 0 | 5.73486e-11 | 5.73486e-11 | +------------------------+-------------+-------------+--------------+ | strategy.balanceOf | 0 | 5.73486e-11 | 5.73486e-11 | +------------------------+-------------+-------------+--------------+ snap snap ____ test_withdrawother ____

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0x81FBb5403fBeAdd744f24da28977F0292B815Aba'> controller = <Controller Contract '0x93079019DC27Ad21e59ab4C380585cA812CeB315'>, strategy = <MyStrategy Contract '0x00d23748fB22bE27ff47a72a593D9C38ea6Dab6E'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_withdraw_other(deployer, sett, controller, strategy, want):
    """
    - Controller should be able to withdraw other tokens
    - Controller should not be able to withdraw core tokens
    - Non-controller shouldn't be able to do either
    """
    # Setup
    randomUser = accounts[6]
    startingBalance = want.balanceOf(deployer)
    depositAmount = startingBalance // 2
    assert startingBalance >= depositAmount
    # End Setup

    # Deposit
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(15)
    chain.mine()

    sett.earn({"from": deployer})

    chain.sleep(days(0.5))
    chain.mine()

    if strategy.isTendable():
        strategy.tend({"from": deployer})
  strategy.harvest({"from": deployer})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_harvestflow.py:219: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ____ test_single_user_harvest_flow_remove_fees __

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, vault = <SettV3 Contract '0xAE7f7F645261c33e45cD9261B8a6753901563cdf'> sett = <SettV3 Contract '0xAE7f7F645261c33e45cD9261B8a6753901563cdf'>, controller = <Controller Contract '0x079DC4fc0f2abB72Ccf99ea130436F93dD2FcB15'> strategy = <MyStrategy Contract '0xe15854D3842e2f537d01793cA10b5E5dEFFCb5Df'>, want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_single_user_harvest_flow_remove_fees(deployer, vault, sett, controller, strategy, want):
    # Setup
    randomUser = accounts[6]
    snap = SnapshotManager(vault, strategy, controller, "StrategySnapshot")
    startingBalance = want.balanceOf(deployer)
    tendable = strategy.isTendable()
    startingBalance = want.balanceOf(deployer)
    depositAmount = startingBalance // 2
    assert startingBalance >= depositAmount
    # End Setup

    # Deposit
    want.approve(sett, MaxUint256, {"from": deployer})
    snap.settDeposit(depositAmount, {"from": deployer})

    # Earn
    snap.settEarn({"from": deployer})

    chain.sleep(days(0.5))
    chain.mine()

    if tendable:
      snap.settTend({"from": deployer})

../daomoon/tests/examples/test_harvest_flow.py:269:


helpers/SnapshotManager.py:86: in settTend self.resolver.confirm_tend(before, after, tx) config/StrategyResolver.py:62: in confirm_tend assert after.get("strategy.isTendable") == True


self = <helpers.snapshot.snap.Snap object at 0x10922ca60>, key = 'strategy.isTendable'

def get(self, key):
    if key not in self.data.keys():
      raise Exception("Key {} not found in snap data".format(key))

E Exception: Key strategy.isTendable not found in snap data

helpers/snapshot/snap.py:17: Exception ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... -------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------- init_resolver wBTC-AAVE-Rewards snap snap === Compare Deposit === === Compare: StrategySnapshot Sett 12741623 -> 12741624 === +--------------------------+-------------+-------------+--------------+ | metric | before | after | diff | +==========================+=============+=============+==============+ | balances.want.sett | 0 | 3.4055e-11 | 3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | balances.want.strategist | 6.81099e-11 | 3.4055e-11 | -3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | balances.want.user | 6.81099e-11 | 3.4055e-11 | -3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | balances.sett.strategist | 0 | 3.4055e-11 | 3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | balances.sett.user | 0 | 3.4055e-11 | 3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | sett.balance | 0 | 3.4055e-11 | 3.4055e-11 | +--------------------------+-------------+-------------+--------------+ | sett.available | 0 | 3.23522e-11 | 3.23522e-11 | +--------------------------+-------------+-------------+--------------+ | sett.totalSupply | 0 | 3.4055e-11 | 3.4055e-11 | +--------------------------+-------------+-------------+--------------+ 34054963 34054963 1 34054963 34054963 1 34054964 34054964 1 34054963 34054963 1 snap snap === Compare Earn === === Compare: StrategySnapshot Sett 12741624 -> 12741625 === +------------------------+-------------+-------------+--------------+ | metric | before | after | diff | +========================+=============+=============+==============+ | balances.want.sett | 3.4055e-11 | 1.70275e-12 | -3.23522e-11 | +------------------------+-------------+-------------+--------------+ | balances.want.aToken | 3.93309e-06 | 3.93312e-06 | 3.23522e-11 | +------------------------+-------------+-------------+--------------+ | sett.available | 3.23522e-11 | 1.61761e-12 | -3.07346e-11 | +------------------------+-------------+-------------+--------------+ | strategy.balanceOfPool | 0 | 3.23522e-11 | 3.23522e-11 | +------------------------+-------------+-------------+--------------+ | strategy.balanceOf | 0 | 3.23522e-11 | 3.23522e-11 | +------------------------+-------------+-------------+--------------+ snap snap __ test_strategy_action_permissions __

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xbb80a0C6b30c79b540Bd82fe72cb9042560FED63'> controller = <Controller Contract '0x102d77874aB8132d457a20474f175a412751a163'>, strategy = <MyStrategy Contract '0xA627fAA8B868a824A1a9727E9aD45d9EA40B8B8d'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_strategy_action_permissions(deployer, sett, controller, strategy, want):
  state_setup(deployer, sett, controller, strategy, want)

../daomoon/tests/examples/test_strategy_permissions.py:46:


deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xbb80a0C6b30c79b540Bd82fe72cb9042560FED63'> controller = <Controller Contract '0x102d77874aB8132d457a20474f175a412751a163'>, strategy = <MyStrategy Contract '0xA627fAA8B868a824A1a9727E9aD45d9EA40B8B8d'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def state_setup(deployer, sett, controller, strategy, want):
    startingBalance = want.balanceOf(deployer)

    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(deployer)
    depositAmount = int(startingBalance * 0.8)
    assert startingBalance >= depositAmount
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(days(1))
    chain.mine()

    sett.earn({"from": settKeeper})

    chain.sleep(days(1))
    chain.mine()

    if tendable:
        strategy.tend({"from": strategyKeeper})
  strategy.harvest({"from": strategyKeeper})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_strategypermissions.py:32: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ____ test_strategy_pausing_permissions __

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xc6967a6D52E3a8bb4844ee04d19A3919489E684E'> controller = <Controller Contract '0x937BbE6aa57fef909A136954237D71A8eB3A4D8b'>, strategy = <MyStrategy Contract '0xb7304C691851f7B2b30CbDc03d2c13bde67a5700'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_strategy_pausing_permissions(deployer, sett, controller, strategy, want):
    # Setup
  state_setup(deployer, sett, controller, strategy, want)

../daomoon/tests/examples/test_strategy_permissions.py:162:


deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xc6967a6D52E3a8bb4844ee04d19A3919489E684E'> controller = <Controller Contract '0x937BbE6aa57fef909A136954237D71A8eB3A4D8b'>, strategy = <MyStrategy Contract '0xb7304C691851f7B2b30CbDc03d2c13bde67a5700'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def state_setup(deployer, sett, controller, strategy, want):
    startingBalance = want.balanceOf(deployer)

    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(deployer)
    depositAmount = int(startingBalance * 0.8)
    assert startingBalance >= depositAmount
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(days(1))
    chain.mine()

    sett.earn({"from": settKeeper})

    chain.sleep(days(1))
    chain.mine()

    if tendable:
        strategy.tend({"from": strategyKeeper})
  strategy.harvest({"from": strategyKeeper})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_strategy_permissions.py:32: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... _ test_sett_pausing_permissions __

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xF3aaaFa85dac443A2dd37E80bd489704C516c608'> controller = <Controller Contract '0xBb617422098cD69440852cBccC5D7Fa41d30961A'>, strategy = <MyStrategy Contract '0x79915079009EBA23DE44f571dfb0B1D17d8c9401'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_sett_pausing_permissions(deployer, sett, controller, strategy, want):
    # Setup
  state_setup(deployer, sett, controller, strategy, want)

../daomoon/tests/examples/test_strategy_permissions.py:216:


deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0xF3aaaFa85dac443A2dd37E80bd489704C516c608'> controller = <Controller Contract '0xBb617422098cD69440852cBccC5D7Fa41d30961A'>, strategy = <MyStrategy Contract '0x79915079009EBA23DE44f571dfb0B1D17d8c9401'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def state_setup(deployer, sett, controller, strategy, want):
    startingBalance = want.balanceOf(deployer)

    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(deployer)
    depositAmount = int(startingBalance * 0.8)
    assert startingBalance >= depositAmount
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(days(1))
    chain.mine()

    sett.earn({"from": settKeeper})

    chain.sleep(days(1))
    chain.mine()

    if tendable:
        strategy.tend({"from": strategyKeeper})
  strategy.harvest({"from": strategyKeeper})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_strategy_permissions.py:32: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ____ test_sett_config_permissions ____

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0x4570491F271F8602D02DB50bE67978aA150f59B2'> controller = <Controller Contract '0x0cc4a2CC6044Dd69cc65de475825B0f3Fd7986F2'>, strategy = <MyStrategy Contract '0x67482864E6C6C27d59389D24128E7cD54f520669'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_sett_config_permissions(deployer, sett, controller, strategy, want):
  state_setup(deployer, sett, controller, strategy, want)

../daomoon/tests/examples/test_strategy_permissions.py:271:


deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0x4570491F271F8602D02DB50bE67978aA150f59B2'> controller = <Controller Contract '0x0cc4a2CC6044Dd69cc65de475825B0f3Fd7986F2'>, strategy = <MyStrategy Contract '0x67482864E6C6C27d59389D24128E7cD54f520669'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def state_setup(deployer, sett, controller, strategy, want):
    startingBalance = want.balanceOf(deployer)

    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(deployer)
    depositAmount = int(startingBalance * 0.8)
    assert startingBalance >= depositAmount
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(days(1))
    chain.mine()

    sett.earn({"from": settKeeper})

    chain.sleep(days(1))
    chain.mine()

    if tendable:
        strategy.tend({"from": strategyKeeper})
  strategy.harvest({"from": strategyKeeper})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_strategypermissions.py:32: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ____ test_sett_earnpermissions ____

deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0x65aE0995C62732C610Caa0213287A9A11AB1B9c7'> controller = <Controller Contract '0x6Dd3677B3F255AA4beb331329575E8571E3452F4'>, strategy = <MyStrategy Contract '0xD4510f05966Cf16fa6C20750474360E5b4359Cbe'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def test_sett_earn_permissions(deployer, sett, controller, strategy, want):
    # Setup
  state_setup(deployer, sett, controller, strategy, want)

../daomoon/tests/examples/test_strategy_permissions.py:310:


deployer = <Account '0x33A4622B82D4c04a53e170c638B944ce27cffce3'>, sett = <SettV3 Contract '0x65aE0995C62732C610Caa0213287A9A11AB1B9c7'> controller = <Controller Contract '0x6Dd3677B3F255AA4beb331329575E8571E3452F4'>, strategy = <MyStrategy Contract '0xD4510f05966Cf16fa6C20750474360E5b4359Cbe'> want = <IERC20 Contract '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'>

def state_setup(deployer, sett, controller, strategy, want):
    startingBalance = want.balanceOf(deployer)

    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(deployer)
    depositAmount = int(startingBalance * 0.8)
    assert startingBalance >= depositAmount
    want.approve(sett, MaxUint256, {"from": deployer})
    sett.deposit(depositAmount, {"from": deployer})

    chain.sleep(days(1))
    chain.mine()

    sett.earn({"from": settKeeper})

    chain.sleep(days(1))
    chain.mine()

    if tendable:
        strategy.tend({"from": strategyKeeper})
  strategy.harvest({"from": strategyKeeper})

E brownie.exceptions.VirtualMachineError: revert: STF E Trace step -1, program counter 3405: E File "contracts/MyStrategy.sol", line 169, in MyStrategy.harvest:
E 0 E ); E
E ISwapRouter(ROUTER).exactInputSingle(fromRewardToAAVEParams); E
E bytes memory path = abi.encodePacked(AAVE_TOKEN, uint24(10000), WETH_TOKEN, uint24(10000), want); E ISwapRouter.ExactInputParams memory fromAAVETowBTCParams = ISwapRouter.ExactInputParams(

../daomoon/tests/examples/test_strategy_permissions.py:32: VirtualMachineError ------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------- Fetching source of 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from api.etherscan.io... ====================================================================== warnings summary ====================================================================== tests/test_profitable.py: 1 warning tests/examples/test_are_you_trying.py: 1 warning tests/examples/test_basic.py: 1 warning tests/examples/test_harvest_flow.py: 5 warnings tests/examples/test_strategy_permissions.py: 6 warnings /Users/StarGard3n/Desktop/Repos/defi/daomoon/venv/lib/python3.9/site-packages/brownie/network/contract.py:779: BrownieEnvironmentWarning: 'SettV3' defines a 'balance' function, 'SettV3.balance' is available as SettV3.wei_balance warnings.warn(

tests/test_profitable.py: 1 warning tests/examples/test_are_you_trying.py: 1 warning tests/examples/test_basic.py: 1 warning tests/examples/test_harvest_flow.py: 5 warnings tests/examples/test_strategy_permissions.py: 6 warnings /Users/StarGard3n/Desktop/Repos/defi/daomoon/venv/lib/python3.9/site-packages/brownie/network/contract.py:1221: BrownieCompilerWarning: 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D: Locally compiled and on-chain bytecode do not match! warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html ================================================================== short test summary info =================================================================== FAILED tests/examples/test_are_you_trying.py::test_are_you_trying - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_harvest_flow.py::test_single_user_harvest_flow - Exception: Key strategy.isTendable not found in snap data FAILED tests/examples/test_harvest_flow.py::test_withdraw_other - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_harvest_flow.py::test_single_user_harvest_flow_remove_fees - Exception: Key strategy.isTendable not found in snap data FAILED tests/examples/test_strategy_permissions.py::test_strategy_action_permissions - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_strategy_permissions.py::test_strategy_pausing_permissions - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_strategy_permissions.py::test_sett_pausing_permissions - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_strategy_permissions.py::test_sett_config_permissions - brownie.exceptions.VirtualMachineError: revert: STF FAILED tests/examples/test_strategy_permissions.py::test_sett_earn_permissions - brownie.exceptions.VirtualMachineError: revert: STF ==================================================== 9 failed, 5 passed, 28 warnings in 577.27s (0:09:37) ==================================================== Terminating local RPC client...