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 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})
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"]))
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
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() ), } )
def test_deploy(test=False, uniswap=True): # Badger Deployer deployer = "" keeper = "" guardian = "" accounts.at( web3.toChecksumAddress("0xDA25ee226E534d868f0Dd8a459536b03fEE9079b"), force=True, ) accounts.at( web3.toChecksumAddress("0x872213E29C85d7e30F1C8202FC47eD1Ec124BB1D"), force=True, ) accounts.at( web3.toChecksumAddress("0x29F7F8896Fb913CF7f9949C623F896a154727919"), force=True, ) if test: accounts.at( web3.toChecksumAddress( "0xDA25ee226E534d868f0Dd8a459536b03fEE9079b"), force=True, ) else: # Load accounts from keystore deployer = accounts.load("badger_deployer") keeper = accounts.load("badger_keeper") guardian = accounts.load("badger_guardian") # Ganache Accounts if test: accounts.at("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", force=True) accounts.at("0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", force=True) accounts.at("0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b", force=True) accounts.at("0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", force=True) accounts.at("0xd03ea8624C8C5987235048901fB614fDcA89b117", force=True) accounts.at("0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC", force=True) accounts.at("0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9", force=True) accounts.at("0x28a8746e75304c0780E011BEd21C72cD78cd535E", force=True) accounts.at("0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E", force=True) accounts.at("0x1dF62f291b2E969fB0849d99D9Ce41e2F137006e", force=True) # Unlocked Accounts if test: accounts.at( web3.toChecksumAddress( "0x193991827e291599a262e7fa7d212ff1ae31d110"), force=True, ) accounts.at( web3.toChecksumAddress( "0x97ca371d59bbfefdb391aa6dcbdf4455fec361f2"), force=True, ) accounts.at( web3.toChecksumAddress( "0x3d24d77bec08549d7ea86c4e9937204c11e153f1"), force=True, ) accounts.at( web3.toChecksumAddress( "0xcD9e6Df80169b6a2CFfDaE613fAbC3F7C3647B14"), force=True, ) accounts.at( web3.toChecksumAddress( "0xaf379f0228ad0d46bb7b4f38f9dc9bcc1ad0360c"), force=True, ) accounts.at( web3.toChecksumAddress( "0xc25099792e9349c7dd09759744ea681c7de2cb66"), force=True, ) accounts.at( web3.toChecksumAddress( "0xb1f2cdec61db658f091671f5f199635aef202cac"), force=True, ) accounts.at( web3.toChecksumAddress( "0x2bf792ffe8803585f74e06907900c2dc2c29adcb"), force=True, ) # Test Accounts accounts.at( web3.toChecksumAddress( "0xe7bab002A39f9672a1bD0E949d3128eeBd883575"), force=True, ) accounts.at( web3.toChecksumAddress( "0x482c741b0711624d1f462E56EE5D8f776d5970dC"), force=True, ) deployer = accounts.at( web3.toChecksumAddress( ("0xDA25ee226E534d868f0Dd8a459536b03fEE9079b"))) keeper = accounts.at( web3.toChecksumAddress( ("0xDA25ee226E534d868f0Dd8a459536b03fEE9079b"))) guardian = accounts.at( web3.toChecksumAddress( ("0xDA25ee226E534d868f0Dd8a459536b03fEE9079b"))) print( "Initialize Badger System", { "deployer": deployer, "keeper": keeper, "guardian": guardian }, ) print(deployer.balance()) # ClaimEncoder.deploy({'from': deployer}) # assert False badger = BadgerSystem(badger_config, None, deployer, keeper, guardian, deploy=False) badger.test = test badger_deploy_file = "deploy-final.json" print("Connecting to deploy at " + badger_deploy_file) with open(badger_deploy_file) as f: badger_deploy = json.load(f) print("Connect Logic Contracts") badger.connect_logic(badger_deploy["logic"]) print("Create / Connect Badger<>wBTC LP Pair") # pair = create_uniswap_pair(badger.token.address, registry.tokens.wbtc, deployer) factory = interface.IUniswapV2Factory( web3.toChecksumAddress(registry.uniswap.factoryV2)) # tx = factory.createPair(badger.token.address, registry.tokens.wbtc, {"from": deployer}) pairAddress = factory.getPair(badger.token.address, registry.tokens.wbtc) pair = interface.IUniswapV2Pair(pairAddress) badger.pair = pair if uniswap: print("Test: Distribute assets to deployer") accounts.at(badger_config.dao.initialOwner, force=True) badger.token.transfer(deployer, badger_total_supply, {"from": badger_config.dao.initialOwner}) console.log( "after initial token transfer", badger.token.balanceOf(deployer) / 1e18, badger_total_supply, ) assert badger.token.balanceOf(deployer) == badger_total_supply distribute_from_whales(deployer) console.log("after whale funding", badger.token.balanceOf(deployer) / 1e18) print("Test: Add Badger<>wBTC Liquidity") wbtc = interface.IERC20(registry.tokens.wbtc) # In test mode, add liqudity to uniswap badger.uniswap.addMaxLiquidity(badger.token, wbtc, deployer) # print("Deploy core logic") # badger.deploy_core_logic() # print("Deploy Sett core logic") # badger.deploy_sett_core_logic() # badger.deploy_sett_strategy_logic() console.log("before deploys", badger.token.balanceOf(deployer) / 1e18) print("Deploy rewards & vesting infrastructure") # badger.deploy_rewards_escrow() # badger.deploy_badger_tree() # badger.deploy_dao_badger_timelock() # badger.deploy_team_vesting() # badger.deploy_badger_hunt() # print("Connect Rewards and Vesting Infrastructure") badger.connect_rewards_escrow(badger_deploy["rewardsEscrow"]) badger.connect_badger_tree(badger_deploy["badgerTree"]) badger.connect_dao_badger_timelock(badger_deploy["daoBadgerTimelock"]) badger.connect_team_vesting(badger_deploy["teamVesting"]) badger.connect_badger_hunt(badger_deploy["badgerHunt"]) console.log("after reward infra deploys", badger.token.balanceOf(deployer) / 1e18) print("Deploy Sett controllers") # badger.add_controller("native") # badger.add_controller("harvest") badger.connect_controller( "native", badger_deploy["sett_system"]["controllers"]["native"]) badger.connect_controller( "harvest", badger_deploy["sett_system"]["controllers"]["harvest"]) print("Deploy native Sett vaults") controller = badger.getController("native") # badger.deploy_sett("native.badger", badger.token, controller) # badger.deploy_sett("native.renCrv", registry.curve.pools.renCrv.token, controller) # badger.deploy_sett("native.sbtcCrv", registry.curve.pools.sbtcCrv.token, controller) # badger.deploy_sett("native.tbtcCrv", registry.curve.pools.tbtcCrv.token, controller) # badger.deploy_sett("native.uniBadgerWbtc", badger.pair.address, controller) settSystem = badger_deploy["sett_system"] badger.connect_sett("native.badger", settSystem["vaults"]["native.badger"]) badger.connect_sett("native.renCrv", settSystem["vaults"]["native.renCrv"]) badger.connect_sett( "native.sbtcCrv", badger_deploy["sett_system"]["vaults"]["native.sbtcCrv"]) badger.connect_sett( "native.tbtcCrv", badger_deploy["sett_system"]["vaults"]["native.tbtcCrv"]) badger.connect_sett( "native.uniBadgerWbtc", badger_deploy["sett_system"]["vaults"]["native.uniBadgerWbtc"], ) print("Deploy & configure native Sett strategies") print("Deploy vault-specific staking rewards") # badger.deploy_sett_staking_rewards("native.badger", badger.token, badger.token) # badger.deploy_sett_staking_rewards( # "native.uniBadgerWbtc", pair.address, badger.token # ) badger.connect_sett_staking_rewards("native.badger", settSystem["rewards"]["native.badger"]) badger.connect_sett_staking_rewards( "native.uniBadgerWbtc", settSystem["rewards"]["native.uniBadgerWbtc"]) print("Strategy: Native Badger") # badger.deploy_strategy_native_badger() badger.connect_strategy( "native.badger", settSystem["strategies"]["native.badger"], "StrategyBadgerRewards", ) print("Strategy: Native RenCrv") # badger.deploy_strategy_native_rencrv() badger.connect_strategy( "native.renCrv", settSystem["strategies"]["native.renCrv"], "StrategyCurveGaugeRenBtcCrv", ) print("Strategy: Native sBtcCrv") # badger.deploy_strategy_native_sbtccrv() badger.connect_strategy( "native.sbtcCrv", settSystem["strategies"]["native.sbtcCrv"], "StrategyCurveGaugeSbtcCrv", ) print("Strategy: Native tBtcCrv") # badger.deploy_strategy_native_tbtccrv() badger.connect_strategy( "native.tbtCcrv", settSystem["strategies"]["native.tbtcCrv"], "StrategyCurveGaugeTbtcCrv", ) print("Strategy: Native uniBadgerWbtc") # badger.deploy_strategy_native_uniBadgerWbtc() badger.connect_strategy( "native.uniBadgerWbtc", settSystem["strategies"]["native.uniBadgerWbtc"], "StrategyBadgerLpMetaFarm", ) print("Deploy harvest Sett vaults") controller = badger.getController("harvest") # badger.deploy_sett( # "harvest.renCrv", # registry.curve.pools.renCrv.token, # controller, # namePrefixOverride=True, # namePrefix="Badger SuperSett (Harvest) ", # symbolPrefix="bSuper", # ) badger.connect_sett("harvest.renCrv", settSystem["vaults"]["harvest.renCrv"]) print("Deploy & configure harvest Sett strategies") # badger.deploy_strategy_harvest_rencrv() badger.connect_strategy( "harvest.renCrv", settSystem["strategies"]["harvest.renCrv"], "StrategyHarvestMetaFarm", ) # print("Deploy reward geysers") # badger.deploy_geyser(badger.getSett("native.badger"), "native.badger") # badger.deploy_geyser(badger.getSett("native.renCrv"), "native.renCrv") # badger.deploy_geyser(badger.getSett("native.sbtcCrv"), "native.sbtcCrv") # badger.deploy_geyser(badger.getSett("native.tbtcCrv"), "native.tbtcCrv") # badger.deploy_geyser(badger.getSett("native.uniBadgerWbtc"), "native.uniBadgerWbtc") # badger.deploy_geyser(badger.getSett("harvest.renCrv"), "harvest.renCrv") print("Connect reward geysers") badger.connect_geyser("native.badger", badger_deploy["geysers"]["native.badger"]) badger.connect_geyser("native.renCrv", badger_deploy["geysers"]["native.renCrv"]) badger.connect_geyser("native.sbtcCrv", badger_deploy["geysers"]["native.sbtcCrv"]) badger.connect_geyser("native.tbtcCrv", badger_deploy["geysers"]["native.tbtcCrv"]) badger.connect_geyser("native.uniBadgerWbtc", badger_deploy["geysers"]["native.uniBadgerWbtc"]) badger.connect_geyser("harvest.renCrv", badger_deploy["geysers"]["harvest.renCrv"]) # Transfer ownership of all sett Rewards contracts to multisig # Transfer proxyAdmin to multisig console.log("after deploys", badger.token.balanceOf(deployer) / 1e18) return badger
def single_user_harvest_flow(badger: BadgerSystem, sett_id, user): controller = badger.getController("native") strategy = badger.getStrategy(sett_id) want = interface.IERC20(strategy.want()) snap = SnapshotManager(badger, sett_id) sett = badger.getSett(sett_id) strategist = badger.deployer 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}) # if tendable: # snap.settTend({"from": strategyKeeper}) # snap.settWithdraw(depositAmount // 2, {"from": user}) # chain.sleep(days(3)) # chain.mine() # snap.settHarvest({"from": strategyKeeper}) # snap.settWithdraw(depositAmount // 2 - 1, {"from": user}) assert False
def setup_badger(badger: BadgerSystem, settConfig): if rpc.is_active(): seeder = accounts.at("0x3131B6964d96DE3Ad36C7Fe82e9bA9CcdBaf6baa", force=True) else: seeder = accounts.load("badger_proxy_deployer") # Test Proxy Admin (owned by deployer) # badger.testProxyAdmin = deploy_proxy_admin(seeder) # badger.testProxyAdmin.transferOwnership(badger.deployer, {"from": seeder}) badger.connect_test_proxy_admin( "testProxyAdmin", "0x58A3123f350A469eB4fCA01d8F6E857bc1F61b76") controller = badger.getController("native") console.print(controller) controller.initialize(seeder, badger.deployer, badger.keeper, badger.deployer, {"from": seeder}) assert badger.devProxyAdmin.getProxyAdmin( controller) == badger.devProxyAdmin # Strategy strategyLogic = badger.logic.StrategyPancakeLpOptimizer console.print("strategyLogic", strategyLogic) for key, vault in badger.sett_system.vaults.items(): config = configs[key] console.print(key, vault, config) want = interface.IERC20(config["want"]) vault.initialize( config["want"], controller, seeder, badger.keeper, badger.guardian, False, "", "", {"from": seeder}, ) controller.setVault(want, vault, {"from": seeder}) # vault.setGovernance(badger.devMultisig, {"from": seeder}) assert badger.devProxyAdmin.getProxyAdmin( vault) == badger.devProxyAdmin for key, strategy in badger.sett_system.strategies.items(): config = configs[key] console.print(key, strategy, config) want = interface.IERC20(config["want"]) assert badger.devProxyAdmin.getProxyAdmin( strategy) == badger.devProxyAdmin strategy.initialize( seeder, seeder, controller, badger.keeper, badger.guardian, [ config["want"], config["token0"], config["token1"], ], [ config["performanceFeeStrategist"], config["performanceFeeGovernance"], config["withdrawalFee"], ], config["wantPid"], {"from": seeder}, ) token0 = config["token0"] token1 = config["token1"] cake = registry.pancake.cake strategy.setTokenSwapPath(cake, token0, [cake, token0], {"from": seeder}) strategy.setTokenSwapPath(cake, token1, [cake, token1], {"from": seeder}) # Wiring console.print(controller.address, controller.governance()) assert controller.governance() == seeder controller.approveStrategy(want, strategy, {"from": seeder}) controller.setStrategy(want, strategy, {"from": seeder}) strategy.setStrategist(badger.deployer, {"from": seeder}) # controller.setGovernance(badger.devMultisig, {"from": seeder}) badger.setStrategy(key, strategy) snap = SnapshotManager(badger, key) table = [] table.append(["governance", strategy.governance()]) table.append(["strategist", strategy.strategist()]) table.append(["keeper", strategy.keeper()]) table.append(["guardian", strategy.guardian()]) 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"]))
def open_vaults(badger: BadgerSystem, seeder: Account): controller = badger.getController("native") for key, vault in badger.sett_system.vaults.items(): vault.unpause({"from": seeder})
def confirm_setup_sett(badger: BadgerSystem): common_controller_params = DotMap( governance=badger.deployer, strategist=badger.deployer, keeper=badger.keeper, onesplit=registry.onesplit.contract, rewards=badger.dao.agent, ) # ===== Confirm Controller ===== # Native Controller params = common_controller_params params.setts = [ [ badger.token, badger.getSett("native.badger"), badger.getStrategy("native.badger"), ], [ registry.curve.pools.sbtcCrv.token, badger.getSett("native.sbtcCrv"), badger.getStrategy("native.sbtcCrv"), ], [ registry.curve.pools.renCrv.token, badger.getSett("native.renCrv"), badger.getStrategy("native.renCrv"), ], [ registry.curve.pools.tbtcCrv.token, badger.getSett("native.tbtcCrv"), badger.getStrategy("native.tbtcCrv"), ], ] print(badger.getStrategy("native.tbtcCrv")) confirm_controller_params(badger.getController("native"), params) # Harvest Controller params = common_controller_params params.setts = [[ registry.curve.pools.renCrv.token, badger.getSett("harvest.renCrv"), badger.getStrategy("harvest.renCrv"), ]] confirm_controller_params(badger.getController("harvest"), params) # ===== Confirm Setts ===== # Native Setts # TODO: Change governance and strategist to prod values common_native_sett_params = DotMap( governance=badger.deployer, strategist=AddressZero, keeper=badger.deployer, controller=badger.getController("native"), min=9500, ) params = common_native_sett_params params.token = badger.token params.name = "Badger Sett Badger" params.symbol = "bBADGER" # params.name = "Badger Sett BadgerTest" # params.symbol = "bBGTEST" confirm_sett_params(badger.getSett("native.badger"), params) params = common_native_sett_params params.token = registry.curve.pools.sbtcCrv.token params.name = "Badger Sett Curve.fi renBTC/wBTC/sBTC" params.symbol = "bcrvRenWSBTC" confirm_sett_params(badger.getSett("native.sbtcCrv"), params) params = common_native_sett_params params.token = registry.curve.pools.renCrv.token params.name = "Badger Sett Curve.fi renBTC/wBTC" params.symbol = "bcrvRenWBTC" confirm_sett_params(badger.getSett("native.renCrv"), params) params = common_native_sett_params params.token = registry.curve.pools.tbtcCrv.token params.name = "Badger Sett Curve.fi tBTC/sbtcCrv" params.symbol = "btbtc/sbtcCrv" confirm_sett_params(badger.getSett("native.tbtcCrv"), params) # Harvest Setts harvest_sett_params = DotMap( governance=badger.deployer, strategist=AddressZero, keeper=badger.deployer, controller=badger.getController("harvest"), min=9500, token=registry.curve.pools.renCrv.token, name="Badger SuperSett (Harvest) Curve.fi renBTC/wBTC", symbol="bSupercrvRenWBTC", ) confirm_sett_params(badger.getSett("harvest.renCrv"), harvest_sett_params) # ===== Confirm Strategies ===== common_strategy_params = DotMap( governance=badger.deployer, strategist=badger.deployer, keeper=badger.keeper, controller=badger.getController("native"), guardian=badger.guardian, performanceFeeGovernance=1000, performanceFeeStrategist=1000, withdrawalFee=75, ) # ===== Native Strategies ===== # == Badger Native == params = common_strategy_params params.name = "StrategyBadgerRewards" params.want = badger.token params.performanceFeeGovernance = 0 params.performanceFeeStrategist = 0 params.withdrawalFee = 0 confirm_strategy_common_params(badger.getStrategy("native.badger"), params) confirm_strategy_badger_rewards_params( badger.getStrategy("native.badger"), DotMap(geyser=badger.getSettRewards("native.badger")), ) # == Badger LP == params = common_strategy_params params.name = "StrategyBadgerLpMetaFarm" params.want = badger.pair params.performanceFeeGovernance = 0 params.performanceFeeStrategist = 0 params.withdrawalFee = 0 confirm_strategy_common_params(badger.getStrategy("native.uniBadgerWbtc"), params) confirm_strategy_badger_rewards_params( badger.getStrategy("native.uniBadgerWbtc"), DotMap(geyser=badger.getSettRewards("native.uniBadgerWbtc")), ) # == Native SbtcCrv == params = common_strategy_params params.name = "StrategyCurveGauge" params.want = registry.curve.pools.sbtcCrv.token params.performanceFeeGovernance = 1000 params.performanceFeeStrategist = 1000 params.withdrawalFee = 75 confirm_strategy_common_params(badger.getStrategy("native.sbtcCrv"), params) params = common_strategy_params params.name = "StrategyCurveGauge" params.want = registry.curve.pools.renCrv.token params.performanceFeeGovernance = 1000 params.performanceFeeStrategist = 1000 params.withdrawalFee = 75 confirm_strategy_common_params(badger.getStrategy("native.renCrv"), params) params = common_strategy_params params.name = "StrategyCurveGauge" params.want = registry.curve.pools.tbtcCrv.token params.performanceFeeGovernance = 1000 params.performanceFeeStrategist = 1000 params.withdrawalFee = 75 confirm_strategy_common_params(badger.getStrategy("native.tbtcCrv"), params) # Harvest Strategies params.name = "StrategyHarvestMetaFarm" params.controller = badger.getController("harvest") params.want = registry.curve.pools.renCrv.token params.performanceFeeGovernance = 0 params.performanceFeeStrategist = 0 params.farmPerformanceFeeGovernance = 1000 params.farmPerformanceFeeStrategist = 1000 params.withdrawalFee = 75 params.harvestVault = registry.harvest.vaults.renCrv params.vaultFarm = registry.harvest.farms.fRenCrv params.metaFarm = registry.harvest.farms.farm params.badgerTree = badger.badgerTree confirm_strategy_common_params(badger.getStrategy("harvest.renCrv"), params) confirm_strategy_harvest_meta_farm_params( badger.getStrategy("harvest.renCrv"), params) """ def confirm_strategy_harvest_meta_farm_params(strategy, params): assert strategy.harvestVault() == params.harvestVault assert strategy.vaultFarm() == params.vaultFarm assert strategy.metaFarm() == params.metaFarm assert strategy.badgerTree() == params.badgerTree assert strategy.farm() == registry.harvest.farmToken assert strategy.depositHelper() == registry.harvest.depositHelper assert strategy.weth() == registry.tokens.weth assert ( strategy.farmPerformanceFeeGovernance() == params.farmPerformanceFeeGovernance ) assert ( strategy.farmPerformanceFeeStrategist() == params.farmPerformanceFeeStrategist ) """ # Supporting Infrastructure: Rewards confirm_staking_rewards_params( badger.getSettRewards("native.badger"), DotMap(approvedStaker=badger.getStrategy("native.badger")), ) confirm_staking_rewards_params( badger.getSettRewards("native.uniBadgerWbtc"), DotMap(approvedStaker=badger.getStrategy("native.uniBadgerWbtc")), )