Skip to content

Instantly share code, notes, and snippets.

@annu18priya
annu18priya / TestToken.sol
Created August 14, 2018 13:32
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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
// https://medium.com/coinmonks/create-your-own-cryptocurrency-in-ethereum-blockchain-40865db8a29f
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
@annu18priya
annu18priya / TestToken.sol
Created August 14, 2018 11: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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
// https://medium.com/coinmonks/create-your-own-cryptocurrency-in-ethereum-blockchain-40865db8a29f
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
@annu18priya
annu18priya / TestToken.sol
Created August 14, 2018 08: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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
@annu18priya
annu18priya / ERC20.sol
Created August 13, 2018 13:52
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.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
interface ERC20 {
function totalSupply() public view returns (uint256 totalSupply); //[Get the total token supply]
function balanceOf(address _owner) public view returns (uint256 balance); //[Get the account balance of another account with address _owner]
function transfer(address _to, uint256 _value) public returns (bool success); //[Send _value amount of tokens to address _to]
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); //[Send _value amount of tokens from address _from to address _to]
function approve(address _spender, uint256 _value) public returns (bool success); //[Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value]
function allowance(address _owner, address _spender) public view returns (uint256 remaining); //[Returns the amount which _spender is still allowed to withdraw from _owner]
@annu18priya
annu18priya / ERC20.sol
Created August 13, 2018 13:35
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.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
interface ERC20 {
function totalSupply() public view returns (uint256 totalSupply); //[Get the total token supply]
function balanceOf(address _owner) public view returns (uint256 balance); //[Get the account balance of another account with address _owner]
function transfer(address _to, uint256 _value) public returns (bool success); //[Send _value amount of tokens to address _to]
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); //[Send _value amount of tokens from address _from to address _to]
function approve(address _spender, uint256 _value) public returns (bool success); //[Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value]
function allowance(address _owner, address _spender) public view returns (uint256 remaining); //[Returns the amount which _spender is still allowed to withdraw from _owner]
@annu18priya
annu18priya / ballot.sol
Created August 13, 2018 09:41
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.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@annu18priya
annu18priya / ballot.sol
Created August 13, 2018 09: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.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@annu18priya
annu18priya / DataTypes.sol
Created August 10, 2018 13:18
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=false&gist=
pragma solidity ^0.4.0;
contract DataType {
bool myBool = false;
int8 myInt = -128;
uint8 myUint = 255;
string myString;
uint8[] myStringArr;
@annu18priya
annu18priya / DataTypes.sol
Created August 10, 2018 11:03
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=false&gist=
pragma solidity ^0.4.0;
contract DataType {
bool myBool = false;
int8 myInt = -128;
uint8 myUint = 255;
string myString;
uint8[] myStringArr;
@annu18priya
annu18priya / DataTypes.sol
Created August 10, 2018 08:52
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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract DataType {
bool myBool = false;
int8 myInt = -128;
uint8 myUint = 255;
string myString;
uint8[] myStringArr;