예제 #1
0
def strategy(accounts, strategist, keeper, vault, Strategy, gov, token):
    strategy = Strategy.deploy(vault, {"from": strategist})
    strategy.setKeeper(keeper)
    vault.addStrategy(strategy, 10_000, 0, 2**256 - 1, 1_000, {"from": gov})

    # proxy add
    proxy = Contract("0x9a165622a744C20E3B2CB443AeD98110a33a231b", owner=gov)
    proxy.approveStrategy(strategy.gauge(), strategy)

    yield strategy
예제 #2
0
def strategy(accounts, strategist, keeper, vault, Strategy, gov, token):
    strategy = Strategy.deploy(vault, {"from": strategist})
    strategy.setKeeper(keeper)
    vault.addStrategy(strategy, 10_000, 0, 2 ** 256 - 1, 1_000, {"from": gov})

    # proxy add
    proxy = Contract("0xA420A63BbEFfbda3B147d0585F1852C358e2C152", owner=gov)
    proxy.approveStrategy(strategy.gauge(), strategy)

    yield strategy
예제 #3
0
def strategy(accounts, strategist, keeper, vault, Strategy, gov):
    strategy = strategist.deploy(Strategy, vault)
    strategy.setKeeper(keeper)
    vault.addStrategy(strategy, 10_000, 0, 2**256 - 1, 1_000, {"from": gov})

    g = accounts.at("0x710295b5f326c2e47E6dD2E7F6b5b0F7c5AC2F24", force=True)
    proxy = Contract("0x96Dd07B6c99b22F3f0cB1836aFF8530a98BDe9E3", owner=g)
    gauge = strategy.gauge()
    proxy.approveStrategy(gauge, strategy)

    yield strategy
예제 #4
0
def strategy(accounts, strategist, keeper, vault, Strategy, gov, token):
    strategy = Strategy.deploy(vault, {"from": strategist})
    strategy.setKeeper(keeper)

    live_strat = ""  # current live strategy
    vault.migrateStrategy(live_strat, strategy)

    # proxy add
    proxy = Contract(strategy.proxy(), owner=gov)
    proxy.approveStrategy(strategy.gauge(), strategy)

    yield strategy
예제 #5
0
def strategy(accounts, strategist, keeper, vault, Strategy, gov, token):
    strategy = Strategy.deploy(vault, {"from": strategist})
    strategy.setKeeper(keeper)
    vault.addStrategy(strategy, 10_000, 0, 2**256 - 1, 1_000, {"from": gov})

    proxy = Contract("0x9a165622a744C20E3B2CB443AeD98110a33a231b", owner=gov)
    voter = Contract(proxy.proxy(), owner=gov)
    gauge = Contract(strategy.gauge())

    # harvest the old strategy
    ctrl = Contract('0x9E65Ad11b299CA0Abefc2799dDB6314Ef2d91080', owner=gov)
    old_strategy = Contract(ctrl.strategies(token), owner=gov)
    old_vault = Contract(ctrl.vaults(token), owner=gov)
    old_strategy.harvest()

    # remove the old strategy from gauge
    data = vault.withdraw.encode_input(
        gauge.balanceOf(voter))  # just use the vault interface
    voter.execute(gauge, 0, data)

    # transfer token from voter to old vault
    data = token.transfer.encode_input(old_vault, token.balanceOf(voter))
    voter.execute(token, 0, data)
    assert token.balanceOf(voter) == 0
    assert gauge.balanceOf(voter) == 0

    # # clear mintr
    # mintr = Contract(proxy.mintr())
    # data = mintr.mint.encode_input(gauge)
    # voter.execute(mintr, 0, data)

    # # sent to strategy
    # crv = Contract('0xD533a949740bb3306d119CC777fa900bA034cd52')
    # data = token.transfer.encode_input(strategy, token.balanceOf(voter))
    # voter.execute(crv, 0, data)

    # change current strategy proxy
    mock_proxy = Contract('0x96Dd07B6c99b22F3f0cB1836aFF8530a98BDe9E3')
    old_strategy.setProxy(mock_proxy)
    old_strategy.setKeepCRV(0)
    governance = mock_proxy.governance()
    mock_proxy.approveStrategy(gauge, old_strategy, {"from": governance})

    # proxy add
    proxy.approveStrategy(gauge, strategy)

    yield strategy
예제 #6
0
def proxy(strategy, gov):
    p = Contract("0x9a165622a744C20E3B2CB443AeD98110a33a231b")
    p.approveStrategy(strategy.address, strategy.address, {"from":gov}) # Self address as gauge
    yield p