-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactors #152
base: develop
Are you sure you want to change the base?
Refactors #152
Conversation
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.
Reviewable status: 0 of 21 files reviewed, 4 unresolved discussions (waiting on @crisgarner)
contracts/IVaultHandler.sol
line 97 at r1 (raw file):
/// @notice Minimum amount of Index Tokens an user can mint uint256 public minimumMint = 0;
If I were reading this variable for the first time, it wouldn't be obvious to me.
I would either name this as minAmount
or minMintAmount
.
contracts/IVaultHandler.sol
line 152 at r1 (raw file):
/// @notice An event emitted when the minimum required Token is updated event NewMinimumMint(address indexed _owner, uint256 _minimumMint);
event NewMinimumMintAmount(address indexed _owner, uint256 _minimumMintAmount);
contracts/IVaultHandler.sol
line 220 at r1 (raw file):
* @param _ethOracle address * @param _treasury address * @param _minimumMint uint256
* @param _minMintAmount uint256
contracts/IVaultHandler.sol
line 573 at r1 (raw file):
* @notice Allow users to burn Index tokens to liquidate vaults with vault collateral ratio under the minimum ratio, the liquidator receives the staked collateral of the liquidated vault at a premium * @param _vaultId to liquidate * @param _maxIndex max amount of Index the liquidator is willing to pay to liquidate vault
* @param _maxIndexTokens max amount of Index tokens the liquidator is willing to pay to liquidate vault
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.
Overall looks good.
I just suggested some name suggestions.
uint256 req = requiredLiquidationTCAP(_vaultId); | ||
uint256 tcapPrice = TCAPPrice(); | ||
uint256 req = requiredLiquidationIndex(_vaultId); | ||
uint256 iPrice = indexPrice(); |
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.
uint256 iPrice = indexPrice(); | |
uint256 idxPrice = indexPrice(); |
iPrice
reads like inverse price to me.
public | ||
view | ||
virtual | ||
returns (uint256 amount) | ||
{ | ||
Vault memory vault = vaults[_vaultId]; | ||
uint256 tcapPrice = TCAPPrice(); | ||
uint256 iPrice = indexPrice(); |
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.
uint256 iPrice = indexPrice(); | |
uint256 idxPrice = indexPrice(); |
iPrice
reads like an inverse price to me.
* cdaf = Collateral Decimals adjustment Factor | ||
* cp = Collateral Price | ||
* r = Min Vault Ratio | ||
* p = Liquidation Penalty | ||
*/ | ||
function requiredLiquidationTCAP(uint256 _vaultId) | ||
function requiredLiquidationIndex(uint256 _vaultId) |
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.
Can we rename this function to ?
function requiredLiquidationIndex(uint256 _vaultId) | |
function requiredLiquidationAmount(uint256 _vaultId) |
@@ -749,44 +749,44 @@ abstract contract IVaultHandler is | |||
virtual | |||
returns (uint256 collateral) | |||
{ | |||
uint256 tcapPrice = TCAPPrice(); | |||
uint256 iPrice = indexPrice(); |
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.
uint256 iPrice = indexPrice(); | |
uint256 idxPrice = indexPrice(); |
/// @notice Minimum amount of TCAP an user can mint | ||
uint256 public minimumTCAP = 0; | ||
/// @notice Minimum amount of Index Tokens an user can mint | ||
uint256 public minimumMint = 0; |
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.
Can we rename this variable?
uint256 public minimumMint = 0; | |
uint256 public minimumMinAmount = 0; |
function setMinimumTCAP(uint256 _minimumTCAP) external virtual onlyOwner { | ||
minimumTCAP = _minimumTCAP; | ||
emit NewMinimumTCAP(msg.sender, _minimumTCAP); | ||
function setMinimumMint(uint256 _minimumMint) external virtual onlyOwner { |
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.
Can we rename this?
function setMinimumMint(uint256 _minimumMint) external virtual onlyOwner { | |
function setMinimumMintAmount(uint256 _minimumMintAmount) external virtual onlyOwner { |
This change is