This file contains hidden or 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
// Config | |
global.config = { | |
rpc: { | |
host: "localhost", | |
port: "8545" | |
} | |
} | |
// Load Libraries | |
global.solc = require("solc") |
This file contains hidden or 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.0;//please import oraclizeAPI_pre0.4.sol when solidity < 0.4.0 | |
contract OraclizeI { | |
address public cbAddress; | |
function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id); | |
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id); | |
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id); | |
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id); | |
function getPrice(string _datasource) returns (uint _dsprice); | |
function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice); |
This file contains hidden or 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
// Config | |
global.config = { | |
rpc: { | |
host: "localhost", | |
port: "8545" | |
} | |
} | |
// Load Libraries | |
global.solc = require("solc") |
This file contains hidden or 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
contract CrowdFund { | |
address public beneficiary; | |
uint256 public goal; | |
uint256 public deadline; | |
struct Funder { | |
address addr; | |
uint256 contribution; | |
} |
This file contains hidden or 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
contract CrowdFund { | |
address public beneficiary; | |
uint256 public goal; | |
uint256 public deadline; | |
mapping (address => uint256) funders; | |
address[] funderAddresses; | |
function CrowdFund(address _beneficiary, uint256 _goal, uint256 _duration) { | |
beneficiary = _beneficiary; |
This file contains hidden or 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
contract CrowdFund { | |
address public beneficiary; | |
uint256 public goal; | |
uint256 public deadline; | |
mapping (address => uint256) funders; | |
address[] funderAddresses; | |
event NewContribution(address indexed _from, uint256 _value); |
This file contains hidden or 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
// Private Key | |
var pKey = "..." | |
var pKeyx = new Buffer(pKey, "hex") | |
// Shared Message | |
var message = "..." | |
var messageHash = web3.sha3(message) | |
var messageHashx = new Buffer(messageHash.replace("0x", ""), "hex") | |
// Signed Hash |
This file contains hidden or 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
<h1>Example Text</h1> | |
<script> | |
var message = "DecypherTV"; | |
var userEthereumClient; | |
window.addEventListener("load", function() { | |
userEthereumClient = window.web3; | |
}) | |
This file contains hidden or 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
contract DecypherCoin { | |
// ERC20 State | |
mapping (address => uint256) public balances; | |
mapping (address => mapping (address => uint256)) public allowances; | |
uint256 public totalSupply; | |
// Human State | |
string public name; | |
uint8 public decimals; |
This file contains hidden or 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
// Running on Ubuntu 16.04 (64-bit) | |
// Do this first | |
sudo add-apt-repository -y ppa:ethereum/ethereum | |
sudo apt-get update | |
// Install Geth | |
sudo apt-get install ethereum | |
// Install Solc |