Skip to content

Instantly share code, notes, and snippets.

@AlwaysBCoding
AlwaysBCoding / crowdfund.sol
Created February 25, 2017 22:34
Ethereum Ðapp Development - Video 16 | Avoiding Loops with Mappings
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;
@AlwaysBCoding
AlwaysBCoding / crowdfund.sol
Created February 25, 2017 03:51
Ethereum Ðapp Development - Video 15 | The Block Gas Limit
contract CrowdFund {
address public beneficiary;
uint256 public goal;
uint256 public deadline;
struct Funder {
address addr;
uint256 contribution;
}
@AlwaysBCoding
AlwaysBCoding / decypher.js
Created February 19, 2017 21:46
Ethereum Ðapp Development - Video 13 | Ethereum Name Service (ENS)
// Config
global.config = {
rpc: {
host: "localhost",
port: "8545"
}
}
// Load Libraries
global.solc = require("solc")
@AlwaysBCoding
AlwaysBCoding / CoinFlipOracle.sol
Created February 19, 2017 03:47
Ethereum Ðapp Development - Video 12 | Oracles and Oraclize
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);
@AlwaysBCoding
AlwaysBCoding / decypher.js
Last active March 7, 2018 21:47
Ethereum Ðapp Development - Video 11 | Contract Inheritance
// Config
global.config = {
rpc: {
host: "localhost",
port: "8545"
}
}
// Load Libraries
global.solc = require("solc")
@AlwaysBCoding
AlwaysBCoding / decypher.js
Last active December 22, 2017 20:16
Ethereum Ðapp Development - Video 10 | Smart Contracts - Coin Flipper (Part 2)
// Config
global.config = {
rpc: {
host: "localhost",
port: "8545"
}
}
// Load Libraries
global.solc = require("solc")
@AlwaysBCoding
AlwaysBCoding / decypher.js
Last active July 12, 2019 22:33
Ethereum Ðapp Development - Video 9 | Smart Contracts - Coin Flipper (Part 1)
// Config
global.config = {
rpc: {
host: "localhost",
port: "8545"
}
}
// Load Libraries
global.solc = require("solc")
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active August 12, 2018 07:33
Ethereum Ðapp Development - Video 8 | Smart Contracts - Escrow
// package.json
{
"dependencies": {
"web3": "0.17.0-alpha",
"solc": "^0.4.4"
}
}
// Escrow.sol
contract Escrow {
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active November 2, 2018 20:57
Ethereum Ðapp Development - Video 7 | Smart Contracts - Hello World
// package.json
{
"dependencies": {
"web3": "0.17.0-alpha",
"solc": "^0.4.4"
}
}
// HelloWorld.sol
contract HelloWorld {
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active November 2, 2018 20:09
Ethereum Ðapp Development - Video 6 | Sending MainNet Transactions With Code
// Infura
http://infura.io
// BlockCypher
http://blockcypher.com