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])
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])
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]))
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])
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()])
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()])
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])
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()])
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())
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())
def art(self, ilk: Ilk) -> Wad: """Total debt for the collateral""" assert isinstance(ilk, Ilk) return Wad(self._contract.functions.Art(ilk.toBytes()).call())
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())
def tag(self, ilk: Ilk) -> Ray: """Cage price for the collateral""" assert isinstance(ilk, Ilk) return Ray(self._contract.functions.tag(ilk.toBytes()).call())