From 23afda5f44e8773e994df9266b4324719a71b0f0 Mon Sep 17 00:00:00 2001 From: Sowmayjain Date: Mon, 11 Mar 2019 01:55:20 +0530 Subject: [PATCH] added default logic proxy --- ProxyLogics/default.sol | 35 +++++++++++++++++++++++++++++++++++ ProxyLogics/sendETH.sol | 13 ------------- 2 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 ProxyLogics/default.sol delete mode 100644 ProxyLogics/sendETH.sol diff --git a/ProxyLogics/default.sol b/ProxyLogics/default.sol new file mode 100644 index 0000000..d5f22b0 --- /dev/null +++ b/ProxyLogics/default.sol @@ -0,0 +1,35 @@ +pragma solidity ^0.4.23; + + +interface IERC20 { + function transfer(address to, uint256 value) external returns (bool); +} + +interface ICDP { + function give(bytes32 cup, address guy) external; +} + +contract ProxyTest { + + event LogTransferETH(address dest, uint amount); + event LogTransferERC20(address token, address dest, uint amount); + event LogTransferCDP(address dest, uint num); + + function transferETH(address dest, uint amount) public payable { + dest.transfer(amount); + emit LogTransferETH(dest, amount); + } + + function transferERC20(address tokenAddr, address dest, address amount) public { + IERC20 tkn = IERC20(tokenAddr); + tkn.transfer(dest, amount); + emit LogTransferERC20(tokenAddr, dest, amount); + } + + function transferCDP(address tub, address dest, uint num) public { + ICDP loanMaster = ICDP(tub); + loanMaster.give(bytes32(num), dest); + emit LogTransferCDP(dest, num); + } + +} \ No newline at end of file diff --git a/ProxyLogics/sendETH.sol b/ProxyLogics/sendETH.sol deleted file mode 100644 index 38ea87f..0000000 --- a/ProxyLogics/sendETH.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity ^0.4.23; - - -contract ProxyTest { - - event ETHSent(uint amt); - - function sendETH() public payable { - address(msg.sender).transfer(msg.value); - emit ETHSent(msg.value); - } - -} \ No newline at end of file