Skip to content

Instantly share code, notes, and snippets.

View madhavanmalolan's full-sized avatar

Madhavan Malolan madhavanmalolan

View GitHub Profile
@madhavanmalolan
madhavanmalolan / contracts...subquest-dealing-with-money.sol
Created August 7, 2021 13:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract MyErc20 {
string NAME = "MyErc20TokensReallyLongName";
string SYMBOL = "M20";
mapping(address => uint) balances;
address deployer;
@madhavanmalolan
madhavanmalolan / contracts...subquest-dealing-with-money.sol
Created August 7, 2021 12:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract MyErc20 {
string NAME = "MyErc20TokensReallyLongName";
string SYMBOL = "M20";
mapping(address => uint) balances;
address deployer;
@madhavanmalolan
madhavanmalolan / contracts...subquest-dealing-with-money.sol
Created August 7, 2021 11:40
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract MyErc20 {
string NAME = "MyErc20TokensReallyLongName";
string SYMBOL = "M20";
mapping(address => uint) balances;
@madhavanmalolan
madhavanmalolan / contracts...subquest-dealing-with-money.sol
Created August 7, 2021 11:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// this line is added to create a gist. Empty file is not allowed.
@madhavanmalolan
madhavanmalolan / contracts...subquest-new-erc20.sol
Created August 7, 2021 10:54
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract MyErc20 {
string NAME = "MyErc20TokensReallyLongName";
string SYMBOL = "M20";
function name() public view returns (string memory){
return NAME;
}
function symbol() public view returns (string memory) {
@madhavanmalolan
madhavanmalolan / contracts...subquest-new-erc20.sol
Created August 7, 2021 10:06
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract MyErc20 {
function name() public view returns (string){
}
function symbol() public view returns (string) {
@madhavanmalolan
madhavanmalolan / contracts...subquest-add-compound.sol
Created August 5, 2021 18:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
function redeemUnderlying(uint amount) external returns (uint); // to withdraw from compound
@madhavanmalolan
madhavanmalolan / contracts...subquest-accepting-erc20.sol
Created August 5, 2021 05:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
@madhavanmalolan
madhavanmalolan / contracts...subquest-uniswap.sol
Created August 4, 2021 18:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
@madhavanmalolan
madhavanmalolan / contracts...subquest-transfer-from-erc20.sol
Created August 4, 2021 16:59
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound