mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
Removed MKR allowance code.
This commit is contained in:
parent
d4609eedd6
commit
b8e93dbe6e
|
@ -219,14 +219,10 @@ contract Helpers is DSMath {
|
||||||
* @dev handling stability fees payment
|
* @dev handling stability fees payment
|
||||||
*/
|
*/
|
||||||
function handleGovFee(TubInterface tub, uint saiDebtFee) internal {
|
function handleGovFee(TubInterface tub, uint saiDebtFee) internal {
|
||||||
address _otc = getUniswapMKRExchange();
|
|
||||||
(bytes32 val, bool ok) = tub.pep().peek();
|
(bytes32 val, bool ok) = tub.pep().peek();
|
||||||
if (ok && val != 0) {
|
if (ok && val != 0) {
|
||||||
uint govAmt = wdiv(saiDebtFee, uint(val)); // Fees in MKR
|
uint govAmt = wdiv(saiDebtFee, uint(val)); // Fees in MKR
|
||||||
uint saiGovAmt = getDAIRequired(govAmt); // get price
|
uint saiGovAmt = getDAIRequired(govAmt); // get price
|
||||||
if (tub.sai().allowance(address(this), _otc) != uint(-1)) {
|
|
||||||
tub.sai().approve(_otc, uint(-1));
|
|
||||||
}
|
|
||||||
tub.sai().transferFrom(msg.sender, address(this), saiGovAmt);
|
tub.sai().transferFrom(msg.sender, address(this), saiGovAmt);
|
||||||
swapMKR(tub, saiGovAmt); // swap DAI with MKR
|
swapMKR(tub, saiGovAmt); // swap DAI with MKR
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user