示例#1
0
 def skim(self, ilk: Ilk, address: Address) -> Transact:
     """Cancels undercollateralized CDP debt to determine collateral shortfall"""
     assert isinstance(ilk, Ilk)
     assert isinstance(address, Address)
     return Transact(self, self.web3, self.abi, self.address,
                     self._contract, 'skim',
                     [ilk.toBytes(), address.address])
示例#2
0
    def open(self, ilk: Ilk, address: Address) -> Transact:
        assert isinstance(ilk, Ilk)
        assert isinstance(address, Address)

        return Transact(self, self.web3, self.abi, self.address,
                        self._contract, 'open',
                        [ilk.toBytes(), address.address])
示例#3
0
    def deploy(web3: Web3, vat: Address, ilk: Ilk, gem: Address):
        assert isinstance(web3, Web3)
        assert isinstance(vat, Address)
        assert isinstance(ilk, Ilk)
        assert isinstance(gem, Address)

        return GemMock(
            web3=web3,
            address=Contract._deploy(
                web3, GemMock.abi, GemMock.bin,
                [vat.address, ilk.toBytes(), gem.address]))
示例#4
0
 def cash(self, ilk: Ilk, dai: Wad):
     """Exchange an amount of dai (already `pack`ed in the `bag`) for collateral"""
     assert isinstance(ilk, Ilk)
     assert isinstance(dai, Wad)
     return Transact(self, self.web3, self.abi, self.address, self._contract, 'cash', [ilk.toBytes(), dai.value])
示例#5
0
 def flow(self, ilk: Ilk) -> Transact:
     """Calculate the `fix`, the cash price for a given collateral"""
     assert isinstance(ilk, Ilk)
     return Transact(self, self.web3, self.abi, self.address, self._contract, 'flow', [ilk.toBytes()])
示例#6
0
 def free(self, ilk: Ilk) -> Transact:
     """Releases excess collateral after `skim`ming"""
     assert isinstance(ilk, Ilk)
     return Transact(self, self.web3, self.abi, self.address, self._contract, 'free', [ilk.toBytes()])
示例#7
0
 def skip(self, ilk: Ilk, flip_id: int) -> Transact:
     """Cancel a flip auction and seize it's collateral"""
     assert isinstance(ilk, Ilk)
     assert isinstance(flip_id, int)
     return Transact(self, self.web3, self.abi, self.address, self._contract, 'skip', [ilk.toBytes(), flip_id])
示例#8
0
 def cage(self, ilk: Ilk) -> Transact:
     """Set the `cage` price for the collateral"""
     assert isinstance(ilk, Ilk)
     return Transact(self, self.web3, self.abi, self.address, self._contract, 'cage(bytes32)', [ilk.toBytes()])
示例#9
0
 def out(self, ilk: Ilk, address: Address) -> Wad:
     assert isinstance(ilk, Ilk)
     assert isinstance(address, Address)
     return Wad(self._contract.functions.out(ilk.toBytes(), address.address).call())
示例#10
0
 def fix(self, ilk: Ilk) -> Ray:
     """Final cash price for the collateral"""
     assert isinstance(ilk, Ilk)
     return Ray(self._contract.functions.fix(ilk.toBytes()).call())
示例#11
0
 def art(self, ilk: Ilk) -> Wad:
     """Total debt for the collateral"""
     assert isinstance(ilk, Ilk)
     return Wad(self._contract.functions.Art(ilk.toBytes()).call())
示例#12
0
 def gap(self, ilk: Ilk) -> Wad:
     """Collateral shortfall (difference of debt and collateral"""
     assert isinstance(ilk, Ilk)
     return Wad(self._contract.functions.gap(ilk.toBytes()).call())
示例#13
0
 def tag(self, ilk: Ilk) -> Ray:
     """Cage price for the collateral"""
     assert isinstance(ilk, Ilk)
     return Ray(self._contract.functions.tag(ilk.toBytes()).call())