This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
interface etherDice { | |
function bet(uint _number) external payable returns(bool); | |
} | |
contract diceHack2 { | |
constructor (address _etherDice) public payable { | |
etherDice dice = etherDice(_etherDice); | |
uint number = block.timestamp % 6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
// THIS CONTRACT CONTAINS A BUG - DO NOT USE | |
contract EtherDice { | |
event LOG_RESULT(uint _number, uint _dice, address _winner); | |
constructor() public payable { | |
require(msg.value > 0.1 ether); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
interface etherDice { | |
function bet(uint _number) external payable returns(bool); | |
} | |
contract diceHack { | |
etherDice dice; | |
constructor (address _etherDice) public { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
// THIS CONTRACT CONTAINS A BUG - DO NOT USE | |
contract EtherDice { | |
event LOG_RESULT(uint _number, uint _dice, address _winner); | |
constructor() public payable { | |
require(msg.value > 0.1 ether); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PushButton from '../build/contracts/PushButton.json' | |
import getWeb3 from './utils/getWeb3' | |
//其餘省略 | |
componentWillMount() { | |
getWeb3.then(results => { | |
this.setState({ | |
web3: results.web3 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.13; | |
contract TLV { | |
function transfer(address to, uint value) returns (bool ok); | |
} | |
contract Faucet { | |
function getToken(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const Web3 = require('web3'); | |
const solc = require('solc'); | |
const _ = require('lodash'); | |
// config | |
const ethereumUri = 'http://localhost:8545'; | |
const callbackAddr = '0x00A79a80Fb0ff9216AAC81AD416D8f8AA2a6dDB9';//替換成剛剛設定的cbAddress | |
const password = 'password'; //替換成可以unlock callbackAddr的密碼 | |
const oracleAddr = '0xC4Eb879Cd65C4A2F4B4Afc50a657fF6Aee77Ba31'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.10; | |
// Oracle interface | |
contract Oracle { | |
address public cbAddress; | |
function query(string _query) returns (bytes32 id); | |
} | |
// OracleResolver interface | |
contract OracleResolver { |
NewerOlder