Update order

This commit is contained in:
Mubaris NK 2021-01-09 19:05:14 +05:30
parent 70e3bc6348
commit b9778e822c
No known key found for this signature in database
GPG Key ID: 1F132294E8700320

View File

@ -494,10 +494,12 @@ contract Helpers is DSMath {
}
function transferFees(address token, uint feeAmt) internal {
if (token == getEthAddr()) {
feeCollector.transfer(feeAmt);
} else {
IERC20(token).safeTransfer(feeCollector, feeAmt);
if (feeAmt > 0) {
if (token == getEthAddr()) {
feeCollector.transfer(feeAmt);
} else {
IERC20(token).safeTransfer(feeCollector, feeAmt);
}
}
}
}
@ -992,12 +994,13 @@ contract MakerHelpers is AaveV2Helpers {
makerData.daiJoin = getMcdDaiJoin();
makerData.vatContract = VatLike(managerContract.vat());
transferFees(address(makerData.tokenContract), collateralFeeAmt);
if (address(makerData.tokenContract) == getWethAddr()) {
makerData.tokenContract.deposit.value(_collateralAmt)();
}
transferFees(address(makerData.tokenContract), collateralFeeAmt);
transferFees(getMcdDai(), debtFeeAmt);
makerData.tokenContract.approve(address(makerData.colAddr), _collateralAmt);
makerData.tokenJoinContract.join(urn, _collateralAmt);