Skip to content

Instantly share code, notes, and snippets.

@sekrystal
Created March 20, 2023 18:41
Show Gist options
  • Save sekrystal/7a11bc8f5c5141c7586facf7d7fa67d1 to your computer and use it in GitHub Desktop.
Save sekrystal/7a11bc8f5c5141c7586facf7d7fa67d1 to your computer and use it in GitHub Desktop.
Defi Lending Concepts 2
pragma solidity ^0.8.13;
function bark(bytes32 ilk, address urn, address kpr) external returns (uint256 id) {
require(live == 1, "Dog/not-live");
(uint256 ink, uint256 art) = vat.urns(ilk, urn);
Ilk memory milk = ilks[ilk];
uint256 dart;
uint256 rate;
uint256 dust;
{
uint256 spot;
(,rate, spot,, dust) = vat.ilks(ilk);
require(spot > 0 && mul(ink, spot) < mul(art, rate), "Dog/not-unsafe");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment