def sett_curve_gauge_tbtc(): deployer = accounts[0] params = sett_config.native.tbtcCrv.params want = sett_config.native.tbtcCrv.params.want badger = deploy_badger_minimal(deployer) distribute_from_whales(badger, deployer) # badger.deploy_logic("StrategyCurveGaugeTbtcCrv", StrategyCurveGaugeTbtcCrv) badger.deploy_core_logic() badger.deploy_sett_core_logic() badger.deploy_sett_strategy_logic() controller = badger.add_controller("native.tbtcCrv") vault = badger.deploy_sett("native.tbtcCrv", want, controller) strategy = badger.deploy_strategy("native.tbtcCrv", "StrategyCurveGaugeTbtcCrv", controller, params) badger.wire_up_sett(vault, strategy, controller) badger.deploy_geyser(badger.getSett("native.tbtcCrv"), "native.tbtcCrv") return badger
def sett_harvest_meta_farm(): deployer = accounts[0] params = sett_config.harvest.renCrv.params want = sett_config.harvest.renCrv.params.want badger = deploy_badger_minimal(deployer) params.badgerTree = badger.badgerTree distribute_from_whales(badger, deployer) # badger.deploy_logic("StrategyHarvestMetaFarm", StrategyHarvestMetaFarm) # badger.deploy_logic("BadgerGeyser", BadgerGeyser) badger.deploy_core_logic() badger.deploy_sett_core_logic() badger.deploy_sett_strategy_logic() controller = badger.add_controller("harvest.renCrv") vault = badger.deploy_sett("harvest.renCrv", want, controller) strategy = badger.deploy_strategy("harvest.renCrv", "StrategyHarvestMetaFarm", controller, params) badger.wire_up_sett(vault, strategy, controller) badger.deploy_geyser(badger.getSett("harvest.renCrv"), "harvest.renCrv") return badger
def sett_badger_lp_rewards(): deployer = accounts[0] # TODO: Deploy UNI pool and add liquidity in order to get want badger = deploy_badger_minimal(deployer) distribute_from_whales(badger, deployer) pair = create_uniswap_pair(badger.token.address, registry.tokens.wbtc, deployer) badger.pair = pair want = pair rewards = badger.deploy_sett_staking_rewards("native.uniBadgerWbtc", pair.address, badger.token) assert rewards.rewardsToken() == badger.token assert rewards.stakingToken() == pair # badger.deploy_logic("StrategyBadgerLpMetaFarm", StrategyBadgerLpMetaFarm) badger.deploy_core_logic() badger.deploy_sett_core_logic() badger.deploy_sett_strategy_logic() controller = badger.add_controller("native.uniBadgerWbtc") vault = badger.deploy_sett("native.uniBadgerWbtc", want, controller) params = sett_config.native.uniBadgerWbtc.params params.want = badger.pair params.geyser = rewards strategy = badger.deploy_strategy("native.uniBadgerWbtc", "StrategyBadgerLpMetaFarm", controller, params) badger.wire_up_sett(vault, strategy, controller) wbtc = interface.IERC20(registry.tokens.wbtc) # Grant deployer LP tokens # badger.uniswap.addMaxLiquidity(badger.token, wbtc, deployer) badger.distribute_staking_rewards( "native.uniBadgerWbtc", badger_config.geyserParams.unlockSchedules.uniBadgerWbtc[0].amount, ) rewards.grantRole(APPROVED_STAKER_ROLE, strategy, {"from": deployer}) badger.deploy_geyser(badger.getSett("native.uniBadgerWbtc"), "native.uniBadgerWbtc") return badger
def badger_tree_unit(): deployer = accounts[0] badger = deploy_badger_minimal(deployer) distribute_from_whales(badger, deployer) badger.deploy_logic("BadgerHunt", BadgerHunt) badger.deploy_badger_hunt() badger.token.transfer(badger.badgerHunt, badger_config.huntParams.badgerAmount, {"from": deployer}) return badger
def badger_hunt_unit(): deployer = accounts[0] badger = deploy_badger_minimal(deployer) distribute_from_whales(deployer) badger.deploy_logic("BadgerHunt", BadgerHunt) badger.deploy_badger_hunt() source = accounts.at("0x394DCfbCf25C5400fcC147EbD9970eD34A474543", force=True) badger.token.transfer(badger.badgerHunt, Wei("100000 ether"), {"from": source}) return badger
def deploy(self, new_badger=True): if (new_badger): self.badger = deploy_badger_minimal(self.deployer, self.keeper, self.guardian) self.controller = self.badger.add_controller(self.key) else: self.badger="" self.deploy_required_logic() self.pre_deploy_setup() (params, want) = self.fetch_params() self.params = params self.want = want distribute_test_ether(self.deployer, Wei("20 ether")) distribute_from_whales(self.badger, self.deployer) self.controller = self.badger.add_controller(self.key) self.vault = self.badger.deploy_sett( self.key, self.want, self.controller, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, ) self.post_vault_deploy_setup() self.strategy = self.badger.deploy_strategy( self.key, self.strategyName, self.controller, self.params, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, ) self.badger.wire_up_sett(self.vault, self.strategy, self.controller) self.post_deploy_setup() assert self.vault.paused() self.vault.unpause({"from": self.governance}) return self.badger
def sett_native_badger(): deployer = accounts[0] badger = deploy_badger_minimal(deployer) distribute_from_whales(badger, deployer) # badger.deploy_logic("StrategyBadgerRewards", StrategyBadgerRewards) # badger.deploy_logic("BadgerGeyser", BadgerGeyser) badger.deploy_core_logic() badger.deploy_sett_core_logic() badger.deploy_sett_strategy_logic() controller = badger.add_controller("native.badger") vault = badger.deploy_sett("native.badger", badger.token, controller) rewards = badger.deploy_sett_staking_rewards("native.badger", badger.token, badger.token) params = sett_config.native.badger.params params.want = badger.token params.geyser = rewards strategy = badger.deploy_strategy("native.badger", "StrategyBadgerRewards", controller, params) # want = badger.getStrategyWant('native.badger') badger.wire_up_sett(vault, strategy, controller) badger.distribute_staking_rewards( "native.badger", badger_config.geyserParams.unlockSchedules.badger[0].amount) # Approve Setts on specific rewards.grantRole(APPROVED_STAKER_ROLE, strategy, {"from": deployer}) print(badger.getSett("native.badger")) badger.deploy_geyser(badger.getSett("native.badger"), "native.badger") return badger
def sett_pickle_meta_farm(): deployer = accounts[0] params = sett_config.pickle.renCrv.params want = sett_config.pickle.renCrv.params.want badger = deploy_badger_minimal(deployer) distribute_from_whales(badger, deployer) # badger.deploy_logic("StrategyPickleMetaFarm", StrategyPickleMetaFarm) # badger.deploy_logic("BadgerGeyser", BadgerGeyser) badger.deploy_core_logic() badger.deploy_sett_core_logic() badger.deploy_sett_strategy_logic() controller = badger.add_controller("pickle.renCrv") vault = badger.deploy_sett("pickle.renCrv", want, controller) strategy = badger.deploy_strategy("pickle.renCrv", "StrategyPickleMetaFarm", controller, params) badger.wire_up_sett(vault, strategy, controller) return badger
def deploy(self, sett_type=SettType.DEFAULT, deploy=True) -> BadgerSystem: if not deploy: self.badger = connect_badger(badger_config.prod_json) self.pre_deploy_setup(deploy=deploy) distribute_test_ether(self.deployer, Wei("20 ether")) distribute_from_whales(self.deployer) self.controller = self.badger.sett_system.controllers[self.key] self.vault = self.badger.sett_system.vaults[self.key] self.post_vault_deploy_setup(deploy=deploy) self.strategy = self.badger.sett_system.strategies[self.key] self.post_deploy_setup(deploy=deploy) if self.vault.paused(): self.vault.unpause({"from": self.governance}) return self.badger self.badger = deploy_badger_minimal(self.deployer, self.keeper, self.guardian) self.controller = self.badger.add_controller(self.key) self.deploy_required_logic() self.pre_deploy_setup(deploy=deploy) (params, want) = self.fetch_params() self.params = params self.want = want distribute_test_ether(self.deployer, Wei("20 ether")) distribute_from_whales(self.deployer) self.controller = self.badger.add_controller(self.key) self.vault = self.badger.deploy_sett( self.key, self.want, self.controller, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, sett_type=sett_type, ) self.post_vault_deploy_setup(deploy=deploy) print("Deploying Strategy with key: ", self.key) self.strategy = self.badger.deploy_strategy( self.key, self.strategyName, self.controller, self.params, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, ) self.badger.wire_up_sett(self.vault, self.strategy, self.controller) self.post_deploy_setup(deploy=deploy) assert self.vault.paused() self.vault.unpause({"from": self.governance}) return self.badger
def deploy(self, sett_type=SettType.DEFAULT, deploy=True) -> BadgerSystem: if not deploy: self.badger = connect_badger(badger_config.prod_json) self.pre_deploy_setup(deploy=deploy) distribute_test_ether(self.deployer, Wei("20 ether")) self.controller = self.badger.sett_system.controllers[self.key] self.vault = self.badger.sett_system.vaults[self.key] self.post_vault_deploy_setup(deploy=deploy) self.strategy = self.badger.sett_system.strategies[self.key] self.post_deploy_setup(deploy=deploy) # NB: Not all vaults are pauseable. try: if self.vault.paused(): self.vault.unpause({"from": self.governance}) except exceptions.VirtualMachineError: pass return self.badger self.badger = deploy_badger_minimal(self.deployer, self.keeper, self.guardian) # NB: We always connect to dao contracts and multisig. self.badger.connect_dao() self.badger.connect_multisig("0xB65cef03b9B89f99517643226d76e286ee999e77") self.controller = self.badger.add_controller(self.key) self.deploy_required_logic() self.pre_deploy_setup(deploy=deploy) (params, want) = self.fetch_params() self.params = params self.want = want distribute_test_ether(self.deployer, Wei("20 ether")) self.controller = self.badger.add_controller(self.key) self.vault = self.badger.deploy_sett( self.key, self.want, self.controller, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, sett_type=sett_type, ) self.post_vault_deploy_setup(deploy=deploy) print("Deploying Strategy with key: ", self.key) self.strategy = self.badger.deploy_strategy( self.key, self.strategyName, self.controller, self.params, governance=self.governance, strategist=self.strategist, keeper=self.keeper, guardian=self.guardian, ) self.badger.wire_up_sett(self.vault, self.strategy, self.controller) self.post_deploy_setup(deploy=deploy) assert self.vault.paused() self.vault.unpause({"from": self.governance}) return self.badger