Пример #1
0
def tend_all(badger: BadgerSystem, skip):
    table = []
    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            continue

        strategy = badger.getStrategy(key)

        if not strategy.isTendable():
            continue

        console.print("\n[bold green]===== Tend: " + key + " =====[/bold green]\n")

        snap = SnapshotManager(badger, key)
        strategy = badger.getStrategy(key)
        keeper = accounts.at(badger.keeper)

        before = snap.snap()

        if strategy.keeper() == badger.badgerRewardsManager:
            snap.settTendViaManager(
                strategy, {"from": keeper, "gas_limit": 1000000}, confirm=False,
            )
        else:
            snap.settTend(
                {"from": keeper, "gas_limit": 1000000}, confirm=False,
            )

        tx_wait()

        if rpc.is_active():
            chain.mine()
        after = snap.snap()

        snap.printCompare(before, after)
Пример #2
0
def start_staking_rewards(badger: BadgerSystem):
    """
    StakingRewards contracts start immediately when the first tokens are locked
    """
    # == Badger ==
    deployer = badger.deployer
    rewards = badger.getSettRewards("native.badger")

    assert (badger.token.balanceOf(rewards) >=
            badger_config.geyserParams.unlockSchedules.badger[0].amount)
    assert rewards.stakingToken() == badger.token
    assert rewards.rewardsToken() == badger.token

    rewards.notifyRewardAmount(
        badger_config.geyserParams.unlockSchedules.badger[0].amount,
        {"from": deployer})

    # == Uni LP ==
    rewards = badger.getSettRewards("native.uniBadgerWbtc")

    assert (badger.token.balanceOf(rewards) >=
            badger_config.geyserParams.unlockSchedules.uniBadgerWbtc[0].amount)
    assert rewards.stakingToken() == badger.pair
    assert rewards.rewardsToken() == badger.token

    rewards.notifyRewardAmount(
        badger_config.geyserParams.unlockSchedules.uniBadgerWbtc[0].amount,
        {"from": deployer},
    )
Пример #3
0
def deploy_digg_native_sett(badger: BadgerSystem, digg):
    deployer = badger.deployer
    key = "native.digg"
    params = sett_config.native.badger.params
    params.want = digg.token

    rewards = badger.deploy_digg_rewards_faucet(key, digg.token)
    time.sleep(sleep_between_tx)

    params.geyser = rewards

    deploy_sett_by_key(
        badger,
        key,
        "StrategyDiggRewards",
        SettType.DIGG,
        params,
        deployer=deployer,
        governance=badger.devMultisig,
        strategist=badger.deployer,
        keeper=badger.keeper,
        guardian=badger.guardian,
    )

    strategy = badger.getStrategy(key)

    rewards.grantRole(PAUSER_ROLE, badger.keeper, {"from": deployer})
    rewards.grantRole(UNPAUSER_ROLE, badger.devMultisig, {"from": deployer})

    # Make strategy the recipient of the DIGG faucet
    rewards.initializeRecipient(strategy, {"from": deployer})
Пример #4
0
def get_expected_strategy_deposit_location(badger: BadgerSystem, id):
    if id == "native.badger":
        # Rewards Staking
        return badger.getSettRewards("native.badger")
    if id == "native.uniBadgerWbtc":
        # Rewards Staking
        return badger.getSettRewards("native.uniBadgerWbtc")
    if id == "native.renCrv":
        # CRV Gauge
        return registry.curve.pools.renCrv.gauge
    if id == "native.sbtcCrv":
        # CRV Gauge
        return registry.curve.pools.sbtcCrv.gauge
    if id == "native.tbtcCrv":
        # CRV Gauge
        return registry.curve.pools.tbtcCrv.gauge
    if id == "harvest.renCrv":
        # Harvest Vault
        return registry.harvest.vaults.renCrv
    if id == "native.sushiWbtcEth":
        # Sushi Chef
        return registry.sushi.sushiChef
    if id == "native.sushiBadgerWbtc":
        # Sushi Chef
        return registry.sushi.sushiChef
    def __init__(self, badger: BadgerSystem, key):
        self.badger = badger
        self.key = key
        self.sett = badger.getSett(key)
        self.strategy = badger.getStrategy(key)
        self.controller = Controller.at(self.sett.controller())
        self.want = interface.IERC20(self.sett.token())
        self.resolver = self.init_resolver(self.strategy.getName())
        self.snaps = {}
        self.settSnaps = {}
        self.entities = {}

        assert self.want == self.strategy.want()

        # Common entities for all strategies
        self.addEntity("sett", self.sett.address)
        self.addEntity("strategy", self.strategy.address)
        self.addEntity("controller", self.controller.address)
        self.addEntity("governance", self.strategy.governance())
        self.addEntity("governanceRewards", self.controller.rewards())
        self.addEntity("strategist", self.strategy.strategist())

        destinations = self.resolver.get_strategy_destinations()
        for key, dest in destinations.items():
            self.addEntity(key, dest)
def test_update_rewards(badger: BadgerSystem) -> str:
    data = encode_abi(["address"], [GOVERNANCE_MULTISIG_ADDRESS])
    delay = 2 * days(2)
    eta = web3.eth.getBlock("latest")["timestamp"] + delay

    result = badger.timelock_run_direct(CONTROLLER_ADDRESS, FUNCTION_TO_CALL,
                                        data, eta)

    controller = badger.getController("native")
    assert controller.rewards() == GOVERNANCE_MULTISIG_ADDRESS
    console.print("[orange] Controller Rewards {} [/orange]".format(
        controller.rewards()))
    return result
Пример #7
0
def multisig_action(badger: BadgerSystem):
    multi = GnosisSafe(badger.opsMultisig)
    key = "native.bDiggBtcb"

    vault = badger.getSett(key)
    strategy = badger.getStrategy(key)

    multi.execute(
        MultisigTxMetadata(description="Set PoolId"),
        {"to": strategy.address, "data": strategy.setWantPid.encode_input(104)},
    )

    assert strategy.wantPid() == 104
Пример #8
0
def queue_upgrade_strategy(
    badger: BadgerSystem,
    strategyID: str,
    artifactName: str,
) -> str:
    # if rpc.is_active():
    #     badger.deploy_logic(artifactName, name_to_artifact[artifactName])
    #     logic = badger.logic[artifactName]
    #     return badger.queue_upgrade_strategy(strategyID, logic)
    # else:
    logic = badger.getLogic(artifactName)
    console.print("Preparing Upgrade", logic.address, logic.getName())
    return badger.queue_upgrade_strategy(strategyID, logic)
Пример #9
0
def tend_all(badger: BadgerSystem, skip):
    table = []
    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            continue

        strategy = badger.getStrategy(key)

        if not strategy.isTendable():
            continue

        console.print("\n[bold green]===== Tend: " + key +
                      " =====[/bold green]\n")
        fpps_before = vault.getPricePerFullShare()

        keeper = accounts.at(strategy.keeper())
        strategy.tend({'from': keeper, "gas_price": gas_strategy})

        table.append([
            key,
            val(fpps_before),
            val(vault.getPricePerFullShare()),
            val(vault.getPricePerFullShare() - fpps_before),
        ])

        print("PPFS: Tend")
        print(tabulate(table, headers=["name", "before", "after", "diff"]))
Пример #10
0
def set_governance(badger: BadgerSystem):
    if rpc.is_active():
        seeder = accounts.at("0x3131B6964d96DE3Ad36C7Fe82e9bA9CcdBaf6baa",
                             force=True)
    else:
        seeder = accounts.load("badger_proxy_deployer")

    controller = badger.getController("native")

    table = []

    for key, vault in badger.sett_system.vaults.items():
        assert badger.devProxyAdmin.getProxyAdmin(
            vault) == badger.devProxyAdmin
        if vault.governance() == seeder:
            vault.setGovernance(badger.opsMultisig, {"from": seeder})
        table.append(["vault", key, vault.address, vault.governance()])

    for key, strategy in badger.sett_system.strategies.items():
        assert badger.devProxyAdmin.getProxyAdmin(
            strategy) == badger.devProxyAdmin
        if strategy.governance() == seeder:
            strategy.setGovernance(badger.opsMultisig, {"from": seeder})
        table.append(
            ["strategy", key, strategy.address,
             strategy.governance()])

    if controller.governance() == seeder:
        controller.setGovernance(badger.opsMultisig, {"from": seeder})
    table.append(
        ["controller", "native", controller.address,
         controller.governance()])

    print(tabulate(table, headers=["type", "key", "address", "governance"]))
def update_rewards(badger: BadgerSystem) -> str:
    data = encode_abi(["address"], [GOVERNANCE_MULTISIG_ADDRESS])
    delay = 2 * days(2)
    eta = web3.eth.getBlock("latest")["timestamp"] + delay

    return badger.governance_queue_transaction(CONTROLLER_ADDRESS,
                                               FUNCTION_TO_CALL, data, eta)
Пример #12
0
def test_upgrades(badger: BadgerSystem, seeder: Account):
    controller = badger.getController("native")

    for key, vault in badger.sett_system.vaults.items():
        assert vault.paused() == False

    for key, strategy in badger.sett_system.strategies.items():
        strategy.setGovernance(badger.opsMultisig, {"from": seeder})
Пример #13
0
def earn_all(badger: BadgerSystem, skip):
    keeper = badger.deployer
    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            print("Skip ", key)
            continue
        console.print("\n[bold red]===== Earn: " + key + " =====[/bold red]\n")
        strategy = badger.getStrategy(key)
        controller = Controller.at(vault.controller())
        want = interface.IERC20(vault.token())

        # Pre safety checks
        assert want == strategy.want()
        assert strategy.controller() == controller
        assert vault.controller() == controller
        assert controller.strategies(want) == strategy

        vaultBefore = want.balanceOf(vault)
        strategyBefore = strategy.balanceOf()

        toEarn = False
        if earn_preconditions(vaultBefore, strategyBefore):
            print("Earn: " + key, vault, strategy)
            toEarn = True

            snap = SnapshotManager(badger, key)
            strategy = badger.getStrategy(key)
            keeper = accounts.at(strategy.keeper())

            before = snap.snap()
            snap.printTable(before)

            keeper = accounts.at(vault.keeper())
            snap.settEarn(
                {
                    'from': keeper,
                    "gas_price": gas_strategy,
                    "gas_limit": 2000000,
                    "allow_revert": True
                },
                confirm=False)

            after = snap.snap()
            snap.printTable(after)

            snap.printCompare(before, after)
Пример #14
0
def single_user_harvest_flow(badger: BadgerSystem, settConfig, user):
    strategy = badger.getStrategy(settConfig["id"])
    want = interface.IERC20(registry.pancake.chefPairs.bnbBtcb)
    snap = SnapshotManager(badger, settConfig["id"])
    sett = badger.getSett(settConfig["id"])
    settKeeper = accounts.at(sett.keeper(), force=True)
    strategyKeeper = accounts.at(strategy.keeper(), force=True)
    randomUser = accounts[6]

    tendable = strategy.isTendable()

    startingBalance = want.balanceOf(user)

    depositAmount = startingBalance // 200
    assert startingBalance >= depositAmount
    assert startingBalance >= 0

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

    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})

    numTends = 48
    timeBetweenTends = days(365) // numTends

    console.print({"numTends": numTends, "timeBetweenTends": timeBetweenTends})

    for i in range(0, numTends):
        console.print("Tend {}".format(i))
        snap.settTend({"from": strategyKeeper})
        chain.sleep(timeBetweenTends)
        chain.mine()

    with brownie.reverts("onlyAuthorizedActors"):
        strategy.harvest({"from": randomUser})

    snap.settHarvest({"from": strategyKeeper})
    def __init__(
            self,
            badger: BadgerSystem,
            snap: SnapshotManager,
            settId: str,
            seed: int = 0,  # Default seed is 0 or unset, will generate.
    ):
        self.accounts = accounts[9:]  # Use the 10th account onwards.
        # User accounts (need to be provisioned before running sim).
        self.users = []

        self.debug = True

        self.badger = badger
        self.snap = snap
        self.sett = badger.getSett(settId)
        self.strategy = badger.getStrategy(settId)
        self.want = badger.getStrategyWant(settId)
        self.settKeeper = accounts.at(self.sett.keeper(), force=True)
        self.strategyKeeper = accounts.at(self.strategy.keeper(), force=True)

        # Actors generate valid actions based on the actor type. For example,
        # user actors need to have deposited first before they can withdraw
        # (withdraw before deposit is an invalid action).
        self.actors = [
            SettKeeperActor(self, self.settKeeper),
            StrategyKeeperActor(self, self.strategyKeeper),
            ChainActor(),
        ]
        if isinstance(snap, DiggSnapshotManager):
            self.actors.append(DiggActor(self, self.badger.deployer))
        # Ordered valid actions generated by actors.
        self.actions = []

        self.state = SimulationManagerState.IDLE

        # Track seed so we can configure this value if we want to repro test failures.
        self.seed = seed
        if self.seed == 0:
            self.seed = int(time.time())
        console.print(f"initialized simulation manager with seed: {self.seed}")
        random.seed(self.seed)
        console.print("Random Seed")
        self.provisioner = self._initProvisioner(settId)
        console.print("initialization complete")
Пример #16
0
def upgrade_bridge(
        badger: BadgerSystem,
        bridge: BridgeSystem) -> str:
    """
    Upgrades bridge.
    """
    adapterLogic = BadgerBridgeAdapter.deploy({"from": badger.deployer})

    return badger.queue_upgrade(bridge.adapter.address, adapterLogic.address,)
Пример #17
0
def setup_badger(badger: BadgerSystem, settConfig):
    controller = badger.getController("native")
    console.print(registry.pancake.chefPids.bnbBtcb)
    strategyLogic = StrategyPancakeLpOptimizer.deploy({"from": badger.deployer})

    strategy = deploy_proxy(
        "StrategyPancakeLpOptimizer",
        StrategyPancakeLpOptimizer.abi,
        strategyLogic.address,
        badger.devProxyAdmin.address,
        strategyLogic.initialize.encode_input(
            badger.devMultisig,
            badger.deployer,
            controller,
            badger.keeper,
            badger.guardian,
            [
                registry.pancake.chefPairs.bnbBtcb,
                registry.tokens.btcb,
                registry.tokens.bnb,
            ],
            [100, 100, 50],
            15,
        ),
        badger.deployer,
    )

    token0 = registry.tokens.btcb
    token1 = registry.tokens.bnb
    cake = registry.pancake.cake

    strategy.setTokenSwapPath(cake, token0, [cake, token0], {"from": badger.deployer})
    strategy.setTokenSwapPath(cake, token1, [cake, token1], {"from": badger.deployer})

    # want = interface.IERC20(registry.pancake.chefPairs.bnbBtcb)
    # multi = accounts.at(badger.devMultisig.address, force=True)

    # snap = SnapshotManager(badger, settConfig["id"])

    table = []

    table.append(["want", strategy.want()])
    table.append(["token0", strategy.token0()])
    table.append(["token1", strategy.token1()])
    table.append(["wantPid", strategy.wantPid()])
    table.append(["performanceFeeGovernance", strategy.performanceFeeGovernance()])
    table.append(["performanceFeeStrategist", strategy.performanceFeeStrategist()])
    table.append(["withdrawalFee", strategy.withdrawalFee()])
    table.append(
        ["path0", strategy.getTokenSwapPath(registry.pancake.cake, strategy.token0())]
    )
    table.append(
        ["path1", strategy.getTokenSwapPath(registry.pancake.cake, strategy.token1())]
    )

    print(tabulate(table, headers=["param", "value"]))
Пример #18
0
def approve_root(badger: BadgerSystem):
    badgerTree = badger.badgerTree
    if not badgerTree.hasPendingRoot():
        console.print("No pending root")
        return False

    if rpc.is_active():
        badger.guardian = accounts.at(
            "0x626F69162Ea1556A75Dd4443D87D2fe38dd25901", force=True)

    current = fetchCurrentMerkleData(badger)
    pending = fetchPendingMerkleData(badger)

    (publishedRewards, sb, eb) = get_last_published_cycle(badger)
    (proposedRewards, startBlock, endBlock) = get_last_proposed_cycle(badger)

    console.print(proposedRewards["merkleRoot"])

    rootHash = hash(proposedRewards["merkleRoot"])
    contentFileName = content_hash_to_filename(rootHash)
    print("Uploading to file " + contentFileName)

    with open(contentFileName, "w") as outfile:
        json.dump(proposedRewards, outfile, indent=4)

    with open(contentFileName) as f:
        after_file = json.load(f)

    console.print(contentFileName)

    print(
        proposedRewards["merkleRoot"],
        startBlock,
        endBlock,
        badgerTree.lastProposeStartBlock(),
        badgerTree.lastProposeEndBlock(),
    )

    verify_rewards(badger, startBlock, endBlock, publishedRewards,
                   proposedRewards)

    badgerTree.approveRoot(
        proposedRewards["merkleRoot"],
        pending["contentHash"],
        proposedRewards["cycle"],
        startBlock,
        endBlock,
        {
            "from": badger.guardian,
            "gas_limit": 3000000,
            "allow_revert": True
        },
    )

    upload(contentFileName)
Пример #19
0
def upgrade_bridge(badger: BadgerSystem, bridge: BridgeSystem) -> str:
    '''
    Upgrades bridge.
    '''
    adapterLogic = BadgerBridgeAdapter.deploy({"from": badger.deployer})
    bridge.deploy_curve_token_wrapper()

    return badger.queue_upgrade(
        bridge.adapter.address,
        adapterLogic.address,
    )
Пример #20
0
def snap_strategy_balance(badger: BadgerSystem, key, manager):
    digg = badger.digg

    strategy = badger.getStrategy(key)
    sett = badger.getSett(key)

    want = interface.IERC20(strategy.want())
    wbtc = interface.IERC20(registry.tokens.wbtc)

    state = {
        "manager (badger)": badger.token.balanceOf(manager),
        "manager (digg)": digg.token.balanceOf(manager),
        "manager (want)": want.balanceOf(manager),
        "manager (wbtc)": wbtc.balanceOf(manager),
        "balanceOfPool": strategy.balanceOfPool(),
        "balanceOfWant": strategy.balanceOfWant(),
        "balanceOf": strategy.balanceOf(),
        "pricePerFullShare": sett.getPricePerFullShare(),
    }
    return state
Пример #21
0
def upgrade_swap_strategy(
        badger: BadgerSystem,
        strategy: network.contract.ProjectContract,
        SwapStrategy: network.contract.ContractContainer) -> str:
    '''
    Upgrades swap strategy.
    '''
    logic = SwapStrategy.deploy({"from": badger.deployer})
    return badger.queue_upgrade(
        strategy.address,
        logic.address,
    )
Пример #22
0
def setup_badger(badger: BadgerSystem):
    # Set paths

    key = "native.bDiggBtcb"
    sett = badger.getSett(key)
    strategy = badger.getStrategy(key)

    multi = GnosisSafe(badger.opsMultisig)

    multi.execute(
        MultisigTxMetadata(description="Set path"),
        {
            "to":
            strategy.address,
            "data":
            strategy.setTokenSwapPath.encode_input(
                registry.pancake.cake,
                strategy.token0(),
                [
                    registry.pancake.cake, registry.tokens.btcb,
                    strategy.token0()
                ],
            ),
        },
    )

    multi.execute(
        MultisigTxMetadata(description="Set path"),
        {
            "to":
            strategy.address,
            "data":
            strategy.setTokenSwapPath.encode_input(
                registry.pancake.cake,
                strategy.token1(),
                [registry.pancake.cake, registry.tokens.btcb],
            ),
        },
    )
Пример #23
0
def vault_report(badger: BadgerSystem):
    controller = badger.getController("native")

    for key, vault in badger.sett_system.vaults.items():
        strategy = badger.getStrategy(key)
        snap = SnapshotManager(badger, key)

        snap.printPermissions()

        console.print(
            {
                "want": strategy.want(),
                "token0": strategy.token0(),
                "token1": strategy.token1(),
                "path0": strategy.getTokenSwapPath(
                    registry.pancake.cake, strategy.token0()
                ),
                "path1": strategy.getTokenSwapPath(
                    registry.pancake.cake, strategy.token1()
                ),
            }
        )
Пример #24
0
def swap_for_strategy(badger: BadgerSystem, key, amount):
    manager = badger.badgerRewardsManager
    print(key)
    strategy = badger.getStrategy(key)

    before = snap_strategy_balance(badger, key, manager)

    swap_for_strategy_internal(badger, key, amount)

    after = snap_strategy_balance(badger, key, manager)
    diff = diff_numbers_by_key(before, after)

    console.print("[green]==Swap for {}==[/green]".format(key))
    console.print("Amount", amount)
    to_tabulate("Diff {}".format(key), diff)
Пример #25
0
def transfer_for_strategy(badger: BadgerSystem, key, amount, decimals=18):
    console.print("Transferring Amount for Strategy {}".format(key),
                  val(amount, decimals))
    manager = badger.badgerRewardsManager
    strategy = badger.getStrategy(key)

    before = snap_strategy_balance(badger, key, manager)

    transfer_for_strategy_internal(badger, key, amount)

    after = snap_strategy_balance(badger, key, manager)
    diff = diff_numbers_by_key(before, after)

    console.print("[green]==Transfer for {}==[/green]".format(key))
    to_tabulate("Diff {}".format(key), diff)
Пример #26
0
def lp_for_strategy(badger: BadgerSystem, key):
    """
    Add maximum liquidity for associated strategy LP position
    """
    manager = badger.badgerRewardsManager
    strategy = badger.getStrategy(key)

    want = interface.IERC20(strategy.want())

    before = snap_strategy_balance(badger, key, manager)

    lp_for_strategy_internal(badger, key)

    after = snap_strategy_balance(badger, key, manager)
    diff = diff_numbers_by_key(before, after)

    console.print("[cyan]==LP for {}==[/cyan]".format(key))
    to_tabulate("Diff {}".format(key), diff)
Пример #27
0
def grant_token_locking_permission(badger: BadgerSystem, locker):
    multi = GnosisSafe(badger.devMultisig)

    for key in keys:
        geyser = badger.getGeyser(key)
        print(key, geyser)

        multi.execute(
            MultisigTxMetadata(
                description="Add Geyser permission for {} to {}".format(key, locker)
            ),
            {
                "to": geyser.address,
                "data": geyser.grantRole.encode_input(TOKEN_LOCKER_ROLE, locker),
            },
        )

        assert geyser.hasRole(TOKEN_LOCKER_ROLE, locker)
Пример #28
0
def harvest_all(badger: BadgerSystem, skip):
    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            continue

        console.print("\n[bold yellow]===== Harvest: " + str(key) +
                      " =====[/bold yellow]\n")

        print("Harvest: " + key)

        snap = SnapshotManager(badger, key)
        strategy = badger.getStrategy(key)
        keeper = accounts.at(badger.keeper)

        before = snap.snap()
        if strategy.keeper() == badger.badgerRewardsManager:
            snap.settHarvestViaManager(
                strategy,
                {
                    "from": keeper,
                    "gas_limit": 2000000,
                    "allow_revert": True
                },
                confirm=False,
            )
        else:
            snap.settHarvest(
                {
                    "from": keeper,
                    "gas_limit": 2000000,
                    "allow_revert": True
                },
                confirm=False,
            )

        tx_wait()

        if rpc.is_active():
            chain.mine()
        after = snap.snap()

        snap.printCompare(before, after)
Пример #29
0
def harvest_all(badger: BadgerSystem, skip):
    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            continue

        console.print("\n[bold yellow]===== Harvest: " + str(key) + " =====[/bold yellow]\n")

        print("Harvest: " + key)

        snap = SnapshotManager(badger, key)
        strategy = badger.getStrategy(key)
        keeper = accounts.at(strategy.keeper())

        before = snap.snap()
        snap.printTable(before)
        snap.settHarvest({'from': keeper, "gas_price": gas_strategy, "gas_limit": 2000000, "allow_revert": True}, confirm=False)
        after = snap.snap()
        snap.printTable(after)

        snap.printCompare(before, after)
Пример #30
0
def harvest_all(badger: BadgerSystem, skip):
    keeper = badger.deployer

    for key, vault in badger.sett_system.vaults.items():
        if key in skip:
            continue

        console.print("\n[bold yellow]===== Harvest: " + str(key) + " =====[/bold yellow]\n")

        print("Harvest: " + key)

        snap = SnapshotManager(badger, key)
        strategy = badger.getStrategy(key)
        keeper = accounts.at(strategy.keeper())

        before = snap.snap()
        snap.settHarvest({'from': keeper, "gas_price": gas_strategy})
        after = snap.snap()

        snap.printCompare(before, after)