Bitcoins, Ethereum and The DAO
money
ownership
transactions
clearing
bank
buy
sell
distributed, anonymous, consensus
A chain of BLOCKs
A CHAIN of blocks
money
ownership
transactions
bitcoin
wallet
any currency
smart contracts
any asset
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}contract Coin {
// The keyword "public" makes those variables
// readable from outside.
mapping (address => uint) public balances;
address public minter;
// Events allow light clients to react on
// changes efficiently.
event Sent(address from, address to, uint amount);
// This is the constructor whose code is
// run only when the contract is created.
function Coin() {
minter = msg.sender;
}
function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
}
function mint(address receiver, uint amount) {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
}mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) {
if (frozenAccount[msg.sender])
throw;
...
}Decentralized Autonomous Organisation
Ethereum
(ETH)
Ethereum Classic
(ETC)
Ethereum
(ETH)
Ethereum Classic
(ETC)
buy 1 ETH
sell 1 ETH
sell 1 ETC