-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epic: FiRMv2 #90
base: dev
Are you sure you want to change the base?
Epic: FiRMv2 #90
Conversation
interface IEscrow { | ||
function initialize(IERC20 _token, address beneficiary) external; | ||
function onDeposit() external; | ||
function onDepositCallBack() external returns(uint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this function?
interface IDebtManager { | ||
function debt(address borrower) external view returns(uint); | ||
function totalDebt() external view returns(uint); | ||
function dbrDeficit(address borrower) external view returns(uint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debt managers shouldn't have to deal with DBR and therefore this function shouldn't be on the interface. Maybe it can be replaced with a boolean inDeficit(address) returns (bool)
function which would be universal whether using DBR or not.
function dbrDeficit(address borrower) external view returns(uint); | ||
function increaseDebt(address borrower, uint amount) external; | ||
function decreaseDebt(address borrower, uint amount) external returns(uint); | ||
function replenish(address borrower, uint amount) external; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unused? imo replenishments can happen through the debt manager contract directly. Doesn't have to be done through the market anyway.
keccak256( | ||
abi.encode( | ||
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), | ||
keccak256(bytes("DBR MARKET")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keccak256(bytes("DBR MARKET")), | |
keccak256(bytes("FiRM MARKET")), |
function withdrawInternal(address from, address to, uint amount) internal { | ||
uint limit = getWithdrawalLimitInternal(from); | ||
require(limit >= amount, "Insufficient withdrawal limit"); | ||
require(dbr.deficitOf(from) == 0, "Can't withdraw with DBR deficit"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this rule still apply? I think it should be replaced with the user's debtManager's deficit instead, no?
* Liquidation incentive linearly increase as borrower collateral factor decreases * Liquidation fee linearly decreases as borrower collateral factor decreases * Remove collateral factor, instead add max liquidation amount
Base branch for firmv2