From 8682fc9092ef05ddc0d306d45a26c51b7d8afbe6 Mon Sep 17 00:00:00 2001 From: Sowmayjain Date: Fri, 30 Nov 2018 12:24:38 +0530 Subject: [PATCH] Asset collection functions. --- contracts/protocols/InstaKyber.sol | 14 ++++++++++++++ contracts/protocols/InstaMaker.sol | 2 ++ 2 files changed, 16 insertions(+) diff --git a/contracts/protocols/InstaKyber.sol b/contracts/protocols/InstaKyber.sol index d3a8091..53eadd0 100644 --- a/contracts/protocols/InstaKyber.sol +++ b/contracts/protocols/InstaKyber.sol @@ -181,10 +181,24 @@ contract Trade is Registry { contract InstaKyber is Trade { + event ERC20Collected(address addr, uint amount); + event ETHCollected(uint amount); + constructor(address rAddr) public { addressRegistry = rAddr; } 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); + } + } \ No newline at end of file diff --git a/contracts/protocols/InstaMaker.sol b/contracts/protocols/InstaMaker.sol index ad0643a..8d73ef6 100644 --- a/contracts/protocols/InstaMaker.sol +++ b/contracts/protocols/InstaMaker.sol @@ -263,6 +263,7 @@ contract BorrowTasks is RepayLoan { contract InstaMaker is BorrowTasks { event MKRCollected(uint amount); + event ETHCollected(uint amount); constructor(address rAddr) public { addressRegistry = rAddr; @@ -285,6 +286,7 @@ contract InstaMaker is BorrowTasks { function collectETH(uint amount) public onlyAdmin { msg.sender.transfer(amount); + emit ETHCollected(amount); } } \ No newline at end of file