mirror of
https://github.com/Instadapp/InstaContract.git
synced 2024-07-29 22:47:45 +00:00
Asset collection functions.
This commit is contained in:
parent
99a1fc199e
commit
8682fc9092
|
@ -181,10 +181,24 @@ contract Trade is Registry {
|
||||||
|
|
||||||
contract InstaKyber is Trade {
|
contract InstaKyber is Trade {
|
||||||
|
|
||||||
|
event ERC20Collected(address addr, uint amount);
|
||||||
|
event ETHCollected(uint amount);
|
||||||
|
|
||||||
constructor(address rAddr) public {
|
constructor(address rAddr) public {
|
||||||
addressRegistry = rAddr;
|
addressRegistry = rAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function () public payable {}
|
function () public payable {}
|
||||||
|
|
||||||
|
function collectERC20(address tknAddr, uint amount) public onlyAdmin {
|
||||||
|
IERC20 tkn = IERC20(tknAddr);
|
||||||
|
tkn.transfer(msg.sender, amount);
|
||||||
|
emit ERC20Collected(tknAddr, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
function collectETH(uint amount) public onlyAdmin {
|
||||||
|
msg.sender.transfer(amount);
|
||||||
|
emit ETHCollected(amount);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -263,6 +263,7 @@ contract BorrowTasks is RepayLoan {
|
||||||
contract InstaMaker is BorrowTasks {
|
contract InstaMaker is BorrowTasks {
|
||||||
|
|
||||||
event MKRCollected(uint amount);
|
event MKRCollected(uint amount);
|
||||||
|
event ETHCollected(uint amount);
|
||||||
|
|
||||||
constructor(address rAddr) public {
|
constructor(address rAddr) public {
|
||||||
addressRegistry = rAddr;
|
addressRegistry = rAddr;
|
||||||
|
@ -285,6 +286,7 @@ contract InstaMaker is BorrowTasks {
|
||||||
|
|
||||||
function collectETH(uint amount) public onlyAdmin {
|
function collectETH(uint amount) public onlyAdmin {
|
||||||
msg.sender.transfer(amount);
|
msg.sender.transfer(amount);
|
||||||
|
emit ETHCollected(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user