mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
set fees function
This commit is contained in:
parent
a43a7ed802
commit
049ad9fb2a
|
@ -128,6 +128,7 @@ contract Helper is DSMath {
|
||||||
|
|
||||||
address public feeOne = 0xd8db02A498E9AFbf4A32BC006DC1940495b4e592;
|
address public feeOne = 0xd8db02A498E9AFbf4A32BC006DC1940495b4e592;
|
||||||
address public feeTwo = 0xa7615CD307F323172331865181DC8b80a2834324;
|
address public feeTwo = 0xa7615CD307F323172331865181DC8b80a2834324;
|
||||||
|
uint public fees = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev setting allowance to compound for the "user proxy" if required
|
* @dev setting allowance to compound for the "user proxy" if required
|
||||||
|
@ -490,6 +491,15 @@ contract LiquidityProvider is BridgeResolver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setFees(uint amt) public {
|
||||||
|
require(msg.sender == feeOne || msg.sender == feeTwo, "Not manager address");
|
||||||
|
if (amt > 3000000000000000) {
|
||||||
|
fees = 3000000000000000; // max fees 0.3%
|
||||||
|
} else {
|
||||||
|
fees = amt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -514,15 +524,15 @@ contract Bridge is LiquidityProvider {
|
||||||
uint ethAmt;
|
uint ethAmt;
|
||||||
(ethAmt, daiAmt) = checkCDP(bytes32(cdpId), ethCol, daiDebt);
|
(ethAmt, daiAmt) = checkCDP(bytes32(cdpId), ethCol, daiDebt);
|
||||||
daiAmt = wipeAndFree(cdpId, ethAmt, daiAmt);
|
daiAmt = wipeAndFree(cdpId, ethAmt, daiAmt);
|
||||||
uint fees = wmul(daiAmt, 2000000000000000); // 0.2% fees
|
uint cut = wmul(daiAmt, fees);
|
||||||
daiAmt = wmul(daiAmt, 1002000000000000000);
|
daiAmt = wmul(daiAmt, add(1000000000000000000, fees));
|
||||||
mintCETH(ethAmt);
|
mintCETH(ethAmt);
|
||||||
give(cdpId, msg.sender);
|
give(cdpId, msg.sender);
|
||||||
emit LogMakerToCompound(
|
emit LogMakerToCompound(
|
||||||
cdpId,
|
cdpId,
|
||||||
ethAmt,
|
ethAmt,
|
||||||
daiAmt,
|
daiAmt,
|
||||||
fees,
|
cut,
|
||||||
msg.sender
|
msg.sender
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -536,8 +546,8 @@ contract Bridge is LiquidityProvider {
|
||||||
fetchCETH(ethAmt);
|
fetchCETH(ethAmt);
|
||||||
redeemUnderlying(cEth, ethAmt);
|
redeemUnderlying(cEth, ethAmt);
|
||||||
uint cdpNum = cdpId > 0 ? cdpId : open();
|
uint cdpNum = cdpId > 0 ? cdpId : open();
|
||||||
uint fees = wmul(daiAmt, 2000000000000000); // 0.2% fees
|
uint cut = wmul(daiAmt, fees);
|
||||||
daiAmt = wmul(daiAmt, 1002000000000000000);
|
daiAmt = wmul(daiAmt, add(1000000000000000000, fees));
|
||||||
lockAndDraw(cdpNum, ethAmt, daiAmt);
|
lockAndDraw(cdpNum, ethAmt, daiAmt);
|
||||||
if (daiAmt > 0) {
|
if (daiAmt > 0) {
|
||||||
assert(CDAIInterface(cDai).mint(daiAmt) == 0);
|
assert(CDAIInterface(cDai).mint(daiAmt) == 0);
|
||||||
|
@ -547,7 +557,7 @@ contract Bridge is LiquidityProvider {
|
||||||
cdpNum,
|
cdpNum,
|
||||||
ethAmt,
|
ethAmt,
|
||||||
daiAmt,
|
daiAmt,
|
||||||
fees,
|
cut,
|
||||||
msg.sender
|
msg.sender
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user