Ejemplo n.º 1
0
def main():
    badger = connect_badger(badger_config.prod_json)
    console.print("\n[white]===== 🦡 Sett Status 🦡 =====[white]\n")
    for key in badger.sett_system.vaults.keys():
        sett = badger.getSett(key)

        admin = badger.getProxyAdmin(sett)
        sett_impl = admin.getProxyImplementation(sett)
        sett_admin = admin.getProxyAdmin(sett)

        sett_type = badger.getSettType(key)

        print(key, sett_type)

        table = []

        table.append(["Sett Key", key])
        table.append(["Sett Type", sett_type])
        table.append(["Sett Logic", sett_impl])
        table.append(["Sett Admin", sett_admin])

        if sett_type == "v1":
            snap = SnapshotManager(badger, key)
            state = snap.snap()
            snap.printPermissions()
            # snap.printTable(state)
            strategy = badger.getStrategy(key)
            strategy_impl = badger.devProxyAdmin.getProxyImplementation(
                strategy)
            strategy_admin = admin.getProxyAdmin(strategy)
            table.append(["Strategy Logic", strategy_impl])
            table.append(["Strategy Admin", strategy_admin])

        print(tabulate(table, ["Key", "Value"]))
Ejemplo n.º 2
0
def main():
    badger = connect_badger(badger_config.prod_json)
    console.print("\n[white]===== 🦡 Sett Status 🦡 =====[white]\n")
    for key in badger.sett_system.vaults.keys():
        snap = SnapshotManager(badger, key)
        state = snap.snap()
        snap.printPermissions()
        snap.printTable(state)
Ejemplo n.º 3
0
def main():
    badger = connect_badger(badger_config.prod_json)
    console.print("\n[white]===== 🦡 Sett Status 🦡 =====[white]\n")
    for key in badger.sett_system.vaults.keys():
        if key in setts_to_skip:
            continue
        sett = badger.getSett(key)

        admin = badger.getProxyAdmin(sett)
        sett_impl = admin.getProxyImplementation(sett)
        sett_admin = admin.getProxyAdmin(sett)

        sett_type = badger.getSettType(key)

        print(key, sett_type)

        table = []

        console.print("[green]=== Admin: {} Sett ===[green]".format(key))

        table.append(["Sett Key", key])

        table.append(["Sett Type", sett_type])
        table.append(["Sett Logic", sett_impl])
        table.append(["Sett Admin", sett_admin])
        print(tabulate(table, ["Key", "Value"]))

        table = []
        table.append(["PPFS", sett.getPricePerFullShare()])
        table.append(["totalSupply", sett.totalSupply()])
        table.append(["balance", sett.balance()])
        print(tabulate(table, ["Key", "Value"]))

        if sett_type == "v1":
            snap = SnapshotManager(badger, key)
            # state = snap.snap()

            # snap.printTable(state)

            if badger.hasStrategy(key):
                snap.printPermissions()
                strategy = badger.getStrategy(key)
                admin = badger.getProxyAdmin(strategy)
                strategy_impl = admin.getProxyImplementation(strategy)
                strategy_admin = admin.getProxyAdmin(strategy)

                table = []
                console.print(
                    "[green]=== Admin: {} Strategy ===[green]".format(key))
                table.append(["Strategy Logic", strategy_impl])
                table.append(["Strategy Admin", strategy_admin])

        print(tabulate(table, ["Key", "Value"]))
Ejemplo n.º 4
0
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()
                ),
            }
        )