示例#1
0
def main():
    badger = connect_badger("deploy-final.json")
    bBadger = badger.getSett("native.badger")

    escrows = [
        "0x1fc3C85456322C8514c0ff7694Ea4Ef5bC7F9f37",
        "0xaeDb773C226e6d74f2cd3542372076779Ff6fA6E"
    ]

    timelocks = [
        "0x2Bc1A5E26ad0316375E68942fe0B387adE6b9254",
        "0x7C651D13DfB87748b0F05914dFb40E5B15a78D35",
        "0xB6c9e9Ba41291044Cf5dadFB22D72d3fe9312880",
        "0xdbd185c59f64d2d39c6ababf5d701669417a002d"
        # "0x1fc3C85456322C8514c0ff7694Ea4Ef5bC7F9f37",
        # "0xaeDb773C226e6d74f2cd3542372076779Ff6fA6E"
    ]

    for address in timelocks:
        vesting = interface.ITokenTimelock(address)

        console.print(
            {
                "token": vesting.token(),
                "beneficiary": vesting.beneficiary(),
                "releaseTime": vesting.releaseTime(),
                "releaseDate": to_utc_date(vesting.releaseTime()),
            }
        )

    chain.sleep(days(182))
    chain.mine()

    for address in timelocks:
        vesting = interface.ITokenTimelock(address)
        beneficiary = accounts.at(vesting.beneficiary(), force=True)
        pre = get_token_balances([bBadger], [vesting, beneficiary])
        vesting.release({"from": badger.deployer})
        post = get_token_balances([bBadger], [vesting, beneficiary])
        diff_token_balances(pre, post)
示例#2
0
def main():
    badger = connect_badger("deploy-final.json")

    test_user = accounts.at(decouple.config("TEST_ACCOUNT"), force=True)

    distribute_test_ether(test_user, Wei("20 ether"))
    distribute_from_whales(test_user, assets=["bBadger", "badger", "usdc"])

    rest = get_active_rewards_schedule(badger)
    usdc = interface.IERC20(registry.tokens.usdc)

    usdc_per_badger = 40.37 * 0.75
    usdc_total = 13386240

    multi = GnosisSafe(badger.devMultisig)

    badger_total_scaled = usdc_total / usdc_per_badger

    badger_total = Wei(str(badger_total_scaled) + " ether")

    bBadger = badger.getSett("native.badger")

    ppfs = bBadger.getPricePerFullShare()

    bBadger_total = int(badger_total / ppfs * 10**18)

    badger_total = Wei(str(badger_total_scaled) + " ether")

    console.print({
        "TRADE": "BASED",
        "usdc_per_badger": usdc_per_badger,
        "usdc_total": usdc_total,
        "badger_total_scaled": badger_total_scaled,
        "badger_total": badger_total,
        "ppfs": ppfs,
        "bBadger_total": str(bBadger_total),
    })

    params = {
        "beneficiary": "0x3159b46a7829a0dbfa856888af768fe7146e7418",
        "duration": days(182),
        "usdcAmount": usdc_total * 10**6,
        "bBadgerAmount": bBadger_total,
        # "usdcAmount": 0,
        # "bBadgerAmount": 0,
    }

    console.print(params)

    # # Oxb1 Test
    beneficiary = accounts.at(params["beneficiary"], force=True)

    escrow = OtcEscrow.at("0x7163fB2fA38Ea3BBc1F8525F3d8D0417C0c9d903")

    # bBadger.transfer(badger.devMultisig, Wei("100000 ether"), {"from": test_user})

    pre = get_token_balances(
        [usdc, bBadger], [test_user, escrow, badger.devMultisig, beneficiary])
    pre.print()

    # assert usdc.balanceOf(params["beneficiary"]) >= params["usdcAmount"]

    # multi.execute(MultisigTxMetadata(description="Transfer to 0xb1"), {
    #     "to": bBadger.address,
    #     "data": bBadger.transfer.encode_input(escrow, bBadger_total + Wei("1000 ether"))
    # })

    # assert usdc.allowance(beneficiary, escrow) >= params["usdcAmount"]

    # usdc.approve(escrow, params["usdcAmount"], {"from": beneficiary})
    # tx = escrow.swap({"from": beneficiary})

    tx = multi.execute(MultisigTxMetadata(description="Swap"), {
        "to": escrow.address,
        "data": escrow.swap.encode_input()
    },
                       print_output=False)

    chain.mine()

    print(tx.call_trace())

    vesting = interface.ITokenTimelock(
        tx.events["VestingDeployed"][0]["vesting"])

    console.print({
        "token": vesting.token(),
        "beneficiary": vesting.beneficiary(),
        "releaseTime": to_utc_date(vesting.releaseTime()),
    })

    post = get_token_balances(
        [usdc, bBadger], [test_user, escrow, badger.devMultisig, beneficiary])

    diff_token_balances(pre, post)
    try:
        vesting.release({"from": test_user})
    except:
        print("early vest failed!")

    chain.sleep(days(182))
    chain.mine()
    # End

    vesting.release({"from": test_user})

    post = get_token_balances(
        [usdc, bBadger], [test_user, escrow, badger.devMultisig, beneficiary])

    diff_token_balances(pre, post)

    return

    escrow = OtcEscrow.deploy(
        params["beneficiary"],
        params["duration"],
        params["usdcAmount"],
        params["bBadgerAmount"],
        {"from": badger.deployer},
    )

    beneficiary = accounts.at(params["beneficiary"], force=True)
    usdc.transfer(beneficiary, params["usdcAmount"], {"from": test_user})
    usdc.transfer(beneficiary, 1500000000000, {"from": test_user})

    badger.token.transfer(badger.devMultisig, badger_total,
                          {"from": test_user})

    multi.execute(
        MultisigTxMetadata(description="Whitelist Multi"),
        {
            "to": bBadger.address,
            "data": bBadger.approveContractAccess.encode_input(
                badger.devMultisig),
        },
    )

    assert badger.token.balanceOf(badger.devMultisig) > Wei("100 ether")

    multi.execute(
        MultisigTxMetadata(description="Approve bBadger Contract"),
        {
            "to": badger.token.address,
            "data": badger.token.approve.encode_input(bBadger, badger_total),
        },
    )

    multi.execute(
        MultisigTxMetadata(description="Deposit"),
        {
            "to": bBadger.address,
            "data": bBadger.deposit.encode_input(badger_total)
        },
    )

    console.print(
        "bBadger.balanceOf(badger.devMultisig)",
        bBadger.balanceOf(badger.devMultisig), params["bBadgerAmount"],
        params["bBadgerAmount"] - bBadger.balanceOf(badger.devMultisig))
    assert bBadger.balanceOf(badger.devMultisig) >= params["bBadgerAmount"]

    chain.mine()
    chain.sleep(14)
    chain.mine()

    multi.execute(
        MultisigTxMetadata(description="Transfer"),
        {
            "to": bBadger.address,
            "data": bBadger.transfer.encode_input(escrow,
                                                  params["bBadgerAmount"]),
        },
    )

    assert bBadger.balanceOf(escrow) == params["bBadgerAmount"]

    multi.execute(
        MultisigTxMetadata(description="Revoke"),
        {
            "to": escrow.address,
            "data": escrow.revoke.encode_input()
        },
    )

    assert bBadger.balanceOf(escrow) == 0
    assert bBadger.balanceOf(badger.devMultisig) >= params["bBadgerAmount"]

    print(bBadger.balanceOf(badger.devMultisig))

    bBadger.transfer(escrow, params["bBadgerAmount"], {"from": test_user})

    pre = get_token_balances(
        [usdc, bBadger], [test_user, escrow, badger.devMultisig, beneficiary])
    console.print(pre)

    assert usdc.balanceOf(beneficiary) >= params["usdcAmount"]
    assert bBadger.balanceOf(escrow) == params["bBadgerAmount"]

    usdc.approve(escrow, params["usdcAmount"], {"from": beneficiary})
    tx = escrow.swap({"from": beneficiary})

    post = get_token_balances(
        [usdc, bBadger], [test_user, escrow, badger.devMultisig, beneficiary])

    console.print(tx.events)
    post.print()
    diff_token_balances(pre, post)

    vesting = interface.ITokenTimelock(
        tx.events["VestingDeployed"][0]["vesting"])

    console.print({
        "token": vesting.token(),
        "beneficiary": vesting.beneficiary(),
        "releaseTime": to_utc_date(vesting.releaseTime()),
    })

    chain.sleep(days(365))
    chain.mine()

    vesting.release({"from": test_user})
示例#3
0
def test_claim(badger, user, claim, tokens_to_check):
    digg = badger.digg
    tree = badger.badgerTree

    total_claimed_before = tree.getClaimedFor(user, tokens_to_check)

    print("=== Claim: " + user + " ===")

    accounts[0].transfer(user, Wei("0.5 ether"))
    userAccount = accounts.at(user, force=True)

    table = []

    assert tree.merkleRoot() == root

    pre = get_token_balances(tokens_to_check, [userAccount])

    parsed_amounts = []
    for amount in claim["cumulativeAmounts"]:
        parsed_amounts.append(int(amount))

    tokens = claim["tokens"]
    amounts = claim["cumulativeAmounts"]

    canClaim = tree.isClaimAvailableFor(user, claim["tokens"], parsed_amounts)
    claimable = tree.getClaimableFor(user, claim["tokens"],
                                     claim["cumulativeAmounts"])[1]
    print(claimable)
    # console.log("canClaim Test", user, tokens, amounts, parsed_amounts)
    console.log("canClaim Test", canClaim)

    # Get claimable amounts before to test against reality

    if canClaim:
        tx = tree.claim(
            claim["tokens"],
            claim["cumulativeAmounts"],
            claim["index"],
            claim["cycle"],
            claim["proof"],
            claimable,
            {"from": userAccount},
        )
        # with brownie.reverts("excessive claim"):
        try:
            console.print("[red]===== 🐻 Trying to claim twice=====[/red]")
            tree.claim(
                claim["tokens"],
                claim["cumulativeAmounts"],
                claim["index"],
                claim["cycle"],
                claim["proof"],
                claimable,
                {
                    "from": user,
                    "allow_revert": True
                },
            )
        except Exception as e:
            console.print("Double Claim Attempt", e)

    # Ensure fail if no claim
    else:
        console.print(
            "[yellow]===== 🍄 Trying to claim when no claim=====[/yellow]")
        try:
            tree.claim(
                claim["tokens"],
                claim["cumulativeAmounts"],
                claim["index"],
                claim["cycle"],
                claim["proof"],
                claimable,
                {
                    "from": user,
                    "allow_revert": True
                },
            )
        except Exception as e:
            console.print("No tokens claim", e)

    # Test double claim on same data set

    post = get_token_balances(tokens_to_check, [userAccount])
    claimed_totals_after = tree.getClaimedFor(user, tokens_to_check)

    for token in post.balances.keys():
        cumulative_claimed = int(claim["cumulativeAmounts"][0])
        cumulative_claimed = get_cumulative_claimable_for_token(claim, token)
        claimed_for_token_before = get_claimed_for_token(
            total_claimed_before, token)
        claimed_for_token_after = get_claimed_for_token(
            claimed_totals_after, token)

        if debug:
            console.print({
                "token": token,
                "cumulative_claimed": cumulative_claimed,
                "claimed_for_token_after": claimed_for_token_after,
                "claimed_for_token_before": claimed_for_token_before,
            })

        expected_claim = cumulative_claimed - claimed_for_token_before
        pre_amount = pre.get(token, user)
        post_amount = post.get(token, user)
        diff = post_amount - pre_amount
        table.append([
            user,
            token_metadata.get_symbol(token),
            # val(pre_amount, decimals=token_metadata.get_decimals(token)),
            # val(post_amount, decimals=token_metadata.get_decimals(token)),
            val(diff, decimals=token_metadata.get_decimals(token)),
            val(expected_claim, token_metadata.get_decimals(token)),
            val(cumulative_claimed, token_metadata.get_decimals(token)),
        ])

    print(
        tabulate(
            table,
            headers=[
                "user",
                "token",
                # "before",
                # "after",
                "diff",
                "claim",
                "culumativeClaimed",
            ],
        ))

    assert cumulative_claimed == claimed_for_token_after
    assert post_amount == pre_amount + expected_claim
示例#4
0
def main():
    badger = connect_badger("deploy-final.json")
    digg = badger.digg

    tx_data = {
        "to":
        "0x8D29bE29923b68abfDD21e541b9374737B49cdAD",
        "data":
        "0x8d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000009fe00b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024694e80c300000000000000000000000000000000000000000000000000000000000000010019d099670a21bc0a8211a89b84cedf59abb4377f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064beabacc80000000000000000000000003472a5a71965499acd81997a54bba8d852c6e53d000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000017c5d213c7a8f712f400019d099670a21bc0a8211a89b84cedf59abb4377f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064beabacc8000000000000000000000000798d1be841a82a273720ce31c822c61a67a601c3000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000000000000001b69e2595003472a5a71965499acd81997a54bba8d852c6e53d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000000000000000000000000068bce40cf18444c28000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001244a25d94a000000000000000000000000000000000000000000000002b01ee2a20a8a2a90000000000000000000000000000000000000000000000068bce40cf18444c28000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000000000000000604be4d100000000000000000000000000000000000000000000000000000000000000030000000000000000000000003472a5a71965499acd81997a54bba8d852c6e53d0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2003472a5a71965499acd81997a54bba8d852c6e53d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000019d97d8fa813ee2f51ad4b4e04ea08baf4dffc28000000000000000000000000000000000000000000000113a03d2f890b2c6cc00019d97d8fa813ee2f51ad4b4e04ea08baf4dffc2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024b6b55f25000000000000000000000000000000000000000000000113a03d2f890b2c6cc000798d1be841a82a273720ce31c822c61a67a601c300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000007e7e112a68d8d2e221e11047a72ffc1065c38e1a00000000000000000000000000000000000000000000000000000001b69e2595007e7e112a68d8d2e221e11047a72ffc1065c38e1a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246c361865000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e77007e7e112a68d8d2e221e11047a72ffc1065c38e1a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024b6b55f2500000000000000000000000000000000000000000000000000000001b69e25950019d97d8fa813ee2f51ad4b4e04ea08baf4dffc2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f0000000000000000000000000000000000000000000000e203f5dc3c00323a8000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f00000000000000000000000000000000000000000000000777723ca5ab7fcb9000000000000000000000000000000000000000000000000000000000000000c4f305d71900000000000000000000000019d97d8fa813ee2f51ad4b4e04ea08baf4dffc280000000000000000000000000000000000000000000000e203f5dc3c00323a800000000000000000000000000000000000000000000000e203f5dc3c00323a8000000000000000000000000000000000000000000000000777723ca5ab7fcb90000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000000000000000604be4db007e7e112a68d8d2e221e11047a72ffc1065c38e1a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f00000000000000000000000000000000000000000000000048ada1feff60844a00d9e1ce17f2641f24ae83637ab66a2cca9c378b9f00000000000000000000000000000000000000000000000777723ca5ab7fcb9000000000000000000000000000000000000000000000000000000000000000c4f305d7190000000000000000000000007e7e112a68d8d2e221e11047a72ffc1065c38e1a00000000000000000000000000000000000000000000000048ada1feff60844a00000000000000000000000000000000000000000000000048ada1feff60844a00000000000000000000000000000000000000000000000777723ca5ab7fcb90000000000000000000000000b65cef03b9b89f99517643226d76e286ee999e7700000000000000000000000000000000000000000000000000000000604be4dd0000",
    }

    sushiBbadgerPair = "0x0a54d4b378c8dbfc7bc93be50c85debafdb87439"
    sushiBDiggPair = "0xf9440fedc72a0b8030861dcdac39a75b544e7a3c"

    sushiswap = SushiswapSystem()

    pair = interface.IUniswapV2Pair(sushiBbadgerPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    pair = interface.IUniswapV2Pair(sushiBDiggPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    usd_amount = 500000

    weth = interface.IERC20(registry.tokens.weth)

    console.log("..Before Safe")

    safe = ApeSafe(badger.devMultisig.address)
    ops_safe = ApeSafe(badger.opsMultisig.address)

    console.log("..After Safe Setup")

    # multi = GnosisSafe(badger.devMultisig)

    # multi.execute(
    #     MultisigTxMetadata(description="Run TX"),
    #     {"to": tx_data["to"], "data": tx_data["data"], "operation": 1},
    # )

    after = get_token_balances(
        [
            badger.token,
            digg.token,
            interface.IERC20(registry.tokens.usdc),
            interface.IERC20(sushiBbadgerPair),
            interface.IERC20(sushiBDiggPair),
        ],
        [badger.devMultisig],
    )
    after.print()

    pair = interface.IUniswapV2Pair(sushiBbadgerPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    pair = interface.IUniswapV2Pair(sushiBDiggPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    router = safe.contract(sushiswap.router.address)
    rewardsEscrow = safe.contract(badger.rewardsEscrow.address)
    badgerToken = safe.contract(badger.token.address)
    diggToken = safe.contract(digg.token.address)

    digg_to_lp = Wei("8.4 gwei")

    usd_per_side = 250000

    # TODO: Use banteg's nice value calc script.

    badger_usd = fetch_usd_price(badger.token.address)
    digg_usd = fetch_usd_price(digg.token.address)
    eth_usd = fetch_usd_price_eth()

    console.log(eth_usd)

    badger_to_swap = Wei(str(95000 / badger_usd) + " ether")
    badger_to_lp = Wei(str(usd_per_side / badger_usd) + " ether")
    digg_to_lp = Wei(str(usd_per_side / digg_usd) + " gwei")
    eth_out = Wei(str(usd_per_side / eth_usd) + " ether")

    console.print({
        "badger_to_swap": badger_to_swap,
        "badger_to_lp": badger_to_lp,
        "digg_to_lp": digg_to_lp,
        "eth_out": eth_out,
        "badger_usd": badger_usd,
        "digg_usd": digg_usd,
        "eth_usd": eth_usd,
    })

    badger_to_get_from_escrow = badger_to_swap + badger_to_lp

    # Get 250k worth of bBadger + $90k Amount to swap to ETH
    rewardsEscrow.transfer(badger.token, badger.devMultisig,
                           badger_to_get_from_escrow)

    # Get 250k worth of bDigg
    rewardsEscrow.transfer(digg.token, badger.devMultisig, digg_to_lp)

    # Sell badger for 90k USD
    exact_eth = Wei(str(90000 / eth_usd) + " ether")

    console.print("exact_eth", exact_eth)

    assert badger.token.balanceOf(badger.devMultisig) >= badger_to_swap

    print("a")

    badgerToken.approve(sushiswap.router.address, badger_to_swap)

    print("b")

    assert (badger.token.allowance(badger.devMultisig,
                                   sushiswap.router.address) == badger_to_swap)

    router.swapTokensForExactETH(
        exact_eth,
        int(badger_to_swap * 1.02),
        [badger.token, registry.tokens.wbtc, registry.tokens.weth],
        badger.devMultisig,
        chain.time() + 200000,
    )

    print("d")

    after = get_token_balances([badger.token, digg.token],
                               [badger.devMultisig])
    after.print()

    # Deposit Badger for bBadger
    # Deposit DIGG for bDigg

    bBadger_address = badger.getSett("native.badger").address
    bDigg_address = badger.getSett("native.digg").address

    console.print(bBadger_address, bDigg_address)

    abi = Sett.abi

    bBadger = safe.contract_from_abi(bBadger_address, "Sett", abi)
    bDigg = safe.contract_from_abi(bDigg_address, "Sett", abi)

    badgerToken.approve(bBadger.address, badger_to_lp)

    print(bBadger)
    console.print(bBadger)
    bBadger.deposit(badger_to_lp)

    diggToken.approve(bDigg.address, digg_to_lp)
    bDigg.approveContractAccess(badger.devMultisig)

    tx = bDigg.deposit(digg_to_lp)
    console.print(tx.events)

    # tx = bDigg.withdraw(bDigg.balanceOf(badger.devMultisig))
    # console.print(tx.events)

    after = get_token_balances(
        [
            badger.token,
            digg.token,
            interface.IERC20(bDigg.address),
            interface.IERC20(bBadger.address),
        ],
        [badger.devMultisig],
    )
    after.print()

    # Seed pools: 250k worth of bToken, 250k worth of ETH

    tokenA = bBadger

    amountA = (badger_to_lp * 10**18) / bBadger.getPricePerFullShare()
    amountB = eth_out

    # TODO: Set the amount of ETH to what is required.

    after = get_token_balances(
        [
            badger.token,
            digg.token,
            interface.IERC20(bDigg.address),
            interface.IERC20(bBadger.address),
            interface.IERC20(sushiBbadgerPair),
            interface.IERC20(sushiBDiggPair),
        ],
        [badger.devMultisig],
    )
    after.print()

    safe_tx = safe.multisend_from_receipts()
    safe.preview(safe_tx)
    data = safe.print_transaction(safe_tx)
    safe.post_transaction(safe_tx)
    """
    How do we get exactly 250k worth of each asset?
    Calculate how much you need to get 250k

    ===== Normal Assets =====
    250k / USD price of asset 

    ===== For bTokens =====
    How much original token to get: 250k / USD price of underlying asset 
    bToken will handle itself
    """

    tokenA.approve(sushiswap.router, amountA)
    console.print(
        "addLiquidityETH",
        {
            "tokenA": tokenA.address,
            "amountA": amountA,
            "amountB": amountB,
            "badger ppfs": bBadger.getPricePerFullShare(),
            "original supply": Wei("4000 gwei"),
            "current supply": digg.token.totalSupply(),
        },
    )

    router.addLiquidityETH(
        tokenA.address,
        amountA,
        int(amountA * 0.95),
        int(eth_out * 0.95),
        badger.devMultisig,
        chain.time() + 200000,
        {"value": eth_out},
    )

    tokenA = bDigg

    amountA = ((digg_to_lp * 10**9) * 10**18) / bDigg.getPricePerFullShare()
    amountA = amountA * (Wei("4000 gwei")) / digg.token.totalSupply()

    print("expected bDigg", amountA)

    amountA = bDigg.balanceOf(badger.devMultisig)

    print("actual bDigg", amountA)

    tokenA.approve(sushiswap.router, amountA)
    console.print(
        "addLiquidityETH",
        {
            "tokenA": tokenA.address,
            "amountA": amountA,
            "amountB": amountB,
            "digg ppfs": bDigg.getPricePerFullShare(),
        },
    )

    router.addLiquidityETH(
        tokenA.address,
        amountA,
        int(amountA * 0.95),
        int(eth_out * 0.95),
        badger.devMultisig,
        chain.time() + 200000,
        {"value": eth_out},
    )

    after = get_token_balances(
        [
            badger.token,
            digg.token,
            interface.IERC20(bDigg.address),
            interface.IERC20(bBadger.address),
            interface.IERC20(sushiBbadgerPair),
            interface.IERC20(sushiBDiggPair),
        ],
        [badger.devMultisig],
    )
    after.print()

    safe_tx = safe.multisend_from_receipts()
    safe.preview(safe_tx)
    data = safe.print_transaction(safe_tx)
    safe.post_transaction(safe_tx)

    pair = interface.IUniswapV2Pair(sushiBbadgerPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    pair = interface.IUniswapV2Pair(sushiBDiggPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    safe.post_transaction(safe_tx)

    pair = interface.IUniswapV2Pair(sushiBbadgerPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })

    pair = interface.IUniswapV2Pair(sushiBDiggPair)
    console.print({
        "getReserves": pair.getReserves(),
        "token0": pair.token0(),
        "token1": pair.token1(),
        "price0CumulativeLast": pair.price0CumulativeLast(),
        "price1CumulativeLast": pair.price1CumulativeLast(),
    })