Merge branch 'new-tests' of https://github.com/Instadapp/dsa-polygon-migration into new-tests

This commit is contained in:
Thrilok Kumar 2021-04-16 22:28:36 +05:30
commit b2cfa3f523
3 changed files with 9 additions and 13 deletions

View File

@ -68,9 +68,9 @@ abstract contract Helpers is Stores, DSMath, Variables {
if (data.atokenBal < data.supplyAmt) {
uint _reqAmt = data.supplyAmt - data.atokenBal;
uint num = _reqAmt/data.tokenLiq + 1; // TODO: Is this right
uint splitAmt = _reqAmt/num; // TODO: Check decimal
uint finalSplit = _reqAmt - (splitAmt * (num - 1)); // TODO: to resolve upper decimal error
uint num = _reqAmt/data.tokenLiq + 1;
uint splitAmt = _reqAmt/num;
uint finalSplit = _reqAmt - (splitAmt * (num - 1));
_tokenContract.approve(address(aave), _reqAmt);
for (uint j = 0; j < num; j++) {
@ -97,10 +97,9 @@ abstract contract Helpers is Stores, DSMath, Variables {
(data.tokenLiq,,,,,,,,,) = aaveData.getReserveData(data.token);
data.borrowAmt = borrowAmts[i];
// TODO: Check number of loops needed. Borrow and supply on user's account.
uint num = data.borrowAmt/data.tokenLiq + 1; // TODO: Is this right
uint splitAmt = data.borrowAmt/num; // TODO: Check decimal
uint finalSplit = data.borrowAmt - (splitAmt * (num - 1)); // TODO: to resolve upper decimal error
uint num = data.borrowAmt/data.tokenLiq + 1;
uint splitAmt = data.borrowAmt/num;
uint finalSplit = data.borrowAmt - (splitAmt * (num - 1));
uint spellsAmt = num <= 1 ? (2 * (num + 1)) : (2 * (num + 1)) + 1;
string[] memory targets = new string[](spellsAmt);

View File

@ -143,10 +143,9 @@ abstract contract Helpers is DSMath, Stores, Variables {
}
function convertTo18(uint amount, uint decimal) internal pure returns (uint) {
return amount * (10 ** (18 - decimal)); // TODO: verify this
return amount * (10 ** (18 - decimal));
}
// TODO: need to verify this throughly
/*
* Checks the position to migrate should have a safe gap from liquidation
*/

View File

@ -88,14 +88,12 @@ contract Variables {
/**
* @dev This will be used to have debt/collateral ratio always 20% less than liquidation
*/
// TODO @KaymasJain: Is this number correct for it?
uint public safeRatioGap = 800000000000000000; // 20%?
uint public safeRatioGap = 800000000000000000; // 80%
/**
* @dev fee on collateral
*/
// TODO @KaymasJain: Is this number correct for it?
uint public fee = 998000000000000000; // 0.2% (99.8%) on collateral? TODO: Is this right?
uint public fee = 998000000000000000; // 0.2% (99.8%) on collateral
/**
* @dev Mapping of supported token