Skip to content

Instantly share code, notes, and snippets.

@kyriediculous
kyriediculous / Crowdsale.sol
Last active January 22, 2018 22:05 — forked from anonymous/Crowdsale.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.10;
import 'gist/ERC223ReceivingContract.sol';
import 'gist/SafeMath.sol';
import 'gist/StandardToken.sol';
import 'gist/Ownable.sol';
contract Crowdsale is Ownable {
using SafeMath for uint;
pragma solidity ^0.4.10;
interface ERC223 {
function transfer(address to, uint value, bytes data) public;
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
}
pragma solidity ^0.4.10;
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public;
}
pragma solidity ^0.4.10;
import 'browser/SafeMath.sol';
import 'browser/ERC20.sol';
contract StandardToken is ERC20 {
using SafeMath for uint;
string internal _name;
string internal _symbol;
pragma solidity ^0.4.10;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
pragma solidity ^0.4.10;
interface ERC20 {
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 Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
@kyriediculous
kyriediculous / ERC20.sol
Last active December 24, 2017 22:31 — forked from anonymous/ERC20.sol
ERC223 with ERC20 backwards compatibility
pragma solidity ^0.4.10;
import 'browser/SafeMath.sol';
contract ERC20 {
uint256 public totalSupply;
function name() constant returns (string _name);
function symbol() constant returns (string _symbol);
function decimals() constant returns (uint8 _decimals);
function totalSupply() constant returns (uint256 _totalSupply);