Skip to content

Instantly share code, notes, and snippets.

View kevindkim's full-sized avatar

Kevin D. Kim kevindkim

View GitHub Profile
pragma solidity ^0.5.8;
contract ERC20Interface {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
pragma solidity ^0.5.8;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
// File: contracts/ComptrollerInterface.sol
pragma solidity ^0.5.8;
interface ComptrollerInterface {
/**
* @notice Marker function used for light validation when updating the comptroller of a market
* @dev Implementations should simply return true.
* @return true
*/
@kevindkim
kevindkim / LenderContractWallet.sol
Created June 20, 2019 19:55
Contract wallet for Ethereum dApp that takes users' DAI or USDC and supplies to Compound v2 in exchange for cTokens
pragma solidity ^0.5.8;
import { CErc20, CToken, ReentrancyGuard } from "./CERC20.sol";
import { ERC20Interface } from "./ERC20.sol";
import "./SafeMath.sol";
/// @title Lender Contract Wallet
/// @author Tarik Bellamine & Kevin Kim
/// @notice The contract is intended to be used as a user contract wallet that will allow users to easily interact with Compound's money