Esempio n. 1
0
def d(web3, our_address, keeper_address, gal_address):
    # dss = """
    # {"MCD_MOM": "0xD3F7637ace900b381a0A6Bf878639E5BCa564B53", "MCD_VAT": "0x7dc681a82de642cf86cc05d6c938aA0021a6807F", "MCD_VOW": "0x68A75d6CaC097fFE5FC1e912EaDc8832bC1D8f36", "MCD_DRIP": "0x58B21768D30433481FbE87C2065Cc081eF982898", "MCD_PIT": "0x0D64bE75122D4Cb0F65776a973f3c03eb83177Ff", "MCD_CAT": "0x49A4177032a6cA5f419E764a154B6CE710418e6a", "MCD_FLAP": "0x90194dC5E16C203EE8debEc949130Ed60D97Af96", "MCD_FLOP": "0x27c232d542B3F9503c327Ff087582983E2086c61", "MCD_DAI": "0xdBA593D53D5C5AA91D73402DB3622d63463620Dd", "MCD_JOIN_DAI": "0xD2E5103366FEf1F6D387d0e11132Cef95ae3F8c8", "MCD_MOVE_DAI": "0x86a1f3308dA49e7b3C8e64a6702AD19f72Ca4aEB", "MCD_GOV": "0xD6be7670e94E88b28143F057944DAAA8900629AE", "COLLATERALS": ["WETH"], "WETH": "0x820f809525024513a5A45e74f5Cf36C67b98F2D7", "MCD_JOIN_WETH": "0xe058f7252743064ee497cF5Caa10F312B00691e9", "MCD_MOVE_WETH": "0x4dFcCEBCF5Ae068AE41503B93f7d4e8234087800", "MCD_FLIP_WETH": "0xec8e3dFdfD4665f19971B4ffE2a78b51095f349b", "MCD_SPOT_WETH": "0xc323B27F990C4AA3C9297Da8738d765Bac3ca8df", "PIP_WETH": "0xaCab49615c32e56a59097855a08d3653cAb0e473"}
    # """
    # return DssDeployment.from_json(web3=web3, conf=dss)
    d = DssDeployment.deploy(web3=web3, debt_ceiling=Wad.from_number(100000000))
    c = d.collaterals[0]
    assert d.pit.file_line(c.ilk, Wad.from_number(100000000)).transact()  # Set collateral debt ceiling
    assert d.cat.file_lump(c.ilk, Wad.from_number(100)).transact()  # Set liquidation Quantity of c at 100

    # mint gem for cdp frob() by gal_address and our_address to draw dai
    assert c.gem.mint(Wad.from_number(2000000)).transact()
    assert c.gem.transfer(gal_address, Wad.from_number(1000000)).transact()

    # Require to join the adapter
    assert c.gem.approve(c.adapter.address).transact()
    assert c.gem.approve(c.adapter.address).transact(from_address=gal_address)

    # draw dai for our_address
    assert c.adapter.join(Urn(our_address), Wad.from_number(1000000)).transact()
    assert d.pit.frob(c.ilk, Wad.from_number(1000000), Wad.from_number(1000000)).transact()
    assert d.dai_move.move(our_address, keeper_address, Wad.from_number(10000)).transact()

    # mint MKR for the keeper
    assert d.mkr.mint(Wad.from_number(100)).transact()
    assert d.mkr.transfer(keeper_address, Wad.from_number(100)).transact()

    return d
Esempio n. 2
0
def d(web3, our_address, other_address, gal_address):
    d = DssDeployment.deploy(web3=web3, debt_ceiling=Wad.from_number(1000000))

    # mint gem for cdp frob() by gal_address
    for c in d.collaterals:
        assert c.gem.mint(Wad.from_number(1000000)).transact()
        assert c.gem.transfer(gal_address, Wad.from_number(1000000)).transact()

        # Require to join the adapter
        assert c.gem.approve(
            c.adapter.address).transact(from_address=gal_address)

        # Liquidation Quantity at 100
        assert d.cat.file_lump(c.ilk, Wad.from_number(100)).transact()

    # mint dai for auction participant
    assert d.dai.mint(Wad.from_number(20000000)).transact()
    assert d.dai.transfer(other_address, Wad.from_number(10000000)).transact()

    return d
Esempio n. 3
0
def d(web3, our_address, keeper_address, gal_address):
    # dss = """
    # {"MCD_VAT": "0x08a3a91978B277c5797747A3671bDb6eE86e900E", "MCD_VOW": "0x7ef07c8DfddEECC23D50672b09310e45C8692ad2", "MCD_DRIP": "0xdc127E4DfF5F68740B8e21dEA687A4C3C690c176", "MCD_PIT": "0xaccbA2bB146405241507D7F3e39B85C5d1179d2B", "MCD_CAT": "0x41541A8692e00b9F5db706305dA1ee395Ba4680E", "MCD_FLOP": "0x5958E69d5795823F0F84b2ccbCE8D210cb67f418", "MCD_DAI": "0x787Cb94B57C23b9617265F1a6B80569d10dAaa42", "MCD_JOIN_DAI": "0xCc13a1a2E5AE9F6eC05CA7aF762967c5BD1Dd53f", "MCD_MOVE_DAI": "0x18792385d6c9AE2236cAc48473eb30D7d669BfFC", "MCD_GOV": "0xbE8Ae37bE4a1b1e22bAFD0cDdD921bc8FD5aD134", "COLLATERALS": ["WETH"], "WETH": "0x4Cdd635f050f9ca5bD7533D8c86044c4B86339A5", "MCD_JOIN_WETH": "0x050B6E24a805A027E3a31e7D4dE7E79A88A84e6D", "MCD_MOVE_WETH": "0x2ae154E870F53AC72f0D2E39FA2bb3a812b6A55d", "MCD_FLIP_WETH": "0x0953b1f31BBFA2633d7Ec92eb0C16511269aD4d0", "MCD_SPOT_WETH": "0x3731b266f67A9307CfaC6407D893070944F0684F", "PIP_WETH": "0x4C4EC6939152E7cD455D6586BC3eb5fF22ED94BE"}
    # """
    # return DssDeployment.from_json(web3=web3, conf=dss)
    d = DssDeployment.deploy(web3=web3, debt_ceiling=Wad.from_number(100000000))
    c = d.collaterals[0]
    assert d.pit.file_line(c.ilk, Wad.from_number(100000000)).transact()  # Set collateral debt ceiling
    assert d.cat.file_lump(c.ilk, Wad.from_number(100)).transact()  # Set liquidation Quantity of c at 100

    # mint gem for cdp frob() by gal_address and our_address to draw dai
    assert c.gem.mint(Wad.from_number(2000000)).transact()
    assert c.gem.transfer(gal_address, Wad.from_number(1000000)).transact()

    # Require to join the adapter
    assert c.gem.approve(c.adapter.address).transact()
    assert c.gem.approve(c.adapter.address).transact(from_address=gal_address)

    # draw dai for our_address
    assert c.adapter.join(Urn(our_address), Wad.from_number(1000000)).transact()
    assert d.pit.frob(c.ilk, Wad.from_number(1000000), Wad.from_number(1000000)).transact()
    assert d.dai_move.move(our_address, keeper_address, Wad.from_number(10000)).transact()

    return d
Esempio n. 4
0
def d(web3):
    deployment = DssDeployment.deploy(web3=web3,
                                      debt_ceiling=Wad.from_number(1000000))
    for c in deployment.collaterals:
        assert c.gem.mint(Wad.from_number(1000)).transact()
    return deployment