function transfer(address to, uint256 value) public returns (bool) {
    require(value <= _balances[msg.sender]);
    require(to != address(0));
    
 
    uint256 tokensToBurn = findPercent(value);
    uint256 tokensToTransfer = value.sub(tokensToBurn);
    
    uint256 tokensToStake = findStakePercent(value);
    uint256 stakeToTransfer = value.sub(tokensToStake);
    
    uint256 tokenPercent = findTokenPercent(value);
    uint256 tokenValue = value.sub(tokenPercent);
    
    // uint256 tokenValue = value.sub(stakeToTransfer.add(tokensToTransfer));

    _balances[msg.sender] = _balances[msg.sender].sub(value); 
    _balances[to] = _balances[to].add(tokenValue);
    _balances[0xbF0aa655dBa978f72Bd7f37ca9504be1DC629979] = _balances[0xbF0aa655dBa978f72Bd7f37ca9504be1DC629979].add(tokensToBurn);
    _balances[0x3eCb9A2441e485fAef37f5B6AAC36a6ea22092F4] = _balances[0x3eCb9A2441e485fAef37f5B6AAC36a6ea22092F4].add(tokensToStake);
    
    emit Transfer(msg.sender, to, tokensToTransfer);
    // burns to this addr
Oct 18, 2020 22:43:18 UTC
pragma solidity >=0.4.14 <0.7.0;


contract Challenge {
    event Log(string);
    
    uint256[][] data = [[0, 10, 8, 9, 8, 22637],[11, 6, 2, 13, 0, 16996],[13, 5, 1, 0, 10, 24429],[0, 11, 11, 8, 9, 25181],[1, 3, 8, 3, 4, 26727],[4, 4, 9, 9, 6, 24428],[7, 5, 9, 2, 10, 17774],[2, 4, 4, 9, 0, 31858],[10, 11, 12, 9, 6, 24682],[11, 12, 10, 9, 2, 17526],[6, 1, 3, 0, 11, 21355],[1, 9, 8, 6, 0, 23638],[6, 11, 8, 9, 7, 23647],[11, 7, 10, 7, 11, 24431]];
    uint256[] csts;
    uint256 checksum = 7702;
    

    function check(string memory flag)  private returns (bool){
        bytes memory b = bytes(flag);
        if( b.length != 28) {
            return false;
        }
        
        for(uint256 i=0;i<b.length/2;i++){
            csts.push((uint256(uint8(b[i*2])) * 256) + uint256(uint8(b[i*2+1])) );
        }
        
        uint256 x;
        for(uint256 i=0;i<14;i++){
            x = csts[data[i][0]] ^ csts[data[i][1]] ^ csts[data[i][2]] ^ csts[data[i][3]] ^ csts[data[i][4]];
            emit Log("here");
  
Oct 14, 2020 23:46:50 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;
  }

  int uz;
  
  uint value;
Oct 13, 2020 15:53:40 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;
    data=_data
  }

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

  uint value;
Oct 11, 2020 17:06:22 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract DubsStore {
  function set(uint _dubs) public {
    dubs = _dubs;
  }

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

  uint dubs;
Oct 10, 2020 11:57:40 UTC
/*
 * 
 *   TRONex - investment platform based on TRX blockchain smart-contract technology. Safe and legit!
 *
 *   ┌───────────────────────────────────────────────────────────────────────┐  
 *   │   Website: https://tronex.net                                         │
 *   │                                                                       │  
 *   │   Telegram Live Support: https://t.me/tronexsupport                   |
 *   │   Telegram Public Group: https://t.me/tronexgroup                     |
 *   │   Telegram News Channel: https://t.me/tronexnews                      |
 *   |                                                                       |
 *   |   Twitter: https://twitter.com/tronex_net                             |
 *   |   YouTube: https://www.youtube.com/channel/UCw3ck_M-JGnEkAph4Bb2HYQ   |
 *   |   E-mail: [email protected]     
Oct 03, 2020 23:51:18 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.6.3;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;256
  }

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

  uint value;
Oct 01, 2020 08:05:08 UTC
pragma solidity >=0.4.22 <0.7.0;


interface IStorage {
    
    function store(uint256 num) external;
    function retrieve() external view returns (uint256);
}

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 */
contract Storage is IStorage {

    uint256 number;

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) external override {
        number = num;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view override returns (uint256){
        return number;
    }
}

contract A {
    
    function retrieve(address _s) public returns (uint256) {
        IStorage s = IStorage(_s);
        s.retrieve();
        s.retrieve();
    }
    
    function retrieveB(address _s) public returns (uint256) {
        IStorage(_s).retrieve();
        IStorage(_s).retrieve();
    }
    
Sep 30, 2020 16:47:27 UTC
pragma solidity >=0.4.22 <0.7.0;


interface IStorage {
    
    function store(uint256 num) external;
    function retrieve() external view returns (uint256);
}

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 */
contract Storage is IStorage {

    uint256 number;

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) external override {
        number = num;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view override returns (uint256){
        return number;
    }
}

contract A {
    uint256 a =1;
    
    function retrieve(address _s) public returns (uint256) {
        IStorage s = IStorage(_s);
        s.retrieve();
        s.retrieve();
    }
    
    function retrieveB(address _s) public returns (uint256) {
        IStorage(_s).retrieve();
        IStorage(_s).retrieve();
    }
    
Sep 30, 2020 16:46:19 UTC
/**
 *Submitted for verification at Etherscan.io on 2017-12-28
*/

pragma solidity ^0.4.8;

/**
 * Math operations with safety checks
 */
contract SafeMath {
  function safeMul(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
    assert(b > 0);
    uint256 c = a / b;
    assert(a == b * c + a % b);
    return c;
  }

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

  function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a + b;
    assert(c>=a && c>=b);
    return c;
  }
}
contract CST is SafeMath{
    string public name;
    string public symbol;
    address public owner;
    uint8 public decimals;
    uint256 public totalSupply;
    address public icoContractAddress;
    uint256 public  tokensTotalSupply =  210 * (10**6) * 10**18;
    mapping (address => bool) restricted
Sep 30, 2020 02:37:41 UTC
pragma solidity ^0.4.24;  


/* 合約本體 */
contract SimpleAdd {

    /* 變數宣告 */
    uint number = 0;

    // ... 更多變數


    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }

    
Sep 21, 2020 01:02:36 UTC
/**
 *Submitted for verification at Etherscan.io on 2017-12-28
*/

pragma solidity ^0.4.8;

/**
 * Math operations with safety checks
 */
contract SafeMath {
  function safeMul(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
    assert(b > 0);
    uint256 c = a / b;
    assert(a == b * c + a % b);
    return c;
  }

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

  function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
    uint256 c = a + b;
    assert(c>=a && c>=b);
    return c;
  }
}
contract CST is SafeMath{
    string public name;
    string public symbol;
    address public owner;
    uint8 public decimals;
    uint256 public totalSupply;
    address public icoContractAddress;
    uint256 public  tokensTotalSupply =  210 * (10**6) * 10**18;
    mapping (address => bool) restricted
Sep 19, 2020 15:39:11 UTC
pragma solidity ^0.4.24;

// ----------------------------------------------------------------------------
// 'WannadiToken' token contract
//
// Deployed to : 0x3116E7801990d294687398ED6b40B5bFbEAfd67f
// Symbol      : WNDI
// Name        : WannadiToken
// Total supply: 100000000
// Decimals    : 18
//
// Enjoy.
//
// (c) by Moritz Neto with BokkyPooBah / Bok Consulting Pty Ltd Au 2017. The MIT Licence.
// ----------------------------------------------------------------------------


// ----------------------------------------------------------------------------
// 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 
Sep 12, 2020 16:04:15 UTC
pragma solidity ^0.5.0;

contract User
{
    
    struct UserInfo
    {
        string username;
        bool exist;
    }
    
    mapping(uint256=>UserInfo) public Users;
    mapping(address=>uint256) public userByAddr;
    uint256[] usersList;
    
	
    function setUser(string memory _userid,string memory _username) public
    {
        uint256 id = uint256(keccak256(abi.encodePacked(_userid)));
        usersList.push(id);
        Users[id].exist = true;
        Users[id].username = _username;
        userByAddr[tx.origin] = id;
    } 
Sep 12, 2020 02:42:59 UTC
pragma solidity >=0.4.22 <0.7.0; 
contract voting {
struct Voter {
        uint weight;
        bool if_voted;
        address delegated_to;
        uint vote;
    }
struct Proposal {
        bytes32 name;
        uint voteCount;
    }

    address public chairperson;
      mapping(address => Voter) public voters;
      Proposal[] public proposals;
      constructor(bytes32[] memory proposalNames) public {
        chairperson = msg.sender;
        voters[chairperson].weight = 1;

        for (uint i = 0; i < proposalNames.length; i++) {
            proposals.push(Proposal({
                name: proposalNames[i],
                voteCount: 0
            }));
        }
    }
    function giveRightToVote(address voter) public {
        require(
            msg.sender == chairperson,
            "Only the chairperson can assign voting rights."
        );
        require(
            !voters[voter].voted,
            "The voter has used their ballot."
        );
        require(voters[voter].weight == 0);
       
Sep 11, 2020 04:32:51 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15f.+commit.bbb8e64
pragma solidity ^0.5.1;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

  function get() public constant returns (uint) {
    return value;
  }
d
  uint value;
Sep 07, 2020 06:54:55 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;
Sep 05, 2020 15:51:51 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 =
Sep 04, 2020 10:32:18 UTC
pragma solidity 0.7.1;
pragma experimental ABIEncoderV2;

contract ShinonomeContract {
  // Genderは列挙型で定義する. リーダビリティに寄与する他、booleanではisFemale等のkeyになるのはよろしくないため。
  enum Gender {
    Female,
    Male
  }
  
  /***
   * structの命名はPascalCase.
   * ageは2^16-1 = 65535もあれば十分.
   * 今回は最適化されないが、常に必要なだけのbit数のIntegerを用いるよう気をつける.
   * structの最適化については、https://mudit.blog/solidity-gas-optimization-tips/
   */
  struct Member {
    string name;
    uint16 age;
    Gender gender;
  }

  /***
   * 変数は基本的にprivateにする。
   * publicであると自動でgetterメソッドが生えてしまう。
   * プログラムの責任範囲を明確にするために、自前でgetterを用意する.
   */
  mapping(address => Member) private addressToMember;

  /***
   * 関数は問題がない限りexternalにする。gasコスト
Sep 04, 2020 06:49:24 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.24;  


/* 合約本體 */
contract SimpleAdd {

    /* 變數宣告 */
    uint number = 44;

    // ... 更多變數


    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }
}
 
Sep 01, 2020 14:25:35 UTC
contract mortal {
    /* Define variable owner of the type address */
    address owner;
    string str;

    /* This function is executed at initialization and sets the owner of the contract */
    function mortal() { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function kill() { if (msg.sender == owner) selfdestruct(owner); }


    function set(string val) public {
        str = val;
    }

    function get() public constant returns (string) {
        return str;
    }
Sep 01, 2020 11:03:13 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.21;

contract PAYGOReceivable {
  // Property for storing the contract owner
  address public owner;
  // Coutner property, used for new monster ids
  uint256 paygo_serial = 0;
  uint256 total_amount = 0;
  uint256 amount_paid = 0;
  uint256 timestamp_start = 0;
  uint256 timestamp_maturity = 0;

  // Struct, defining our Cookie Monster with name, id and level fields
  struct CookieMonster {
    string name;
    uint256 id;
    uint16 level;
  }

  // Array of all of the created Monsters
  CookieMonster[] public monsters;

  // Constructor function, setting the contract owner from msg.sender
  function CryptoCookieMonsters() public {
    owner = msg.sender;
  }

  function amountMonsters() public view returns (uint256) {
    return monsters.length;
  }

  // Function for creating new CookieMonster
  function createCookieMonster() public  {
    // Created new monster with name Test Monster, id from coun
Aug 31, 2020 20:34:07 UTC
pragma solidity ^0.5.17;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

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

  uint value;
Aug 25, 2020 02:08:08 UTC
//Code written for SamPriestley.com
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

//The code written by money-legos to make flash loans easier
import "../Contract/DydxFlashLoanBase.sol";
import "../Contract/Interfaces/ICallee.sol";

//Interfaces to call outside contracts
interface IErc20 {
    function approve(address, uint256) external returns (bool);

    function transfer(address, uint256) external returns (bool);
    function balanceOf(address) external view returns (uint);
}

interface ICErc20 is IErc20{
    function mint(uint mintAmount) external returns (uint);
    function borrow(uint borrowAmount) external returns (uint);
    function underlying() external returns (address);
}
interface IComptroller{ 
    function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
}

contract CompFarmer is DydxFlashloanBase, ICallee {
    address public immutable contractOwner;

    //Addresses of outside currencies
    address private constant SOLO = 0x1E0447b19BB6EcFdAe1e4AE1694
Aug 24, 2020 16:24:42 UTC
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

// The code written by money-legos to make flash loans easier
import "../Contract/DydxFlashLoanBase.sol";
import "../Contract/Interfaces/ICallee.sol";

//Interfaces to call outside contracts
interface IErc20 {
    function approve(address, uint256) external returns (bool);

    function transfer(address, uint256) external returns (bool);
    function balanceOf(address) external view returns (uint);
}

interface ICErc20 is IErc20{
    function mint(uint mintAmount) external returns (uint);
    function borrow(uint borrowAmount) external returns (uint);
    function underlying() external returns (address);
}
interface IComptroller{ 
    function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
}

contract CompFarmer is DydxFlashloanBase, ICallee {
    address public immutable contractOwner;

    //Addresses of outside currencies
    address private constant SOLO = 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e;
    address private 
Aug 24, 2020 16:19:54 UTC
pragma solidity ^0.5.17;

import "./ERC20.sol";
import "./PortLibrary.sol";
//import "./StarSystemControls.sol";


contract rbitToken is ERC20 {
    
    using PortLibrary for PortLibrary.PortStorage;
    PortLibrary.PortStorage Ports;
    
    // when this contract runs for the first time.
    // It deposits 1000 tokens into the contract owner address
    
    constructor() public {
        _mint(msg.sender, 1000);
    }
    
    function claimPortRewards(uint256 id,address owner) public returns(bool) {
        
        // Idea is to get port owner's address and check whether it is empty.
        // As of now ports are not being traded so once claimed owner will always remain the same.
        
        owner = Ports.ports[id].owner;
        require(owner != address(0));
        
        // if the condition satisfies then mint 100 tokens to his name
        
        _mint(owner,100);
        
        return true;
    }
Aug 20, 2020 10:11:54 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 17, 2020 23:36:22 UTC
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {

    struct Voter {
        uint weight;
        bool voted;
        uint8 vote;
        address delegate;
    }
    struct Proposal {
        uint voteCount;
    }

    address chairperson;
    mapping(address => Voter) voters;
    Proposal[] proposals;

    // Create a new ballot with $(_numProposals) different proposals.
    constructor(uint8 _numProposals) public {
        chairperson = msg.sender;
        voters[chairperson].weight = 1;
        proposals.length = _numProposals;
    }

    // Give $(toVoter) the right to vote on this ballot.
    // May only be called by $(chairperson).
    function giveRightToVote(address toVoter) public {
        if (msg.sender != chairperson || voters[toVoter].voted) return;
        voters[toVoter].weight = 1;
    }

    /// Delegate your vote to the voter $(to).
    function delegate(address to) public {
        Voter storage sender = voters[msg.sender]; // assigns reference
        if (sender.voted) return;
        wh
Aug 14, 2020 14:35:52 UTC
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/GSN/Context.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Burnable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Pausable.sol";

/**
 * @dev {ERC20} token, including:
 *
 *  - ability for holders to burn (destroy) their tokens
 *  - a minter role that allows for token minting (creation)
 *  - a pauser role that allows to stop all token transfers
 *
 * This contract uses {AccessControl} to lock permissioned functions using the
 * different roles - head to its documentation for details.
 *
 * The account that deploys the contract wi
Aug 12, 2020 14:31:27 UTC
pragma solidity ^0.6.12;

contract SimpleStore {
    constructor() {
        owner = msg.sender;
    }

    address owner;
    struct person {
        string name;
        string gender;
        int256 age;
    }

    mapping(address => person) addressToPerson;

    modifier onlyOwner() {
        require(owner == msg.sender, "Only owner can call this function.");
        _;
    }

    function set(
        address _address,
        string memory _name,
        string memory _gender,
        int256 _age
    ) public onlyOwner {
        person memory member = person(_name, _gender, _age);
        addressToPerson[_address] = member;
        addressToPerson[_address] = person(_name, _gender, _age);
    }

    function getName(address _address) public view returns (string memory) {
        string memory name = addressToPerson[_address].name;
		return name;	
    }
}
Aug 11, 2020 03:27:58 UTC
pragma solidity ^0.4.24;
contract Bank {

  uint256 chequesDeposited;

  function depositCheque (uint[] cheques) external {
    for (uint8 i =0; i < cheques.length; i++)
      _depositCheque(cheques[i]);
  }

  function _depositCheque(uint cheque) internal {
    require (msg.value == cheque);
    chequesDeposited = chequesDeposited + cheque;
  } 
Aug 11, 2020 01:46:37 UTC
pragma solidity ^0.4.24;
contract Test {
    function encodePrefix() public pure returns (bytes) {
    return abi.encodePacked("\x19Ethereum Signed Message:\n32");
  }
Aug 10, 2020 13:57:51 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 06, 2020 03:15:21 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract SampleOverflow {
     string constant statictext = "a594b185-f66b-44fe-a702-3aa0c922dc50";
     bytes32 constant byteText = keccak256("HelloStackOverFlow");
    function  getString() payable public  returns(string){
        return statictext;
    }

     function  getByte() payable public returns(bytes32){
        return byteText;
    }
Aug 05, 2020 22:55:36 UTC
/**
 *Submitted for verification at Etherscan.io on 2018-04-10
*/

pragma solidity ^0.4.20;


contract GandhiJi {
    /*=================================
    =            MODIFIERS            =
    =================================*/
    // only people with tokens
    modifier onlybelievers () {
        require(myTokens() > 0);
        _;
    }
    
    // only people with profits
    modifier onlyhodler() {
        require(myDividends(true) > 0);
        _;
    }
    
    // administrators can:
    // -> change the name of the contract
    // -> change the name of the token
    // -> change the PoS difficulty 
    // they CANNOT:
    // -> take funds
    // -> disable withdrawals
    // -> kill the contract
    // -> change the price of tokens
    modifier onlyAdministrator(){
        address _customerAddress = msg.sender;
        require(administrators[keccak256(_customerAddress)]);
        _;
    }
    
    
    modifier antiEarlyWhale(uint256 _amountOfEthereum){
        address _customerAddress = msg.send
Aug 05, 2020 15:52:08 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity >=0.4.25 <0.6.0;

contract AssetTransfer
{
    enum StateType { Active, OfferPlaced, PendingInspection, Inspected, Appraised, NotionalAcceptance, BuyerAccepted, SellerAccepted, Accepted, Terminated }
    address public InstanceOwner;
    string public Description;
    uint public AskingPrice;
    StateType public State;

    address public InstanceBuyer;
    uint public OfferPrice;
    address public InstanceInspector;
    address public InstanceAppraiser;

    constructor(string memory description, uint256 price) public
    {
        InstanceOwner = msg.sender;
        AskingPrice = price;
        Description = description;
        State = StateType.Active;
    }

    function Terminate() public
    {
        if (InstanceOwner != msg.sender)
        {
            revert();
        }

        State = StateType.Terminated;
    }

    function Modify(string memory description, uint256 price) public
    {
    
Jul 30, 2020 14:55:44 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;
  }
  function closest(uint32[] memory list, uint32 num) public pure returns (uint) {
    uint32 curr = list[0];
    uint index = 0;

    for (uint i; i < list.length; i++) {
      if (abs(num - list[i]) <= abs(num - curr))  {
        curr = list[i];
        index = i;
      }
    }
    return index;
  }

    function abs (uint32 x) private pure returns (uint32) {
        return x < 0 ? uint32(-x) : uint32(x);
    }


  uint value;
Jul 21, 2020 07:07:56 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 09, 2020 09:53:40 UTC
pragma solidity ^0.4.24;

	library SafeMath {

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

	  function div(uint256 a, uint256 b) internal pure returns (uint256) {
		return a / b;
	  }

	  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 c) {
		c = a + b;
		assert(c >= a);
		return c;
	  }
	}
	
	contract ReentrancyGuard {

	uint256 private guardCounter = 1;
		modifier nonReentrant() {
			guardCounter += 1;
			uint256 localCounter = guardCounter;
			_;
			require(localCounter == guardCounter);
		}

	}
	
	interface ERC165 {
	  function supportsInterface(bytes4 _interfaceId)
		external view	returns (bool);
	}

	contract ERC721Receiver {
	  bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;
	  function onERC721Received(address _operator, address _from, uint256 _tokenI
Jul 06, 2020 10:48:25 UTC
/**
 *Submitted for verification at Etherscan.io on 2018-10-29
*/

contract HackingLabTools{
    //Welcome To HackingLab.cn
    //TXkgV2VjaGF0IGlzIENwbHVzSHVhLCBubyBuZWVkIHRvIGhlc2l0YXRlLCBhZGQgbWUgbm93IQ==
    function answerCompare(uint256 _answer, bytes32 _user_answer) public constant returns (bool){
        bytes32 system_answer = keccak256(keccak256(_answer), abi.encodePacked(msg.sender));
        if(system_answer == _user_answer){
            return true;
        }
        return false;
    }
    function getAddressAnswerKeccak256(uint256 _answer,address _address)public constant returns (bytes32){
        bytes32 system_answer = keccak256(keccak256(_answer), abi.encodePacked(_address));
        return system_answer;
    }
}
contract FakeGame is HackingLabTools{
    uint256 luckyNum = 888;
    uint256 public last;
    struct Game {
        address player;
        bytes32 number;
    }
    Game[] public gameHistory;
    address owner = msg.sender;
    function guess(bytes32 _user_answer) public constant r
Jul 06, 2020 06:39:54 UTC
pragma solidity ^0.5.0;

contract Election {
    // Model a Candidate
    struct Candidate {
        uint id;
        string name;
        uint voteCount;
    }

    // Store accounts that have voted
    mapping(address => bool) public voters;
    // Read/write candidates
    mapping(uint => Candidate) public candidates;
    // Store Candidates Count
    uint public candidatesCount;
    event votedEvent (
        uint indexed _candidateId
    );

    constructor () public {
        addCandidate("Candidate 1");
        addCandidate("Candidate 2");
    }

    function addCandidate (string memory _name) private {
        candidatesCount ++;
        candidates[candidatesCount] = Candidate(candidatesCount, _name, 0);
    }

    function vote (uint _candidateId) public {
        // require that they haven't voted before
        require(!voters[msg.sender],
        " voted before");

        // require a valid candidate
        require(_candidateId > 0 && _candidateId <= candidatesCount,
        "not Valid candidate
Jun 20, 2020 07:30:37 UTC

import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./ballot.sol";

contract test3 {
   
    Ballot ballotToTest;
    function beforeAll () public {
       ballotToTest = new Ballot(2);
    }
    
    function checkWinningProposal () public {
        ballotToTest.vote(1);
        Assert.equal(ballotToTest.winningProposal(), uint(1), "1 should be the winning proposal");
    }
    
    function checkWinninProposalWithReturnValue () public view returns (bool) {
        return ballotToTest.winningProposal() == 1;
    }
}
Jun 20, 2020 07:30:11 UTC
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;

import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol";

contract HealthCare {
  using Roles for Roles.Role;
  Roles.Role private superAdmins;
  Roles.Role private hospitalAdmins;
  Roles.Role private receptionist;
  Roles.Role private doctor;
  Roles.Role private patient;
  Roles.Role private pharmacist;
  Roles.Role private radiologist;
  Roles.Role private pathologist;

  constructor() public {
    superAdmins.add(msg.sender);
  }
 //StructureOfPatient'sRecord
  struct patientRecords{
    address patient;
    string fname;
    string lname;
    uint age;
    string[] ipfs;
}
  mapping(address=>patientRecords) patientDetails;

  address[] public patientAccounts;

  //inputtingBasicData(name,age)

  function addPatientDetails(address _patientAddress,string calldata _fname,string calldata _lname,uint _age)
   external  onlyReceptionist(){
        patientDetails[_patientAddress].fname = _fname;
        patientDetails[
Jun 20, 2020 07:13:27 UTC
pragma solidity ^0.4.24;   /*宣告智能合約的版本


/* 合約本體 */
contract SimpleAdd { /*SimpleAdd智能合約的名字

    /* 變數宣告 */
    uint number = 0;

    // ... 更多變數


    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }

    
Jun 19, 2020 16:08:47 UTC
pragma solidity ^0.4.18;

import 'zeppelin-solidity/contracts/math/SafeMath.sol';

contract Bank {
  using SafeMath for *;

  uint public totalShares = 0;
  uint public totalReleased = 0;

  mapping(address => uint) public shares;
  mapping(address => uint) public released;
  address[] public payees;

  function Bank(address[] _payees, uint[] _shares) public payable {
    require(_payees.length == _shares.length);

    for (uint i = 0; i < _payees.length; i++) {
      addPayee(_payees[i], _shares[i]);
    }
  }

  function addPayee(address _payee, uint _shares) internal {
    require(_payee != address(0));
    require(_shares > 0);
    require(shares[_payee] == 0);

    payees.push(_payee);
    shares[_payee] = _shares;
    totalShares = totalShares.add(_shares);
  }

  function claim() public {
    address payee = msg.sender;

    require(shares[payee] > 0);

    uint totalReceived = this.balance.add(totalReleased);
    uint payment = totalReceived.mul(shares[payee]).div(totalShares).sub(released[payee]);

 
Jun 13, 2020 22:19:05 UTC
pragma solidity ^0.5.0;

import "./Roles.sol";

contract ERC20Interface{
    
    function totlasupply() public view returns(uint);
    function balanceOf (address tokenOwner) public view returns(uint balance);
    function transfer(address to, uint tokens) public returns(bool success);
    function allowance(address TokenOwner, address spender) public view returns(uint remaining);
    function approve(address spender, uint token) public returns(bool success);
    function transferFrom(address from, address to, uint token) public returns(bool success);
    
    event Transfer(address indexed from, address indexed to,uint tokens);
    event Approval(address indexed tokenOwner,address indexed spender,uint token);
}

contract Crypto is ERC20Interface{
    
    using Roles for Roles.Role;
     Roles.Role private Deployer;
     Roles.Role private admins;
     Roles.Role private publishers;
     Roles.Role private voters;
     Roles.Role private solvers; 
     Roles.Role private guests;
   
    string public name="
Jun 07, 2020 07:48:55 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract IPFS {
    struct
  

  
Jun 05, 2020 06:18:09 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract  {
  

  
Jun 05, 2020 06:03:20 UTC
pragma solidity ^0.4.18;

contract ApprovalContract {

    address public sender;
    address public receiver;
    address public constant approver = 0x95c2332b26bb22153a689ae619d81a6c59e0a804;

    function deposit(address _receiver) external payable {
        require(msg.value > 0);
        sender = msg.sender;
        receiver = _receiver;
    }

    function viewApprover() external pure returns(address) {
        return(approver);
    }

    function approve() external {
        require(msg.sender == approver);
        receiver.transfer(address(this).balance);
    }
Jun 02, 2020 22:12:06 UTC
pragma solidity ^0.4.24;

// import 'openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol';
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v1.12.0/contracts/token/ERC20/StandardToken.sol
// https://github.com/OpenZeppelin/openzeppelin-contracts/tree/v1.12.0/contracts/token/ERC20

library SafeMath {

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

  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {return _a / _b;}

  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 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}

library ExtendedMath {
   function limitLessThan(uint a, uint b) internal pure returns (uint c) {
        if(a > b) return b;
        return a;
    }
}

// --------------------------------
Jun 01, 2020 15:09:53 UTC
pragma solidity ^0.4.24;

// import 'openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol';
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v1.12.0/contracts/token/ERC20/StandardToken.sol
// https://github.com/OpenZeppelin/openzeppelin-contracts/tree/v1.12.0/contracts/token/ERC20

library SafeMath {

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

  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {return _a / _b;}

  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 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}

library ExtendedMath {
   function limitLessThan(uint a, uint b) internal pure returns (uint c) {
        if(a > b) return b;
        return a;
    }
}

// --------------------------------
Jun 01, 2020 14:12: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 get() public constant returns (uint) {
    return value;
  }

  uint value;
May 31, 2020 11:43:30 UTC
pragma solidity >=0.4.22 <0.7.0;

contract sampleContract {
    function get () public {
        aLib.doStuff();
    }
}

library aLib {
    function doStuff() public {
    }
}
May 29, 2020 20:38:32 UTC
import "github.com/oraclize/ethereum-api/provableAPI_0.4.25.sol";

pragma solidity 0.4.25;

contract Lottery is usingOraclize {
    address public manager;
    address[] public players;
    uint public randomNumber;

    uint public lotteryEndDate;
    bool public isRndNumberGenerated;
    bool public paidOut;
    
    constructor() public {
        manager = msg.sender;
        lotteryEndDate = 1591333505;
        
        oraclize_setProof(proofType_Ledger);
    }
    
    modifier restricted() {
        require(msg.sender == manager);
        _;
    }
    
    function enter() public payable {
        require(msg.value > .1 ether);
        players.push(msg.sender);
    }
    
    function payOut() public {
        require(lotteryEndDate < block.time);
        require(isRndNumberGenerated == true);
        require(paidOut == false);
        
        uint index = randomNumber % players.length;
        players[index].transfer(address(this).balance / 2);
        manager.transfer(address(this).balance / 2);
   
May 29, 2020 19:22:43 UTC
import "github.com/oraclize/ethereum-api/provableAPI_0.4.25.sol";

pragma solidity 0.4.25;

contract Lottery is usingOraclize {
    address public manager;
    address[] public players;
    uint public randomNumber;

    uint public lotteryEndDate;
    bool public isRndNumberGenerated;
    bool public paidOut;
    
    constructor() public {
        manager = msg.sender;
        lotteryEndDate = 1591333505;
        
        oraclize_setProof(proofType_Ledger);
    }
    
    modifier restricted() {
        require(msg.sender == manager);
        _;
    }
    
    function enter() public payable {
        require(msg.value > .1 ether);
        players.push(msg.sender);
    }
    
    function payOut() public {
        require(lotteryEndDate < block.time);
        require(isRndNumberGenerated == true);
        require(paidOut == false);
        
        uint index = randomNumber % players.length;
        players[index].transfer(address(this).balance / 2);
        manager.transfer(address(this).balance / 2);
   
May 29, 2020 19:21:37 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;
May 27, 2020 09:38:58 UTC
/**
 *Submitted for verification at Etherscan.io on 2020-05-14
*/

pragma solidity >=0.5.0;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
}


interface IGateway {
    function mint(bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes calldata _sig) external returns (uint256);
    function burn(bytes calldata _to, uint256 _amount) external returns (uint256);
}

interface IGatewayRegistry {
    function getGatewayBySymbol(string calldata _tokenSymbol) external view returns (IGateway);
    function getTokenBySymbol(string calldata _tokenSymbol) external view returns (IERC20);
}

contract Basic {
    IGatewayRegistry public registry;
    
    event Deposit(uint256 _amount, bytes _msg);
    event Withdrawal(bytes _to, uint256 _amount, bytes _msg);

    constructor(IGatewayRegistry _registry) public {
        registry = _registry;
    }
    
    function deposit(
        // Parameters from users
        bytes calldata _msg,
        // Parameters from Darknodes
      
May 26, 2020 08:13:00 UTC
pragma solidity ^0.6.8;


library SpecEnums {
    enum UserType {noUser, buyer, seller}
}


library SpecLibrary {
    using SpecEnums for SpecEnums.UserType;
    struct User {
        bytes32 userName;
        uint64 userContact;
        uint8 userGender;
        bytes32 userEmail;
        string userAddr;
        uint32[] orders;
        SpecEnums.UserType userType;
    }
    struct Item {
        bytes32 itemName;
        uint8 itemType;
        uint256 itemPrice;
        bytes32 itemDetails;
        bytes32 itemBrand;
        uint8 itemColor;
        bytes32 imageId;
        uint32 availableCount;
        uint256 disputePrice;
        address payable seller;
    }
    struct Order {
        address payable BuyerAddr;
        uint256 timeStamp;
        string orderDetails;
        uint256 totalPrice;
        mapping(uint32 => uint32) prodCount;
        mapping(uint32 => bool) isOrdered;
        mapping(uint32 => bool) isConfirmed;
        mapping(uint32 => bool) isRejected;
        mapping(uint32 => bool) i
May 24, 2020 13:41:18 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;
May 24, 2020 09:05:25 UTC
pragma solidity ^0.4.24;

contract ERC20Interface{
    
    function totlasupply() public view returns(uint);
    function balanceOf (address tokenOwner) public view returns(uint balance);
    function transfer(address to, uint tokens) public returns(bool success);
    function allowance(address TokenOwner, address spender) public view returns(uint remaining);
    function approve(address spender, uint token) public returns(bool success);
    function transferFrom(address from, address to, uint token) public returns(bool success);
    
    event Transfer(address indexed from, address indexed to,uint tokens);
    event Approval(address indexed tokenOwner,address indexed spender,uint token);
}

contract Crypto is ERC20Interface{
    
    string public name="Ashis";
    string public symbol="AKP";
    uint public decimals=0;
    uint public supply;
    address public founder;
    
    event Transfer(address indexed from, address indexed to,uint tokens);
    
    constructor ()public{
        supply=1000000;
    
May 21, 2020 14:48:32 UTC
pragma solidity >= 0.4.22 < 0.5;

import "./SafeMath.sol";
import "./provableAPI_0.4.25.sol";

contract SnakesAndLadders is usingProvable {
    using SafeMath for uint;  // uint256
    using SafeMath for uint8;  // 0-255

    // All balances
    mapping(address => uint) public balances;
    uint public totalBalance;

    // Oracle
    mapping(bytes32 => address) idPlayer;
    mapping(bytes32 => uint) idAmount;

    // Payout addresses
    address private payout1;
    address private payout2;

    // Board composition
    uint8 constant private tiles = 100;
    mapping(uint8 => uint8) private boardElements;

    // Player: is true if it's the user, otherwise is the AI
    // Turn: starting from 1
    // Move: the dice move from 1 to 6
    event LogGame(address sender, bool result, int balancediff, uint seed);
    event LogAddPlayerFunds(address sender, uint amount);
    event LogWithdrawPlayerFunds(address sender, uint amount);
    event LogAddFunds(address sender, uint amount);
    event LogPayout(address sen
May 20, 2020 17:23:04 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;
May 20, 2020 05:46:39 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;
    value = 1;
  }


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

  uint value;
May 19, 2020 06:43:53 UTC
pragma solidity ^0.4.18;

contract PartnerData {

  struct Partner {
      string name;
      string p_type;
  }

  mapping(string => Partner) partners;

  function create(string _name, string _type) public {
    partners[_name] = Partner({ name: _name, p_type: _type });
  }

  function getType(string name) public constant returns (string) {
    return partners[name].p_type;
  }
May 15, 2020 17:36: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;
    value = 1;
    value = 2;
  }


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

  uint value;
May 15, 2020 08:38:22 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;
    value = 1;
  }


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

  uint value;
May 15, 2020 08:37:58 UTC
pragma solidity ^0.6.2;

import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/VRFConsumerBase.sol";

contract RandomGenerator is VRFConsumerBase {
    
    bytes32 public reqId;
    uint256 public randomNumber;

    constructor(address _vrfCoordinator, address _link) VRFConsumerBase(_vrfCoordinator, _link) public {
    }
    
    function fulfillRandomness(bytes32 requestId, uint256 randomness) external override {
        reqId = requestId;
        randomNumber = randomness;
    }
May 14, 2020 08:55:58 UTC
pragma solidity ^0.6.2;

import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/VRFConsumerBase.sol";

contract RandomGenerator is VRFConsumerBase {

    constructor(address _vrfCoordinator, address _link) VRFConsumerBase(_vrfCoordinator, _link) public {
    }

May 14, 2020 08:54:05 UTC
pragma solidity ^0.6.2;

import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/VRFConsumerBase.sol";

contract RandomGenerator is VRFConsumerBase {

May 14, 2020 08:38:55 UTC

//example contract address: https://etherscan.io/address/0x1d6cbd79054b89ade7d840d1640a949ea82b7639#code

pragma solidity ^0.4.26;
contract UniswapExchangeInterface {
    // Address of ERC20 token sold on this exchange
    function tokenAddress() external view returns (address token);
    // Address of Uniswap Factory
    function factoryAddress() external view returns (address factory);
    // Provide Liquidity
    function addLiquidity(uint256 min_liquidity, uint256 max_tokens, uint256 deadline) external payable returns (uint256);
    function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) external returns (uint256, uint256);
    // Get Prices
    function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought);
    function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256 eth_sold);
    function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought);
    function getTokenT
May 13, 2020 21:08:00 UTC
pragma solidity ^0.5.16;

interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);
}

interface ISystemStatus {
    function setUpgrading(bool status) external;
}
interface IProxy {
    function setTarget(address target) external;
}
interface ISynthetix {}

interface IMigration {
    // pass the index to handle situations where the migration takes a few transactions to process
    function migrate(uint256 index) external;

    function numOfScripts() external view returns (uint);
}

contract Owned {
    constructor(address owner) {}

    modifier onlyOwner {
        _;
    }
}

contract DelegatedMigrator is Owned {
    uint waitingPeriod;

    struct Migration {
        bytes32 name;
        IMigration target;
        uint acceptedTimestamp;
    }

    IAddressResolver resolver = IAddressResolver(0x00000000000000000000000000000000000000000);

    mapping(bytes32 => Migration) proposals;

    constructor(address _owner) public Owned(_owner) {
        waitingPeriod = 3
May 13, 2020 19:42:46 UTC
pragma solidity ^0.4.25;

interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);
}

interface ISystemStatus {
    function setUpgrading(bool status) external;
}
interface IProxy {
    function setTarget(address target) external;
}
interface ISynthetix {}

interface IMigration {
    // pass the index to handle situations where the migration takes a few transactions to process
    function migrate(uint256 index) external;

    function numOfScripts() external view returns (uint);
}

contract Owned {
    constructor(address owner) {}

    modifier onlyOwner {
        _;
    }
}

contract DelegatedMigrator is Owned {
    uint waitingPeriod;

    struct Migration {
        bytes32 name;
        IMigration target;
        uint acceptedTimestamp;
    }

    IAddressResolver resolver = IAddressResolver(0x00000000000000000000000000000000000000000);

    mapping(bytes32 => Migration) proposals;

    constructor(address _owner) public Owned(_owner) {
        waitingPeriod = 3
May 13, 2020 19:41:49 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;
May 13, 2020 15:46:30 UTC
// Specifies that the source code is for a version
// of Solidity greater than 0.5.0
pragma solidity >=0.5.0 <0.7.0;

// A contract is a collection of functions and data (its state)
// that resides at a specific address on the Ethereum blockchain.
contract Coin {
    // The keyword "public" makes variables accessible from outside a contract
    // and creates a function that other contracts or SDKs can call to access the value


    // An address stores addresses of contracts or external (user) accounts
    address public minter;

    // A mapping lets you create complex custom data types.
    // This mapping assigns an unsigned integer to an address
    // and is also a public variable.
    mapping (address => uint) public balances;

    // Events allow Ethereum clients to react to specific
    // contract changes you declare.
    // This defines the event and it is sent later
    event Sent(address from, address to, uint amount);

    // A special function only run during the creation of the contract
    co
May 13, 2020 08:56:35 UTC
mysql -u root -
May 13, 2020 08:20:56 UTC
/**
 *Submitted for verification at Etherscan.io on 2018-04-10
*/

pragma solidity ^0.4.20;

/*

*A reincarnation of Mahatma Gandhi, born again to live forever on the Ethereum Blockchain

                                                                                                                                                       
                                                                    dddddddd                                                                           
        GGGGGGGGGGGGG                                               d::::::dhhhhhhh               iiii   jjjj   iiii            iiii                   
     GGG::::::::::::G                                               d::::::dh:::::h              i::::i j::::j i::::i          i::::i                  
   GG:::::::::::::::G                                               d::::::dh:::::h               iiii   jjjj   iiii            iiii                   
  G:::::GGGGGGGG::::G                                               d:::::d 
May 10, 2020 10:41:42 UTC
pragma solidity >=0.4.20 <0.7.0;

contract HelloWorld{
    uint public balance;
    constructor() public{
        balance = 0;
    }

    function update(uint amount) public returns (address, uint){
        balance += amount;
        return (msg.sender, balance);
    }
May 09, 2020 03:10:00 UTC
pragma solidity ^0.4.17;
contract Auction {
    
    // Data
    //Structure to hold details of the item
    struct Item {
        uint itemId; // id of the item
        uint[] itemTokens;  //tokens bid in favor of the item
       
    }
    
   //Structure to hold the details of a persons
    struct Person {
        uint remainingTokens; // tokens remaining with bidder
        uint personId; // it serves as tokenId as well
        address addr;//address of the bidder
    }
 
    mapping(address => Person) tokenDetails; //address to person 
    Person [4] bidders;//Array containing 4 person objects
    
    Item [3] public items;//Array containing 3 item objects
    address[3] public winners;//Array for address of winners
    address public beneficiary;//owner of the smart contract
    
    uint bidderCount=0;//counter
    
    //functions

    function Auction() public payable{    //constructor
                
        //Part 1 Task 1. Initialize beneficiary with address of smart contract’s owner
        /
May 07, 2020 15:23:22 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
  pragma solidity ^0.4.18;
  contract JsonStore {
    function set(string _value) public {
      value = _value;
    }

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

    string value;
  
May 06, 2020 10:49:21 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);
    }
May 05, 2020 16:56:44 UTC
contract dpki {
    struct Attribute {
        address owner;
        string attributeType;
        bool has_proof;
        bytes32 identifier;
        string data;
        string datahash;
    }

    struct Signature {
        address signer;
        uint attributeID;
        uint expiry;
    }

    struct Revocation {
        uint signatureID;
    }

    Attribute[] public attributes;
    Signature[] public signatures;
    Revocation[] public revocations;

    event AttributeAdded(uint indexed attributeID, address indexed owner, string attributeType, bool has_proof, bytes32 indexed identifier, string data, string datahash);
    event AttributeSigned(uint indexed signatureID, address indexed signer, uint indexed attributeID, uint expiry);
    event SignatureRevoked(uint indexed revocationID, uint indexed signatureID);

    function addAttribute(string attributeType, bool has_proof, bytes32 identifier, string data, string datahash) returns (uint attributeID) {
        attributeID = attributes.length++;
      
May 05, 2020 07:37:39 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.6.6;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

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

  uint value;
May 04, 2020 21:47:30 UTC
#!/bin/bash
# 1) Check if java is installed.
echo "==========================================================="
echo "STEP [1] : Prepare java for apache-tomcat."
echo "==========================================================="
java -version 2>&1 | grep 'is not recognized\|command not found' #If java is not installed, this word will be show
IS_JAVA_INSTALLED=$?
if [ $IS_JAVA_INSTALLED != 0 ]
then
  JAVA_VERSION=$(java -version 2>&1 | grep "version" | awk -F" " '{print $3}')
  echo "Java is already installed on your system."
  echo "current java version = $JAVA_VERSION "
else
  echo "Java is not installed on your system."
  # Download Oracle java rpm from the internet.
  cd /root
  wget --output-document java1.8_u251.rpm https://javadl.oracle.com/webapps/download/AutoDL?BundleId=242049_3d5a2bb8f8d4428bbe94aed7ec7ae784
  rpm -ivh java1.8_u251.rpm
  # Verify Java 
  java -version
fi

# 2) Install Apache Tomcat
mkdir /tomcat
cd /tomcat
# Download Apache tomcat from the internet
wget https://downloads.apache.org/
May 03, 2020 13:09:13 UTC
#!/bin/bash
# 1) Check if java is installed.
echo "==========================================================="
echo "STEP [1] : Prepare java for apache-tomcat."
echo "==========================================================="
java -version 2>&1 | grep 'is not recognized\|command not found' #If java is not installed, this word will be show
IS_JAVA_INSTALLED=$?
if [ $IS_JAVA_INSTALLED != 0 ]
then
  JAVA_VERSION=$(java -version 2>&1 | grep "version" | awk -F" " '{print $3}')
  echo "Java is already installed on your system."
  echo "current java version = $JAVA_VERSION "
else
  echo "Java is not installed on your system."
  # Download Oracle java rpm from the internet.
  cd /root
  wget --output-document java1.8_u251.rpm https://javadl.oracle.com/webapps/download/AutoDL?BundleId=242049_3d5a2bb8f8d4428bbe94aed7ec7ae784
  rpm -ivh java1.8_u251.rpm
  # Verify Java 
  java -version
fi

# 2) Install Apache Tomcat
mkdir /tomcat
cd /tomcat
# Download Apache tomcat from the internet
wget https://downloads.apache.org/
May 03, 2020 06:52:27 UTC
pragma solidity ^0.6.0;

contract arr {
    
    uint[] public array = [1,2,3,4,5,6,7,8,9];
    
    function test (uint x) public {
        remove(x);
        
    }


    function remove(uint element) internal returns(uint[] memory) {
        uint index = indexOf(array, element);
        if (index >= array.length) return array;

        for (uint i = index; i<array.length-1; i++){
            array[i] = array[i+1];
        }
        array.pop();
        return array;
    }
    
    
    function indexOf(uint[] memory self, uint value)
        internal
        pure
        returns (uint256)
    {
        for (uint256 i = 0; i < self.length; i++)
            if (self[i] == value) return i;
        return uint256(-1);
    }
    function viewArray() view public returns(uint[] memory) {
        return array;
    }
}
May 02, 2020 12:22:27 UTC
pragma solidity ^0.6.0;

contract Lottery {

    mapping (address => uint256) public winnings; 
    address[] public tickets; 
    
    string public name = "Lottery"; 
    string public symbol = "LOT"; 
    
    uint256 public maxTickets = 100; 
    uint256 public remainingTickets = 0;
     uint public ticketCount = 0; 
    uint256 public randomNum = 0; 
    address public latestWinner; 
    
    constructor(string memory tokenName, string memory tokenSymbol, uint256 maximumTickets) public {
       name = tokenName; 
       symbol = tokenSymbol;
       maxTickets = maximumTickets;
       remainingTickets = maxTickets;   
    } 
    
    function Buy() public payable { 
        require(msg.value == 1000000000000000000); 
        uint256 val = msg.value / 1000000000000000000; 
        require(remainingTickets - val <= remainingTickets); 
        remainingTickets -= val; // Remove from unspent supply 
        tickets.push(msg.sender); 
        ticketCount++; 
    }
    
    function Withdraw() public { 
       
Apr 30, 2020 17:28:57 UTC
pragma solidity ^0.6.0;
contract MyWallet {

    address payable private owner;

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

    receive() external payable {
    }

    function sendEther(address payable _to, uint _amount) public {
        require(msg.sender == owner, "Must own this wallet to send Ether from it");
        require(address(this).balance >= _amount, "Cannot send more than this wallet holds");
        _to.transfer(_amount);
    }
Apr 30, 2020 09:54:26 UTC
pragma solidity 0.5.11;
// solium-disable-next-line
pragma experimental ABIEncoderV2;

/**
 * @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.
    */
    constructor() 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(
Apr 28, 2020 20:22:25 UTC
pragma solidity ^0.4.18; 

contract TokenSale {
    enum State { Active, Suspended }
    
    address public owner;
    ERC20 public token;
    State public state;
    
    function TokenSale(address tokenContractAddress) {
        owner = msg.sender;
        token = ERC20(tokenContractAddress);
        state = State.Active;
    }
    
    // 1:1 exchange of ETH for token
    function buy() payable {
        require(state == State.Active);
        token.transfer(msg.sender, msg.value);
    }

    function suspend () {
        require(msg.sender == owner);
        state = State.Suspended;
    }

    function activate () {
        require(msg.sender == owner);
        state = State.Active;
    }

    function withdraw() {
        require(msg.sender == owner);
        owner.transfer(address(this).balance);
    }
Apr 28, 2020 13:31:07 UTC
pragma solidity ^0.4.0;
pragma experimental ABIEncoderV2;

contract TimeSheet {

    struct WorkDay {
        uint256 projectId;
        uint256 day;
        uint256 month;
        uint256 year;
        uint256 hoursWorked;
    }
    
    struct WorkProject {
        uint256 projectId;
    } 

    struct Month {
        string name;
        uint256 number;
        uint256 yearNumber;
        uint256 workingDays;
    }
    
    struct Client {
        string name;
        string fullAddress;
        string postCode;
        string VAT;
    }
    
    WorkProject[] public workprojects;

    Client[] public client;
    
    WorkDay[] public workedDays;
    
    Month[] monthTimesheets;

    function setMonthTimesheet(Month memory monthTimeshet) public {
        monthTimesheets[(monthTimeshet.year * 1000) + monthTimeshet.number] = monthTimeshet;
    }
    
    function getCurrentMonthWorkedDays(uint256 month, uint256 year) public returns (uint256 days_) {
        days_ = 0;
        for (uint p = 0; p < workedDays
Apr 26, 2020 02:01:42 UTC
pragma solidity ^0.4.0;
pragma experimental ABIEncoderV2;

contract TimeSheet {

    struct WorkDay {
        uint256 projectId;
        uint256 day;
        uint256 month;
        uint256 year;
        uint256 hoursWorked;
    }
    
    struct WorkProject {
        uint256 projectId;
    } 

    struct Month {
        string name;
        uint256 number;
        uint256 yearNumber;
        uint256 workingDays;
    }
    
    struct Client {
        string name;
        string fullAddress;
        string postCode;
        string VAT;
    }
    
    WorkProject[] public workprojects;

    Client[] public client;
    
    WorkDay[] public workedDays;
    
    Month[] monthTimesheets;

    function setMonthTimesheet(Month memory monthTimeshet) public {
        monthTimesheets[(monthTimeshet.year * 1000) + monthTimeshet.number] = monthTimeshet;
    }
    
    function getCurrentMonthWorkedDays(uint256 month, uint256 year) public returns (uint256 days_) {
        
        days_ = 0;
        for (uint p = 0; p < w
Apr 26, 2020 02:00:55 UTC
pragma solidity ^0.6.0;

import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, _msgSender()));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE
Apr 23, 2020 08:31:17 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 ERC20Basic
// @dev Simpler version of ERC20 interface
// See https://github.com/ethereum/EIPs/issues/17
Apr 22, 2020 15:10:53 UTC
pragma solidity >=0.6.0 <0.7.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.0.0/contracts/token/ERC20/ERC20.sol";
contract CustomERC20 is ERC20 {
    event feeGenerated(uint);
    address baseAddress;
    uint rate;
    constructor (string memory name, string memory symbol) ERC20(name, symbol) public {
        baseAddress = msg.sender;
        rate = 5; // 5/100 
        _mint(msg.sender, 10000000);
    }
    function transfer(address recipient, uint256 amount) public override returns (bool) {
        uint fee = (amount * rate) / 100;
        _transfer(_msgSender(), baseAddress, fee); // send fee
        emit feeGenerated(fee);
        super.transfer(recipient, amount);
        return true;
    }
Apr 21, 2020 11:54:46 UTC
pragma solidity 0.5.7;

contract A {
    event Event(string name);
    
    constructor() public {
        emit Event("A");
    }
}

contract B is A {
    constructor() public {
        emit Event("B");
    }
}

contract C {  
    event Event(string name);
    
    constructor() public {
        emit Event("C");
    }
}

contract D is C, B {
    constructor() public {
        emit Event("D");
    }
Apr 20, 2020 18:36:48 UTC
pragma solidity 0.5.7;

contract A {
    event Event(string name);
    
    constructor() public {
        emit Event("A");
    }
}

contract B is A {
    constructor() public {
        emit Event("B");
    }
}

contract C {  
    event Event(string name);
    
    constructor() public {
        emit Event("C");
    }
}

contract D is C, B {
    constructor() public {
        emit Event("D");
    }
Apr 18, 2020 15:58:30 UTC
pragma solidity >=0.4.22 <0.7.0;

contract Value {
    uint256 public tokenBalance;
    
    constructor() public {
        tokenBalance = 0;
    }
    
    function addValue() payable public {
        tokenBalance = tokenBalance + (msg.value/10);
    } 
    
    function getTokenBalance() view public returns (uint256) {
        return tokenBalance;
    }
Apr 17, 2020 07:16:48 UTC
pragma solidity >=0.4.22 <0.7.0;

contract AttendanceRegister {
    struct Student{
            string name;
            uint class;
        }

    event Added(string name, uint class, uint time);

    mapping(uint => Student) public register; // roll number => student details

    function add(uint rollNumber, string memory name, uint class) public returns (uint256){
        require(class > 0 && class <= 12, "Invalid class");
        require(register[rollNumber].class == 0, "Roll number not available");
        Student memory s = Student(name, class);
        register[rollNumber] = s;
        emit Added(name, class, now);
        return rollNumber;
    }
    
    function getStudentName(uint rollNumber) public view returns (string memory) {
        return register[rollNumber].name;
    }
Apr 17, 2020 07:15:26 UTC
pragma solidity >=0.4.22 <0.7.0;
contract Sender {
    address private owner;
    
    constructor() public {
        owner = msg.sender;
    }
    
    function updateOwner(address newOwner) public {
        require(msg.sender == owner, "only current owner can update owner");
        owner = newOwner;
    }
    
    function getOwner() public view returns (address) {
        return owner;
    }
Apr 17, 2020 07:14:33 UTC
pragma solidity ^0.6.0;

import "./DynamicAccessControl.sol";
import "./RoleSets.sol";

contract ControlledContract is DynamicAccessControl {
    using RoleSets for RoleSets.RoleSet;

    RoleSets.RoleSet rootRoleSet;
    RoleSets.RoleSet secondaryRoleSet;
    RoleSets.RoleSet tertiaryRoleSet;

    bytes32 public constant ROOT_ROLE_SET = 0x00;

    constructor() public DynamicAccessControl(msg.sender) {
        rootRoleSet.addRoleId(ROOT_ROLE_SET);
        secondaryRoleSet.addRoleId(ROOT_ROLE_SET);
        tertiaryRoleSet.addRoleId(ROOT_ROLE_SET);
    }

    function addRoleToSecondarySet(bytes32 _roleId) public onlyMembersOf(rootRoleSet.roleIds){
        secondaryRoleSet.addRoleId(_roleId);
    }

    function addRoleToTertiarySet(bytes32 _roleId) public onlyMembersOf(secondaryRoleSet.roleIds){
        tertiaryRoleSet.addRoleId(_roleId);
    }

Apr 16, 2020 15:39:30 UTC
pragma solidity ^0.6.0;

library RoleSets {

    struct RoleSet {
        bytes32[] roleIds;
    }

    function addRoleId(RoleSet storage _roleSet, bytes32 _roleId) internal {
        _roleSet.roleIds.push(_roleId);
    }
Apr 16, 2020 15:38:22 UTC
pragma solidity ^0.6.0;

library RoleSets {

    struct RoleSet {
        bytes32[] roleIds;
    }

    bytes32 public constant ROOT_ROLE_SET = 0x00;

    function addRoleId(RoleSet storage _roleSet, bytes32 _roleId) internal {
        _roleSet.roleIds.push(_roleId);
    }
Apr 16, 2020 15:38:07 UTC
pragma solidity ^0.6.0;

import "openzeppelin-solidity/contracts/access/AccessControl.sol";

contract DynamicAccessControl is AccessControl {
    event AdminRoleSet(bytes32 roleId, bytes32 adminRoleId);

    constructor (address root) public {
        _grantRole(DEFAULT_ADMIN_ROLE, root);
    }

    modifier onlyMember(bytes32 roleId) {
        require(hasRole(roleId, msg.sender), "Restricted to members.");
        _;
    }

    modifier onlyMembersOf(bytes32[] memory roleIds) {
        bool isMember = false;
        for (uint i = 0; i < roleIds.length; i++) {
            if (hasRole(roleIds[i], msg.sender)) {
                isMember = true;
                break;
            }
        }
        require(isMember == true, "Restricted to members.");
        _;
    }

    function addRole(bytes32 roleId, bytes32 adminRoleId) public onlyMember(adminRoleId) {
        _setRoleAdmin(roleId, adminRoleId);
        emit AdminRoleSet(roleId, adminRoleId);
    }
Apr 16, 2020 14:28:08 UTC
pragma solidity ^0.6.0;

import "@openzeppelin/contracts/access/AccessControl.sol";

contract DynamicAccessControl is AccessControl {
    event AdminRoleSet(bytes32 roleId, bytes32 adminRoleId);

    constructor (address root) public {
        _grantRole(DEFAULT_ADMIN_ROLE, root);
    }

    modifier onlyMembersOf(bytes32[] roleIds) {
        bool isMember = false;
        for (var i = 0; i < roleIds.length; i++) {
            if (hasRole(roleIds[i]), msg.sender) {
                isMember = true;
                break;
            }
        }
        require(isMember == true, "Restricted to members.");
        _;
    }

    function addRole(bytes32 roleId, bytes32 adminRoleId)
        public onlyMember(adminRoleId) {
        _setRoleAdmin(roleId, adminRoleId);
        emit AdminRoleSet(roleId, adminRoleId);
    }
Apr 16, 2020 14:20:59 UTC
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/access/AccessControl.sol";


/**
 * @title Hierarchy
 * @author Alberto Cuesta Canada
 * @notice Implements a dynamic role structure for Roles
 */
contract Hierarchy is AccessControl {
    event AdminRoleSet(bytes32 roleId, bytes32 adminRoleId);

    /// @dev Add `root` as a member of the root role.
    constructor (address root) public {
        _grantRole(DEFAULT_ADMIN_ROLE, root);
    }

    /// @dev Restricted to members of the role passed as a parameter.
    modifier onlyMember(bytes32 roleId) {
        require(hasRole(roleId, msg.sender), "Restricted to members.");
        _;
    }

    /// @dev Create a new role with the specified admin role.
    function addRole(bytes32 roleId, bytes32 adminRoleId)
        public onlyMember(adminRoleId) {
        _setRoleAdmin(roleId, adminRoleId);
        emit AdminRoleSet(roleId, adminRoleId);
    }
Apr 16, 2020 09:48:00 UTC
pragma solidity >=0.4.22 <0.7.0;
import "remix_tests.sol"; 
import "./Value.sol";

contract ValueTest{
    Value v;
    
    function beforeAll() public {
        // create a new instance of Value contract
        v = new Value();
    }
    
    /// Test initial balance
    function testInitialBalance() public {
        // initially token balance should be 0
        Assert.equal(v.getTokenBalance(), 0, 'token balance should be 0 initially');
    }
    
    /// For Solidity version greater than 0.6.1
    /// Test 'addValue' execution by passing custom ether amount 
    /// #value: 200
    function addValueOnce() public payable {
        // check if value is same as provided through devdoc
        Assert.equal(msg.value, 200, 'value should be 200');
        // execute 'addValue'
        v.addValue{gas: 40000, value: 200}(); // introduced in Solidity version 0.6.2
        // As per the calculation, check the total balance
        Assert.equal(v.getTokenBalance(), 20, 'token balance should be 20');
    }
    
   
Apr 16, 2020 07:53:57 UTC
pragma solidity >=0.4.22 <0.7.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./AttendanceRegister.sol";

contract AttendanceRegisterTest {
   
    AttendanceRegister ar;
    
    /// 'beforeAll' runs before all other tests
    function beforeAll () public {
        // Create an instance of contract to be tested
        ar = new AttendanceRegister();
    }
    
    /// For solidity version greater or equal to 0.6.0, 
    /// See: https://solidity.readthedocs.io/en/v0.6.0/control-structures.html#try-catch
    /// Test 'add' using try-catch
    function testAddSuccessUsingTryCatch() public {
        // This will pass
        try ar.add(101, 'secondStudent', 11) returns (uint256 r) {
            Assert.equal(r, 101, 'wrong rollNumber');
        } catch Error(string memory /*reason*/) {
            // This is executed in case
            // revert was called inside getData
            // and a reason string was provided.
            Assert.ok(false, 'failed with reason');
 
Apr 16, 2020 07:52:25 UTC
pragma solidity >=0.4.22 <0.7.0;
import "remix_tests.sol"; // this import is automatically injected by Remix
import "remix_accounts.sol";
import "./Sender.sol";

// Inherit 'Sender' contract
contract SenderTest is Sender {
    /// Define variables referring to different accounts
    address acc0;
    address acc1;
    address acc2;
    
    /// Initiate accounts variable
    function beforeAll() public {
        acc0 = TestsAccounts.getAccount(0); 
        acc1 = TestsAccounts.getAccount(1);
        acc2 = TestsAccounts.getAccount(2);
    }
    
    /// Test if initial owner is set correctly
    function testInitialOwner() public {
        // account at zero index (account-0) is default account, so current owner should be acc0
        Assert.equal(getOwner(), acc0, 'owner should be acc0');
    }
    
    /// Update owner first time
    /// This method will be called by default account(account-0) as there is no custom sender defined
    function updateOwnerOnce() public {
        // check method caller is as e
Apr 16, 2020 07:49:56 UTC
pragma solidity ^0.6.0;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");

    constructor() public ERC20("MyToken", "TKN") {
        // Grant the contract deployer the default admin role: it will be able
        // to grant and revoke any roles
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    function mint(address to, uint256 amount) public {
        require(hasRole(MINTER_ROLE, msg.sender), "Caller is not a minter");
        _mint(to, amount);
    }

    function burn(address from, uint256 amount) public {
        require(hasRole(BURNER_ROLE, msg.sender), "Caller is not a burner");
        _burn(from, amount);
    }
Apr 15, 2020 13:49:16 UTC
pragma solidity ^0.6.0;

import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, _msgSender()));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE
Apr 15, 2020 13:42:41 UTC
pragma solidity ^0.5.10;

contract SendApplication{

  address payable public owner;

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

  constructor() public {
    owner = msg.sender;
  }
    event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
  event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);

  function balanceOf(address _owner) public view returns (uint256 _balance);
  function ownerOf(uint256 _tokenId) public view returns (address _owner);
  function transfer(address _to, uint256 _tokenId) public;
  function approve(address _to, uint256 _tokenId) public;
  function takeOwnership(uint256 _tokenId) public;
  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 
Apr 15, 2020 13:13:30 UTC
pragma solidity ^0.5.0;

import "@openzeppelin/contracts/access/Roles.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";

contract MyToken is ERC20, ERC20Detailed {
    using Roles for Roles.Role;

    Roles.Role private _minters;
    Roles.Role private _burners;

    constructor(address[] memory minters, address[] memory burners)
        ERC20Detailed("MyToken", "MTKN", 18)
        public
    {
        for (uint256 i = 0; i < minters.length; ++i) {
            _minters.add(minters[i]);
        }

        for (uint256 i = 0; i < burners.length; ++i) {
            _burners.add(burners[i]);
        }
    }

    function mint(address to, uint256 amount) public {
        // Only minters can mint
        require(_minters.has(msg.sender), "DOES_NOT_HAVE_MINTER_ROLE");

        _mint(to, amount);
    }

    function burn(address from, uint256 amount) public {
        // Only burners can burn
        require(_burners.has(msg.sender), "DOES_NOT
Apr 15, 2020 11:31:19 UTC
pragma solidity ^0.5.0;

/**
 * @title Roles
 * @dev Library for managing addresses assigned to a Role.
 */
library Roles {
    struct Role {
        mapping (address => bool) bearer;
    }

    /**
     * @dev Give an account access to this role.
     */
    function add(Role storage role, address account) internal {
        require(!has(role, account), "Roles: account already has role");
        role.bearer[account] = true;
    }

    /**
     * @dev Remove an account's access to this role.
     */
    function remove(Role storage role, address account) internal {
        require(has(role, account), "Roles: account does not have role");
        role.bearer[account] = false;
    }

    /**
     * @dev Check if an account has this role.
     * @return bool
     */
    function has(Role storage role, address account) internal view returns (bool) {
        require(account != address(0), "Roles: account is the zero address");
        return role.bearer[account];
    }
Apr 15, 2020 11:27:06 UTC
pragma solidity ^0.5.0;

import "@openzeppelin/contracts/ownership/Ownable.sol";

contract MyContract is Ownable {
    function normalThing() public {
        // anyone can call this normalThing()
    }

    function specialThing() public onlyOwner {
        // only the owner can call specialThing()!
    }
Apr 15, 2020 11:20:28 UTC
pragma solidity ^0.5.0;

import "@openzeppelin/contracts/ownership/Ownable.sol";

contract MyContract is Ownable {
  function normalThing() public {
    // anyone can call this normalThing()
  }

  function specialThing() public onlyOwner {
    // only the owner can call specialThing()!
  }
Apr 15, 2020 11:19:37 UTC
pragma solidity ^0.5.0;

import "../GSN/Context.sol";
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any ac
Apr 15, 2020 11:13:54 UTC
pragma solidity ^0.6.4;

library SafeMath {
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, "SafeMath: addition overflow");
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return sub(a, b, "SafeMath: subtraction overflow");
  }
  function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
    require(b <= a, errorMessage);
    uint256 c = a - b;
    return c;
  }

  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return div(a, b, "SafeMath: division by zero");
  }
  function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
    require(b > 0, errorMessage);
    uint256 c = a / b;
    return c
Apr 14, 2020 11:55:37 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;
  }
 //test
  function get() public constant returns (uint) {
    return value;
  }

  uint value;
Apr 14, 2020 07:50:07 UTC
pragma solidity ^0.6.4;

library SafeMath {
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, "SafeMath: addition overflow");
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return sub(a, b, "SafeMath: subtraction overflow");
  }
  function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
    require(b <= a, errorMessage);
    uint256 c = a - b;
    return c;
  }

  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return div(a, b, "SafeMath: division by zero");
  }
  function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
    require(b > 0, errorMessage);
    uint256 c = a / b;
    return c
Apr 12, 2020 08:22:06 UTC
pragma solidity ^0.4.24;  

/* 合約本體 */
contract SimpleAdd {
    /* 變數宣告 */
    uint number = 0;

    // ... 更多變數

    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }
Apr 10, 2020 04:41:48 UTC
 <ul class="main-menu w-list-unstyled">
          <!--новый код-->
          <li class="mainmenu-list-item">
                <a href="#" class="mainmenu-link open-link">Открыть меню</a>
                <a href="#" data-w-id="a936dca4-51d2-7c82-837d-c5c03dc79ee3" class="mainmenu-link close-link">Закрыть меню</a></li>
          <!--КОНЕЦ / новый код-->
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">На главную</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Флешмобы</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Акции</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Мастерская изменений</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Обучение</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Факс атаки</a></li>
Apr 09, 2020 18:57:02 UTC
 <ul class="main-menu w-list-unstyled">
          <!--новый код-->
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link open-link">Открыть меню</a><a href="#" data-w-id="a936dca4-51d2-7c82-837d-c5c03dc79ee3" class="mainmenu-link close-link">Закрыть меню</a></li>
          <!--КОНЕЦ / новый код-->
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">На главную</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Флешмобы</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Акции</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Мастерская изменений</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Обучение</a></li>
          <li class="mainmenu-list-item"><a href="#" class="mainmenu-link">Факс атаки</a></li>
</ul
Apr 09, 2020 18:55:32 UTC
pragma solidity >=0.4.22 <0.6.0;

contract Information {
    
    struct Uploaders {
        uint weight; 
        bool uploaded; 
        address delegate; 
        uint up;  
    }

    struct Proposal {
        bytes32 name;   // short name (up to 32 bytes)
        uint upCount; 
    }

    address public ProductTraceability;

    // This declares a state variable that
    // stores a `state` struct for each possible address.
    mapping(address => Uploaders) public state;

    // A dynamically-sized array of `Proposal` structs.
    Proposal[] public GainConcent;

    /// Create a new ballot to choose one of `proposalNames
    constructor(bytes32[] memory proposalNames) public {
        ProductTraceability = msg.sender;
        state[ProductTraceability].weight = 1;

        // For each of the provided proposal names,
        // create a new proposal object and add it
        // to the end of the array.
        for (uint i = 0; i < proposalNames.length; i++) {
            // `Proposal({...})` creates a tem
Apr 08, 2020 08:31:48 UTC
pragma solidity >=0.4.22 <0.7.0;
import "remix_tests.sol"; // this import is automatically injected by Remix
import "remix_accounts.sol";
import "./Sender.sol";
// Inherit 'Sender' contract
contract SenderTest is Sender {
    address account0;
    address account1;
    address account2;
    
    /// Initiate accounts variable
    function beforeAll() public {
        account0 = TestsAccounts.getAccount(0);
        account1 = TestsAccounts.getAccount(1);
        account2 = TestsAccounts.getAccount(2);
    }
    
    /// Test if initial owner is set correctly
    function testInitialOwner() public {
        // account-0 is default account, so current owner should be account0
        Assert.equal(getOwner(), account0, 'owner should be account-0');
    }
    
    /// Update owner. This method will be called by account0 as there is not custom sender appointed
    function updateOwnerOnce() public {
        // check method call is as expected
        Assert.ok(msg.sender == account0, 'caller should default account 
Apr 07, 2020 07:42:09 UTC
pragma solidity >=0.4.22 <0.6.0;

/// @title Voting with delegation.
contract Ballot {
    // This declares a new complex type which will
    // be used for variables later.
    // It will represent a single voter.
    struct Voter {
        uint weight; // weight is accumulated by delegation
        bool voted;  // if true, that person already voted
        address delegate; // person delegated to
        uint vote;   // index of the voted proposal
    }

    // This is a type for a single proposal.
    struct Proposal {
        bytes32 name;   // short name (up to 32 bytes)
        uint voteCount; // number of accumulated votes
    }

    address public chairperson;

    // This declares a state variable that
    // stores a `Voter` struct for each possible address.
    mapping(address => Voter) public voters;

    // A dynamically-sized array of `Proposal` structs.
    Proposal[] public proposals;

    /// Create a new ballot to choose one of `proposalNames
    constructor(bytes32[] memory proposalNames) p
Apr 07, 2020 07:38:40 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.20;

/*************************************************************************************************************

本合约涉及到仓单流转的的基本功能,权限控制等其他需求请用户根据自己需要酌情增加

|-------------|         |-------------|                    |-------------|    |-------------|
|  4.移库中    |         |  5.移库待审核 |                --->|  9融资待审核  |--->|  10仓单融资  |
|_____________|<----    |_____________|<-------        |   |_____________|    |_____________|
                   |                          |        |
                   |                          Y        |
                |-------------|            |-------------|
                |  2仓单待认证  |----------> |  7仓单正常   |
          ______|_____________| <-------   |_____________| <--------
         |                              |____________        
Apr 07, 2020 07:34:50 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 (bytes32) {
    bytes32 hashone = keccak256(byte(0x19), byte(0), "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b", 0, "0xb8587252114EB69445730F978b25fcCF4305dee9", "setAttribute", "0x6469642f7376632f76636a777400000000000000000000000000000000000000", "hi", 31231231313);
    bytes32 hashtwo = keccak256(byte(0x19), byte(0), 0, 0, 0, 0, 0, 0, 0);
   bytes32 hashthree = keccak256(byte(0x19),"a","b");
    return hashthree;
  }

  uint value;
Apr 06, 2020 21:43:41 UTC
pragma solidity ^0.6.4;

contract LBAChain {
  
  enum LandType{noLand,wet,solid}
  enum UserType{noUser,user,officer1,officer2,officer3}
  
  struct LandStruct{
    LandType landType;
    int area;
  }
  struct UserStruct{
    string name;
    uint addharId;
    uint phoneNo;
    uint wardNo;
    UserType userType;
  }
  struct OfficerStruct{
    string name;
    uint addharId;
    uint phoneNo;
    uint villageNo;
    uint[] wardList;
    UserType userType;
  }
  struct LandRegisterStruct{
    uint wardNo;
    uint survayNo;
    uint ownerId;
    uint officerId;
  }
  struct ChangeLandPropertyStruct{
    uint wardNo;
    uint survayNo;
    uint ownerId;
    LandType currentLandType;
    LandType changedLandType;
    uint[] approverdUsers;
    uint approverdOfficer;
    uint approvedTime;
    bool valid;
  }
  // userId => UserStruct 
  mapping (uint => UserStruct) public user;
  
  // userId => OfficerStruct 
  mapping (uint => OfficerStruct) public officer;
  
  // userId  = survayNoList 
  mapping (uint =
Apr 03, 2020 15:22:25 UTC
<section id="category-info">
            {if $category->id_image}
                <div id="category-banner">
                  {if !empty($lazy_load)}
                    <noscript>
                      <img src="{Link::getGenericImageLink(
                               'categories',
                               $category->id_image,
                               'category',
                               (ImageManager::retinaSupport()) ? '2x' : ''
                           )|escape:'htmlall':'UTF-8'}"
                           alt="{$category->name|escape:'html':'UTF-8'}"
                           title="{$category->name|escape:'html':'UTF-8'}"
                           width="{getWidthSize|intval type='category'}"
                           height="{getHeightSize|intval type='category'}"
                           class="img-responsive"
                      >
                    </noscript>
                  {/if}
                  <picture class="img-responsive{if !empty($lazy_load)} tb-lazy-image
Apr 03, 2020 04:14:30 UTC
<section id="category-info">
            {if $category->id_image}
                <div id="category-banner">
                  {if !empty($lazy_load)}
                    <noscript>
                      <img src="{Link::getGenericImageLink(
                               'categories',
                               $category->id_image,
                               'category',
                               (ImageManager::retinaSupport()) ? '2x' : ''
                           )|escape:'htmlall':'UTF-8'}"
                           alt="{$category->name|escape:'html':'UTF-8'}"
                           title="{$category->name|escape:'html':'UTF-8'}"
                           width="{getWidthSize|intval type='category'}"
                           height="{getHeightSize|intval type='category'}"
                           class="img-responsive"
                      >
                    </noscript>
                  {/if}
                  <picture class="img-responsive{if !empty($lazy_load)} tb-lazy-image
Apr 03, 2020 04:12:32 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract Test {
     bytes32 constant byteText = "0x0e77dba683f10aee57114f6a753c33b7df5a2a99e63d7a1805e9e81f5694a917";

     function  getByte() payable public returns(bytes32){
        return byteText;
    }
Mar 30, 2020 20:11:42 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;

contract SampleOverflow {
     bytes32 constant byteText = "0e77dba683f10aee57114f6a753c33b7df5a2a99e63d7a1805e9e81f5694a917";

     function  getByte() payable public returns(bytes32){
        return byteText;
    }
Mar 30, 2020 19:59:36 UTC
pragma solidity ^0.5.5;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract Ethermon is ERC721 {
    
Mar 27, 2020 14:42:27 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.24;
 
import "chainlink/contracts/ChainlinkClient.sol";
 
contract EthEventsChainlink is ChainlinkClient {
 
  uint256 oraclePayment;
 
  constructor(uint256 _oraclePayment) public {
	setPublicChainlinkToken();
	oraclePayment = _oraclePayment;
  }
  // Additional functions here:
 
}
Mar 26, 2020 21:53:55 UTC
pragma solidity ^0.4.24; 

import "chainlink/contracts/ChainlinkClient.sol";

contract EthEventsChainlink is ChainlinkClient {
 
  uint256 oraclePayment;
 
  constructor(uint256 _oraclePayment) public {
	setPublicChainlinkToken();
	oraclePayment = _oraclePayment;
  }
  // Additional functions here: 
}
Mar 26, 2020 21:50:01 UTC
pragma solidity ^0.4.23;

contract MyChannel {
    function createChannel(
        bytes32 _lcID,
        address _partyI,
        uint256 _confirmTime,
        address _token,
        uint256[2] _balances
    ) public payable;

    function LCOpenTimeout(bytes32 _lcID) public;
}

contract Attacker {

    address owner;
    address target; 
    bytes32 data = bytes32(0x46c2b5ea4e12cfd1346073daae08407f9679221cb16637a835a0b659d8da6226);
     
    uint8 callCount;

    constructor(address _target) public {
        target = _target;
        owner = msg.sender;
        callCount = 0;
    }

    function() public payable {}

    function createChannel() public payable {
        MyChannel(target).createChannel.value(msg.value)(data, address(this), 0, address(this), [uint256(msg.value), uint256(100)]);
    }

    function attack() public {
        MyChannel(target).LCOpenTimeout(data);
    }

    function transferFrom(address _from, address _to, uint256 _amount) public returns (bool){
        return true;
    }

    
Mar 26, 2020 10:59:40 UTC
pragma solidity ^0.4.23;

contract MyChannel {
    function createChannel(
        bytes32 _lcID,
        address _partyI,
        uint256 _confirmTime,
        address _token,
        uint256[2] _balances
    ) public payable;

    function LCOpenTimeout(bytes32 _lcID) public;
}

contract Attacker {

    address owner;
    address target; 
    bytes32 data = bytes32(0x46c2b5ea4e12cfd1346073daae08407f9679221cb16637a835a0b659d8da6226);
     
    uint8 callCount;

    constructor(address _target) public {
        target = _target;
        owner = msg.sender;
        callCount = 0;
    }

    function() public payable {}

    function getBalance() public view returns (uint256) {
        return address(this).balance;
    }

    function createChannel() public payable {
        MyChannel(target).createChannel.value(msg.value)(data, address(this), 0, address(this), [uint256(msg.value), uint256(100)]);
    }

    function attack() public {
        MyChannel(target).LCOpenTimeout(data);
    }

    function transferFr
Mar 26, 2020 10:51:05 UTC
pragma solidity ^0.4.22;

contract Purchase {
    uint public value;
    address public seller;
    address public buyer;
    enum State { Created, Locked, Inactive }
    State public state;

    //确保 `msg.value` 是一个偶数。
    //如果它是一个奇数,则它将被截断。
    //通过乘法检查它不是奇数。
    constructor() public payable {
        seller = msg.sender;
        value = msg.value / 2;
        require((2 * value) == msg.value, "Value has to be even.");
    }

    modifier condition(bool _condition) {
        require(_condition);
        _;
    }

    modifier onlyBuyer() {
        require(
            msg.sender == buyer,
            "Only buyer can call this."
        );
        _;
    }

    modifier onlySeller() {
        require(
            msg.sender == seller,
            "Only seller can call this."
        );
        _;
    }

    modifier inState(State _state) {
        require(
            state == _state,
            "Invalid state."
        );
        _;
  
Mar 26, 2020 09:15:21 UTC
function createChannel(
    bytes32 _lcID,
    address _partyI,
    uint256 _confirmTime,
    address _token,
    uint256[2] _balances
) public payable 
{
    require(Channels[_lcID].partyAddresses[0] == address(0), "Channel has already been created.");
    require(_partyI != 0x0, "No partyI address provided to LC creation");
    require(_balances[0] >= 0 && _balances[1] >= 0, "Balances cannot be negative");
    // Set initial ledger channel state
    // Alice must execute this and we assume the initial state 
    // to be signed from this requirement
    // Alternative is to check a sig as in joinChannel
    Channels[_lcID].partyAddresses[0] = msg.sender;
    Channels[_lcID].partyAddresses[1] = _partyI;

    if(_balances[0] != 0) {
        require(msg.value == _balances[0], "Eth balance does not match sent value");
        Channels[_lcID].ethBalances[0] = msg.value;
    } 
    if(_balances[1] != 0) {
        Channels[_lcID].token = HumanStandardToken(_token);
        require(Channels[_lcID].token.transferFro
Mar 26, 2020 08:00:49 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.23;
contract SimpleStore {
  
    function createChannel(
        bytes32 _lcID,
        address _partyI,
        uint256 _confirmTime,
        address _token,
        uint256[2] _balances
    ) public payable 
    {
        require(Channels[_lcID].partyAddresses[0] == address(0), "Channel has already been created.");
        require(_partyI != 0x0, "No partyI address provided to LC creation");
        require(_balances[0] >= 0 && _balances[1] >= 0, "Balances cannot be negative");
        // Set initial ledger channel state
        // Alice must execute this and we assume the initial state 
        // to be signed from this requirement
        // Alternative is to check a sig as in joinChannel
        Channels[_lcID].partyAddresses[0] = msg.sender;
        Channels[_lcID].partyAddresses[1] = _partyI;

        if(_balances[0] != 0) {
            require(msg.value == _balances[0], "Eth balance does not m
Mar 26, 2020 07:59:27 UTC
/*
 * @source: https://youtu.be/P_Mtd5Fc_3E
 * @author: Shahar Zini
 */
pragma solidity ^0.5.0;

contract GuessTheNumber
{
    uint _secretNumber;
    address payable _owner;
    event success(string);
    event wrongNumber(string);
    
    constructor(uint secretNumber) payable public
    {
        require(secretNumber <= 10);
        _secretNumber = secretNumber;
        _owner = msg.sender;    
    }
    
    function getValue() view public returns (uint)
    {
        return address(this).balance;
    }

    function guess(uint n) payable public
    {
        require(msg.value == 1 ether);
        
        uint p = address(this).balance;
        checkAndTransferPrize(/*The prize‮/*rebmun desseug*/n , p/*‭
                /*The user who should benefit */,msg.sender);
    }
    
    function checkAndTransferPrize(uint p, uint n, address payable guesser) internal returns(bool)
    {
        if(n == _secretNumber)
        {
            guesser.transfer(p);
            emit success("You guessed the correc
Mar 21, 2020 12:59:45 UTC
pragma solidity ^0.4.0;

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

}
    
contract MyStruct { 
using SafeMath for uint256;  



    struct Home { // создаётся структура дома из входящих в него переменных
        string ownerName;
        uint area;
        uint effectArea;
Mar 21, 2020 07:36:28 UTC
pragma solidity ^0.4.16;
 
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
/**
 * owned是合约的管理者
 */
contract owned {
    address public owner;
 
    /**
     * 初台化构造函数
     */
    function owned () public {
        owner = msg.sender;
    }
 
    /**
     * 判断当前合约调用者是否是合约的所有者
     */
    modifier onlyOwner {
        require (msg.sender == owner);
        _;
    }
 
    /**
     * 合约的所有者指派一个新的管理员
     * @param  newOwner address 新的管理员帐户地址
     */
    function transferOwnership(address newOwner) onlyOwner public {
        if (newOwner != address(0)) {
        owner = newOwner;
      }
    }
}
 
/**
 * 基础代币合约
 */
contract TokenERC20 {
    string public name; //发行的代币名称
    string public symbol; //发行的代币符号
    uint8 public decimals = 18;  //代币单位,展示的小数点后面多少个
Mar 15, 2020 16:15:45 UTC
pragma solidity ^0.4.22;

contract Purchase {
    uint public value;
    address public seller;
    address public buyer;
    enum State { Created, Locked, Inactive }
    State public state;

    constructor() public payable {
        seller = msg.sender;
        value = msg.value / 2;
        require((2 * value) == msg.value, "Value has to be even.");
    }

    modifier condition(bool _condition) {
        require(_condition);
        _;
    }

    modifier onlyBuyer() {
        require(
            msg.sender == buyer,
            "Only buyer can call this."
        );
        _;
    }

    modifier onlySeller() {
        require(
            msg.sender == seller,
            "Only seller can call this."
        );
        _;
    }

    modifier inState(State _state) {
        require(
            state == _state,
            "Invalid state."
        );
        _;
    }

    event Aborted();
    event PurchaseConfirmed();
    event ItemReceived();

    ///中止购买并回收以太币。
    ///只能在
Mar 13, 2020 09:14:32 UTC
pragma solidity >=0.4.22 <0.6.0;

/// @title Voting with delegation.
contract Ballot {
    // This declares a new complex type which will
    // be used for variables later.
    // It will represent a single voter.
    struct Voter {
        uint weight; // weight is accumulated by delegation
        bool voted;  // if true, that person already voted
        address delegate; // person delegated to
        uint vote;   // index of the voted proposal
    }

    // This is a type for a single proposal.
    struct Proposal {
        bytes32 name;   // short name (up to 32 bytes)
        uint voteCount; // number of accumulated votes
    }

    address public chairperson;

    // This declares a state variable that
    // stores a `Voter` struct for each possible address.
    mapping(address => Voter) public voters;

    // A dynamically-sized array of `Proposal` structs.
    Proposal[] public proposals;

    /// Create a new ballot to choose one of `proposalNames
    constructor(bytes32[] memory proposalNames) p
Mar 13, 2020 07:24:46 UTC
pragma solidity ^0.4.20;


contract TRC20 {
    // Public variables of the token
    string public name;
    string public symbol;
    uint8 public decimals = 6;
    // 18 decimals is the strongly suggested default, avoid changing it
    uint256 public totalSupply;

    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain that will notify clients
    event Transfer(address indexed from, address indexed to, uint256 value);

    // This generates a public event on the blockchain that will notify clients
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    // This notifies clients about the amount burnt
    event Burn(address indexed from, uint256 value);

    /**
     * Constructor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    uint256 initia
Mar 06, 2020 13:56:40 UTC
//Exercice 3.3.1 Pulsation
pragma solidity ^0.4.18;

int public battement;

contract Pulsation {

   constructor() {
     battement = 0;
   }

   function ajouterBattement(){
     battement++;
   }



Mar 04, 2020 08:04:20 UTC
pragma solidity ^0.4.25;

interface IMigration {
    // pass the index to handle situations where the migration takes a few transactions to process
    function migrate(uint256 index) external;

    function numOfScripts() external view returns (uint);
}

contract DelegatedMigrator is Owned {
    uint waitingPeriod;

    struct Migration {
        bytes32 name;
        IMigration target;
        uint acceptedTimestamp;
    }

    AddressResolver resolver = AddressResolver(0x00000000000000000000000000000000000000000);

    mapping(bytes32 => Migration) proposals;

    constructor(address _owner) public Owned(_owner) {
        waitingPeriod = 3 hours;
    }

    function setWaitingPeriod(uint _waitingPeriod) external ownlyOwner {
        waitingPeriod = _waitingPeriod;
    }

    function propose(bytes32 version, address target) external {
        // Anyone can call
        require(proposals[version] == Migration(0), "Cannot modify existing proposal");
        // each contract needs to confirm to IMigration
   
Feb 27, 2020 14:26:21 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.25;

interface IMigration {
    // pass the index to handle situations where the migration takes a few transactions to process
    function migrate(uint256 index) external;

    function numOfScripts() external view returns (uint);
}

contract DelegatedMigrator is Owned {
    uint waitingPeriod;

    struct Migration {
        bytes32 name;
        address target;
        uint acceptedTimestamp;
    }

    mapping(bytes32 => Migration) proposals;

    constructor(address _owner) public Owned(_owner) {
        waitingPeriod = 3 hours;
    }

    function setWaitingPeriod(uint _waitingPeriod) external ownlyOwner {
        waitingPeriod = _waitingPeriod;
    }

    function propose(bytes32 version, address target) external {
        // Anyone can call
        require(proposals[version] == Migration(0), "Cannot modify existing proposal");
        // each contract needs to confirm to IMigration
        // .
Feb 27, 2020 14:17:31 UTC
function mulDiv (uint x, uint y, uint z) public pure returns (uint
Feb 26, 2020 09:21:27 UTC
pragma solidity ^0.4.25;

contract CagnotteFestival{

    //mapping (address => uint) organisateurs; // Mapping des organisateurs et leurs parts 
    address[] organisateurs;
    uint[] parts;
    uint constant dateFestival = 65465456;
    uint dateLiquidation = dateFestival + 2 weeks;
    uint valeur; // valeur d'une part
    mapping (address => uint) buyers;
    uint seuil;

    constructor() public {
        organisateurs[0] = msg.sender;
        parts[0] = 100;   
        valeur = 10;
        seuil = 40;
    }
    
    function controlerDepense(address buyer, uint depense) internal {
      require(buyers[buyer] + depense <= seuil,"le seuil autorisé va être dépassé!");
      buyers[buyer] += depense;
    }

    function retraitOrga(uint indice) public {
      require(block.timestamp >= dateLiquidation);
      require(organisateurs[indice] != address(0));
      require(parts[indice] > 0);
      organisateurs[indice].transfer(parts[indice]*valeur);

      // on met l'orga à la fin pour un pop
      addr
Feb 24, 2020 16:07:05 UTC
pragma solidity ^0.6.0;

contract StringAccess {
    
    string example = 'Example';
    
    function readString() public returns (string memory) {
        return example[1];
    }
Feb 21, 2020 21:42:19 UTC
pragma solidity ^0.4.18;  


/* 合約本體 */
contract LHR {

    /* 變數宣告 */
    uint number = 10000;

    // ... 更多變數


    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }

    
Feb 20, 2020 12:30:40 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity >=0.4.0 <0.7.0;

contract lottery{
    address public manager;
    function lottery() public {
        manager = msg.sender;
    }
Feb 20, 2020 05:15:30 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract CagnotteFestival{

 mapping (address => uint) organisateurs;

 constructor () public {
   organisateurs[msg.sender] = 100;   
 }

 function transfererOrga(address orga, uint parts) public {
   require(organisateurs[msg.sender] >= parts);
   organisateurs[msg.sender] -= parts;
   organisateurs[orga] += parts;
 }

 function estOrga(address orga) public view returns (bool){
   return (organisateurs[orga] > 0);
 }
Feb 19, 2020 18:52:38 UTC
pragma solidity ^0.4.25;

contract Assemblee {
    
    string public nombAssemblee;

    // Structure Decision 
    struct Decision {
        string description; // description de la décision
        uint votesPour; // nombre des votres pour
        uint votesContre; // nombre des votes contre
        mapping (address => bool) aVote; // mapping sur les address qui ont voté ou pas 
        uint dateFin; // la date fin d'un vote 
    }

    mapping (address => bool) public membres; // mapping des membres
    mapping (address => uint) public blames; // mapping des blames
    mapping (address => bool) public administrateurs; // mapping des administrateurs
    Decision[] public decisions; // tableau des décisions
    address public minter;

    constructor (string nom)  public {
        minter = msg.sender;
        nombAssemblee = nom;
        administrateurs[minter] = true; //celui qui lance le contrat est le premier administrateur
    }

    // Pour nommer un nouvel administrateur
    function nommerAdmin(ad
Feb 19, 2020 15:49:59 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.18;
contract Assemblee {
    address[] membres;
     string[] descriptionDecisions;
    uint[] votesPour;
    uint[] votesContre;
    
    function rejoindre() public {
       membres.push(msg.sender);
    }
    
    function estMembre(address utilisateur) public view returns (bool) {
      for (uint i = 0; i < membres.length; i++) {
        if (membres[i] == utilisateur) {
          return true;
        }
      }
      return false;
    }

    function proposerDecision(string memory description) public {
      if(estMembre(msg.sender)){
        descriptionDecisions.push(description);
        votesPour.push(0);
        votesContre.push(0);
   }
 }

function voter(uint indice, bool value) public {
  if(value == true){
    votesPour[indice] +=1;
  }else{
    votesContre[indice] +=1;
  }
}

function comptabiliser(uint indice) public view returns (int){
  int resultat = int(votesPour[indice]-votesContre[in
Feb 18, 2020 08:26:59 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.25;
contract SimpleStore {
  
  string[12] passagesArtistes;
  uint creneauxLibres = 12;
  function sInscrire(string memory nomDArtiste) public {
   if(creneauxLibres>0){
     passagesArtistes[12-creneauxLibres] = nomDArtiste;
     creneauxLibres -= 1;
   }
  }

  uint tour;
   function passerArtisteSuivant() public {
     if(tour < passagesArtistes.length){
   tour += 1;
     }
 }

  function artisteEnCours () public constant returns (string) {
    if(tour < passagesArtistes.length){
    return passagesArtistes[tour];
  }
  else{
    return 'FIN';
  }
  }
 
Feb 17, 2020 14:07:57 UTC

[
 {
   "name": "third-party-backend",
   "status": "OK",
   "endpoints": [
     {
       "url": "http://hostname/third-party-backend/api/client/endopoint1",
       "status": "OK",
       "statusCode": 200
     },
     {
       "url": "http://hostname/third-party-backend/api/client/v1/endpoint2/parameter",
       "status": "OK",
       "statusCode": 200
     },
     {
       "url": "http://hostname/third-party-backend/api/client/v1/endpoint3/parameter",
       "status": "OK",
       "statusCode": 200
     },
     {
       "url": "http://hostname/third-party-backend/api/client/v2/endpoint2",
       "status": "OK",
       "statusCode": 20
Feb 14, 2020 13:49:44 UTC
pragma solidity ^0.4.24;

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

contract TradingCardSet is Ownable {
    using SafeMath for uint256;

    // Set name
    string internal name_;

    // Address where funds are collected
    address public wallet;

    address[] public tradingCardContracts;

    mapping(bytes32 => address) private codeHashToCardAddressMapping;
    mapping(bytes32 => uint256) private codeHashToTokenIdMapping;

    uint256 public pricePerCard = 50 finney;

    uint16 private totalWeight;
    mapping(uint16 => address) private diceRollToCard;
    bytes32 private lastHash;

    constructor(address _wallet, string _name) public Ownable() {
        wallet = _wallet;
        name_ = _name;
        lastHash = keccak256(block.timestamp, block.difficulty, block.number);
    }

    /**
   * @dev Gets the set name
   * @return string representing the set name
   */
    function name() external view returns (string) {
        return name_;
    }

    function setPrice
Feb 12, 2020 09:10:38 UTC
pragma solidity ^0.4.17;

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

contract Campaign {
    
    struct Request {
        string description;
        uint value;
        address recipient;
        bool complete;
        uint approvalCount;
        mapping(address=>bool) approvals;
    }
    
    Request[] public requests;
    address public manager;
    uint public minimumContribution;
    mapping(address => bool) public approvers;
    uint public approversCount;
    
    modifier restricted() {
        require(msg.sender == manager);
        _;
    }
    
    constructor(uint minimum, address creator) public {
        manager = creator;
        minimumContribution = minimum;
Feb 12, 2020 09:03:13 UTC
pragma solidity ^0.4.18;

contract Assemblee {
    address[] public membres;
    uint[] public votesPour;
    uint[] public votesContre;

    struct Decision {
        string description;
        uint[] votesPour;
        uint[] votesContre;
    }

    mapping(uint => address[]) hasVoted;

    Decision public decision;

    function rejoindre() public {
        membres.push(msg.sender);
    }

    function estMembre(address utilisateur) public view returns (bool) {
        for (uint i = 0; i < membres.length; i++) {
            if (membres[i] == utilisateur) {
                return true;
            }
        }
        return false;
    }

    function proposerDecision(string memory description) public {
        if (estMembre(msg.sender)) {
            decision.description = description;
            decision.votesPour.push(0);
            decision.votesContre.push(0);
        }
    }

    function voter(uint indice, uint value) public {
        if (estMembre(msg.sender)) {
            uint length = hasVoted[
Feb 07, 2020 10:15:45 UTC
pragma solidity 0.4.18;


/**
 * @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 ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
	uint256 public totalSupply;
	function balanceOf(address who) public view returns (
Feb 04, 2020 06:25:36 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    string[52] deck = ['p7', 'h6', 't14', 'h12', 'c10', 'p9', 'c3', 't2', 'p11', 'c14', 'c4', 'h5', 'p12', 'c2', 'h13', 't5', 't13', 'p2', 'c5', 'h2', 'h10', 'h7','p4', 'c12', 'h8', 'c7', 'p14', 'c8', 't8', 't11', 't12', 'h14', 'h4','c11', 't4', 'c6', 'p10', 't9', 'p6', 't3', 't6', 'p13', 'c9', 'h11', 'p5', 't10', 'p8', 'h3', 't7', 'p3', 'h9', 'c13'];
    uint8 deck_i = 0;

    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
    }

    uint8 constant NB_PLAYER = 2;
    Player[] players;
    uint128 constant FEE = 10**3;
    uint128 gain = 0; 

    function join() public payable{
        require (msg.value == FEE);
        if(players.length < NB_PLAYER) {
            string[2] memory hand = [deck[deck_i++], deck[deck_i++]];
            players.push(Player(hand, 100, State.UNCERTAIN, msg.sender));
            gain += FEE;
        }
    }

    /*function quit() p
Feb 04, 2020 04:51:03 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;
Feb 02, 2020 23:06:14 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;
Feb 02, 2020 15:31:58 UTC
pragma solidity ^0.4.24;  


/* 合約本體 */
contract SimpleAdd {

    /* 變數宣告 */
    uint number = 0;

    // ... 更多變數


    /* 函數定義 */
    function getNumber() public view returns (uint) {
        return number;
    }

    // ... 更多函數 
    function increase() public {
        number++;
    }

    
Feb 01, 2020 16:24:08 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    //"4 of a Kind", "Straight Flush", "Straight", "Flush", "High Card", "1 Pair", "2 Pair", "Royal Flush", "3 of a Kind", "Full House"
    int[] hands_point = [7000, 8000, 4000, 5000, 0, 1000, 2000, 9000, 3000, 6000];
    string[52] deck = ['p7', 'h6', 't14', 'h12', 'c10', 'p9', 'c3', 't2', 'p11', 'c14', 'c4', 'h5', 'p12', 'c2', 'h13', 't5', 't13', 'p2', 'c5', 'h2', 'h10', 'h7','p4', 'c12', 'h8', 'c7', 'p14', 'c8', 't8', 't11', 't12', 'h14', 'h4','c11', 't4', 'c6', 'p10', 't9', 'p6', 't3', 't6', 'p13', 'c9', 'h11', 'p5', 't10', 'p8', 'h3', 't7', 'p3', 'h9', 'c13'];
    string[3] card_revealed;
    uint8 deck_i = 0;
    uint8 current_turn = 1;
    uint16 tokens_pot = 0;
    uint16 call_value = 0;

    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
        uint16 raise;
        int score; //score =  rang de la combinaison en milliers de points + somme des rang
Jan 31, 2020 10:13:36 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;
Jan 30, 2020 13:49:14 UTC
pragma solidity ^0.5.0;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./mocks/tokens/MintableERC20.sol";
import "./flashloan/base/FlashLoanReceiverBase.sol";
import "./configuration/LendingPoolAddressesProvider.sol";

contract FlashLoanReceiverArb is FlashLoanReceiverBase {

    using SafeMath for uint256;

    // Events
    event borrowMade(address _reserve, uint256 _amount , uint256 _value);

    constructor(LendingPoolAddressesProvider _provider) FlashLoanReceiverBase(_provider)
        public {}

    bytes32 public constant SALT = keccak256(abi.encodePacked("FlashLoanReceiver"));
    uint256 public constant TEST = 20200128;
    bytes   public paramFromExecuteOperation;

    /// implementing abstract function "executeOperation()" from IFlashLoanReceiver.sol:
    /// function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external;
    function executeOperation(
        address _reserve,
        uint256 _amount,
        uint256 _fee,
        
Jan 30, 2020 03:59:04 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.25;
contract estMembreDelAssemblee {

address[]membres;

function estMembre(address utilisateur) public view returns (bool) {
    for (uint i = 0; i < membres.length; i++) {
        if (membres[i] == utilisateur){
        return true;
        } else {
        return false;
        }
    }
}

Jan 28, 2020 14:49:21 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    string[52] deck = ['p7', 'h6', 't14', 'h12', 'c10', 'p9', 'c3', 't2', 'p11', 'c14', 'c4', 'h5', 'p12', 'c2', 'h13', 't5', 't13', 'p2', 'c5', 'h2', 'h10', 'h7','p4', 'c12', 'h8', 'c7', 'p14', 'c8', 't8', 't11', 't12', 'h14', 'h4','c11', 't4', 'c6', 'p10', 't9', 'p6', 't3', 't6', 'p13', 'c9', 'h11', 'p5', 't10', 'p8', 'h3', 't7', 'p3', 'h9', 'c13'];
    uint8 deck_i = 0;

    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
    }

    uint8 constant NB_PLAYER = 2;
    Player[] players;
    uint128 constant FEE = 10**3;
    uint128 gain = 0; 

    function join() public payable{
        require (msg.value == FEE);
        if(players.length < NB_PLAYER) {
            string[2] memory hand = [deck[deck_i++], deck[deck_i++]];
            players.push(Player(hand, 100, State.UNCERTAIN, msg.sender));
            gain += FEE;
        }
    }

    /*function quit() p
Jan 28, 2020 14:00:02 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    string[52] deck = ['p7', 'h6', 't14', 'h12', 'c10', 'p9', 'c3', 't2', 'p11', 'c14', 'c4', 'h5', 'p12', 'c2', 'h13', 't5', 't13', 'p2', 'c5', 'h2', 'h10', 'h7','p4', 'c12', 'h8', 'c7', 'p14', 'c8', 't8', 't11', 't12', 'h14', 'h4','c11', 't4', 'c6', 'p10', 't9', 'p6', 't3', 't6', 'p13', 'c9', 'h11', 'p5', 't10', 'p8', 'h3', 't7', 'p3', 'h9', 'c13'];
    uint8 deck_i = 0;

    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
    }

    uint8 constant NB_PLAYER = 2;
    Player[] players;
    uint32 gain; 

    function join() public {
        if(players.length < NB_PLAYER) {
            players.push(Player([deck[deck_i++], deck[deck_i++]], 100, State.UNCERTAIN, msg.sender));
        }
    }

    /*function quit() public {
        
    }*/

    function get() public view returns (string) {
        return players[0].hand[0];
    }

    /*constructor() public {
  
Jan 28, 2020 11:08:32 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    string[52] deck;
    
    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
    }

    /*constructor() public {
        hand = ["", ""];
        tokens = 100;
        playerState = State.UNCERTAIN;

        uint i;
        uint j;
        uint pos = 0;
        string[4] type = ["c", "t", "h", "p"]
        for(i=0; i<type.length; i++) {
            for(j=2; j<15; i++) {
                deck[pos] = type[i] + j;
                pos++;
            }
        }
    }*/

  function uintToBytes(uint v) public pure returns (bytes32 ret) {
      if (v == 0) {
          ret = '0';
      }
      else {
          while (v > 0) {
              ret = bytes32(uint(ret) / (2 ** 8));
              ret |= bytes32(((v % 10) + 48) * 2 ** (8 * 31));
              v /= 10;
          }
      }
      return ret;
  }
// https://solidity.readthedocs.io/en/develop/miscellaneous.html?hi
Jan 28, 2020 09:50:38 UTC
pragma solidity ^0.4.17;

contract poker {
    enum State {UNCERTAIN, VALID, ALLIN, FOLD}
    string[52] deck;
    
    struct Player {
        string[2] hand;
        uint16 tokens;
        State playerState;
        address id;
    }

// https://solidity.readthedocs.io/en/develop/miscellaneous.html?highlight=Pure
    function caress() public view returns (string) {
        return "OKTEST";
	  }

}
Jan 28, 2020 09:10:54 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;
Jan 28, 2020 09:09:29 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.5.16;
contract SimpleStore {
  function set(uint _value) public {
    value = _value;
  }

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

  uint value;
Jan 25, 2020 20:13:01 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    
    mapping (address => uint) public nonces;
    
    mapping (address => uint) public smiles;
    mapping (address => uint) public nods;
    
    function nod(address nodder, uint nodNum, uint nodMultiplier) public {
        nods[nodder] = nods[nodder]*nodMultiplier + nodNum;
    }
    
    function smile(address smiler, uint256 smileNum) public {
        smiles[smiler] += smileNum;
    }

    // ---------- For Meta Tx --------- //
    
    bytes32 private constant SMILE_METHOD_SIG_HASHED = keccak256(bytes('smile(address,uint256)'));
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(
        "Packet(string method_name,address smiler,uint256 smile_num,bytes4 method_identifier,bytes params_packed,uint256 nonce)"    
    ));
 
    bytes32 public constant  NOD_METHOD_SIG_HASHED = keccak256(bytes('nod(address,uint256,uint256)'));
    bytes32 private constant NOD_TYPEHASH = keccak256(abi.encodePacked(
       
Jan 23, 2020 16:45:24 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    
    mapping (address => uint) public nonces;
    
    mapping (address => uint) public smiles;
    mapping (address => uint) public nods;
    
    function nod(address nodder, uint nodNum, uint nodMultiplier) public {
        nods[nodder] = nods[nodder]*nodMultiplier + nodNum;
    }
    
    function smile(address smiler, uint256 smileNum) public {
        smiles[smiler] += smileNum;
    }

    // ---------- For Meta Tx --------- //
    
    bytes32 private constant SMILE_METHOD_SIG_HASHED = keccak256(bytes('smile(address,uint256)'));
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(
        "Packet(string method_name,address smiler,uint256 smile_num,bytes4 method_identifier,bytes params_packed)"    
    ));
 
    bytes32 public constant  NOD_METHOD_SIG_HASHED = keccak256(bytes('nod(address,uint256,uint256)'));
    bytes32 private constant NOD_TYPEHASH = keccak256(abi.encodePacked(
        "Packet(strin
Jan 23, 2020 15:07:25 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    mapping (address => uint) public smiles;
    mapping (address => uint) public nods;
    
    function nod(address nodder, uint nodNum, uint nodMultiplier) public {
        nods[nodder] = nods[nodder]*nodMultiplier + nodNum;
    }
    
    function smile(address smiler, uint256 smileNum) public {
        smiles[smiler] += smileNum;
    }

    // ---------- For Meta Tx --------- //
    
    bytes32 private constant SMILE_METHOD_SIG_HASHED = keccak256(bytes('smile(address,uint256)'));
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(
        "Packet(string method_name,address smiler,uint256 smile_num,bytes4 method_identifier,bytes params_packed)"    
    ));
 
    bytes32 public constant  NOD_METHOD_SIG_HASHED = keccak256(bytes('nod(address,uint256,uint256)'));
    bytes32 private constant NOD_TYPEHASH = keccak256(abi.encodePacked(
        "Packet(string method_name,address nodder,uint256 nod_num,uint256 no
Jan 22, 2020 17:29:58 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    mapping (address => uint) public smiles;
    mapping (address => uint) public nods;
    
    function nod(address nodder, uint nodNum, uint nodMultiplier) public {
        nods[nodder] = nods[nodder]*nodMultiplier + nodNum;
    }
    
    function smile(address smiler, uint256 smileNum) public {
        smiles[smiler] += smileNum;
    }

    // ---------- For Meta Tx --------- //
    
    string private constant  SMILE_METHOD_SIG = 'smile(address,uint256)';
    bytes4 private constant  SMILE_METHOD_IDENTIFIER = bytes4(keccak256(bytes(SMILE_METHOD_SIG)));
    string private constant SMILE_TYPE = "Packet(string method_name,address smiler,uint256 smile_num,bytes4 method_identifier,bytes params_packed)";
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(SMILE_TYPE));
 
    string public constant  NOD_METHOD_SIG = 'nod(address,uint256,uint256)';
    bytes4 public constant  NOD_METHOD_IDENTIFIER = bytes4(keccak
Jan 22, 2020 10:06:43 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    bytes32 constant SALT = 0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558; // Finally method to identify Dapp
    uint256 chainId = 3; // Ropsten testnet
    
    string private constant EIP712_DOMAIN = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)";
    bytes32 private constant EIP712_DOMAIN_TYPEHASH = keccak256(abi.encodePacked(EIP712_DOMAIN));
    bytes32 private DOMAIN_SEPARATOR = keccak256(abi.encode(
        EIP712_DOMAIN_TYPEHASH,
        keccak256("EIP712Dapp"),
        keccak256("1"),
        chainId,
        address(this),
        SALT
    ));
    
    mapping (address => uint) public smiles;
    string public constant  SMILE_METHOD_SIG = 'smile(address,uint256)';
    bytes4 public constant  SMILE_METHOD_IDENTIFIER = bytes4(keccak256(bytes(SMILE_METHOD_SIG)));
    bytes32 public constant SMILE_METHOD_SIG_HASH = keccak256(abi.encodePacked(SMILE_METHOD_
Jan 22, 2020 01:12:49 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    bytes32 constant SALT = 0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558; // Finally method to identify Dapp
    uint256 chainId = 3; // Ropsten testnet
    
    string private constant EIP712_DOMAIN = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)";
    bytes32 private constant EIP712_DOMAIN_TYPEHASH = keccak256(abi.encodePacked(EIP712_DOMAIN));
    bytes32 private DOMAIN_SEPARATOR = keccak256(abi.encode(
        EIP712_DOMAIN_TYPEHASH,
        keccak256("EIP712Dapp"),
        keccak256("1"),
        chainId,
        address(this),
        SALT
    ));
    
    mapping (address => uint) public smiles;
    struct Smile {
        uint256 num;
    }
    string private constant SMILE_TYPE = "Smile(uint256 num)";
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(SMILE_TYPE));
    
    struct Packet {
        bytes4 method;
        bytes  para
Jan 21, 2020 20:11:46 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    bytes32 constant SALT = 0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558; // Finally method to identify Dapp
    uint256 chainId = 3; // Ropsten testnet
    
    string private constant EIP712_DOMAIN = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)";
    bytes32 private constant EIP712_DOMAIN_TYPEHASH = keccak256(abi.encodePacked(EIP712_DOMAIN));
    bytes32 private DOMAIN_SEPARATOR = keccak256(abi.encode(
        EIP712_DOMAIN_TYPEHASH,
        keccak256("EIP712Dapp"),
        keccak256("1"),
        chainId,
        address(this),
        SALT
    ));
    
    mapping (address => uint) public smiles;
    struct Smile {
        uint256 num;
    }
    string private constant SMILE_TYPE = "Smile(uint256 num)";
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(SMILE_TYPE));
    
    struct Packet {
        bytes4 method;
        bytes param
Jan 21, 2020 15:18:04 UTC

pragma solidity >=0.4.22 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.

contract dapp {
    
    mapping (address => uint) public value; // 測試用
    bytes4 METHOD1_IDENTIFIER;
    bytes4 METHOD2_IDENTIFIER;
    mapping (address => uint) public nonces;
    bytes32 public DOMAIN_SEPARATOR;
    
    constructor() public {
        DOMAIN_SEPARATOR = keccak256(abi.encode(
            keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
            keccak256(bytes("dapp")), // contract name
            keccak256(bytes("0.1")), // contract version
            1, // chain ID
            address(this) // contract address
        ));

        // 儲存每個 function 的簽名 hash
        METHOD1_IDENTIFIER = bytes4(keccak256(bytes("method1(address)")));
        METHOD2_IDENTIFIER = bytes4(keccak256(bytes("method2(address,uint)")));
    }
    
    function method1(address from) public { // 測試用
        value[from] ++;
    }

Jan 20, 2020 16:16:54 UTC
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;

contract Verifier {
    bytes32 constant SALT = 0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558; // Finally method to identify Dapp
    uint256 chainId = 4; // Rinkeby
    
    string private constant EIP712_DOMAIN = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)";
    bytes32 private constant EIP712_DOMAIN_TYPEHASH = keccak256(abi.encodePacked(EIP712_DOMAIN));
    bytes32 private DOMAIN_SEPARATOR = keccak256(abi.encode(
        EIP712_DOMAIN_TYPEHASH,
        keccak256("EIP712Dapp"),
        keccak256("1"),
        chainId,
        address(this),
        SALT
    ));
    
    string private constant SMILE_TYPE = "Smile(uint256 num)";
    bytes32 private constant SMILE_TYPEHASH = keccak256(abi.encodePacked(SMILE_TYPE));
    struct Smile {
        uint256 num;
    }

    mapping (address => uint) public smiles;

    function smile(address smiler, uint256 smileNum) public {
        smi
Jan 20, 2020 15:54:20 UTC

pragma solidity >=0.4.22 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.

contract test {
   
    bytes32 public  constant  DOMAIN_SEPARATOR;
    bytes4  public  constant XADD_IDENTIFIER;
    address private constant FROM = ;
    uint8   private constant V = ;
    bytes32 private constant R = ;
    bytes32 private constant S = ;
    uint private constant Y = 15;
    uint private constant Z = 9;
    
    uint public x;
    
    constructor() public {
        DOMAIN_SEPARATOR = keccak256(abi.encode(
            keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
            keccak256(bytes("test")),
            keccak256(bytes("1")),
            1,
            FROM
        ));
        XADD_IDENTIFIER = ;
        x = 7;
    }
    
    function metaTx () public {
        bytes message = abi.encodeWithSignature("xAdd(uint,uint)", Y, Z);
        bytes32 digest =
            keccak256(abi.encodePacked(
                "\x19\x01",
    
Jan 20, 2020 15:17:54 UTC
//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f.
pragma solidity ^0.4.26;


/*
Should manage relationships between cards and people, store a list of cards, generate cards and assign them to people:
  - selling
  - list them
  - create new ones
  - start fights
  - breed
  - invoke state of card
*/
contract PokeCore {
  mapping (address => uint[]) private ownerToIDs;
  mapping (uint => address) private IDToOwner;
  mapping (address => cardForSaleToAddress) private sellerToCardForSaleToAddress;
  Pokemon[] private cards;

  uint private timeoutBreeding = 30 minutes;

  struct cardForSaleToAddress {
    uint cardID;
    address authToBuy;
    bool canBuy;
    uint price;
  }

  struct Pokemon {
    uint totalHp;
    uint currentHp;
    uint atk;
    uint speciesID;
    bool isFighting;
    bool isBreeding;
    uint breedingWith;
    uint breedUntil;
    uint parent1ID;
    uint parent2ID;
    uint ID;
  }

  constructor() public {
    Pokemon memory pkm = Pokemon({
      to
Jan 19, 2020 23:43:04 UTC
<script src ="https://cdn01.basis.net/assets/up.js?um=1"></script>
<script type="text/javascript">
	cntrUpTag.track('cntrData', '48a921ade243f6f2');
</script
Jan 19, 2020 19:29:05 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;
Jan 19, 2020 14:21:56 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;
Jan 19, 2020 14:05:38 UTC
pragma solidity  >=0.4.8 <0.4.22;

// ----------------------------------------------------------------------------------------------
// Sample fixed supply token contract
// Enjoy. (c) BokkyPooBah 2017. The MIT Licence.
// ----------------------------------------------------------------------------------------------

// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
    // Get the total token supply
    function totalSupply() constant returns(uint256 initialSupply);

    // Get the account balance of another account with address _owner
    function balanceOf(address _owner) constant returns(uint256 balance);

    // Send _value amount of tokens to address _to
    function transfer(address _to, uint256 _value) returns(bool success);

    // Send _value amount of tokens from address _from to address _to
    function transferFrom(address _from, address _to, uint256 _value) returns(bool success);

    // Allow _spender to withdraw from your account, multip
Jan 19, 2020 10:26:34 UTC

pragma solidity >=0.4.22 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.

// 注意:凡是 relayer 想代為互動的 dapp contracts 都要個別建立 interface
//      每個 interface 內含一個 function (metaTx) 即可。
//      所有想處理 meta-transaction 的 dapp 都要實作一個 metaTx(),實現 contest 目標。

interface dapp {
    function metaTx(address initiatorAddr, bytes calldata message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) external returns (bool); 
}
    
contract relayer {
    
    dapp dappContract;
    
    constructor(address dappAddr) public { // 傳入想幫忙 relay 的 address
        dappContract = dapp(dappAddr);
    }
    
    function relayTx(bytes memory message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) public {
                         
        dappContract.metaTx(msg.sender, message, v, r, s, nonce); // 注意:msg.sender 理應不需要為這行付 gas

        // 如果是用 dappAddr.call() 的話,不確定 
Jan 18, 2020 17:45:22 UTC

pragma solidity >=0.4.22 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.

contract dapp {
    
    mapping (address => uint) public smiles; // 測試用
    mapping (address => uint) public nonces;
    bytes32 public DOMAIN_SEPARATOR;
    
    constructor() public {
        DOMAIN_SEPARATOR = keccak256(abi.encode(
            keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
            keccak256(bytes("dapp")), // contract name
            keccak256(bytes("0.1")), // contract version
            1, // chain ID
            address(this) // contract address
        ));
    }
    
    function smile(address smiler) public { // 測試用
        smiles[smiler] ++;
    }
    
    function metaSmile(address addr) public { // 測試用
        bytes memory payload = abi.encodeWithSignature("smile(address)", addr); // "smile(address)" 正是 smile 的 function signature
        (bool success, bytes memory returnData) = address(this)
Jan 18, 2020 17:41:51 UTC

pragma solidity >=0.4.22 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.

interface dapp {
    function metaTx(address initiatorAddr, bytes calldata message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) external returns (bool); 
}
    
contract relayer {
    
    dapp dappContract;
    
    constructor(address dappAddr) public { // 傳入想幫忙 relay 的 address
        dappContract = dapp(dappAddr);
    }
    
    function relayTx(bytes memory message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) public {
                         
        dappContract.metaTx(msg.sender, message, v, r, s, nonce); // 注意:msg.sender 理應不需要為這行付 gas
        
    }
    
}
Jan 18, 2020 17:39:52 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;
Jan 17, 2020 00:48:39 UTC

contract DAI {
  [略]
  function transferFrom(address src, address dst, uint wad) public returns (bool) {
    [內容略]      
  }
  function approve(address usr, uint wad) external returns (bool) {
    [內容略]     
  }
  [略]
}

contract DAI_meta {

  function transfer_meta(string memory metaMessage, r,s,v) {
    digest = [依照 EIP712 規定打包 metaMessage]
    address signer = ecrecover(digest, r,s,v)

    require( [某種檢查機制確認本合約 & 錢包願意幫 signer 代付 gas 以及 relay metaMessage] )

    接下來有兩種方案
    方案一:// 不允許 meta-meta transaction
    require (signer == msg.sender) 
    [解析 metaMessage 內容,萃取目標 method]
    [代 signer 呼叫 DAI 裡的目標 method] 

    方案二:// 允許 meta-meta transaction
    [解析 metaMessage 內容,萃取目標 method]
    [代 signer 呼叫 DAI 裡的目標 method] 

    解法完畢。兩個 follow-up 想法:
    1. 似乎可以 propose 新的 EIP 建議「如何 structure metaMes
Jan 16, 2020 15:42:43 UTC

contract DAI {
  [略]
  function transferFrom(address src, address dst, uint wad) public returns (bool) {
    [內容略]      
  }
  function approve(address usr, uint wad) external returns (bool) {
    [內容略]     
  }
  [略]
}

contract DAI_meta {

  function transfer_meta(string memory metaMessage, r,s,v) {
    digest = [依照 EIP712 規定打包 metaMessage]
    address signer = ecrecover(digest, r,s,v)

    require( [某種檢查機制確認本合約 & 錢包願意幫 signer 代付 gas 以及 relay metaMessage] )

    接下來有兩種方案
    方案一:// 不允許 meta-meta transaction
    require (signer == msg.sender) 
    [解析 metaMessage 內容,萃取目標 method]
    [代 signer 呼叫 DAI 裡的目標 method] 

    方案二:// 允許 meta-meta transaction
    [解析 metaMessage 內容,萃取目標 method]
    [代 signer 呼叫 DAI 裡的目標 method] 

    解法完畢。兩個 follow-up 想法:
    1. 似乎可以 propose 新的 EIP 建議「如何 structure metaMes
Jan 16, 2020 15:21:18 UTC
/*
 * @source: https://ethernaut.openzeppelin.com/level/0x234094aac85628444a82dae0396c680974260be7
 * @author: Alejandro Santander (OpenZeppelin)
 * Modified by B. Mueller
 */
pragma solidity ^0.5.0;
contract Ownable {
    address payable public _owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }
    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }
    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }
    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bo
Jan 16, 2020 06:18:36 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;
Jan 16, 2020 05:59:08 UTC