Skip to content

Instantly share code, notes, and snippets.

@ryestew
ryestew / ballot.sol
Created October 2, 2018 16: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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / ballot.sol
Created October 2, 2018 16: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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / ballot.sol
Created October 2, 2018 16: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.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / AwardToken.sol
Created October 2, 2018 16:27
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.25+commit.59dbf8f1.js&optimize=false&gist=
import "github/OpenZeppelin/openzeppelin-zos/contracts/token/ERC20/MintableToken.sol";
import "gist/Ballot.sol";
contract AwardToken is MintableToken {
uint quantity;
uint ballotPeriod = 7 hours;
Ballot public currBallot;
address[] public prevWinners;
event log (string _msg);
event winLog (address _win);
@ryestew
ryestew / AwardToken.sol
Last active October 2, 2018 16:30
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.25+commit.59dbf8f1.js&optimize=false&gist=
import "github/OpenZeppelin/openzeppelin-zos/contracts/token/ERC20/MintableToken.sol";
import "gist/Ballot.sol";
contract AwardToken is MintableToken {
uint quantity;
uint ballotPeriod = 7 hours;
Ballot public currBallot;
address[] public prevWinners;
event log (string _msg);
event winLog (address _win);
@ryestew
ryestew / dependencies.js
Created October 29, 2018 10:49
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.25+commit.59dbf8f1.js&optimize=false&gist=
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol')
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol')
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol')
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol')
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol')
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/access/roles/MinterRole.sol')
@ryestew
ryestew / AwardToken.sol
Last active March 1, 2019 10:24
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;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol";
import "./Ballot.sol";
contract AwardToken is ERC20Mintable {
uint quantity;
uint ballotPeriod = 7 hours;
Ballot public currBallot;
address[] public prevWinners;
@ryestew
ryestew / ballot.sol
Last active July 10, 2019 14:58
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.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / AwardTokenData.sol
Last active July 11, 2019 13:26
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=
// this line is added to create a gist. Empty file is not allowed.
@ryestew
ryestew / ballot.sol
Last active July 23, 2019 09: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.1+commit.c8a2cb62.js&optimize=false&gist=
// this line is added to create a gist. Empty file is not allowed.