mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
borrow and send implemented
This commit is contained in:
parent
f9a33dc7f6
commit
a01b9c0370
|
@ -117,6 +117,7 @@ contract CDPResolver is Helpers {
|
||||||
event LogLock(uint cdpNum, uint amtETH, uint amtPETH, address owner);
|
event LogLock(uint cdpNum, uint amtETH, uint amtPETH, address owner);
|
||||||
event LogFree(uint cdpNum, uint amtETH, uint amtPETH, address owner);
|
event LogFree(uint cdpNum, uint amtETH, uint amtPETH, address owner);
|
||||||
event LogDraw(uint cdpNum, uint amtDAI, address owner);
|
event LogDraw(uint cdpNum, uint amtDAI, address owner);
|
||||||
|
event LogDrawSend(uint cdpNum, uint amtDAI, address to);
|
||||||
event LogWipe(uint cdpNum, uint daiAmt, uint mkrFee, uint daiFee, address owner);
|
event LogWipe(uint cdpNum, uint daiAmt, uint mkrFee, uint daiFee, address owner);
|
||||||
event LogShut(uint cdpNum);
|
event LogShut(uint cdpNum);
|
||||||
|
|
||||||
|
@ -208,6 +209,19 @@ contract CDPResolver is Helpers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function drawSend(uint cdpNum, uint _wad, address to) public {
|
||||||
|
bytes32 cup = bytes32(cdpNum);
|
||||||
|
if (_wad > 0) {
|
||||||
|
TubInterface tub = TubInterface(getSaiTubAddress());
|
||||||
|
|
||||||
|
tub.draw(cup, _wad);
|
||||||
|
tub.sai().transfer(to, _wad);
|
||||||
|
|
||||||
|
emit LogDraw(cdpNum, _wad, address(this));
|
||||||
|
emit LogDrawSend(cdpNum, _wad, to);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function wipe(uint cdpNum, uint _wad) public {
|
function wipe(uint cdpNum, uint _wad) public {
|
||||||
if (_wad > 0) {
|
if (_wad > 0) {
|
||||||
TubInterface tub = TubInterface(getSaiTubAddress());
|
TubInterface tub = TubInterface(getSaiTubAddress());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user