mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
cut implemented
This commit is contained in:
parent
3969d4af74
commit
39cbd004e8
|
@ -602,16 +602,10 @@ contract Save is SaveResolver {
|
||||||
uint thisBalance = address(this).balance;
|
uint thisBalance = address(this).balance;
|
||||||
free(cdpID, colToFree);
|
free(cdpID, colToFree);
|
||||||
uint destAmt = saveSwap(colToFree, daiDebt);
|
uint destAmt = saveSwap(colToFree, daiDebt);
|
||||||
// uint destAmt = KyberInterface(getAddressKyber()).trade.value(colToFree)(
|
uint cut = wmul(destAmt, 2000000000000000);
|
||||||
// getAddressETH(),
|
TokenInterface(getAddressDAI()).transfer(getAddressAdmin(), cut);
|
||||||
// colToFree,
|
uint wipeAmt = sub(destAmt, cut);
|
||||||
// getAddressDAI(),
|
wipe(cdpID, wipeAmt);
|
||||||
// address(this),
|
|
||||||
// daiDebt,
|
|
||||||
// 0,
|
|
||||||
// getAddressAdmin()
|
|
||||||
// );
|
|
||||||
wipe(cdpID, destAmt);
|
|
||||||
|
|
||||||
if (thisBalance < address(this).balance) {
|
if (thisBalance < address(this).balance) {
|
||||||
uint balToLock = sub(address(this).balance, thisBalance);
|
uint balToLock = sub(address(this).balance, thisBalance);
|
||||||
|
@ -641,7 +635,10 @@ contract Save is SaveResolver {
|
||||||
debtToBorrow = daiToSwap;
|
debtToBorrow = daiToSwap;
|
||||||
}
|
}
|
||||||
draw(cdpID, debtToBorrow);
|
draw(cdpID, debtToBorrow);
|
||||||
uint destAmt = loopSwap(debtToBorrow);
|
uint cut = wmul(debtToBorrow, 2000000000000000);
|
||||||
|
uint swapAmt = sub(debtToBorrow, cut);
|
||||||
|
TokenInterface(getAddressDAI()).transfer(getAddressAdmin(), cut);
|
||||||
|
uint destAmt = loopSwap(swapAmt);
|
||||||
lock(cdpID, destAmt);
|
lock(cdpID, destAmt);
|
||||||
|
|
||||||
emit LogLeverageCDP(cdpID, debtToBorrow, destAmt);
|
emit LogLeverageCDP(cdpID, debtToBorrow, destAmt);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user