Exemplo n.º 1
0
def main():

    badger = connect_badger("deploy-final.json")

    deployer = badger.deployer
    key = "native.sushiWbtcIbBtc"
    controller = badger.getController("native")
    governance = badger.devMultisig
    strategist = badger.deployer
    keeper = badger.keeper
    guardian = badger.guardian

    params = sett_config.sushi.sushiWbtcIbBtc.params
    params.badgerTree = badger.badgerTree

    sushiswap = SushiswapSystem()
    if sushiswap.hasPair(registry.tokens.ibbtc, registry.tokens.wbtc):
        params.want = sushiswap.getPair(registry.tokens.ibbtc,
                                        registry.tokens.wbtc)
    else:
        params.want = sushiswap.createPair(
            registry.tokens.ibbtc,
            registry.tokens.wbtc,
            deployer,
        )

    # Setup sushi reward allocations (ONLY DO THIS ONCE).
    params.pid = sushiswap.add_chef_rewards(params.want)

    vault = badger.deploy_sett(
        key,
        params.want,
        controller,
        governance=governance,
        strategist=strategist,
        keeper=keeper,
        guardian=guardian,
    )
    time.sleep(sleep_between_tx)

    strategy = badger.deploy_strategy(
        key,
        strategyName,
        controller,
        params,
        governance=governance,
        strategist=strategist,
        keeper=keeper,
        guardian=guardian,
    )
    time.sleep(sleep_between_tx)

    badger.wire_up_sett(vault, strategy, controller)

    assert vault.paused()
    vault.unpause({"from": governance})
    assert vault.paused() == False
    def post_vault_deploy_setup(self, deploy=True):
        """
        Setup sushi rewards.
        """
        if not deploy:
            return

        # Setup sushi reward allocations.
        sushiswap = SushiswapSystem()
        pid = sushiswap.add_chef_rewards(self.want)

        # Pass in LP token pool id to underlying strategy.
        self.params.pid = pid
    def post_vault_deploy_setup(self, deploy=True):
        """
        Deploy StakingRewardsSignalOnly for Digg Strategy
        Generate LP tokens and grant to deployer
        """
        if not deploy:
            return

        # Setup sushi reward allocations.
        sushiswap = SushiswapSystem()
        pid = sushiswap.add_chef_rewards(self.want)
        # Generate lp tokens.
        sushiswap.addMaxLiquidity(
            self.digg.token,
            registry.tokens.wbtc,
            self.deployer,
        )

        # Pass in LP token pool id to underlying strategy.
        self.params.pid = pid