-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: emergency liquidator draft #6
Conversation
contracts/EmergencyLiquidator.sol
Outdated
/// @dev Returns whether the msg.sender can liquidate in lieu of policy | ||
function _isPolicyWaived(address account) internal view returns (bool) { | ||
return isWhitelisted[account] | ||
&& block.timestamp > lastWhitelistedPolicyWaivedTimestamp + whitelistedPolicyWaiveDuration; |
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.
It seems that these 2 vars could be combined into one allowedPublicLiquidationsTill
, which could be set as block.timestamp + duration
/// whitelisted addresses | ||
bool public whitelistedOnlyWithLoss; | ||
/// @notice Map to substitute prices of tokens with other tokens, for policy checks | ||
mapping(address => address) public priceAlias; |
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.
No method to get all set aliases in a call
contracts/EmergencyLiquidator.sol
Outdated
@@ -46,13 +57,21 @@ contract EmergencyLiquidator is ACLNonReentrantTrait, IEmergencyLiquidatorExcept | |||
/// @notice Whether the address is a trusted account capable of doing whitelist-only actions | |||
mapping(address => bool) public isWhitelisted; |
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.
It's better to use EnumerableSet.Address to get all whitelisted liquidators
contracts/EmergencyLiquidator.sol
Outdated
address creditManager, | ||
address creditAccount, | ||
MultiCall[] calldata calls | ||
) external whitelistedOnly { |
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.
Porbably, it's good to make the contract pausable to block all liquidations if needed
No description provided.