Skip to content

Instantly share code, notes, and snippets.

@crypto-perry
crypto-perry / erc20controlled.sol
Created October 11, 2019 14:43
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.5.11+commit.c082d0b4.js&optimize=false&gist=
pragma solidity >=0.5.0;
import "./ierc20.sol";
// In fact this only implements the IERC20 transfer and trasnferFrom functions
// Except for that it allows users to withdraw money
contract ERC20Controlled is IERC20 {
string public constant name = "Controlled Token";
string public constant symbol = "CTRL";
uint256 private constant MASK_BUTLER = 1 << 0;
@crypto-perry
crypto-perry / erc20controlled.sol
Created October 8, 2019 02:42
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.5.11+commit.c082d0b4.js&optimize=true&gist=
pragma solidity >=0.5.0;
import "./ierc20.sol";
contract ERC20Controlled is IERC20 {
string public constant name = "ERC20ControlledToken";
string public constant symbol = "CTRL";
// The owner can set butlers and bots.
address private owner;
@crypto-perry
crypto-perry / erc20controlled.sol
Created October 8, 2019 02:17
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.5.11+commit.c082d0b4.js&optimize=true&gist=
pragma solidity >=0.5.0;
import "./ierc20.sol";
contract ERC20Controlled is IERC20 {
string public constant name = "ERC20ControlledToken";
string public constant symbol = "CTRL";
// The owner can set butlers and bots.
address private owner;
@crypto-perry
crypto-perry / erc20controlled.sol
Created October 7, 2019 15: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.5.11+commit.c082d0b4.js&optimize=true&gist=
pragma solidity >=0.5.0;
import "./ierc20.sol";
contract ERC20Controlled is IERC20 {
string public constant name = "ERC20ControlledToken";
string public constant symbol = "CTRL";
// The owner can set butlers and bots.
address private owner;
@crypto-perry
crypto-perry / Untitled.sol
Created October 4, 2019 15:08
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.5.11+commit.c082d0b4.js&optimize=false&gist=
/**
*Submitted for verification at Etherscan.io on 2019-07-29
*/
pragma solidity ^0.4.24;
contract UtilFairWin {
/* fairwin.me */
@crypto-perry
crypto-perry / Untitled.sol
Last active October 4, 2019 13: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.5.11+commit.c082d0b4.js&optimize=false&gist=
/**
*Submitted for verification at Etherscan.io on 2019-07-29
*/
pragma solidity ^0.4.24;
contract UtilFairWin {
/* fairwin.me */
@crypto-perry
crypto-perry / Untitled.sol
Created October 4, 2019 09:21
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.5.11+commit.c082d0b4.js&optimize=false&gist=
/**
*Submitted for verification at Etherscan.io on 2019-07-29
*/
pragma solidity ^0.4.24;
contract UtilFairWin {
/* fairwin.me */
@crypto-perry
crypto-perry / erc20openoffer.sol
Created September 16, 2019 13: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=undefined&optimize=true&gist=
pragma solidity >=0.5.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
@crypto-perry
crypto-perry / erc20options.sol
Created September 15, 2019 09:02
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.5.11+commit.c082d0b4.js&optimize=false&gist=
pragma solidity >=0.5.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
@crypto-perry
crypto-perry / erc20options.sol
Created August 19, 2019 14:16
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.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity >=0.5.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);