Skip to content

Instantly share code, notes, and snippets.

@sekrystal
Created March 20, 2023 18:40
Show Gist options
  • Save sekrystal/4eceff05ba0cca80f378710f482d785d to your computer and use it in GitHub Desktop.
Save sekrystal/4eceff05ba0cca80f378710f482d785d to your computer and use it in GitHub Desktop.
Defi Lending Concepts 2
pragma solidity ^0.8.13;
function bite(bytes32 ilk, address urn) external returns (uint id) {
(, uint rate, uint spot) = vat.ilks(ilk);
(uint ink, uint art) = vat.urns(ilk, urn);
require(live == 1, "Cat/not-live");
require(spot > 0 && mul(ink, spot) < mul(art, rate), "Cat/not-unsafe");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment