pragma solidity ^0.4.24;

contract startUpFunding {
    
//DATA FOR PROJECT

    struct projectIdeas { //we require idProjectIdea
        string ideaGoal;
        address projectWallet; //we do not need this here ?
        string ideaDescription;
        string ideaDetails;
        string votes;
    }

    struct projects {
        string projectName;
        address projectWallet;
        string projectGit;
        string projectWhitePaper;
        string projectHash;
        uint256 projectDeadLine;
        projectIdeas projIdeas ; // we need mapping here for idProjectIdea ?
    }
    
    mapping(uint => projects) projectId;
    
    /// Set project data
    
    /// input data example: 0001,"FirstProject",0xca35b7d915458ef540ade6068dfe2f44e8fa733c,"git link","WhitePaper link","hash",1534499073

/*
//DATA FOR INVESTOR

- investorWallet (used to return ether if project doesn't get funding)
- investedIdea : struct
      - idProject
      - idProjectIdea
      - amount
*/
    
// PROJECT FUNCTIONS : begin

  
Aug 17, 2018 07:40:27 UTC
pragma solidity ^0.4.24;

contract startUpFunding {
    
//DATA FOR PROJECT

    struct projectIdeas {
        string ideaGoal;
        address projectWallet; //we do not need this here ?
        string ideaDescription;
        string ideaDetails;
        string votes;
    }

    struct projects {
        string projectName;
        address projectWallet;
        string projectGit;
        string projectWhitePaper;
        string projectHash;
        uint256 projectDeadLine;
        projectIdeas projIdeas ;
    }
    
    mapping(uint => projects) projectId;
    
    /// Set project data
    
    /// input data example: 0001,"FirstProject",0xca35b7d915458ef540ade6068dfe2f44e8fa733c,"git link","WhitePaper link","hash",1534499073

/*
//DATA FOR INVESTOR

- investorWallet (used to return ether if project doesn't get funding)
- investedIdea : struct
      - idProject
      - idProjectIdea
      - amount
*/
    
// PROJECT FUNCTIONS : begin

    function projectCreate(uint id, 
        string projectName,
        
Aug 17, 2018 07:32:14 UTC
pragma solidity ^0.4.24;

contract ProjectsData {
    
    struct projectIdeas {
        string ideaGoal;
        address projectWallet;
        string ideaDescription;
        string ideaDetails;
        string votes;
    }

    struct projects {
        string projectName;
        address projectWallet;
        string projectGit;
        string projectWhitePaper;
        string projectHash;
        uint256 projectDeadLine;
        projectIdeas projIdeas ;
    }
    
    mapping(uint => projects) projectId;
    
    /// Set project data
    
    /// input data example: 0001,"FirstProject",0xca35b7d915458ef540ade6068dfe2f44e8fa733c,"git link","WhitePaper link","hash",1534499073
    
    
    function projectCreate(uint id, 
        string projectName,
        address projectWallet,
        string projectGit,
        string projectWhitePaper,
        string projectHash,
        uint256 projectDeadLine) public returns(bool success) {
        projectId[id].projectName = projectName;
        projectId[id].project
Aug 17, 2018 07:20:08 UTC
pragma solidity ^0.4.24;

contract ProjectsData {
    
    struct projectIdeas {
        string ideaGoal;
        address projectWallet;
        string ideaDescription;
        string ideaDetails;
        string votes;
    }

    struct projects {
        string projectName;
        address projectWallet;
        string projectGit;
        string projectWhitePaper;
        string projectHash;
        uint256 projectDeadLine;
        projectIdeas projIdeas ;
    }
    
    mapping(uint => projects) projectId;
    
    /// Set project data
    
    /// input data example: 0001,"FirstProject",0xca35b7d915458ef540ade6068dfe2f44e8fa733c,"git link","WhitePaper link","hash",1534499073
    
    
    function projectCreate(uint id, 
        string projectName,
        address projectWallet,
        string projectGit,
        string projectWhitePaper,
        string projectHash,
        uint256 projectDeadLine) public returns(bool success) {
        projectId[id].projectName = projectName;
        projectId[id].project
Aug 16, 2018 23:00:02 UTC
// @dev add ascii art 

// 0xRACER is a brand new team-based pot lottery game. 
// In order to play, you must have a vanity address that starts with the same prefix as your team. 
// For example: 0xBEEF vs. 0xBABE.

// DISCLAIMER: This is an expiermental game in distributed psychology and distributed technology.
// DISCLAIMER: You can, and likely will, lose any ETH you send to this contract. Don't send more than you can afford to lose.

// RULES:

// 1. The team with the highest buy volume when the clock expires wins the pot.
// 2. The pot is divided among the winning team members, proportional to their share of team volume. 
// 3. Every new buy adds time to the clock at the rate of 1 second/finney. The timer is capped at 24h.
// 4. You can also reduce the clock at the rate of 1 second/finney, but this does not count towards your share. The timer can't go below 2 minutes with this method.
// 5. Referals and dividends are distributed by team. 20% of each new buy is proportionally split between that team's memb
Aug 16, 2018 20:27:06 UTC
pragma solidity ^0.4.23;

/**
 * The owned contract ensures that only the creator of a contract can perform certain tasks.
 */
contract owned {
    address public owner;

    /**
     * Sets the initator as the owner of the contract
     */
    constructor () {
        owner = msg.sender;
    }    

    /**
     * Checks or make sure that only the owner can call a function with this modifier
     */
    modifier onlyOwner { 
        require (msg.sender == owner); 
        _; 
    }

    /**
     * Transfer Ownership to `newOwner`
     * 
     * @param newOwner The new Owner of the contract
     */
    function transferOwnership (address newOwner) onlyOwner {
        owner = newOwner;
    }
}

/**
 * Receive message from the owner of balance to spend (approveAndCall)
 */
interface tokenRecipient { 
    function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}

/**
 * The EICToken contract is the Estate Invest Coin based on the ERC20 Token Standard
 */
contract EICTok
Aug 16, 2018 20:07:25 UTC
frackzip -b -l1-6 -u secret.zip

-b - brute-force
-l - długość hasła
-u - używa unzipa, żeby odsiać niepoprawne hasł
Aug 16, 2018 19:20:24 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
    
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 16, 2018 18:41:07 UTC
//by nightman
//2018.08.15  draft

pragma solidity ^0.4.24;

contract ZEROxRACER {

    //VARIABLES AND CONSTANTS

    //owner variables
    address public owner;
    uint256 public devFeeRate = 2; //2% 
    uint256 public devBalance;
    uint256 public precisionFactor = 6; //shares precise to 00.0001%

    //team variables
    string public teamOnePrefix; // eg 'dead';
    string public teamTwoPrefix; // eg 'beef';
    address private teamOneRefAddress; // eg 0xdead000000000000000000000000000000000000;
    address private teamTwoRefAddress; // eg 0xbeeF000000000000000000000000000000000000; reference address formated with correct checksums because solidity is finicky 
    uint256 public teamOneId = 1; 
    uint256 public teamTwoId = 2;

    //user variables
    address[] public teamOneMembers;
    mapping (address => bool) public isTeamOneMember;
    mapping (address => uint256) public teamOneStake;
    address[] public teamTwoMembers;
    mapping (address => bool) public isTeamTwoMember;
    mapping (address
Aug 16, 2018 01:30:56 UTC
pragma solidity ^0.4.13;

contract AssignmentTest {
    // state variables are enforced on "storage"
    uint256 stateValue;
    uint256[2] stateArray;
    uint256[2] stateArray_2;
    
    // function parameters allocated on "memory" by default
    function test(uint256 inValue, uint256[2] inArray) public {
        
        /*********************************************
         * value type assignments 
        **********************************************/        
        // below will NOT compile because data location can only used 
        // on reference type a.k.a struct/array
        // uint256 storage _local1; 
        // uint256 memory _local2;
        
        // local variable of value type allocated on "stack"
        uint256 localValue; 
        
        // copy by value between memory and stack
        localValue = inValue; 
        localValue = 1;
        assert(localValue != inValue);
        // copy by value between storage and stack
        stateValue = localValue; 
        stateValue = 2;
Aug 15, 2018 18:59:35 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 14, 2018 04:08:04 UTC
function callOperator(
        address _operator,
        address _from,
        address _to,
        uint256 _amount,
        bytes _userData,
        bytes _operatorData,
        bool _preventLocking
    ) private {
        address recipientImplementation = interfaceAddr(_to, "ERC777TokensOperator");
        if (recipientImplementation != 0) {
            ERC777TokensOperator(recipientImplementation).tokensReceived(
                _operator, _from, _to, _amount, _userData, _operatorData);
        } else if (_preventLocking) {
            require(isRegularAddress(_to));
        }
    
Aug 13, 2018 21:36:47 UTC
pragma solidity ^0.4.2;

contract Insurance {

    address[] recipients;
    uint totalPaidOut = 0;
    mapping (address => uint) withdrawAmounts;

    function InsurancePay() public payable {

    }

    function () public payable {
        updateTotalPaidOut();

    }

    function updateTotalPaidOut() internal {
        totalPaidOut += msg.value;
    }

    modifier canWithdraw() {
        bool contains = false;

        for(uint i = 0; i < recipients.length; i++) {
            if (recipients[i] == msg.sender) {
                contains = true;
            }
        }
        require(contains);
        _;
    }

    function withdraw() public canWithdraw {
        uint amountAllocated = totalPaidOut/recipients.length;
        uint amountWithdrawn = withdrawAmounts[msg.sender];
        uint amount = amountAllocated - amountWithdrawn;
        withdrawAmounts[msg.sender] = amountWithdrawn + amount;

        if (amount > 0) {
            msg.sender.transfer(amount);
        }
    }

Aug 13, 2018 19:00:38 UTC
pragma solidity ^0.4.24;

contract CrowdfundingFactory {
    address[] public deployedCrowdfunding;

    function createCrowdfunding(uint minimum) public {
        address newCrowdfunding = new Crowdfunding(minimum, msg.sender);
        deployedCrowdfunding.push(newCrowdfunding);
    }

    function getDeployedCrowdfunding() public view returns (address[]) {
        return deployedCrowdfunding;
    }

}

contract Crowdfunding {
    struct Request {
        string description;
        uint value;
        address recipient;
        bool isComplete;
        uint approvalCount;
        mapping(address => bool) approvals;
    }

    Request[] public requests;
    address public manager;
    uint public miniumContribution;
    mapping(address => bool) public approvers; // contributer
    uint public approversCount;

    modifier restricted() {
        require(msg.sender == manager);
        _;
    }

    constructor(uint minimum, address creator) public {
        manager = creator;
        miniumContribution = mini
Aug 13, 2018 16:19:29 UTC
Aug 13, 2018 13:25:23 UTC
pragma solidity ^0.4.24;

contract SimpleStore {
  function getArray() {
    // Instantiate a new array in memory with a length of 3
    uint[] memory values = new uint[](3);

    values.push(1);
    values.push(2);
    values.push(3);
  }
Aug 13, 2018 08:04:52 UTC
pragma solidity ^0.4.18;

contract SimpleStore {
  uint intval;

  function setIntval(uint _newVal) public view returns (uint) {
    intval = _newVal;

    return _newVal;
  }
Aug 13, 2018 06:09:27 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract SimpleStore {
  uint intval;

  function 
Aug 13, 2018 06:07:45 UTC
contract hackCoinFlip {
    CoinFlip public originalContract = CoinFlip("your instance address"); 
    uint256 FACTOR = 57896044618658097711785492504343953926634992332820282019728792003956564819968;

    function hackFlip(bool _guess) public {
        //TODO
    }
Aug 12, 2018 13:57:33 UTC
contract hackCoinFlip {
    CoinFlip public originalContract = CoinFlip("your instance address"); 
    uint256 FACTOR = 57896044618658097711785492504343953926634992332820282019728792003956564819968;

function hackFlip(bool _guess) public {
    
    // pre-deteremine the flip outcome
    uint256 blockValue = uint256(block.blockhash(block.number-1));
    uint256 coinFlip = blockValue / FACTOR;
    bool side = coinFlip == 1 ? true : false;

    // If I guessed correctly, submit my guess
    if (side == _guess) {
        originalContract.flip(_guess);
    } else {
    // If I guess incorrectly, submit the opposite
        originalContract.flip(!_guess);
    }
Aug 12, 2018 13:57:05 UTC
function hackFlip(bool _guess) public {
    
    // pre-deteremine the flip outcome
    uint256 blockValue = uint256(block.blockhash(block.number-1));
    uint256 coinFlip = blockValue / FACTOR;
    bool side = coinFlip == 1 ? true : false;

    // If I guessed correctly, submit my guess
    if (side == _guess) {
        originalContract.flip(_guess);
    } else {
    // If I guess incorrectly, submit the opposite
        originalContract.flip(!_guess);
    }
Aug 12, 2018 13:55:27 UTC
function hackFlip(bool _guess) public {
    
    // pre-deteremine the flip outcome
    uint256 blockValue = uint256(block.blockhash(block.number-1));
    uint256 coinFlip = blockValue / FACTOR;
    bool side = coinFlip == 1 ? true : false;

    // If I guessed correctly, submit my guess
    if (side == _guess) {
        realFlip.flip(_guess);
    } else {
    // If I guess incorrectly, submit the opposite
        realFlip.flip(!_guess);
    }
Aug 12, 2018 13:55:02 UTC
function flip(bool _guess) public {
    
    // pre-deteremine the flip outcome
    uint256 blockValue = uint256(block.blockhash(block.number-1));
    uint256 coinFlip = blockValue / FACTOR;
    bool side = coinFlip == 1 ? true : false;

    // If I guessed correctly, submit my guess
    if (side == _guess) {
        realFlip.flip(_guess);
    } else {
    // If I guess incorrectly, submit the opposite
        realFlip.flip(!_guess);
    }
Aug 12, 2018 13:51:57 UTC
pragma solidity ^0.4.18;

contract CampaignFactory {
    address[] public deployedCampaigns;
    
    function createCampaign(uint _minimumContribution) public {
        address newCampaign = new Campaign(_minimumContribution, msg.sender);
        deployedCampaigns.push(newCampaign);
    }
}

contract Campaign {
    struct Request {
        string description;
        uint amount;
        address vendor;
        bool complete;
        mapping(address => bool) approvals;
        uint approvalCount;
    }
    
    address public manager;
    uint public minimumContribution;
    mapping(address => bool) public contributors;
    Request[] public requests;
    uint public contributerCount = 0;
    
    constructor(uint _minimumContribution, address _manager) public {
        manager = _manager;
        minimumContribution= _minimumContribution;
    }
    
    function contribute() public payable {
        require(msg.value >= minimumContribution);
        
        contributors[msg.sender] = true;
        contribut
Aug 12, 2018 13:48:09 UTC
contract HackCoinFlip {
    uint256 public consecutiveWins;
    uint256 FACTOR = 57896044618658097711785492504343953926634992332820282019728792003956564819968;
    CoinFlip public realFlip = CoinFlip("your instance address");

    function hack(bool _guess) public returns (bool) {
        //TODO
    }
Aug 12, 2018 13:43:05 UTC
// 1st option: you contribute more eth than Ethernaut
function contribute() public payable {
  require(msg.value < 0.001 ether);
  contributions[msg.sender] += msg.value;
  if(contributions[msg.sender] > contributions[owner]) {
    owner = msg.sender;
  }
}

// 2nd option: you trigger the fallback function
function() payable public {
  require(msg.value > 0 && contributions[msg.sender] > 0);
  owner = msg.sender;
Aug 12, 2018 11:00:04 UTC
  event LevelInstanceCreatedLog(address indexed player, address instance);
  event LevelCompletedLog(address indexed player, Level level);

  function createLevelInstance(Level _level) public payable {
Aug 12, 2018 08:50:18 UTC
  event LevelInstanceCreatedLog(address indexed player, address instance);
  event LevelCompletedLog(address indexed player, Level level);

  function createLevelInstance(Level _level) public payable {

    // Ensure level is registered.
    require(registeredLevels[_level]);

    // Get level factory to create an instance.
    address instance = _level.createInstance.value(msg.value)(msg.sender);

    // Store emitted instance relationship with player and level.
    emittedInstances[instance] = EmittedInstanceData(msg.sender, _level, false);

    // Retrieve created instance via logs.
    LevelInstanceCreatedLog(msg.sender, instance);
  
Aug 12, 2018 08:25:13 UTC
pragma solidity ^0.4.24;

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;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner =
Aug 11, 2018 19:08:20 UTC
pragma solidity ^0.4.24;

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;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner =
Aug 11, 2018 19:06:58 UTC
pragma solidity ^0.4.24;

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;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner =
Aug 11, 2018 19:06:29 UTC
pragma solidity ^0.4.24;

contract GetEthBlock {
  mapping (uint => hash) blockHash;
  mapping (bytes32 => bytes32) blockStateRoot;

  function markBlock() public {
    // block.stateRoot?
    blockHash[block.number] = block.hash;
  }

  function submitBlockData(uint256 blockNumber, bytes blockData) public {
    bytes32 targetHash = blockHash[blockNumber];
    
    require(sha3(blockData) == targetHash);

    blockStateRoot[targetHash] = parseEthBlock(blockData).stateRoot;
  }

  function getStateRootByNumber(uint256 blockNumber) public returns (bytes32) {
    return blockStateRoot[blockHash[blockNumber]];
  }

  function getStateRootByHash(bytes32 blockhash) public returns (bytes32) {
    return blockStateRoot[blockhash];
  }
Aug 11, 2018 14:43:40 UTC
//by nightman
//2018.08.09 pseudocode draft
//untested

pragma solidity ^0.4.24;

contract ZEROxRACER {

    //VARIABLES AND CONSTANTS

    //owner variables
    address public owner;
    uint256 public devFeeRate = 98; //2% 
    uint256 public devBalance;

    //team variables
    string public teamOnePrefix; // eg 'dead';
    string public teamTwoPrefix; // eg 'beef';
    address private teamOneRefAddress; // eg 0xdead000000000000000000000000000000000000;
    address private teamTwoRefAddress; // eg 0xbeeF000000000000000000000000000000000000; reference address formated with correct checksums because solidity is finicky 
    uint256 public teamOneId = 1; 
    uint256 public teamTwoId = 2;

    //user variables
    address[] public teamOneMembers;
    mapping (address => bool) isTeamOneMember;
    mapping (address => uint256) teamOneStake;
    address[] public teamTwoMembers;
    mapping (address => bool) isTeamTwoMember;
    mapping (address => uint256) teamTwoStake;

    //round variables
    uint256 public
Aug 11, 2018 12:57:59 UTC
pragma solidity 0.4.24;

contract Lottery {
    address public manager;
    address[] public players;
    address public lastWinner;
    
    constructor() public {
        manager = msg.sender;
    }
    
    function enter() public payable {
        require(msg.value == 1 ether);
        
        players.push(msg.sender);
    }
    
    function random() private view returns (uint) {
        return uint(keccak256(abi.encodePacked(block.difficulty, now, players, manager)));
    }
    
    function pickWinner() public onlyManagerCanCall {
        uint index = random() % players.length;
        lastWinner = players[index];
        lastWinner.transfer(address(this).balance);
        
        players = new address[](0);
    }
    
    modifier onlyManagerCanCall() {
        require(msg.sender == manager);
        _;
    }
    
    function getPlayers() public view returns (address[]) {
        return players;
    }
Aug 11, 2018 10:06:40 UTC
pragma solidity ^0.4.24;

contract HelloWorld {
    string public message;

    constructor(string initialMessage) public {
        message = initialMessage;
    }

    function setMessage(string newMessage) public {
        message = newMessage;
    }
Aug 10, 2018 18:21:33 UTC
pragma solidity ^0.4.24;

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;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner =
Aug 10, 2018 15:18:24 UTC
pragma solidity ^0.4.18;

import "./SafeMath.sol";
import "./Ownable.sol";

contract ERC20Token {
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);

  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function allowance(address owner, address spender) public view returns (uint256);
  function approve(address spender, uint256 value) public returns (bool);
}

contract Alpaca is ERC20Token, Ownable {
  using SafeMath for uint256;

  event TokenPurchased(address indexed buyer, uint256 value, uint256 tokens);

  mapping(address => uint256) balances;
  mapping (address => mapping (address => uint256)) internal allowed;

  uint256 totalSupply_;

  //100000000000000 wei = 0.0001 ether = 5
Aug 10, 2018 09:55:22 UTC
pragma solidity ^0.4.18;

import "./SafeMath.sol";
import "./Ownable.sol";

contract ERC20Token {
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);

  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function allowance(address owner, address spender) public view returns (uint256);
  function approve(address spender, uint256 value) public returns (bool);
}

contract Alpaca is ERC20Token, Ownable {
  using SafeMath for uint256;

  event TokenPurchased(address indexed buyer, uint256 value, uint256 tokens);

  mapping(address => uint256) balances;
  mapping (address => mapping (address => uint256)) internal allowed;

  uint256 totalSupply_;

  //100000000000000 wei = 0.0001 ether = 5
Aug 10, 2018 09:53:30 UTC
//by nightman
//2018.08.09 pseudocode draft
//untested

pragma solidity ^0.4.24;

contract ZEROxRACER {

    //VARIABLES AND CONSTANTS

    //owner variables
    address public owner;
    uint256 public devFeeRate = 98; //2% 
    uint256 public devBalance;

    //team variables
    string public teamOnePrefix; // eg 'dead';
    string public teamTwoPrefix; // eg 'beef';
    address private teamOneRefAddress; // eg 0xdead000000000000000000000000000000000000;
    address private teamTwoRefAddress; // eg 0xbeeF000000000000000000000000000000000000; reference address formated with correct checksums because solidity is finicky 
    uint256 public teamOneId = 1; 
    uint256 public teamTwoId = 2;

    //user variables
    address[] public teamOneMembers;
    mapping (address => bool) isTeamOneMember;
    mapping (address => uint256) teamOneStake;
    address[] public teamTwoMembers;
    mapping (address => bool) isTeamTwoMember;
    mapping (address => uint256) teamTwoStake;

    //round variables
    uint256 public
Aug 10, 2018 00:37:32 UTC
//by nightman
//2018.08.09 pseudocode draft
//untested

pragma solidity ^0.4.24;

contract ZEROxRACER {

    //VARIABLES AND CONSTANTS

    //owner variables
    address public owner;
    uint256 public devFeeRate = 98; //2% 
    uint256 public devBalance;

    //team variables
    string public teamOnePrefix; // eg 'dead';
    string public teamTwoPrefix; // eg 'beef';
    address private teamOneRefAddress; // eg 0xdead000000000000000000000000000000000000;
    address private teamTwoRefAddress; // eg 0xbeeF000000000000000000000000000000000000; reference address formated with correct checksums because solidity is finicky 
    uint256 public teamOneId = 1; 
    uint256 public teamTwoId = 2;

    //user variables
    address[] public teamOneMembers;
    mapping (address => bool) isTeamOneMember;
    mapping (address => uint256) teamOneStake;
    address[] public teamTwoMembers;
    mapping (address => bool) isTeamTwoMember;
    mapping (address => uint256) teamTwoStake;

    //round variables
    uint256 public
Aug 10, 2018 00:34:12 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  int public integer;
  function subtract(int _number)
    public
  {
    integer = integer - _number;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 08, 2018 19:53:57 UTC
pragma solidity ^0.4.19;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint a, uint b) internal pure returns (uint) {
    uint c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint a, uint b) internal pure returns (uint) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint a, uint b) internal pure returns (uint) {
    assert(b <= a);
    return a - b;
  }

  function add(uint a, uint b) internal pure returns (uint) {
    uint c = a + b;
    assert(c >= a);
    return c;
  }
}

/**
 * @title Ownable contract
 */
contract Ownable {
    address public owner;


    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sen
Aug 08, 2018 18:36:49 UTC
pragma solidity 0.4.18;
mapping (address => uint) private userBalances;

function withdrawBalance() public {
    uint amountToWithdraw = userBalances[msg.sender];
    require(msg.sender.call.value(amountToWithdraw)());
    userBalances[msg.sender] = 0;
Aug 08, 2018 10:59:23 UTC
pragma solidity ^0.4.18;

library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a * b;
        assert(a == 0 || c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }

    function max64(uint64 a, uint64 b) internal pure returns (uint64) {
        return a >= b ? a : b;
    }

    function min64(uint64 a, uint64 b) internal pure returns (uint64) {
        return a < b ? a : b;
    }

    function max256(uint256 a, ui
Aug 07, 2018 16:28:54 UTC
pragma solidity ^0.4.24;

/*
    ledger over issues/bounties in a github repo
*/
contract IssueBounty {
    struct Repo {
        uint id;
        mapping (uint => Issue) issues;
    }
    
    struct Issue {
        uint taskId;
        uint totalBountyAmount;
        Bounty[] bounties;
    }
    
    struct Bounty {
        uint amount;
        uint endTime;
        address issuerAddress;
    }
    
    address owner;
    mapping(uint => Repo) repos;

    constructor() public {
        owner = msg.sender;
    }

    modifier onlySeller() {
        require(
            msg.sender == owner,
            "Only seller can call this."
        );
        // _ is the place where the modified function body will be inserted
        _;
    }

    function getIssue(uint repoId, uint issueId) internal view returns (Issue) {
        Repo storage repo = repos[repoId];
        return repo.issues[issueId];
    }

    // TODO handle multiple bounties on the same issue
    function putBountyOnIssue(uint repoId, uint issueId, 
Aug 07, 2018 15:14:00 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    address boss;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked
    mapping(uint  => bool) approvals; // day (starting 1.1.1970) -> is approved


    constructor(address _employee, address _boss) public {
        employee = _employee;
        boss = _boss;
    }

    function approveWork(uint _day) public {
        // only accept approval from boss:
        if (msg.sender != boss) {
            return;
        }
        approvals[_day] = true;
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        // only accept work logged if day not yet approved:
        if (approvals[_day] == true) {
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours);
    }

    function getHoursWorked(uint _day) public constant returns (uint hoursWorked) {
    
Aug 07, 2018 14:10:23 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked
    
    // Event (=logging) for logged work
    event WorkLogged(uint _day, uint _hours);

    constructor(address _employee, address _boss) public {
        employee = _employee;
    }

    function approveWork(uint _day) public {
        // TODO
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours);
    }

    function getHoursWorked(uint _day) public constant returns (uint hoursWorked) {
        hoursWorked = times[_day];
    }
Aug 07, 2018 14:06:39 UTC
pragma solidity ^0.4.24;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./timesheet.sol";

contract TimesheetTest {
    
    function testNoTimeUpdateAfterApproval() public {
        address employee = this;
        address boss = this;
        Timesheet timesheet = new Timesheet(employee, boss);
        
        uint _day = 1;
        timesheet.logWork(_day, 8);
        timesheet.approveWork(_day);
        timesheet.logWork(_day, 10);
        
        Assert.equal(timesheet.getHoursWorked(_day), uint(8), "hours worked should still be 8!");
        
    }
    
    function testApprovalByBossOnly() public {
        address employee = this;
        address boss = 0x33eC1E7D89F78D4268747FBe99e9A484B5Cb1e47;
        Timesheet timesheet = new Timesheet(employee, boss);
        
        uint _day = 1;
        timesheet.logWork(_day, 8);
        timesheet.approveWork(_day);
        timesheet.logWork(_day, 10);
        
        Assert.equal(timesheet.getHoursWorked(_day), uint(10
Aug 07, 2018 14:05:32 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked
    
    // Event (=logging) for logged work
    event WorkLogged(uint _day, uint _hours);

    constructor(address _employee, address _boss) public {
        employee = _employee;
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours);
    }
    
    function approveWork(uint _day) public {
        // TODO
    }

    function getHoursWorked(uint _day) public constant returns (uint hoursWorked) {
        hoursWorked = times[_day];
    }
Aug 07, 2018 13:54:24 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked
    
    // Event (=logging) for logged work
    event WorkLogged(uint _day, uint _hours);

    constructor(address _employee) public {
        employee = _employee;
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours);
    }
    
    function approveWork(uint _day) public {
        // TODO
    }

    function getHoursWorked(uint _day) public constant returns (uint hoursWorked) {
        hoursWorked = times[_day];
    }
Aug 07, 2018 13:52:33 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked

    constructor(address _employee) public {
        employee = _employee;
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours); // logging
    }

    function getHoursWorked(uint _day) public constant returns (uint hoursWorked) {
        hoursWorked = times[_day];
    }
        
    // Event (=logging) for logged work
    event WorkLogged(uint _day, uint _hours);
Aug 07, 2018 12:44:49 UTC
var shh = web3.shh;
var appName = "My silly app!";
var myName = "Gav Would";
var myIdentity = shh.newIdentity();

shh.post({
  "from": myIdentity,
  "topics": [ web3.fromAscii(appName) ],
  "payload": [ web3.fromAscii(myName), web3.fromAscii("What is your name?") ],
  "ttl": 100,
  "priority": 1000
});

var replyWatch = shh.watch({
  "topics": [ web3.fromAscii(appName), myIdentity ],
  "to": myIdentity
});

replyWatch.arrived(function(m) {
	console.log("Reply from " + web3.toAscii(m.payload) + " whose address is " + m.from);
})
Aug 07, 2018 10:00:44 UTC
var shh = web3.shh;
var appName = "My silly app!";
var myName = "Gav Would";
var myIdentity = shh.newIdentity();

shh.post({
  "from": myIdentity,
  "topics": [ web3.fromAscii(appName) ],
  "payload": [ web3.fromAscii(myName), web3.fromAscii("What is your name?") ],
  "ttl": 100,
  "priority": 1000
});

var replyWatch = shh.watch({
  "topics": [ web3.fromAscii(appName), myIdentity ],
  "to": myIdentity
});
// could be "topic": [ web3.fromAscii(appName), null ] if we wanted to filter all such
// messages for this app, but we'd be unable to read the contents.

replyWatch.arrived(function(m)
{
	// new message m
	console.log("Reply from " + web3.toAscii(m.payload) + " whose address is " + m.from);
})
Aug 07, 2018 09:59:21 UTC
pragma solidity ^0.4.11;

import "./SafeMath.sol";

contract NEFToken{

    using SafeMath for uint;

    string public name = "NEFCoin";
    string public symbol = "NEF";
    string public standard = "NEF Token v1.0";

    event Transfer(address indexed _from,address indexed _to,uint _value);
    event Approval(address indexed _owner,address indexed _spender,uint _value);

    uint public totalSupply;
    
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address=>uint)) public allowance;

    function NEFToken(uint _initialSupply) public {
        totalSupply = _initialSupply;
        balanceOf[msg.sender] = _initialSupply;
    }

    function transfer(address _to,uint _value) public payable returns(bool success){
        require(_to != address(0));
        require(_value <= balanceOf[msg.sender]);
        balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
        balanceOf[_to] = balanceOf[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);
        return t
Aug 07, 2018 09:21:58 UTC
pragma solidity ^0.4.11;

import "./SafeMath.sol";
import "./NEFToken.sol";

contract NEFCrowdsale{

    using SafeMath for uint;

    address public admin;
    NEFToken public tokenContract;
    uint public tokenPrice = 1000000000000000 wei;
    uint public tokensSold;
    // address public myAddress = 0xeF32DcAf2394431b68cFDddA3B2E83C77ce47a01;
    address public myAddress = 0xca35b7d915458ef540ade6068dfe2f44e8fa733c;
    mapping (address => uint) public balances;
    event Sell(address _buyer,uint _amount);

    function NEFCrowdsale(NEFToken _tokenContract) public {
        admin = msg.sender;
        tokenContract = _tokenContract;
    }
    
    function () payable public  {
        // transfer(admin,msg.value);
        buyTokens(msg.)
    }

    // function buyTokens(uint _numberOfTokens) public payable returns(uint){
    //     // require(msg.value == SafeMath.mul(_numberOfTokens , tokenPrice));
    //     uint purchaseAmount = _numberOfTokens * tokenPrice;
    //     tokenSold = purchaseAmount;
    /
Aug 07, 2018 09:15:48 UTC
pragma solidity 0.4.24;

contract AssemblyTest {
    uint[] d = [1,2,3];
    uint[3] s = [1,2,3];
    
    function foo_d(uint offset) public view returns (uint r) {
        uint[] memory arr = d;
        assembly {
            r := mload(add(arr, mul(0x20, offset)))
        }
    }
    
    function foo_s(uint offset) public view returns (uint r) {
        uint[3] memory arr = s;
        assembly {
            r := mload(add(arr, mul(0x20, offset)))
        }
    }
Aug 07, 2018 06:07:39 UTC
pragma solidity 0.4.24;

contract AssemblyTest {
    uint[] d = [1,2,3];
    uint[3] s = [1,2,3];
    
    function d_1() public view returns (uint r) {
        uint[] memory arr = d;
        assembly {
            r := arr
        }
    }
    
    function d_2() public view returns (uint r) {
        uint[] memory arr = d;
        assembly {
            r := mload(arr)
        }
    }
    
    function s_2() public view returns (uint r) {
        uint[3] memory arr = s;
        
        assembly {
            r := mload(arr)
        }
    }
Aug 07, 2018 05:33:34 UTC
pragma solidity ^0.4.19;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

/**
 * @title Ownable contract
 */
contract Ownable {
    address public owner;


    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    /**
     * @dev The Ownable constructor sets th
Aug 06, 2018 15:37:15 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/
  address public PlayerA;
  address public PlayerB;

  function DefineUserA() public {
    PlayerA = msg.sender;
  }

  function DefineUserB() public {
    PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

   User user = User(0x0); 
   //How can I find out the address of the "User contract?
  
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint i, uint k) {
    // fields is already pub
Aug 06, 2018 12:15:12 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

/**
 * @title Ownable contract
 */
contract Ownable {
    address public owner;


    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    /**
     * @dev The Ownable constructor sets th
Aug 06, 2018 09:13:12 UTC
function getCardDetails(uint16 packIndex, uint8 cardIndex, uint result) public view returns (uint16 proto, uint16 purity) {
    ...
    CardProto.Rarity rarity;
    (random, rarityRandom, purityOne, purityTwo, protoRandom) = getComponents(packIndex, cardIndex, result);
    if (cardIndex == 4) {
        rarity = _getLegendaryPlusRarity(rarityRandom);
    } else if (cardIndex == 3) {
        rarity = _getRarePlusRarity(rarityRandom);
    } else {
        rarity = _getCommonPlusRarity(rarityRandom);
    }
    ...
Aug 05, 2018 19:33:28 UTC
function _getEpicPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
    if (rand == 999999) {
        return CardProto.Rarity.Mythic;
    } else if (rand >= 981615) {
        return CardProto.Rarity.Legendary;
    } else {
        return CardProto.Rarity.Epic;
    }
}
function _getLegendaryPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
    if (rand == 999999) {
        return CardProto.Rarity.Mythic;
    } else {
        return CardProto.Rarity.Legendary;
    }
Aug 05, 2018 19:33:10 UTC
function _getCommonPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
    if (rand == 999999) {
        return CardProto.Rarity.Mythic;
    } else if (rand >= 998345) {
        return CardProto.Rarity.Legendary;
    } else if (rand >= 986765) {
        return CardProto.Rarity.Epic;
    } else if (rand >= 924890) {
        return CardProto.Rarity.Rare;
    } else {
        return CardProto.Rarity.Common;
    }
}
function _getRarePlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
    if (rand == 999999) {
        return CardProto.Rarity.Mythic;
    } else if (rand >= 981615) {
        return CardProto.Rarity.Legendary;
    } else if (rand >= 852940) {
        return CardProto.Rarity.Epic;
    } else {
        return CardProto.Rarity.Rare;
    }
Aug 05, 2018 19:32:49 UTC
function callback(uint id) public {

    Purchase storage p = purchases[id];

    require(p.randomness == 0);

    // must be within last 256 blocks, otherwise recommit
    require(block.number - 256 < p.commit);

    // can't callback on the original block
    require(uint64(block.number) != p.commit);

    bytes32 bhash = blockhash(p.commit);
    // will get the same on every block
    // only use properties which can't be altered by the user
    uint random = uint(keccak256(abi.encodePacked(bhash, p.user, address(this), p.count)));

    require(uint(bhash) != 0);

    p.randomness = random;

    emit RandomnessReceived(id, p.user, p.count, p.randomness);
Aug 05, 2018 19:32:09 UTC
function purchase(uint16 packCount, address referrer) whenNotPaused public payable {
    _purchase(msg.sender, packCount, referrer);
}

function _purchase(address user, uint16 packCount, address referrer) internal {
    require(packCount > 0);
    require(referrer != user);

    uint price = calculatePrice(basePrice(), packCount);

    require(msg.value >= price);

    Purchase memory p = Purchase({
        user: user,
        count: packCount,
        commit: uint64(block.number),
        randomness: 0,
        current: 0
    });

    uint id = purchases.push(p) - 1;
    
    emit PacksPurchased(id, user, packCount);
    ...
Aug 05, 2018 19:30:48 UTC
function purchase(uint16 packCount, address referrer) whenNotPaused public payable {
    _purchase(msg.sender, packCount, referrer);
}

function _purchase(address user, uint16 packCount, address referrer) internal {
    require(packCount > 0);
    require(referrer != user);
    uint price = calculatePrice(basePrice(), packCount);
    require(msg.value >= price);
    Purchase memory p = Purchase({
        user: user,
        count: packCount,
        commit: uint64(block.number),
        randomness: 0,
        current: 0
    });
    uint id = purchases.push(p) - 1;
    emit PacksPurchased(id, user, packCount);
    ...
Aug 05, 2018 19:28:48 UTC
/*
    Structs allow to combine data types into single data words of 32 bytes.

    Things to keep in mind:
    1. Putting a 32 bytes type in a struct is more expensive than keeping it outside.
    2. Packing works in multiples of 32 bytes therefore putting a type smaller than 32 bytes alone in a struct does not cause any saving
    3. It's possible to pack numbers and strings together.
*/

struct Struct {
    uint256 num;
}
Struct public s;
function write() public {
    s = Struct(1);              // 20497 gas
}
function read() public returns (uint256) {
    return s.num;               // 656 gas
}

struct Struct {
    uint128 num1;
    uint128 num2;
}
Struct public s;
function write() public {
    s = Struct(1,2);            // 20775 gas (instead of 40000+)
}
function read() public returns (uint128,uint128) {
    return (s.num1,s.num2) ;    // 730 gas
}

struct Struct {
    uint128 num1;
    bytes16 byte1;
    uint128 num2;
    bytes16 byte2;
}
Struct public s;
function write() public {
    s = Struct(1,'2'
Aug 05, 2018 14:38:20 UTC
/*
    SSTORE opcode which writes a data word to storage costs 20000 gas + some amount depending on the type.
    SLOAD opcode which reads a data word from storage costs 200 gas + some amount depending on the type.

    Intuition would tell us gas optimizations can be acheived by using smaller data types.
    However this is only the case inside of structs.
    Large types should always be used unless struct packing is possible.
*/

uint256 public integer256;

function write() public {
    integer256 = 1;         // 20430 gas
}

function read() public returns (uint256) {
    return integer256;      // 656 gas
}


uint128 public integer128;

function write() public {
    integer128 = 1;         // 20648 gas
}

function read() public returns (uint128) {
    return integer128;      // 671 gas
Aug 05, 2018 13:53:56 UTC
/*
    SSTORE opcode which writes a data word to storage costs 20000 gas + some amount depending on the type.
    SLOAD opcode which reads a data word from storage costs 200 gas + some amount depending on the type.

    Intuition would tell us gas optimizations can be acheived by using smaller data types.
    However this is only the case inside of structs.
    Large typse should always be used unless struct packing is possible.
*/

uint256 public integer256;
function write() public {
    integer256 = 1;         // 20430 gas
}
function read() public returns (uint256) {
    return integer256;      // 656 gas
}

uint128 public integer128;
function write() public {
    integer128 = 1;         // 20648 gas
}
function read() public returns (uint128) {
    return integer128;      // 671 gas
Aug 05, 2018 13:28:52 UTC
pragma solidity ^0.4.24;

contract Worldcup {
    string[] public teams;
    int256 public winnerIndex = -1;
    
    constructor() public {
        
    }
    
    // Add Football Team
    function addNewTeam(string _name) public {
        // Validate
        require(keccak256(_name) != keccak256(""));
        
        teams.push(_name);
    }
    
    // Random the winner
    function randomWinner(string _seed) public returns (int256) {
        // random algorithm
        winnerIndex = int256( uint256(keccak256("Random Prefix", _seed, "Random Srefix")) % teams.length );
        return winnerIndex;
    }
    
    // Team count
    function teamCount() public view returns (uint256) {
        return teams.length;
    }
    
    // Winner name
    function winnerName() public view returns (string) {
        // Validate
        require(winnerIndex >= 0);
        
        return teams[uint256(winnerIndex)];
    }
}
Aug 05, 2018 13:26:35 UTC
/*
    SLOAD opcode which reads a data word from storage costs 200 gas.
    MSTORE and MLOAD opcodes which writes and reads a data word from memory costs 3 gas each.

    As such, it is much more efficient to declare to memory if used multiple times in function logic.
*/

uint256 public num = 50;

function readStorage() public {
    if (num == 40 || num <= 10 && num > 100) {
        // execution cost: 885 gas
    }
}

function readMemory() public {
    uint256 mnum = num;
    if (mnum == 40 || mnum <= 10 && mnum > 100) {
        // execution cost: 605 gas
    }
Aug 05, 2018 13:18:07 UTC
pragma solidity ^0.4.24;

contract GasOptimization {

    /*
        SLOAD opcode which reads a data word from storage costs 200 gas.
        MSTORE and MLOAD opcodes which writes and reads a data word from memory costs 3 gas each.

        As such, it is much more efficient to declare to memory if used multiple times in function logic.
    */

    uint256 public num;
    constructor() public {
        num = 50;
    }
    function readStorage() public {
        if (num == 40 || num <= 10 && num > 100) {
            // execution cost: 885 gas
        }
    }
    function readMemory() public {
        uint256 mnum = num;
        if (mnum == 40 || mnum <= 10 && mnum > 100) {
            // execution cost: 605 gas
        }
    }

    /*
        SSTORE opcode which writes a data word to storage costs 20000 gas + some amount depending on the type.
        SLOAD opcode which reads a data word from storage costs 200 gas + some amount depending on the type.

        Intuition would tell us gas optimizations can be ac
Aug 05, 2018 12:59:06 UTC
pragma solidity ^0.4.24;


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;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}



contract Ownable {

    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() internal
Aug 05, 2018 00:05:55 UTC
pragma solidity ^0.4.24;

/*

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/



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;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
    
Aug 04, 2018 23:22:35 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 04, 2018 21:12:18 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.24;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 04, 2018 20:54:49 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/
  address PlayerA;
  address PlayerB;

  function DefineUserA() public {
    PlayerA = msg.sender;
  }

  function DefineUserB() public {
    PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

   User user = User(0x0); 
   //How can I find out the address of the "User contract?
  
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint i, uint k) {
    // fields is already public
    requir
Aug 04, 2018 19:58:18 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/
  address PlayerA;
  address PlayerB;

  function DefineUserA() public {
    PlayerA = msg.sender;
  }

  function DefineUserB() public {
    PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

   User user = User(__deployed_address__); 
   //How can I find out the address of the "User contract?
  
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is alread
Aug 04, 2018 19:47:00 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function hogehogeIitomi() {

  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 03, 2018 01:01:09 UTC
pragma solidity 0.4.24;
contract Receiver {
  function tokenFallback(address, uint, bytes) public {}
}

contract Sender {
  function call(address receiverAddress) public {
    bytes memory empty;
    require(
      receiverAddress.call(abi.encodeWithSignature("tokenFallback(address,uint256,bytes)"), msg.sender, 100, empty),
      "Call failed"
    );
  }
Aug 03, 2018 00:55:00 UTC
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;



contract Inventory
{
        address admin;
        mapping(address => Owner) public owners;
        Asset[] assets;
        uint256 numberOfAssets = 0;

        struct Owner
        {
                uint256 numberAssets;

        }

        struct Asset
        {
                string name;
                address owner;
        }


        function constructor()
        {
                admin = msg.sender;
        }

        function addAsset(string n) public
        {
                assets[numberOfAssets].name = n;
              
                assets[numberOfAssets].owner = msg.sender;
                
                numberOfAssets++;
                owners[msg.sender].numberAssets++;


        }

        function getAsset(uint256 i) constant returns(string name, address owner)
        {
                return (assets[i].name , assets[i].owner);
                
        }



        function kill() public
        {
                if(msg.s
Aug 02, 2018 19:32:41 UTC
pragma solidity 0.4.24;
contract PercentageCalc {
    uint128 public bp = 185; // 1.85% in basis points (parts per 10,000)

    function calculatePercentage(
        uint128 theNumber
    )
    public
    view
    returns (uint128) {
        return uint128(int256(theNumber) / int256(10000) * int256(bp));
    }
Aug 02, 2018 13:08:34 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.21;
contract SimpleStore {
    function getAnswer() public view returns (uint8) {
        return uint8(keccak256(block.blockhash(block.number - 1), now));
    }
Aug 02, 2018 10:26:02 UTC
pragma solidity 0.4.24;


/**
 * @title First attempt to implement a secure RNG, as described here https://github.com/axiomzen/eth-random
 * @author clemlak https://github.com/clemlak
 * @dev This contract is WIP, please don't use it in production!
 */
contract RNG {
  /**
   * @dev Given a number returns a slice of any bits, at certain offset
   * @author flockonus (https://gist.github.com/flockonus/cb75838d78cf544744e7ac95ab3ec431)
   * @param number A number to be sliced
   * @param nbits How many bits long is the new number
   * @param offset How many bits to skip
   * @return A slice of the number, as an uint
   */
  function sliceNumber(uint256 number, uint256 nbits, uint256 offset) public pure returns (uint256) {
    /* Mask is made by shifting left an offset number of times */
    uint256 mask = uint256((2 ** nbits) - 1) << offset;

    /* AND number with mask, and trim to max of nbits bits */
    return uint256((number & mask) >> offset);
  }

  /**
   * @dev Returns an array with random numbers, as 
Aug 02, 2018 09:51:22 UTC
pragma solidity 0.4.24;


contract RNG {
  /**
   * @dev Given a number returns a slice of any bits, at certain offset
   * @author flockonus (https://gist.github.com/flockonus/cb75838d78cf544744e7ac95ab3ec431)
   * @param number A number to be sliced
   * @param nbits How many bits long is the new number
   * @param offset How many bits to skip
   * @return A slice of the number, as an uint
   */
  function sliceNumber(uint256 number, uint256 nbits, uint256 offset) public pure returns (uint256) {
    /* Mask is made by shifting left an offset number of times */
    uint256 mask = uint256((2 ** nbits) - 1) << offset;

    /* AND number with mask, and trim to max of nbits bits */
    return uint256((number & mask) >> offset);
  }

  /**
   * @dev Returns an array with random numbers
   * Implementation of a technique described here https://github.com/axiomzen/eth-random
   * @param count How many random numbers will be returned
   * @param power How big the numbers will be (in bits)
   * @return An array with 
Aug 02, 2018 09:45:14 UTC
pragma solidity 0.4.24;


contract RNG {
  /**
   * @dev Given a number returns a slice of any bits, at certain offset
   * @author flockonus (https://gist.github.com/flockonus/cb75838d78cf544744e7ac95ab3ec431)
   * @param number A number to be sliced
   * @param nbits How many bits long is the new number
   * @param offset How many bits to skip
   * @return A slice of the number, as an uint
   */
  function sliceNumber(uint256 number, uint256 nbits, uint256 offset) public pure returns (uint256) {
    /* Mask is made by shifting left an offset number of times */
    uint256 mask = uint256((2 ** nbits) - 1) << offset;

    /* AND number with mask, and trim to max of nbits bits */
    return uint256((number & mask) >> offset);
  }

  /**
   * @dev Returns an array with random numbers
   * Implementation of a technique described here https://github.com/axiomzen/eth-random
   * @param count How many random numbers will be returned
   * @param power How big the numbers will be (in bits)
   * @return An array with 
Aug 02, 2018 09:25:31 UTC
//Lets empty your balance, shall we!
pragma solidity 0.4.18; contract ForceEther { 
	bool youWin = false;
	function onlyNonZeroBalance() { 
		require(this.balance > 0); 
		youWin = true;
}
 // throw if any ether is received
 function() payable {
   revert();
} 
Aug 02, 2018 07:45:01 UTC
//Lets reduce sender's balance
function withdraw(uint _amount) public { if(balances[msg.sender] >= _amount) {
                          if(msg.sender.call.value(_amount)()) {
                            _amount;
}
                          balances[msg.sender] -= _amount;
                        }
Aug 02, 2018 07:40:25 UTC
contract D {
   uint public n;
   address public sender;
   function delegatecallSetN(address _e, uint _n) { 
   	_e.delegatecall(bytes4(sha3(setN(uint256))), _n); /* D's storage is set, E is not modified */
   	} 
   }
  contract E {
   uint public n;
   address public sender;
   function setN(uint _n) {
n = _n;
     sender = msg.sender;
   }
Aug 02, 2018 07:29:46 UTC
pragma solidity ^0.4.24;

import "safetynetsoliditysdk/contracts/Sagewise";

contract SimpleStore is Sagewise {
  constructor (address _vendor, address _activationParty) {
    setDRVendor(_vendor);
    addDRActivationParty(_activationParty);
  }

  function set(uint _value) public notDRMode {
    require(_value != 24);
    value = _value;
  }

  function get() public constant returns (uint) notDRMode {
    return value;
  }

  uint value;
Aug 01, 2018 15:42:44 UTC
pragma solidity ^0.4.24;

import "safetynetsoliditysdk/contracts/Sagewise";

contract SimpleStore is Sagewise {
  constructor (address _vendor, address _activationParty) {
    setDRVendor(_vendor);
    addDRActivationParty(_activationParty);
  }

  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Aug 01, 2018 15:29:26 UTC
pragma solidity ^0.4.24;

import "safetynetsoliditysdk/contracts/Sagewise";

contract SimpleStore is Sagewise {

  constructor (address _vendor, address _activationParty) {
    setDRVendor(_vendor);
    addDRActivationParty(_activationParty);
  }
Aug 01, 2018 15:16:16 UTC
pragma solidity ^0.4.24;

import "safetynetsoliditysdk/contracts/Sagewise";

contract SimpleStore is Sagewise {
Aug 01, 2018 15:10:47 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
pragma experimental ABIEncoderV2;
contract Inventory
{

  struct Asset
  {
    string name;
    string location;
    string owner;
  }


  uint itemCount;
  Asset[] assets;
  function Inventory() public
  {
    address admin = msg.sender;
    itemCount = 0;
  }
  
  function getNumberAssets() constant public returns (uint items)
  {
    return itemCount;
  }

  function addAsset(string n, string l, string o) public
  {
    assets.push(Asset(n,l,o));
    itemCount++;
  }

  function getAsset(uint index) public constant returns(string name)
  {
    return assets[index].name;
  }

  function listAssets() public 
  {
    for(uint i = 0; i<assets.length; i++)
    {
      getAsset({index : i});
    }
  }

Aug 01, 2018 13:42:35 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
pragma experimental ABIEncoderV2;
contract Inventory
{

  struct Asset
  {
    string name;
    string location;
    string owner;
  }


  uint itemCount;
  Asset[] assets;
  function Inventory() public
  {
    address admin = msg.sender;
    itemCount = 0;
  }
  
  function getNumberAssets() constant public returns (uint items)
  {
    return itemCount;
  }

  function addAsset(string n, string l, string o)
  {
    assets.push(Asset(n,l,o));
    itemCount++;
  }

  function listAssets() public constant returns(string assetList)
  {
    string r = "";
    for(uint i = 0; i <= itemCount; i++)
    {
      r += assets[i].name + "\t" + assets[i].location + "\t" + assets[i].owner + "\n\r";
    }

    return r;
  }

Jul 31, 2018 19:36:29 UTC
pragma solidity 0.4.24;

contract Coin {
/*
* @title A Simple Subcurrency Example
* @author Toshendra Sharma
* @notice Example for the Solidity Course
* @dev This is only for demo the simple Coin example
*
*/
address public minter;
uint public totalCoins;

event LogCoinsMinted(address deliveredTo, uint amount);
event LogCoinsSent(address sentTo, uint amount);

mapping (address => uint) balances;
function Coin(uint initialCoins) {
minter = msg.sender;
totalCoins = initialCoins;
balances[minter] = initialCoins;
}

/// @notice Mint the coins
/// @dev This does not return any value
/// @param owner address of the coin owner, amount amount of coins to be delivered to owner
/// @return Nothing
function mint(address owner, uint amount) {
if (msg.sender != minter) return;
balances[owner] += amount;
totalCoins += amount;
LogCoinsMinted(owner, amount);
}

function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
LogCoinsSent(r
Jul 31, 2018 18:30:36 UTC
pragma solidity ^0.4.18;

contract CoinFlip {
  address owner
  uint payPercentaje = 90;

  event Status(string _msg, address user, uint amount);

  function CoinFlip() payable{
      owner = msg.sender;
  }

  function FlipCoin() payable {
    if((block.timestamp % 2 ) == 0){
      if(this.balance < ((msg.value*payPercentaje)/100)) {
        status('Congratulations, you won! Sry we didnt have enought money, we will pay you soon', msg.sender, this.balance);
        msg.sender.trasnfer(this.balance);
      }
      else{
        status('Congratulatios, you WON!', msg.sender, msg.value * (100 + payPercentaje)/100);
        msg.sender.transfer(msg.value * (100 + payPercentaje)/100);
      }
   }
   {
     status ('We are sorry, you lose, try again to recover your money', msg.sender, msg.value);
   }
  }

  function kill() onlyOwner {
    status('Contrated killed, not longer avaiable to use', msg.sender, this.balance);
  }

  modifier onlyOwner {
    if (msg.sender != owner){
      throw();
    } else {
      _;
 
Jul 31, 2018 18:27:06 UTC
pragma solidity ^0.4.24;

contract A {
  uint32 a = 0;
}

contract B is A {
  uint32[] a = [A.a, A.a, A.a, A.a, A.a, A.a, A.a, A.a, A.a, A.a, A.a, A.a];
}

contract C {
  uint256 a = 0;
}
contract D is C {
  uint256[] a = [C.a, C.a, C.a, C.a, C.a, C.a, C.a, C.a, C.a, C.a, C.a, C.a];
Jul 31, 2018 18:12:24 UTC
pragma solidity ^0.4.24;

contract A {
  uint8 a = 0;
}

contract B is A {
  uint8[] a = [A.a];
}

contract C {
  uint256 a = 0;
}
contract D is C {
  uint256[] a = [C.a];
Jul 31, 2018 18:02:29 UTC
pragma solidity ^0.4.18;

contract A {
  uint8 a = 0;
}

contract B is A {
  uint8[] a = [A.a];
}

contract C {
  uint256 a = 0;
}
contract D is C {
  uint256[] a = [C.a];
Jul 31, 2018 17:58:29 UTC
/**
2018-07-30 initial cut...
Combining ChainLink's example with our Salary contract.


OpenLaw call
[[Payroll call:EthereumCall(
contract:"0xc91cb6603421d96b3aee9ca3f9c0945e369d80c6";
interface:[{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"amountInWei","type":"uint256"}],"name":"makePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}];
function:"makePayment";
arguments:Recipient Address,Monthly Salary in Wei;
startDate:Payment Start Date;
endDate: Payment End Date;
repeatEvery:"1 minute")]]
*/

pragma solidity ^0.4.24;

//1) add this
import "github.com/smartcontractkit/chainlink/solidity/contracts/Chainlinked.sol";

//2) add these super contracts
contract salary is Chainlinked, Ownable {
  uint256 public currentEthUsdConvRate;

  //3) add these constants
  //TODO - genericize these so they aren't tied to
Jul 31, 2018 03:30:16 UTC
/**
2018-07-30 initial cut...
Combining ChainLink's example with our Salary contract.


OpenLaw call
[[Payroll call:EthereumCall(
contract:"0xc91cb6603421d96b3aee9ca3f9c0945e369d80c6";
interface:[{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"amountInWei","type":"uint256"}],"name":"makePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}];
function:"makePayment";
arguments:Recipient Address,Monthly Salary in Wei;
startDate:Payment Start Date;
endDate: Payment End Date;
repeatEvery:"1 minute")]]
*/

pragma solidity ^0.4.24;

//1) add this
import "github.com/smartcontractkit/chainlink/solidity/contracts/Chainlinked.sol";

//2) add these super contracts
contract salary is Chainlinked, Ownable {
  uint256 public currentEthUsdConvRate;

  //3) add these constants
  //TODO - genericize these so they aren't tied to
Jul 31, 2018 03:29:21 UTC
/**
2018-07-30 initial cut...
Combining ChainLink's example with our Salary contract.


OpenLaw call
[[Payroll call:EthereumCall(
contract:"0xc91cb6603421d96b3aee9ca3f9c0945e369d80c6";
interface:[{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"amountInWei","type":"uint256"}],"name":"makePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}];
function:"makePayment";
arguments:Recipient Address,Monthly Salary in Wei;
startDate:Payment Start Date;
endDate: Payment End Date;
repeatEvery:"1 minute")]]
*/

pragma solidity ^0.4.24;

//1) add this
import "github.com/smartcontractkit/chainlink/solidity/contracts/Chainlinked.sol";

//2) add these super contracts
contract salary is Chainlinked, Ownable {
  uint256 public currentEthUsdConvRate;

  //3) add these constants
  //TODO - genericize these so they aren't tied to
Jul 31, 2018 03:24:27 UTC
/**
2018-07-30 initial cut...
Combining ChainLink's example with our Salary contract.


OpenLaw call
[[Payroll call:EthereumCall(
contract:"0xc91cb6603421d96b3aee9ca3f9c0945e369d80c6";
interface:[{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"amountInWei","type":"uint256"}],"name":"makePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}];
function:"makePayment";
arguments:Recipient Address,Monthly Salary in Wei;
startDate:Payment Start Date;
endDate: Payment End Date;
repeatEvery:"1 minute")]]
*/

pragma solidity ^0.4.24;

//1) add this
import "github.com/smartcontractkit/chainlink/solidity/contracts/Chainlinked.sol";

//2) add these parents
contract salary  is Chainlinked, Ownable {
  uint256 public currentEthUsdConvRate;

  //3) add these constants
  //TODO - genericize these so they aren't tied to Ropste
Jul 31, 2018 03:22:29 UTC
async componentWillMount() {
await this.contract.loadContract()
this.contract.addEventListener((v) =&gt; {
  this.setState({ value: v._value })
})
  
Jul 30, 2018 22:55:06 UTC
web3.eth.getAccounts(function(error, accounts) {
if (error) {
  console.log(error);
}
//more code
App.contracts.playersContract.deployed().then(function(instance) {
  playersInstance = instance;
  return playersInstance;
}).then(function(result) {
    newPlayerEvent = playersInstance.playerCreated({fromBlock:'latest'});
}).then(function() {
    newPlayerEvent.watch(function(error, result){
        //Do stuff
    });
}).catch(function(err) {
    console.log(err.message);
});
//more code
})
Jul 30, 2018 22:55:06 UTC
pragma solidity ^0.4.24;

import "./AlphabetToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";


contract AlphabetPack is BasicToken, BurnableToken, Ownable {

    AlphabetToken alphabetToken;
    string public constant NAME = "Alphabet Pack Token";
    string public constant SYMBOL = "PAC";
    uint8 public constant DECIMALS = 18;
    uint16 public constant INITIAL_SUPPLY = 13000;
    uint8 public constant NFTS_PER_PACK = 3;
    uint16 public constant MAX_BLOCKS = 256;

    event PackPurchased(address to);
    event PackUnwrapped(uint256[] tokenIds);

    uint packFee = 0.001 ether;
    uint unwrapCount;

    mapping(address => uint32) unwrapRandomNumbers;


    constructor() public {
        // TODO: require(((NFT_SUPPLY * 26) / 3) == packSupply);
        alphabetToken = new AlphabetToken(address(this));
        string memory error = "NFT Suppl
Jul 30, 2018 22:31:49 UTC
pragma solidity ^0.4.23;

// https://www.truechain.pro 的TTR合约
// 合约地址: 0xf2bb016e8c9c8975654dcd62f318323a8a79d48e

contract TrueTogetherToken {

    string public constant name = "TRUE Together Token"; //合约名称
    string public constant symbol = "TTR"; // 合约符号
    uint256 public constant decimals = 18; // 支持的最小单位 10^18
    uint256 _totalSupply = 100000000 * 10 ** decimals; // 发行量
    address public founder = 0x0; // founder地址
    uint256 public voteEndTime; // 投票结束时间
    uint256 airdropNum = 1 ether; // 空投数量
    uint256 public distributed = 0; //分发的数量


    mapping (address => bool) touched; // 是否已经改变了, 在空投的时候会用到
    mapping (address => uint256) public balances; // 余额
    mapping (address => uint256) public frozen; // 冻结的数量
    mapping (address => uint256) public totalVotes; // 总票数

    mapping (address => mapping (address => uint256)) public votingInfo; // 投票信息
    ma
Jul 30, 2018 10:31:43 UTC
pragma solidity ^0.4.23;

//  0xf2bb016e8c9c8975654dcd62f318323a8a79d48e

contract TrueTogetherToken {

    string public constant name = "TRUE Together Token"; //合约名称
    string public constant symbol = "TTR"; // 合约符号
    uint256 public constant decimals = 18; // 支持的最小单位 10^18
    uint256 _totalSupply = 100000000 * 10 ** decimals; // 发行量
    address public founder = 0x0; // founder地址
    uint256 public voteEndTime; // 投票结束时间
    uint256 airdropNum = 1 ether; // 空投数量
    uint256 public distributed = 0; //分发的数量


    mapping (address => bool) touched; // 是否已经改变了, 在空投的时候会用到
    mapping (address => uint256) public balances; // 余额
    mapping (address => uint256) public frozen; // 冻结的数量
    mapping (address => uint256) public totalVotes; // 总票数

    mapping (address => mapping (address => uint256)) public votingInfo; // 投票信息
    mapping (address => mapping (address => uint256)) allowed
Jul 30, 2018 10:26:16 UTC
// http://blockchaindev.kr/models/content/67
// https://ethfiddle.com/09YbyJRfiI
// https://medium.com/@ihcho131313/이더리움에서-크립토키티-스타일-게임을-만드는-방법-8113372e65e4
// http://solidity.readthedocs.io/en/v0.4.24/types.html

pragma solidity ^0.4.21;
/// SafeMath library
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  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;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  fu
Jul 30, 2018 05:03:38 UTC
// http://blockchaindev.kr/models/content/67
// https://ethfiddle.com/09YbyJRfiI
// https://medium.com/@ihcho131313/이더리움에서-크립토키티-스타일-게임을-만드는-방법-8113372e65e4
// http://solidity.readthedocs.io/en/v0.4.24/types.html

pragma solidity ^0.4.21;
/// SafeMath library
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  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;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  fu
Jul 30, 2018 05:00:43 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Jul 29, 2018 16:54:46 UTC
pragma solidity ^0.4.24;

contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );

  constructor() public {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

contract ERC20SimpleToken {
  function balanceOf(address _owner) public view returns (uint256 balance);
  function transfer(address to, uint256 value) public returns (bool);
}

contract TransferGateway is Ownable {
  address gateway;
  ERC20SimpleToken loomToken;
  ERC2
Jul 28, 2018 19:32:39 UTC
/**
 * @dev We use a fixed version of Solidity
 */
pragma solidity 0.4.24;


/**
 * @title ERC20Token Interface
 * @notice This is the interface to interact with ERC20 tokens
 * @dev As seen here https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 */
contract ERC20Token {
  function name() public view returns (string);
  function symbol() public view returns (string);
  function decimals() public view returns (uint);
  function totalSupply() public view returns (uint);
  function balanceOf(address account) public view returns (uint);
  function transfer(address to, uint amount) public returns (bool);
  function transferFrom(address from, address to, uint amount) public returns (bool);
  function approve(address spender, uint amount) public returns (bool);
  function allowance(address owner, address spender) public view returns (uint);
}

/**
 * @title ERC20TokenHandler
 * @notice This contract handles the interaction with ERC20 tokens
 */
contract ERC20TokenHandler {
  /**
   * @notice Returns the na
Jul 28, 2018 10:25:03 UTC
pragma solidity 0.4.24;

contract Lottery {
    address public manager;
    address[] public players;
    
    constructor() public {
        manager = msg.sender;
    }
    
    function enter() public payable {
        require(msg.value == 0.1 ether);
        
        players.push(msg.sender);
    }
    
    function random() private view returns (uint) {
        return uint(keccak256(block.difficulty, now, players));
    }
    
    function pickWinner() public onlyManagerCanCall returns (address) {
        uint winnerIndex = random() % players.length;
        players[winnerIndex].transfer(address(this).balance);
        
        return players[winnerIndex];
    }
    
    modifier onlyManagerCanCall() {
        require(msg.sender == manager);
        _;
    }
Jul 28, 2018 09:50:26 UTC
pragma solidity ^0.4.18;
library SafeMath {
  function mul(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }

  function max64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a >= b ? a : b;
  }

  function min64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a < b ? a : b;
  }

  function max256(uint256 a, uint256 b) internal constant returns (uint256) {
    return a >= b ? a : b;
  }

  function min25
Jul 28, 2018 09:47:20 UTC
pragma solidity 0.4.24;

contract Inbox {
    string public message;
    
    constructor(string newMessage) public {
        message = newMessage;
    }
    
    function setMessage(string anotherMessage) public {
        message = anotherMessage;
    }
Jul 28, 2018 09:47:19 UTC
function _BidSul(uint[] _tokenIdSet) public payable{
// validate sum of price 
uint p=0;
uint SumOfPrice = 0;
for(p;p&lt;_tokenIdSet.length;p++){
    Sul memory sulp = suls[_tokenIdSet[p]];
    SumOfPrice+=sulp.price;
}
require(msg.value == SumOfPrice);

// validate sum of price
uint e=0;
for(e; e&lt;_tokenIdSet.length; e++){

    Sul storage sul = suls[_tokenIdSet[e]];

    uint256 price = uint256(sul.price);

    uint256 Newgens = sul.gens+1;
    sul.gens = Newgens;
    sul.price = price + (price * 5) / 1000;

    string sulName = string(sul.sulName);
    uint256 IMGindex = uint256(sul.IMGindex);

    uint256 newGenIncredient = Ingredient(sulName, price, IMGindex, Newgens);
    _approve(newGenIncredient, msg.sender);
}

    
Jul 28, 2018 09:31:22 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
//  Это мой контракт
Jul 27, 2018 12:11:57 UTC
/**
 * @dev We use a fixed version of Solidity
 */
pragma solidity 0.4.24;

/**
 * @title ERC20Token Interface
 * @notice This is the interface to interact with ERC20 tokens
 * @dev As seen here https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 */
contract ERC20Token {
  function name() public view returns (string);
  function symbol() public view returns (string);
  function decimals() public view returns (uint);
  function totalSupply() public view returns (uint);
  function balanceOf(address account) public view returns (uint);
  function transfer(address to, uint amount) public returns (bool);
  function transferFrom(address from, address to, uint amount) public returns (bool);
  function approve(address spender, uint amount) public returns (bool);
  function allowance(address owner, address spender) public view returns (uint);
}

/**
 * @title ERC20TokenHandler
 * @notice This contract handles the interaction with ERC20 tokens
 */
contract ERC20TokenHandler {
  /**
   * @notice We create a new
Jul 27, 2018 10:55:05 UTC
pragma solidity ^0.4.24;

contract A {
  uint public variable = 2;
}

contract B {
  A private a = A(0x0);

  function check() view public returns (uint) {
    // notice because variable doesn't belong to B
    // it has to be called as a function
    return a.variable();
  }
Jul 26, 2018 17:36:02 UTC
pragma solidity ^0.4.18;
contract A {
  uint public variable = 2;
}

contract B {
  A private a = new A();

  function check() view public returns (uint) {
    // notice because variable doesn't belong to B
    // it has to be called as a function
    return a.variable();
  }
Jul 26, 2018 17:32:58 UTC
pragma solidity ^0.4.18;

contract Testing{
    address [] public adds;
    uint [] public amounts;

    function bet() public payable {
        adds.push(msg.sender);
        amounts.push(msg.value);
    }

    function give() public {
        adds[0].transfer(amounts[0]);
    }
Jul 26, 2018 08:51:58 UTC
// CryptoKitties Source code
// Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code

pragma solidity ^0.4.11;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    owner = msg.sender;
  }


  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }


  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) onlyOwner {
    if (newOwner != address(0)) {
      owner = newOwner;
    }
  }

}



/// @title Interface for contract
Jul 26, 2018 08:33:35 UTC
pragma solidity ^0.4.21;

contract P3D {
  uint256 public stakingRequirement;
  function buy(address _referredBy) public payable returns(uint256) {}
  function balanceOf(address _customerAddress) view public returns(uint256) {}
  function exit() public {}
  function withdraw() public {}
  function reinvest() public {}
  function sell(uint256 _amountOfTokens) public {}
  function myDividends(bool _includeReferralBonus) public view returns(uint256) {}
}

contract Hodler {
  P3D constant public p3d = P3D(0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe);
  R3D public r3d; 
  address public owner;
  
  constructor(address _owner) public {
    owner = _owner;
    r3d = R3D(msg.sender);
  }
    
  modifier onlyR3D() {
    require(msg.sender == address(r3d));
    _;
  }
    
  function buy() public onlyR3D() payable {
    p3d.buy.value(msg.value)(address(0));
  }
  
  function reinvest(address _sender) public onlyR3D() returns(uint256) {
    // sender must have a master node
    require(p3d.balanceOf(_sender) >= p3d.staki
Jul 26, 2018 07:35:25 UTC
pragma solidity ^0.4.24;

contract DSchool {

	address dean;

	struct Student {
		string name;
		string address;
		string available_credits;
		string isRegistered;
		string scorecard_address;
	}

	struct Mentor {
		string name;
		string department;
		string address;
	}

	struct Department {
		string name;
		string classes_avaialable;
	}

	struct Class {
		string name;
		string address;
		string department;
		string credits;
		string num_activities;
	}

	struct ScoreCard {
		string name;
		string class_id;
		string credits;
		address scorecard_adress;
	}

	constructor() {
		dean = msg.sender;
		Department
	}

	modifier isDean() {

	}

	modifier isStudent() {

	}

	modifier isMentor() {

	}

	function addStudent() isDean {

	}
	
	function addMentor() isDean {

	}

	function addClass() isMentor {

	}

	function addDepartment() isDean {

	}

	
	function getClasses() {

	}

	function getClassInfo() {

	}

	function getMentors() {

	}

	function getStudents() {

	}

	function registerClass() isStudent {

	}

	funct
Jul 25, 2018 17:20:36 UTC
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return
Jul 25, 2018 10:17:52 UTC
pragma solidity ^0.4.19;

contract ZombieFactory {

    event NewZombie(uint zombieId, string name, uint dna);

    uint dnaDigits = 16;
    uint dnaModulus = 10 ** dnaDigits;

    struct Zombie {
        string name;
        uint dna;
    }

    Zombie[] public zombies;

    mapping (uint => address) public zombieToOwner;
    mapping (address => uint) ownerZombieCount;

    function _createZombie(string _name, uint _dna) private {
        uint id = zombies.push(Zombie(_name, _dna)) - 1;
        zombieToOwner[id] = msg.sender;
        ownerZombieCount[msg.sender]++;
        NewZombie(id, _name, _dna);
    }

    function _generateRandomDna(string _str) private view returns (uint) {
        uint rand = uint(keccak256(_str));
        return rand % dnaModulus;
    }

    function createRandomZombie(string _name) public {
        // 여기서 시작
        uint randDna = _generateRandomDna(_name);
        _createZombie(_name, randDna);
    }

}
Jul 25, 2018 09:25:08 UTC
pragma solidity 0.4.24;


contract Template {
  struct Pet {
    string name;
    uint age;
  }

  Pet[] public pets;

  function addPet(string name, uint age) public {
    pets.push(Pet(name, age));
  }

  function changePet(uint petId, string name, uint age) public {
    Pet storage temp = pets[petId];

    temp.name = name;
    temp.age = age;
  }

  function getPet(uint petId) public view returns (string, uint) {
    return (pets[petId].name, pets[petId].age);
  }
}
Jul 24, 2018 23:37:33 UTC
pragma solidity ^0.4.24;
/**
 * @title -FoMo-3D v0.7.1
 * ┌┬┐┌─┐┌─┐┌┬┐   ╦╦ ╦╔═╗╔╦╗  ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
 *  │ ├┤ ├─┤│││   ║║ ║╚═╗ ║   ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
 *  ┴ └─┘┴ ┴┴ ┴  ╚╝╚═╝╚═╝ ╩   ┴  ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
 *                                  _____                      _____
 *                                 (, /     /)       /) /)    (, /      /)          /)
 *          ┌─┐                      /   _ (/_      // //       /  _   // _   __  _(/
 *          ├─┤                  ___/___(/_/(__(_/_(/_(/_   ___/__/_)_(/_(_(_/ (_(_(_
 *          ┴ ┴                /   /          .-/ _____   (__ /
 *                            (__ /          (_/ (, /                                      /)™
 *                                                 /  __  __ __
Jul 24, 2018 15:17:02 UTC
pragma solidity ^0.4.17;

contract Lottery {
   address public manager;
   address[] public players;
   uint256[] private amount;
   
   constructor () public {
      manager = msg.sender;
   }
   
   function enter() public payable {
       require(msg.value > 0.01 ether );
       players.push(msg.sender);
       amount.push(msg.value);
   }
   function getAllPlayers() public view returns(address[]) {
       return players;
   }
   function random () private view returns(uint) {
       return uint(keccak256(block.difficulty,now,players));
   }
   
   function pickWinner () public restricted { // 
  
       uint index = random() % players.length ;
               players[index].transfer(this.balance );
               players = new address[](0);
   }
   
   modifier restricted () {
            require(msg.sender == manager);
            _;
   }
   
   function cancelLottery () public restricted {
       for (uint i=0; i<amount.length; i++){
           players[i].transfer(amount[i]);
       }
   }
Jul 24, 2018 10:38:25 UTC
pragma solidity ^0.4.24;


/**
 * @title Elliptic curve signature operations
 * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
 * TODO Remove this library once solidity supports passing a signature to ecrecover.
 * See https://github.com/ethereum/solidity/issues/864
 */

library ECRecovery {

  /**
   * @dev Recover signer address from a message by using their signature
   * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
   * @param sig bytes signature, the signature is generated using web3.eth.sign()
   */
  function recover(bytes32 hash, bytes sig)
    internal
    pure
    returns (address)
  {
    bytes32 r;
    bytes32 s;
    uint8 v;

    // Check the signature length
    if (sig.length != 65) {
      return (address(0));
    }

    // Divide the signature in r, s and v variables
    // ecrecover takes the signature parameters, and the only way to get them
    // currently is to use assembly.
    // solium-disable-next-l
Jul 24, 2018 08:32:32 UTC
function ABCDE(address _owner) external view returns(uint256[] ownerTokens){
uint256 tokenCount = balanceOf(_owner);
uint256[] memory result = new uint256[](tokenCount);
// result 에 _owner와 주소가 같은 것을 담아서 반환합니다.
// ...
// ...

return result;
Jul 24, 2018 07:21:02 UTC
pragma solidity ^0.4.18;

// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
    function safeAdd(uint a, uint b) public pure returns (uint c) {
        c = a + b;
        require(c >= a);
    }
    function safeSub(uint a, uint b) public pure returns (uint c) {
        require(b <= a);
        c = a - b;
    }
    function safeMul(uint a, uint b) public pure returns (uint c) {
        c = a * b;
        require(a == 0 || c / a == b);
    }
    function safeDiv(uint a, uint b) public pure returns (uint c) {
        require(b > 0);
        c = a / b;
    }
}
Jul 24, 2018 02:12:23 UTC
pragma solidity 0.4.24;


contract Doors {
  enum Role { Minion, Boss }

  mapping (address => Role) public userToRole;
  mapping (address => Role) public doorToRole;

  function addNewUser(address newUser) public {
    userToRole[newUser] = Role.Minion;
  }

  function changeUserRole(address user, Role newRole) public {
    userToRole[user] = newRole;
  }

  function changeDoorRole(address door, Role newRole) public {
    doorToRole[door] = newRole;
  }

  function checkIfUserCanOpenDoor(address user, address door) public view returns (bool) {
    return doorToRole[door] == userToRole[user];
  }
Jul 23, 2018 23:47:27 UTC
pragma solidity ^0.4.24;

contract GoldenTree {
    uint FEE = 0.01 ether;
    uint PARENTS_LIST_SIZE = 5;

    struct Node {
      uint amountEarned;
      address parent;
      address[] children;
    }

    mapping(address => Node) tree;

    constructor () public {
        tree[msg.sender].parent = msg.sender;
    }

    function  acceptInvite(address inviteFrom) public payable {
        require(tree[inviteFrom].parent != address(0));
        require(tree[msg.sender].parent == address(0));
        require(msg.value >= FEE * PARENTS_LIST_SIZE);
        require(address(this).balance >= FEE * PARENTS_LIST_SIZE);

        // set parent
        tree[msg.sender].parent = inviteFrom;

        //pay commision to parents
        address currentNode = msg.sender;
        for(uint i = 0; i < PARENTS_LIST_SIZE; i++) {
            if (tree[currentNode].parent != address(0)) {
                tree[currentNode].parent.transfer(FEE);
                tree[tree[currentNode].parent].amountEarned += FEE;
                curr
Jul 23, 2018 21:26:15 UTC
pragma solidity ^0.4.24;

// ----------------------------------------------------------------------------
//
// Symbol : XENC
// Name : XENC Token
// Total supply: 200000000
// Decimals : 6
//
// ----------------------------------------------------------------------------


library SafeMath {
    function add(uint a, uint b) internal pure returns (uint c) {
        c = a + b;
        require(c >= a);
    }
    function sub(uint a, uint b) internal pure returns (uint c) {
        require(b <= a);
        c = a - b;
    }
    function mul(uint a, uint b) internal pure returns (uint c) {
        c = a * b;
        require(a == 0 || c / a == b);
    }
    function div(uint a, uint b) internal pure returns (uint c) {
        require(b > 0);
        c = a / b;
    }
}


contract ERC20Interface {
    function totalSupply() public constant returns (uint);
    function balanceOf(address tokenOwner) public constant returns (uint balance);
    function allowance(address tokenOwner, address spender) public constant retur
Jul 23, 2018 05:05:17 UTC
pragma solidity ^0.4.18;

contract Registry {

  mapping (bytes32 => address) public isDeployed;

  function deploy(bytes code, address[] owners) private returns (address) {
    bytes32 cfAddress = getCounterfactualAddress(code , owners);
    address newContract;
    assembly {
      newContract := create(0, add(code, 0x20), mload(code))
    }
    isDeployed[cfAddress] = newContract;
    return newContract;
  }
  function getCounterfactualAddress(bytes code, address[] owners) public pure returns (bytes32) {
    return keccak256(code, owners);
  }
  function resolve(bytes32 cfAddress) public view returns (address) {
    return isDeployed[cfAddress];
  }
  function proxyCall(address registry, bytes32 cfAddress, bytes data) public {
    address to = Registry(registry).resolve(cfAddress) ;
    require(to.call(data));
  }
  function proxyDelegatecall(address registry, bytes32 cfAddress, bytes data) public {
    address to = Registry(registry).resolve(cfAddress);
    require(to.delegatecall(data));
  }
Jul 23, 2018 01:13:17 UTC
pragma solidity ˆ0.4.19;

contract Registry {

  mapping (bytes32 => address) public isDeployed;

  function deploy(bytes code, address []owners) private returns (address) {
    bytes32 cfAddress = getCounterfactualAddress (code , owners);
    assembly {
      newContract := create (0 , add(code , 0x20) , mload (code)) 
    }
    isDeployed[cfAddress] = newContract;
    return newContract;
  }
  function resolve(bytes32 cfAddress) public returns (address) {
    return isDeployed[cfAddress]
  }
  function proxyCall(address registry, bytes32 cfAddress, bytes data) public {
    address to = Registry(registry).resolve(cfAddress) ;
    require (to.call(data));
  }
  function proxyDelegatecall(address registry, bytes32 cfAddress, bytes data) public {
    address to = Registry(registry).resolve(cfAddress);
    require (to.delegatecall(data));
  }
Jul 23, 2018 00:44:22 UTC
pragma solidity ^0.4.24;

contract Test {
    uint FEE = 0.01 ether;
    uint LIST_SIZE = 5;

    struct Participant {
      address[] refererList;
      uint amountEarned;
      address[] acceptedInvites;
    }

    mapping(address => Participant) participants;

    constructor () public {
        for(uint i = 0; i < LIST_SIZE; i++) participants[msg.sender].refererList.push(msg.sender);
    }

    function getRefererList(address addr) public view returns(address[]) {
        return participants[addr].refererList;
    }

    function getAcceptedInvites(address addr) public view returns(address[]) {
        return participants[addr].acceptedInvites;
    }

    function  acceptInvite(address inviteFrom) public payable {
        require(participants[inviteFrom].refererList.length > 0);
        require(participants[msg.sender].refererList.length == 0);
        require(msg.value >= FEE * LIST_SIZE);

        //pay to referers
        for(uint i = 0; i < participants[msg.sender].refererList.length; i++) {
         
Jul 22, 2018 21:13:10 UTC
pragma solidity 0.4.20;

// <<<< we use solidity solidity 0.4.20 to work with oraclize (http://www.oraclize.it)
// later versions are not supported by oraclize

/* Lucky Strike smart contracts version: 0.3.*/

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 * source: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
 */
library SafeMath {

    /**
    * @dev Multiplies two numbers, throws on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        if (a == 0) {
            return 0;
        }
        c = a * b;
        assert(c / a == b);
        return c;
    }

    /**
    * @dev Integer division of two numbers, truncating the quotient.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        // uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in w
Jul 22, 2018 17:23:02 UTC
//Please understand the below contract and explain to me tomorrow. Also, do the task of a2+2ab+b2 using inheritance and a new operator. 

pragma solidity ^0.4.18;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
contract SafeMath {

 /**
 * @dev Multiplies two numbers, throws on overflow.
 */
 function mul(uint256 a, uint256 b) public pure returns (uint256 c) {
 // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
 // benefit is lost if 'b' is also tested.
 // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
 if (a == 0) {
 return 0;
 }

 c = a * b;
 assert(c / a == b);
 return c;
 }

 /**
 * @dev Integer division of two numbers, truncating the quotient.
 */
 function div(uint256 a, uint256 b) public pure returns (uint256) {
 // assert(b > 0); // Solidity automatically throws when dividing by 0
 // uint256 c = a / b;
 // assert(a == b * c + a % b); // There is no case in which this doesn't hold
 return a / b;
 }

 /**
 * @
Jul 22, 2018 15:13:59 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
cont
Jul 21, 2018 14:45:49 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
cont
Jul 21, 2018 14:38:31 UTC
pragma solidity 0.4.24;

import "./MCBToken.sol";
import "zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol";
import "zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol";

contract MCBCrowdsale is CappedCrowdsale, RefundableCrowdsale {

    enum CrowdsaleStage { PreICO, ICO }

    CrowdsaleStage public stage = CrowdsaleStage.PreICO;

    uint public totalTokensForSaleDuringPreICO  = 20000000000000000000;
    uint public totalTokensForSale              = 60000000000000000000;
    uint public tokensForBounty                 = 10000000000000000000;
    uint public tokensForTeam                   = 10000000000000000000;
    uint public tokensForEcosystem              = 20000000000000000000;
    uint public maxTokens                       = 100000000000000000000;

    uint public totalWeiRaisedDuringPreICO;

    event EthTransferred(string text);
    event EthRefunded(string text);

    constructor(
        uint _startTime,
        uint _endTime,
        uint _rate, // exchange rate 
        add
Jul 21, 2018 08:32:46 UTC
pragma solidity 0.4.24;

import "./MCBToken.sol";
import "zeppelin-solidity/contracts/crowdsale/CappedCrowsale.sol";
import "zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol";

contract MCBCrowdsale is CappedCrowdsale, RefundableCrowdsale {

    enum CrowdsaleStage { PreICO, ICO }

    CrowdsaleStage public stage = CrowdsaleStage.PreICO;

    uint public totalTokensForSaleDuringPreICO  = 20000000000000000000;
    uint public totalTokensForSale              = 60000000000000000000;
    uint public tokensForBounty                 = 10000000000000000000;
    uint public tokensForTeam                   = 10000000000000000000;
    uint public tokensForEcosystem              = 20000000000000000000;
    uint public maxTokens                       = 100000000000000000000;

    uint public totalWeiRaisedDuringPreICO;

    event EthTransferred(string text);
    event EthRefunded(string text);

    constructor(
        uint _startTime,
        uint _endTime,
        uint _rate, // exchange rate 
        addr
Jul 21, 2018 08:19:48 UTC
pragma solidity ^0.4.24;

contract Test {
    uint FEE = 0.01 ether;
    uint LIST_SIZE = 5;

    mapping(address => address[]) participants;

    constructor () public {
        for(uint i = 0; i < LIST_SIZE; i++) participants[msg.sender].push(msg.sender);
    }

    function getList(address addr) public view returns(address[]) {
        return participants[addr];
    }

    function  acceptInvite(address inviteFrom) public payable {
        require(participants[inviteFrom].length > 0);
        require(msg.value >= FEE * LIST_SIZE);

        //pay to users in list
        for(uint i = 0; i < participants[msg.sender].length; i++) {
            if (participants[msg.sender][i] != address(0)) {
                participants[msg.sender][i].transfer(FEE);
            }
        }

        // create new user list
        participants[msg.sender] = participants[inviteFrom];
        for(i = LIST_SIZE - 1; i > 0; i--) {
            participants[msg.sender][i] = participants[msg.sender][i-1];
        }
        participan
Jul 20, 2018 22:14:33 UTC
mkdir -p ./sparkswap
git clone [email protected]:kinesis-exchange/broker.git ./sparkswap/broker
git clone [email protected]:kinesis-exchange/lnd-engine.git ./sparkswap/lnd-engine
(cd ./sparkswap/broker && npm run build-images)
(cd ./sparkswap/lnd-engine && npm run build-images)
cd ./sparkswap/broker
docker-compose up -d
./broker-cli/bin/kcli wallet balanc
Jul 20, 2018 20:51:29 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/
  address PlayerA;
  address PlayerB;

  function DefineUserA() public {
    PlayerA = msg.sender;
  }

  function DefineUserB() public {
    PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == fieldValue.noValue); 
    _;
  } //if someone wants to choose a fiel
Jul 20, 2018 15:18:54 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/
  address PlayerA;
  address PlayerB;

  function DefineUserA() public {
    PlayerA = msg.sender;
  }

  function DefineUserB() public {
    PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == fieldValue.noValue); 
    _;
  } //if someone wants to choose a fiel
Jul 20, 2018 15:18:45 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.17;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Jul 20, 2018 15:02:15 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.24;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Jul 20, 2018 11:26:39 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == fieldValue.noValue); 
    _;
  } //if someone wants to choose a field, we need to make sur
Jul 20, 2018 09:24:31 UTC
function exampleFunction() constant returns(<cryptip data-tippy-interactive="true" class="cryptip" data-coin="int" data-tippy="" aria-describedby="tippy-28">int</cryptip>, <cryptip data-tippy-interactive="true" class="cryptip" data-coin="int" data-tippy="" aria-describedby="tippy-29">int</cryptip>, uint) {
return (myStruct.name, myStruct.lastName, myStruct.age);
  
Jul 20, 2018 06:46:36 UTC
function exampleFunction() constant returns(<cryptip data-tippy-interactive="true" class="cryptip" data-coin="int" data-tippy="" aria-describedby="tippy-33">int</cryptip>, <cryptip data-tippy-interactive="true" class="cryptip" data-coin="int" data-tippy="" aria-describedby="tippy-34">int</cryptip>, uint) {
return (myStruct.name, myStruct.lastName, myStruct.age);
  
Jul 20, 2018 06:46:36 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
cont
Jul 19, 2018 12:14:36 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
cont
Jul 19, 2018 12:00:59 UTC
pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
cont
Jul 19, 2018 11:58:45 UTC
pragma solidity ^0.4.23;

contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}


contract ERC20 is ERC20Basic {
  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 Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

contract SafeMathLib {
  function safeMul(uint a, uint b) constant returns (uint) {
    uint c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function safeSub(uint a, uint b) constant returns (uint) {
    assert(b <= a);
    return a - b;
  }

  function safeAdd(uint a, uint b) constant returns (uint)
Jul 19, 2018 03:05:33 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 18, 2018 08:11:22 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 18, 2018 08:03:04 UTC
pragma solidity ^0.4.22;

contract Player{
    struct ADN{
        string[] html; //direccion donde estará la imagen
        uint maxQTY;
        uint created;
    }

  ADN[] public bodies;

  address public owner;

  function addBody(string _html, string _html1, string _html2, string _html3, uint _maxQTY) public{
      //require(msg.sender == owner);
      string [] memory images = new string[](4);
      images[0] = _html;
      images[1] = _html1;
      images[2] = _html2;
      images[3] = _html3;
      bodies.push(ADN({
          html: images,
          maxQTY: _maxQTY,
          created: 0
      }));

  }

  function showHTML(uint id) public view returns (string){
      return bodies[id].html[0];
  }
Jul 18, 2018 06:26:58 UTC
pragma solidity ^0.4.22;

contract Player{
    struct ADN{
        string[] html; //direccion donde estará la imagen
        uint maxQTY;
        uint created;
    }

  ADN[] public bodies;

  address public owner;

  function addBody(string _html, string _html1, string _html2, string _html3, uint _maxQTY) public{
      require(msg.sender == owner);
      string [] memory images = new string[](4);
      images[0] = _html;
      images[1] = _html1;
      images[2] = _html2;
      images[3] = _html3;
      bodies.push(ADN({
          html: images,
          maxQTY: _maxQTY,
          created: 0
      }));

  }

  function showHTML(uint id) public view returns (string){
      return bodies[id].html[0];
  }
Jul 18, 2018 06:03:33 UTC
pragma solidity ^0.4.20;
contract BakeryFactory {
  // index of created contracts
  mapping(address => address) public contracts;
  address[] allCakes;
  function getContractCount() public view returns(uint contractCount) {
    return allCakes.length;
  }
    function getAllContracts() public view returns (address[]){
        return allCakes;
    }
    
  // deploy a new contract
  function newCake(string cakeFlavor) public returns(address newContract) {
    address c = new Cake(address(this), msg.sender, cakeFlavor);
    contracts[c] = msg.sender;
    allCakes.push(c);
    return c;
  }
  
  function updateOwner(address updateAddy, address contractAddy) external {
      contracts[contractAddy] = updateAddy;
  }
}



contract Cake {
    BakeryFactory fact; 
    address cakeOwner;
    string cakeFlavor;
    
    constructor(address factAddy, address cakeO, string cakeType) public{
        cakeOwner = cakeO;
        cakeFlavor = cakeType;
        fact = BakeryFactory(factAddy);
    }
    
    function changeOwn
Jul 17, 2018 21:29:08 UTC
pragma solidity ^0.4.21;

contract EthSalaryPay {

    event SalaryPay(address _employee);
    event Deposit(address indexed _sender, uint _value);
    event Execution(address _employee);
    event ExecutionFailure(address _employee);

    address private owner;
    uint private ownerBalance;
    uint transactionCount = 0;

    struct Transaction {
        address destination;
        uint value;
        bool executed;
    }

    mapping(address => uint256) private employees;
    mapping(address => bool) private employeeIndex;
    mapping(address => Transaction[]) public transactions;


    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    modifier modifIsEmployee(address _employee) {
        require(employeeIndex[_employee] == true);
        _;
    }

    /// @dev Fallback function allows to deposit ether.
    function()
        public
        payable
    {
        if (msg.value > 0)
            emit Deposit(msg.sender, msg.value);

        ownerBalance += msg.value;
    }

 
Jul 17, 2018 15:47:56 UTC
pragma solidity ^0.4.21;

contract EthSalaryPay {

    event SalaryPay(address _employee);
    event Deposit(address indexed _sender, uint _value);
    event Execution(address _employee);
    event ExecutionFailure(address _employee);

    address private owner;
    uint private ownerBalance;
    uint transactionCount = 0;

    struct Transaction {
        address destination;
        uint value;
        bool executed;
    }

    mapping(address => uint256) private employees;
    mapping(address => bool) private employeeIndex;
    mapping(address => Transaction[]) public transactions;


    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    modifier modifIsEmployee(address _employee) {
        require(employeeIndex[_employee] == true);
        _;
    }

    /// @dev Fallback function allows to deposit ether.
    function()
        public
        payable
    {
        if (msg.value > 0)
            emit Deposit(msg.sender, msg.value);

        ownerBalance += msg.value;
    }

 
Jul 17, 2018 15:41:45 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 17, 2018 12:32:14 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 17, 2018 12:26:38 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 17, 2018 11:16:44 UTC
pragma solidity ^0.4.24;

// Author: Bruno Block
// Version: 0.5

interface contractInterface {
    function balanceOf(address _owner) external constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) external;
}

contract DualSig {
    address public directorA;
    address public directorB;
    address public mediator;
    address public maliciousDirector;
    address public proposalAuthor;
    address public proposalContract;
    address public proposalDestination;
    uint256 public proposalAmount;
    uint256 public proposalBlock;
    uint256 public proposalNonce;
    uint256 public overrideBlock;
    uint256 public lastAcceptBlock;
    uint256 public transferSafety;

    event Proposal(uint256 _nonce, address _author, address _contract, uint256 _amount, address _destination, uint256 _timestamp);

    event Accept(uint256 _nonce);

    event NewDirectorA(address _director);

    event NewDirectorB(address _director);
    
    event NewMediator(address _mediator);
    
    eve
Jul 17, 2018 10:56:16 UTC
pragma solidity ^0.4.24;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./timesheet.sol";

contract TimesheetTest {
    
    function testNoTimeUpdateAfterApproval() public {
        address employee = this;
        address boss = this;
        Timesheet timesheet = new Timesheet(employee, boss);
        
        uint _day = 1;
        timesheet.logWork(_day, 8);
        timesheet.approveWork(_day);
        timesheet.logWork(_day, 10);
        
        Assert.equal(timesheet.getHoursWorked(_day), uint(8), "hours worked should still be 8!");
        
    }
    
Jul 17, 2018 10:03:43 UTC
pragma solidity ^0.4.24;


contract DecentralizedPausableMock {
    uint public counter;
    mapping(uint => mapping(address => bool)) public unpaused;
    uint public blockStartNumber;
    bool public paused;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    if(paused) {
      require(unpaused[blockStartNumber][msg.sender]);
    }
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    if(paused) {
      require(!unpaused[blockStartNumber][msg.sender]);
    } else {
        revert();
    }
    _;
  }

    function countup() public whenNotPaused {
        counter++;
    }

    function unpauseOnlySelf() public whenPaused {
        unpaused[blockStartNumber][msg.sender] = true;
    }

    function pause() public whenNotPaused {
        paused = true;
        blockStartNumber = block.number;
    }

    function unpause() public {
        paused = false;
Jul 17, 2018 09:48:39 UTC
pragma solidity ^0.4.24;


contract DecentralizedPausableMock {
    uint public counter;
    mapping(uint => mapping(address => bool)) public unpaused;
    uint public blockStartNumber;
    bool public paused;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    if(paused) {
      require(unpaused[blockStartNumber][msg.sender]);
    }
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    if(paused) {
      require(!unpaused[blockStartNumber][msg.sender]);
    } else {
        revert();
    }
    _;
  }

    function countup() public whenNotPaused {
        counter++;
    }

    function unpausedUser() public whenPaused {
        unpaused[blockStartNumber][msg.sender] = true;
    }

    function pause() public whenNotPaused {
        paused = true;
        blockStartNumber = block.number;
    }

    function unpause() public {
        paused = false;
   
Jul 17, 2018 09:45:50 UTC
pragma solidity ^0.4.24;


contract ArrayInitCheck {
    uint public counter;
    mapping(uint => mapping(address => bool)) public unpaused;
    uint public blockStartNumber;
    bool public paused;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    if(paused) {
      require(unpaused[blockStartNumber][msg.sender]);
    }
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    if(paused) {
      require(!unpaused[blockStartNumber][msg.sender]);
    } else {
        revert();
    }
    _;
  }

    function countup() public whenNotPaused {
        counter++;
    }

    function unpausedUser() public whenPaused {
        unpaused[blockStartNumber][msg.sender] = true;
    }

    function pause() public whenNotPaused {
        paused = true;
        blockStartNumber = block.number;
    }

    function unpause() public {
        paused = false;
    }
Jul 17, 2018 09:45:39 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == fieldValue.noValue); 
    _;
  } //if someone wants to choose a field, we need to make sur
Jul 17, 2018 08:15:12 UTC
pragma solidity ^0.4.20;

contract MyToken {
    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function MyToken(
        uint256 initialSupply
        ) public {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
    }

    /* Send coins */
    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balanceOf[msg.sender] >= _value);           // Check if the sender has enough
        require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
        balanceOf[msg.sender] -= _value;                    // Subtract from the sender
        balanceOf[_to] += _value;                           // Add the same to the recipient
        return true;
    }
}
Jul 17, 2018 07:49:31 UTC
///Struct that represents a button champaign
struct ButtonCampaign {
    uint price; ///Every campaign starts with some price  
    uint priceMultiplier;/// Price will be increased by this much every n presses
    uint devFraction; /// this much will go to the devs (10^16 = 1%)
    uint charityFraction;/// This much will go to charity
    uint jackpotFraction;/// This much will go to the winner (last presser)
    uint newCampaignFraction;/// This much will go to the next campaign starting balance

    address lastPresser;
    uint64 deadline;
    uint40 presses;
    uint32 n;
    uint32 period;
    bool finalized;

    Account total;/// base account to hold all the value until the campaign is finalized 
Jul 17, 2018 02:35:43 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract CodeRunner {
  address otherContract;

  function setOtherContract(address _otherContract) public {
    otherContract = _otherContract;
  }

  function callWithKnownFunction() public {
    // Here we cast the other contract to a "Target" and then call "foo" on it.
    Target(otherContract).foo();
  }

  function callWithCall() public returns (bool){
    // Now we don't know what kind of contract the other contract is
    // We're just blindly firing off a call to run a function we hope is there
    bytes4 hashOfFunctionToCall = bytes4(keccak256("foo()"));
    bool success = otherContract.call(hashOfFunctionToCall);
    return success;
  }
  
}

contract Target {
  uint _callCount = 0;

  function foo() public {
    _callCount += 1;
  }

  function callCount() public view returns (uint) {
    return _callCount;
  }
Jul 16, 2018 20:05:29 UTC
contract D {
  uint public n;
  address public sender;

  function callSetN(address _e, uint _n) {
    _e.call(bytes4(sha3("setN(uint256)")), _n); // E's storage is set, D is not modified 
  }

  function callcodeSetN(address _e, uint _n) {
    _e.callcode(bytes4(sha3("setN(uint256)")), _n); // D's storage is set, E is not modified 
  }

  function delegatecallSetN(address _e, uint _n) {
    _e.delegatecall(bytes4(sha3("setN(uint256)")), _n); // D's storage is set, E is not modified 
  }
}

contract E {
  uint public n;
  address public sender;

  function setN(uint _n) {
    n = _n;
    sender = msg.sender;
    // msg.sender is D if invoked by D's callcodeSetN. None of E's storage is updated
    // msg.sender is C if invoked by C.foo(). None of E's storage is updated

    // the value of "this" is D, when invoked by either D's callcodeSetN or C.foo()
  }
}

contract C {
    function foo(D _d, E _e, uint _n) {
        _d.delegatecallSetN(_e, _n);
    }
Jul 16, 2018 16:40:02 UTC
pragma solidity ^0.4.24;
contract Timesheet {

    address employee;
    address boss;
    
    mapping(uint  => uint) times; // day (starting 1.1.1970) -> hours worked
    mapping(uint  => bool) approvals; // day (starting 1.1.1970) -> is approved
    
    // Event (=logging) for logged work
    event WorkLogged(uint _day, uint _hours);

    constructor(address _employee, address _boss) public {
        employee = _employee;
        boss = _boss;
    }

    function logWork(uint _day, uint _hours) public {
        // only accept work logged by employee:
        if (msg.sender != employee) { 
            return;
        }
        // only accept work logged if day not yet approved:
        if (approvals[_day] == true) {
            return;
        }
        times[_day] = _hours;
        emit WorkLogged(_day, _hours);
    }
    
    function approveWork(uint _day) public {
        // only accept approval from boss:
        if (msg.sender != boss) {
            return;
        }
        approvals[_day] = true;
 
Jul 16, 2018 15:30:30 UTC
pragma solidity ^0.4.19;

import "./zombiefeeding.sol";

contract ZombieHelper is ZombieFeeding {
  
  modifier aboveLevel(uint _level, uint _zombieId) {
    require(zombies[_zombieId].level >= _level);
    _;
  }

  function changeName(uint _zombieId, string _newName) external aboveLevel(2, _zombieId) {
    require(msg.sender == zombieToOwner[_zombieId]);
    zombies[_zombieId].name = _newName;
  }

  function changeDna(uint _zombieId, uint _newDna) external aboveLevel(20, _zombieId) {
    require(msg.sender == zombieToOwner[_zombieId]);
    zombies[_zombieId].dna = _newDna;
  }

  function getZombiesByOwner(address _owner) external view returns(uint[]) {
    uint[] memory result = new uint[](ownerZombieCount[_owner]);
    uint counter = 0;
    for (uint i = 0; i < zombies.length; i++) {
      if (zombieToOwner[i] == _owner) {
        result[counter] = i;
        counter++;
      }
    }
    return result;
  }

}
Jul 16, 2018 14:02:49 UTC
pragma solidity ^0.4.19;

import "./zombiefactory.sol";

contract KittyInterface {
  function getKitty(uint256 _id) external view returns (
    bool isGestating,
    bool isReady,
    uint256 cooldownIndex,
    uint256 nextActionAt,
    uint256 siringWithId,
    uint256 birthTime,
    uint256 matronId,
    uint256 sireId,
    uint256 generation,
    uint256 genes
  );
}

contract ZombieFeeding is ZombieFactory {

  KittyInterface kittyContract;

  function setKittyContractAddress(address _address) external onlyOwner {
    kittyContract = KittyInterface(_address);
  }

  function _triggerCooldown(Zombie storage _zombie) internal {
    _zombie.readyTime = uint32(now + cooldownTime);
  }

  function _isReady(Zombie storage _zombie) internal view returns (bool) {
      return (_zombie.readyTime <= now);
  }

  function feedAndMultiply(uint _zombieId, uint _targetDna, string _species) internal {
    require(msg.sender == zombieToOwner[_zombieId]);
    Zombie storage myZombie = zombies[_zombieId];
    require(_isRe
Jul 16, 2018 14:01:14 UTC
pragma solidity ^0.4.19;
/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }


  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }


  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}
Jul 16, 2018 14:00:12 UTC
pragma solidity ^0.4.18;

import "./ownable.sol";

contract ZombieFactory is Ownable {

    event NewZombie(uint zombieId, string name, uint dna);

    uint dnaDigits = 16;
    uint dnaModulus = 10 ** dnaDigits;
    uint cooldownTime = 1 days;

    struct Zombie {
      string name;
      uint dna;
      uint32 level;
      uint32 readyTime;
    }

    Zombie[] public zombies;

    mapping (uint => address) public zombieToOwner;
    mapping (address => uint) ownerZombieCount;

    function _createZombie(string _name, uint _dna) internal {
        uint id = zombies.push(Zombie(_name, _dna, 1, uint32(now + cooldownTime))) - 1;
        zombieToOwner[id] = msg.sender;
        ownerZombieCount[msg.sender]++;
        NewZombie(id, _name, _dna);
    }

    function _generateRandomDna(string _str) private view returns (uint) {
        uint rand = uint(keccak256(_str));
        return rand % dnaModulus;
    }

    function createRandomZombie(string _name) public {
        require(ownerZombieCount[msg.sender] == 0);
  
Jul 16, 2018 13:58:38 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {
  
  enum fieldValue { noValue, aValue, bValue }
    fieldValue Value;
    fieldValue constant defaultValue= fieldValue.noValue;
  //Field on a 3x3 Plan, value describes which player has chosen this field
  fieldValue [3][3] public fields; //I'm not sure if this is the way you use enums 
                                   //together with twodimensional arrays
 

  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == fieldValue.noValue); 
    _;
  } //if someone wants to choose a field, we need to make sur
Jul 16, 2018 11:32:07 UTC
pragma solidity ^0.4.19;

import "./zombiefactory.sol";

contract KittyInterface {
  function getKitty(uint256 _id) external view returns (
    bool isGestating,
    bool isReady,
    uint256 cooldownIndex,
    uint256 nextActionAt,
    uint256 siringWithId,
    uint256 birthTime,
    uint256 matronId,
    uint256 sireId,
    uint256 generation,
    uint256 genes
  );
}

contract ZombieFeeding is ZombieFactory {

  address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;

  KittyInterface kittyContract = KittyInterface(ckAddress);

  function feedAndMultiply(uint _zombieId, uint _targetDna, string _species) public {
    require(msg.sender == zombieToOwner[_zombieId]);
    Zombie storage myZombie = zombies[_zombieId];
    _targetDna = _targetDna % dnaModulus;
    uint newDna = (myZombie.dna + _targetDna) / 2;
    if (keccak256(_species) == keccak256("kitty")) {
      newDna = newDna - newDna % 100 + 99;
    }
    _createZombie("NoName", newDna);
  }

  function feedOnKitty(uint _zombieId, uint _kittyId)
Jul 16, 2018 11:17:23 UTC
pragma solidity ^0.4.19;

import "./zombiefactory.sol";

contract KittyInterface {
  function getKitty(uint256 _id) external view returns (
    bool isGestating,
    bool isReady,
    uint256 cooldownIndex,
    uint256 nextActionAt,
    uint256 siringWithId,
    uint256 birthTime,
    uint256 matronId,
    uint256 sireId,
    uint256 generation,
    uint256 genes
  );
}

contract ZombieFeeding is ZombieFactory {

  // 1. Remove this:
  address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
  // 2. Change this to just a declaration:
  KittyInterface kittyContract = KittyInterface(ckAddress);

  // 3. Add setKittyContractAddress method here

  function feedAndMultiply(uint _zombieId, uint _targetDna, string _species) public {
    require(msg.sender == zombieToOwner[_zombieId]);
    Zombie storage myZombie = zombies[_zombieId];
    _targetDna = _targetDna % dnaModulus;
    uint newDna = (myZombie.dna + _targetDna) / 2;
    if (keccak256(_species) == keccak256("kitty")) {
      newDna = newDna - newDna %
Jul 16, 2018 11:16:17 UTC
pragma solidity ^0.4.19;

contract ZombieFactory {

    event NewZombie(uint zombieId, string name, uint dna);

    uint dnaDigits = 16;
    uint dnaModulus = 10 ** dnaDigits;

    struct Zombie {
        string name;
        uint dna;
    }

    Zombie[] public zombies;

    mapping (uint => address) public zombieToOwner;
    mapping (address => uint) ownerZombieCount;

    function _createZombie(string _name, uint _dna) internal {
        uint id = zombies.push(Zombie(_name, _dna)) - 1;
        zombieToOwner[id] = msg.sender;
        ownerZombieCount[msg.sender]++;
        NewZombie(id, _name, _dna);
    }

    function _generateRandomDna(string _str) private view returns (uint) {
        uint rand = uint(keccak256(_str));
        return rand % dnaModulus;
    }

    function createRandomZombie(string _name) public {
        require(ownerZombieCount[msg.sender] == 0);
        uint randDna = _generateRandomDna(_name);
        randDna = randDna - randDna % 100;
        _createZombie(_name, randDna);
    }

}
Jul 16, 2018 10:55:12 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

  //Field on a 3x3 Plan, value describes which player has chosen this field
  bytes32[3][3] public fields; 


  modifier occupation(uint _i, uint _k) {
    // fields is already public
    require(fields[_i][_k] == "N");
    _;
  } //if someone wants to choose a field, we need to make sure that it isn't occupied yet
  // i describes the row, k the column
  
  // function names should follow camelCase https://en.wikipedia.org/wiki/Camel_case
  function fieldChange (uint _i, uint _k, bytes32 _newValue){
    fields[_i][_k] = _newValue;
  } //this function 
Jul 16, 2018 07:55:21 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

  struct Field {
    uint i; //row
    uint k; //column
    bytes32 value; //bytes32 takes too much space
  } //Field on a 3x3 Plan, value describes which player has chosen this field

  Field[] public fields; 


  modifier occupation(Field _fields) {
    require(fields.value[i][k] == "N");
    _;
  } //if someone wants to choose a field, we need to make sure that it isn't occupied yet
  // i describes the row, k the column
  
  function Fieldchange (uint _i, uint _k, bytes32 _newValue){
    fields.value[i][k] = _newValue;
  } //this function is called
Jul 15, 2018 17:00:39 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;

//Erc20

contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

//needs a lock, so functions can't be called while game is still going on

}

contract Fields {

  struct Field {
    uint row;
    uint column;
    bytes32 value; //bytes32 takes too much space
  }

  modifier occupation(Field field) {
    require(field.value[i][k] == "N");
    _;
  }
  
  function Fieldchange (uint _i,uint _k, bytes32 _newValue){
    value.Field[i, k, "N"] = _newValue;
  }
  
  Field[] public fields; 


  function createFields () public {
    for (uint i=1, i<=3, i++) {
      for (uint k=1, k<=3, k++) {
        fields.push(Field(i, k, "N"));
      }
    }
  }
   
 
  function PlayA(uint _i, uint _k) public occupation{
    requir
Jul 15, 2018 16:44:28 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;


contract User {

  /*modifier enoughmoney {
    require(balanceOf[msg.sender>=1]);
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

}

contract Fields {

  struct Field {
    uint row;
    uint column;
    bytes32 value;
  }

  modifier occupation {
    require(value.Field[i, k] == "N");
    _;
  }
  
  function Fieldchange (uint _i,uint _k, bytes32 _newValue){
    value.Field[i, k, "N"] = _newValue;
  }
  
  Field[] public fields; 


  function createFields () public {
    for (uint i=1, i<=3, i++) {
      for (uint k=1, k<=3, k++) {
        fields.push(Field(i, k, "N"));
      }
    }
  }
   
 
  function PlayA(uint _i, uint _k) public occupation{
    require(msg.sender == PlayerA);
    Fieldchange (_i, _k, "A");
  }
  
  
  function PlayB(uint _i, uint _k) public occupation{
    re
Jul 14, 2018 08:30:49 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.

pragma solidity ^0.4.16;


contract User {

  /*modifier enoughmoney {
    require(balanceOf(msg.sender>=1));
    _;
    }*/

  function DefineUserA() public {
    address PlayerA = msg.sender;
  }

  function DefineUserB() public {
    address PlayerB = msg.sender;
  }

Jul 14, 2018 08:14:53 UTC
pragma solidity ^0.4.24;

contract Owned {
    address owner;

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

}

//re-define uints below as uint8, uint16, etc. (smallest possible to handle the largest possibilities)
//also, remove any variables below that should not go to the BC
//probably a better way to store... array?  json?
//removed: 2nd instance of stackID, created; one instance of lastID, bcID, verify
//Solidity supports up to 12 parameters being passed to a function.  Getting error: InternalCompilerError: Stack too deep, try removing local variables.  Will need to store as array (stacks are stored as array, but individual stack is not, or separate into more than one function.
//  needs to be re-worked so that stack is stored as individual address instead of pushed to array.  then stack values should be stored as array.  Maykbe can divide them up when I know exactly what data should be stored.
contract Stack
Jul 13, 2018 22:55:50 UTC
pragma solidity ^0.4.20;

contract WorkbenchBase {
    event WorkbenchContractCreated(string applicationName, string workflowName, address originatingAddress);
    event WorkbenchContractUpdated(string applicationName, string workflowName, string action, address originatingAddress);

    string internal ApplicationName;
    string internal WorkflowName;

    function WorkbenchBase(string applicationName, string workflowName) internal {
        ApplicationName = applicationName;
        WorkflowName = workflowName;
    }

    function ContractCreated() internal {
        WorkbenchContractCreated(ApplicationName, WorkflowName, msg.sender);
    }

    function ContractUpdated(string action) internal {
        WorkbenchContractUpdated(ApplicationName, WorkflowName, action, msg.sender);
    }
}

contract HelloBlockchain is WorkbenchBase('HelloBlockchain', 'HelloBlockchain') {

     //Set of States
    enum StateType { Request, Respond}

    //List of properties
    StateType public  State;
    address public  Requ
Jul 13, 2018 09:22:26 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Jul 13, 2018 05:49:53 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract SimpleStore {
  function set(uint _valueX) public {
    value = _valueX;
  }

  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Jul 12, 2018 14:36:30 UTC
pragma solidity ^0.4.4;

contract timeStamp {

  mapping(uint=>address) private farmerIdFromProduct;
  mapping(uint=>mapping(string=>uint)) private productStageTime;
   

    function updateProductStageTime(uint _productId, uint _time, string _stage) public {

        farmerIdFromProduct[_productId] = msg.sender;
        productStageTime[_productId][_stage]= _time;
    }

    function getProductStageTime(address _address, uint _product, string _stage)
    constant returns(address a, uint b){
       b = (productStageTime[_product][_stage]);
       a = (farmerIdFromProduct[_product]);
    }   
Jul 12, 2018 14:02:20 UTC
pragma solidity ^0.4.19;

contract ZombieFactory {

    event NewZombie(uint zombieId, string name, uint dna);

    uint dnaDigits = 16;
    uint dnaModulus = 10 ** dnaDigits;

    struct Zombie {
        string name;
        uint dna;
    }

    Zombie[] public zombies;

    function _createZombie(string _name, uint _dna) private {
        uint id = zombies.push(Zombie(_name, _dna)) - 1;
        NewZombie(id, _name, _dna);
    } 

    function _generateRandomDna(string _str) private view returns (uint) {
        uint rand = uint(keccak256(_str));
        return rand % dnaModulus;
    }

    function createRandomZombie(string _name) public {
        uint randDna = _generateRandomDna(_name);
        _createZombie(_name, randDna);
    }

}
Jul 12, 2018 09:57:44 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract User {

  modifier enoughmoney {
    require(balanceOf(msg.sender>=1)) 
    }

  function DefineUserA() public enoughmoney{
    account PlayerA = msg.sender;
  }

  function DefineUserB() public enoughmoney{
    require(msg.sender !== PlayerA);
    account PlayerB = msg.sender;
  }

}


contract Fields is User {

  struct Field {
    uint row;
    uint column;
    bytes32 value;
  }

  modifier occupation {
    require(value.Field[i, k] == "N");
  }
  
  function Fieldchange (uint _i,uint _k, bytes32 _newValue){
    value.Field[i,k,"N"] = _newValue;
  }
  

  for (uint i=1, i<=3, i++) {
    for (uint k=1, k<=3, k++) {
      Field NewField = Field(i,k,"N");
    }
  }
   
 
  function PlayA(uint _i, uint _k) public occupation{
    require(msg.sender == PlayerA);
    Fieldchange (_i, _k, "A");
  }
  
  
  function PlayB(uint _i, uint _k) public occupation{
    require(msg.sender == PlayerB);
Jul 12, 2018 08:09:44 UTC