Also, I don't understand its implementation. Why don't it uses the collRatioOf function and just checks if it's smaller than the minCR?
The current implementation:
function liquidatable(uint256 _tokenId) public view override returns (bool) {
Position memory position = positionFromTokenId[_tokenId];
return _liquidatable(positionValueInETH(_tokenId), debtOfInETH(_tokenId),
riskConstantsFromPool[position.poolAddress].minCR);
}
Could be replaced (The tests still work) by:
function liquidatable(uint256 _tokenId) public view override returns (bool) {
Position memory position = positionFromTokenId[_tokenId];
return collRatioOf(_tokenId) < riskConstantsFromPool[position.poolAddress].minCR;
}
I don't see the point of this function.
Also, I don't understand its implementation. Why don't it uses the collRatioOf function and just checks if it's smaller than the minCR?
The current implementation: function liquidatable(uint256 _tokenId) public view override returns (bool) { Position memory position = positionFromTokenId[_tokenId]; return _liquidatable(positionValueInETH(_tokenId), debtOfInETH(_tokenId), riskConstantsFromPool[position.poolAddress].minCR); }
Could be replaced (The tests still work) by: function liquidatable(uint256 _tokenId) public view override returns (bool) { Position memory position = positionFromTokenId[_tokenId]; return collRatioOf(_tokenId) < riskConstantsFromPool[position.poolAddress].minCR; }