def main():
    deployer = accounts.at('0xB593d82d53e2c187dc49673709a6E9f806cdC835',
                           force=True)
    # deployer = accounts.load('gh')

    werc20 = WERC20.at('0xe28D9dF7718b0b5Ba69E01073fE82254a9eD2F98')
    wmas = WMasterChef.at('0x373ae78a14577682591E088F2E78EF1417612c68')
    wliq = WLiquidityGauge.at('0xfdB4f97953150e47C8606758C13e70b5a789a7ec')
    wsindex = WStakingRewards.at('0x713df2DDDA9C7d7bDa98A9f8fCd82c06c50fbd90')
    wsperp = WStakingRewards.at('0xC4635854480ffF80F742645da0310e9e59795c63')

    uni_kp3r_oracle = ERC20KP3ROracle.at(
        '0x8E2A3777AB22e1c5f6d1fF2BcC6C4aA6aB1DeA14')
    sushi_kp3r_oracle = ERC20KP3ROracle.at(
        '0xC331687FD71bb1D7f2e237091F8888dDcaD50C9a')
    core_oracle = CoreOracle.at('0x1E5BDdd0cDF8839d6b27b34927869eF0AD7bf692')
    uni_oracle = UniswapV2Oracle.at(
        '0x910aD02D355c2966e8dD8E32C890cD50DB29C3B9')
    bal_oracle = BalancerPairOracle.at(
        '0x8F93B0AA2643bf74ab38d6a5910fA82D2da02134')
    crv_oracle = CurveOracle.at('0x04DE0E42B3b0483248deafE86C4F5428613b76Ff')
    proxy_oracle = ProxyOracle.at('0x43c425fB2b00a991A51b18c217D749E393bF1AB2')

    # pair token with oracle
    from .tokens import Tokens

    # re-set oracles
    oracle_params = [
        # lp tokens
        [Tokens.bal_perp_usdc, [14886, 6718, 10250]],
    ]

    token_list_2, param_list = zip(*oracle_params)

    proxy_oracle.setOracles(token_list_2, param_list, {'from': deployer})

    proxy_oracle.unsetOracles([Tokens.bal_dai_weth], {'from': deployer})

    print('DONE')

    ###########################################################
    # test spells (UNCOMMENT TO TEST)

    for token in [
            Tokens.weth, Tokens.dai, Tokens.usdc, Tokens.usdt, Tokens.dpi,
            Tokens.yfi, Tokens.snx, Tokens.susd
    ]:
        token = interface.IERC20Ex(token)
        deposit_safebox(token)

    bank = HomoraBank.at('0x5f5Cd91070960D13ee549C9CC47e7a4Cd00457bb')
    uniswap_spell = UniswapV2SpellV1.at(
        '0xc671B7251a789de0835a2fa33c83c8D4afB39092')
    sushiswap_spell = SushiswapSpellV1.at(
        '0x21Fa95485f4571A3a0d0c396561cF4D8D13D445d')
    balancer_spell = BalancerSpellV1.at(
        '0x15B79c184A6a8E19a4CA1F637081270343E4D15D')
    curve_spell = CurveSpellV1.at('0x42C750024E02816eE32EB2eB4DA79ff5BF343D30')
Ejemplo n.º 2
0
def main():
    deployer = accounts.at('0xB593d82d53e2c187dc49673709a6E9f806cdC835',
                           force=True)
    # deployer = accounts.load('gh')

    werc20 = WERC20.at('0xe28D9dF7718b0b5Ba69E01073fE82254a9eD2F98')
    wmas = WMasterChef.at('0x373ae78a14577682591E088F2E78EF1417612c68')
    wliq = WLiquidityGauge.at('0xfdB4f97953150e47C8606758C13e70b5a789a7ec')
    wsindex = WStakingRewards.at('0x713df2DDDA9C7d7bDa98A9f8fCd82c06c50fbd90')
    wsperp = WStakingRewards.at('0xC4635854480ffF80F742645da0310e9e59795c63')

    kp3r_oracle = ERC20KP3ROracle.at(
        '0x8E2A3777AB22e1c5f6d1fF2BcC6C4aA6aB1DeA14')
    core_oracle = CoreOracle.at('0x1E5BDdd0cDF8839d6b27b34927869eF0AD7bf692')
    uni_oracle = UniswapV2Oracle.at(
        '0x910aD02D355c2966e8dD8E32C890cD50DB29C3B9')
    bal_oracle = BalancerPairOracle.at(
        '0x8F93B0AA2643bf74ab38d6a5910fA82D2da02134')
    crv_oracle = CurveOracle.at('0x04DE0E42B3b0483248deafE86C4F5428613b76Ff')
    proxy_oracle = ProxyOracle.at('0x43c425fB2b00a991A51b18c217D749E393bF1AB2')

    bank_impl = HomoraBank.at('0x95ab3Ca8133b47f16f47F6A79410680fE87a6139')
    proxy_admin = Contract.from_explorer(
        '0x090eCE252cEc5998Db765073D07fac77b8e60CB2')
    bank = HomoraBank.at('0x5f5Cd91070960D13ee549C9CC47e7a4Cd00457bb')
    proxy_admin.upgrade(bank, bank_impl, {'from': deployer})

    bank.setOracle(proxy_oracle, {'from': deployer})

    uniswap_spell = UniswapV2SpellV1.deploy(
        bank,
        werc20,
        '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
        {'from': deployer},
    )
    sushiswap_spell = SushiswapSpellV1.deploy(
        bank,
        werc20,
        '0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F',
        wmas,
        {'from': deployer},
    )
    balancer_spell = BalancerSpellV1.at(
        '0x15B79c184A6a8E19a4CA1F637081270343E4D15D')
    curve_spell = CurveSpellV1.deploy(
        bank,
        werc20,
        '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
        wliq,
        {'from': deployer},
    )

    print('DONE')
def main():
    deployer = accounts.at('0xB593d82d53e2c187dc49673709a6E9f806cdC835',
                           force=True)
    # deployer = accounts.load('gh')

    werc20 = WERC20.at('0xe28D9dF7718b0b5Ba69E01073fE82254a9eD2F98')
    wmas = WMasterChef.at('0x373ae78a14577682591E088F2E78EF1417612c68')
    wliq = WLiquidityGauge.at('0xfdB4f97953150e47C8606758C13e70b5a789a7ec')
    wsindex = WStakingRewards.at('0x713df2DDDA9C7d7bDa98A9f8fCd82c06c50fbd90')
    wsperp = WStakingRewards.at('0xC4635854480ffF80F742645da0310e9e59795c63')

    uni_kp3r_oracle = ERC20KP3ROracle.at(
        '0x8E2A3777AB22e1c5f6d1fF2BcC6C4aA6aB1DeA14')
    sushi_kp3r_oracle = ERC20KP3ROracle.at(
        '0xC331687FD71bb1D7f2e237091F8888dDcaD50C9a')
    core_oracle = CoreOracle.at('0x1E5BDdd0cDF8839d6b27b34927869eF0AD7bf692')
    uni_oracle = UniswapV2Oracle.at(
        '0x910aD02D355c2966e8dD8E32C890cD50DB29C3B9')
    bal_oracle = BalancerPairOracle.at(
        '0x8F93B0AA2643bf74ab38d6a5910fA82D2da02134')
    crv_oracle = CurveOracle.at('0x04DE0E42B3b0483248deafE86C4F5428613b76Ff')
    proxy_oracle = ProxyOracle.at('0x43c425fB2b00a991A51b18c217D749E393bF1AB2')

    # pair token with oracle
    from .tokens import Tokens

    # re-set oracles
    oracle_params = [
        # lp tokens
        [Tokens.bal_dai_weth, [12616, 7927, 10250]],
    ]

    token_list_2, param_list = zip(*oracle_params)

    proxy_oracle.setOracles(token_list_2, param_list, {'from': deployer})

    print('DONE')
Ejemplo n.º 4
0
def main():
    deployer = accounts.at('0xB593d82d53e2c187dc49673709a6E9f806cdC835', force=True)
    # deployer = accounts.load('gh')

    werc20 = WERC20.at('0xe28D9dF7718b0b5Ba69E01073fE82254a9eD2F98')
    wmas = WMasterChef.at('0x373ae78a14577682591E088F2E78EF1417612c68')
    wliq = WLiquidityGauge.at('0xfdB4f97953150e47C8606758C13e70b5a789a7ec')
    wsindex = WStakingRewards.at('0x713df2DDDA9C7d7bDa98A9f8fCd82c06c50fbd90')
    wsperp = WStakingRewards.at('0xC4635854480ffF80F742645da0310e9e59795c63')

    uni_kp3r_oracle = ERC20KP3ROracle.at('0x8E2A3777AB22e1c5f6d1fF2BcC6C4aA6aB1DeA14')
    sushi_kp3r_oracle = ERC20KP3ROracle.deploy(
        '0xf67Ab1c914deE06Ba0F264031885Ea7B276a7cDa', {'from': deployer})
    core_oracle = CoreOracle.at('0x1E5BDdd0cDF8839d6b27b34927869eF0AD7bf692')
    uni_oracle = UniswapV2Oracle.at('0x910aD02D355c2966e8dD8E32C890cD50DB29C3B9')
    bal_oracle = BalancerPairOracle.at('0x8F93B0AA2643bf74ab38d6a5910fA82D2da02134')
    crv_oracle = CurveOracle.at('0x04DE0E42B3b0483248deafE86C4F5428613b76Ff')
    proxy_oracle = ProxyOracle.at('0x43c425fB2b00a991A51b18c217D749E393bF1AB2')

    # pair token with oracle
    from .tokens import Tokens

    token_oracle_settings = [
        # base tokens
        [Tokens.weth, uni_kp3r_oracle],
        [Tokens.dai, uni_kp3r_oracle],
        [Tokens.usdc, uni_kp3r_oracle],
        [Tokens.usdt, uni_kp3r_oracle],
        [Tokens.dpi, uni_kp3r_oracle],
        [Tokens.yfi, sushi_kp3r_oracle],
        [Tokens.perp, uni_kp3r_oracle],
        [Tokens.snx, sushi_kp3r_oracle],
        [Tokens.susd, sushi_kp3r_oracle],
        [Tokens.uni, uni_kp3r_oracle],
        [Tokens.sushi, sushi_kp3r_oracle],
        # lp tokens
        [Tokens.uni_eth_yfi, uni_oracle],
        [Tokens.sushi_eth_yfi, uni_oracle],
        [Tokens.uni_eth_dpi, uni_oracle],
        [Tokens.crv_3pool, crv_oracle],
        [Tokens.sushi_eth_dpi, uni_oracle],
        [Tokens.uni_eth_snx, uni_oracle],
        [Tokens.uni_eth_susd, uni_oracle],
        [Tokens.sushi_eth_susd, uni_oracle],
        [Tokens.sushi_eth_snx, uni_oracle],
        [Tokens.crv_susd, crv_oracle],
        [Tokens.sushi_eth_sushi, uni_oracle],
        [Tokens.uni_eth_uni, uni_oracle],
        [Tokens.bal_perp_usdc, bal_oracle],
    ]

    token_list, oracle_list = zip(*token_oracle_settings)

    # re-route to new uniswap oracle
    core_oracle.setRoute(token_list, oracle_list, {'from': deployer})

    # re-set oracles
    oracle_params = [
        # base tokens
        [Tokens.weth, [17158, 5828, 12500]],
        [Tokens.dai, [10790, 9268, 12500]],
        [Tokens.usdc, [10651, 9389, 12500]],
        [Tokens.usdt, [10743, 9308, 12500]],
        [Tokens.dpi, [16195, 6175, 12500]],
        [Tokens.yfi, [29155, 3430, 12500]],
        [Tokens.perp, [20042, 4989, 12500]],
        [Tokens.snx, [18162, 5506, 12500]],
        [Tokens.susd, [12129, 8245, 12500]],
        [Tokens.uni, [16022, 6241, 12500]],
        [Tokens.sushi, [19418, 5150, 12500]],
        # lp tokens
        [Tokens.uni_eth_dpi, [17158, 5828, 12500]],
        [Tokens.uni_eth_yfi, [29155, 3430, 12500]],
        [Tokens.uni_eth_snx, [18162, 5506, 12500]],
        [Tokens.uni_eth_susd, [17158, 5828, 12500]],
        [Tokens.uni_eth_uni, [17158, 5828, 12500]],
        [Tokens.sushi_eth_dpi, [17158, 5828, 12500]],
        [Tokens.sushi_eth_yfi, [29155, 3430, 12500]],
        [Tokens.sushi_eth_snx, [18162, 5506, 12500]],
        [Tokens.sushi_eth_susd, [17158, 5828, 12500]],
        [Tokens.sushi_eth_sushi, [19418, 5150, 12500]],
        [Tokens.bal_perp_usdc, [20042, 4989, 12500]],
        [Tokens.crv_3pool, [10790, 9268, 12500]],
        [Tokens.crv_susd, [12129, 8245, 12500]],
    ]

    token_list_2, param_list = zip(*oracle_params)

    proxy_oracle.setOracles(token_list_2, param_list, {'from': deployer})

    print('DONE')

    ###########################################################
    # test spells (UNCOMMENT TO TEST)

    bank = HomoraBank.at('0x5f5Cd91070960D13ee549C9CC47e7a4Cd00457bb')
    uniswap_spell = UniswapV2SpellV1.at('0xc671B7251a789de0835a2fa33c83c8D4afB39092')
    sushiswap_spell = SushiswapSpellV1.at('0x21Fa95485f4571A3a0d0c396561cF4D8D13D445d')
    balancer_spell = BalancerSpellV1.at('0x15B79c184A6a8E19a4CA1F637081270343E4D15D')
    curve_spell = CurveSpellV1.at('0x42C750024E02816eE32EB2eB4DA79ff5BF343D30')