早安 我的朋友
GPU_FORCE_64BIT_PTR 0
GPU_MAX_HEAP_SIZE 100
GPU_USE_SYNC_OBJECTS 1
GPU_MAX_ALLOC_PERCENT 100
GPU_SINGLE_ALLOC_PERCENT 100
EthDcrMiner64.exe -epool eth-asia.dwarfpool.com:8008
-ewal 0x749ccdca77c27bc181580b6dba5560bdf000d88f -epsw x
setup
價格、市場趨勢、新技術
blockchain-based CDN service
Decentralized Application
if ( $ ):
select item #
switch ( # ) :
sell something
sell something
confirm
end
其實就是自動販賣機嘛
pragma solidity ^0.4.6;
contract Bet {
address[] Players;
mapping(address => uint) Bet_answer;
mapping(address => uint) Bet_value;
mapping(address => bool) is_winner;
uint last_roundtime ;
uint winner_count ;
uint winner_total_invest ;
function Bet(){
mapping(address => uint) Bet_answer;
mapping(address => uint) Bet_value;
mapping(address => bool) is_winner;
uint last_roundtime = now;
uint winner_count = 0;
uint winner_total_invest = 0;
}
function Join(uint bet) returns(bool){
if(msg.sender.balance >= msg.value){
Players.push(msg.sender);
Bet_answer[msg.sender] = bet;
Bet_value[msg.sender] = msg.value;
return true;
}
else{
return false;
}
}
function betClose(uint answer){
if(now - last_roundtime >= 10 minutes && msg.sender == 0xabc){
for(uint i = 0 ; i < Players.length ; i ++){
if( Bet_answer[Players[i]] == answer ){
winner_count ++;
is_winner[Players[i]] = true;
winner_total_invest += Bet_value[Players[i]];
}
}
if (winner_count > 0){
winnerWinner();
}
delete Players;
last_roundtime = now;
winner_total_invest = 0;
winner_count = 0;
}
}
function winnerWinner (){
for(uint i = 0 ; i < Players.length ; i++){
if( is_winner[Players[i]] == true ){
if(! Players[i].send( Bet_value[Players[i]] / winner_total_invest * this.balance ) ){
throw;
}
}
}
}
}
Bet
Credit: Daniel Hsu
pragma solidity ^0.4.6;
contract Vending {
uint[3] items = [10,1000,10000];
address refundAddr = 0x123;
uint selectedItem;
bool selected = false;
function SelectItem(uint item){
selectedItem = item;
selected = true;
}
function Buy(uint selectedItem) returns(bool){
if(msg.sender.balance >= msg.value && msg.value >= items[selectedItem] && selected == true){
if (!refundAddr.send(msg.value)){
throw;
}
giveItemToBuyer();
selected = false;
}
else{
return false;
}
}
function giveItemToBuyer(){
}
}
Vending Machine
Credit: Daniel Hsu
http://www.varchevbrokers.com/hft-high-frequency-trading/?lang=en
http://www.flaticon.com/
http://cn.nytimes.com/business/20160701/bitcoin-china-part2/zh-hant/
http://slides.com/chih-chengliang/blockchain_intro-10#/7/1
http://www.rirc.nccu.edu.tw/doc/105.05.28/smart_contract-NCCU-2016-05-28-Final.pdf
https://read01.com/dBxaEE.html
https://www.coursera.org/learn/cryptocurrency