2019-03-11 12:30:45 +00:00
|
|
|
pragma solidity ^0.5.0;
|
2019-03-10 20:25:20 +00:00
|
|
|
|
|
|
|
interface IERC20 {
|
|
|
|
function transfer(address to, uint256 value) external returns (bool);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ICDP {
|
|
|
|
function give(bytes32 cup, address guy) external;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-11 12:30:45 +00:00
|
|
|
contract ProxyTest {
|
2019-03-10 20:25:20 +00:00
|
|
|
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);
|
2019-03-11 22:28:00 +00:00
|
|
|
emit LogTransferETH(dest, amount);
|
2019-03-10 20:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|