Last active
May 14, 2020 16:44
-
-
Save anubhavgirdhar/1975a515e8d9b6e76e5956c024899e30 to your computer and use it in GitHub Desktop.
Smart Contract for depositing Eth into Compound
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
interface CtokenInterface { | |
function mint() external payable; | |
function transfer(address, uint256) external returns (bool); | |
function balanceOf(address owner) external view returns (uint256); | |
} | |
contract Zap{ | |
address cEthAddress = 0xf92FbE0D3C0dcDAE407923b2Ac17eC223b1084E4; | |
CtokenInterface cEth = CtokenInterface(cEthAddress); | |
function deposit() external payable { | |
cEth.mint.value(msg.value)(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment