added default logic proxy

This commit is contained in:
Sowmayjain 2019-03-11 01:55:20 +05:30
parent 2e1567b76e
commit 23afda5f44
2 changed files with 35 additions and 13 deletions

35
ProxyLogics/default.sol Normal file
View File

@ -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);
}
}

View File

@ -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);
}
}