Skip to content

Instantly share code, notes, and snippets.

View serapath's full-sized avatar
💔
Github was acquired

Alexander Praetorius serapath

💔
Github was acquired
View GitHub Profile
@serapath
serapath / merkleproof.js
Created May 10, 2021 22:21
merkle proof
/******************************************************************************
MERKLE PROOF
*******************************************************************************
EXAMPLE 1: (as a regular indexed tree)
,---0 = 0000 0000 0000 0000 // LVL_0 : 0 + 2 * 0 (chunk 0)
,---1 = 0000 0000 0000 0001 // LVL_1 : 1 + 4 * 0 (chunk 1)
| `---2 = 0000 0000 0000 0010 // LVL_0 : 0 + 2 * 1 (chunk 2)
|
,---3 = 0000 0000 0000 0011 // LVL_2 : 3 + 8 * 0 (chunk 3)
@serapath
serapath / Escrow.sol
Created October 30, 2018 00: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.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
contract Escrow {
address public buyer;
address public seller;
address public arbiter;
uint256 public escrowAmount;
constructor(address _buyer, address _arbiter, uint256 _escrowAmount) public {
@serapath
serapath / Escrow.sol
Created October 30, 2018 00:47
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.25;
contract Escrow {
address public buyer;
address public seller;
address public arbiter;
uint256 public escrowAmount;
constructor(address _buyer, address _arbiter, uint256 _escrowAmount) public {
@serapath
serapath / Escrow.sol
Created October 30, 2018 00: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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
contract Escrow {
address public buyer;
address public seller;
address public arbiter;
uint256 public escrowAmount;
constructor(address _buyer, address _arbiter, uint256 _escrowAmount) public {
@serapath
serapath / Escrow.sol
Created October 30, 2018 00:33
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.25;
contract Escrow {
address public buyer;
address public seller;
address public arbiter;
uint256 public escrowAmount;
constructor(address _buyer, address _arbiter, uint256 _escrowAmount) public {
@serapath
serapath / AwardToken.sol
Last active March 27, 2022 11: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.23+commit.124ca40d.js&optimize=false&gist=
import "github/OpenZeppelin/zeppelin-solidity/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);
@serapath
serapath / AwardToken.sol
Created May 3, 2018 07:36
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.23+commit.124ca40d.js&optimize=false&gist=
import "github/OpenZeppelin/zeppelin-solidity/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);
@serapath
serapath / AwardToken.sol
Created May 3, 2018 07: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.23+commit.124ca40d.js&optimize=false&gist=
import "github/OpenZeppelin/zeppelin-solidity/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);
@serapath
serapath / AwardToken.sol
Created May 3, 2018 07:31
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.23+commit.124ca40d.js&optimize=false&gist=
import "github/OpenZeppelin/zeppelin-solidity/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);
@serapath
serapath / AwardToken.sol
Created May 3, 2018 00:44
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.23+commit.124ca40d.js&optimize=false&gist=
import "github/OpenZeppelin/zeppelin-solidity/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);