目前智能合約(智約)使用以太坊測試網部署測試,以智約驗證概念為主,未來可望新增Linux基金會的HyperLedger專案的商轉網路,或是外掛比特幣網路側鏈的Rootstock平台網路,就2016年來看,智約概念驗證可用網路裡以太坊較主流,次起智約網路預計2017年才會明朗。
Ethereum Project https://ethereum.org/
Hyper Ledger Foundation https://www.hyperledger.org/
| Verifying issuance of colored coins asset with ID #U3uPyQeyNRafPy7popDfhZui8Hsw98B5XMUpP |
| // Create a cryptocurrency contract in Ethereum https://www.ethereum.org/token | |
| contract owned { | |
| address public owner; | |
| function owned() { | |
| owner = msg.sender; | |
| } | |
| modifier onlyOwner { | |
| if (msg.sender != owner) throw; |
| // OneEther/OneThousand: A simple decentralized raffle https://github.com/OneEther/OneThousand |
目前智能合約(智約)使用以太坊測試網部署測試,以智約驗證概念為主,未來可望新增Linux基金會的HyperLedger專案的商轉網路,或是外掛比特幣網路側鏈的Rootstock平台網路,就2016年來看,智約概念驗證可用網路裡以太坊較主流,次起智約網路預計2017年才會明朗。
Ethereum Project https://ethereum.org/
Hyper Ledger Foundation https://www.hyperledger.org/
| // Create a cryptocurrency contract in Ethereum https://www.ethereum.org/token | |
| contract owned { | |
| address public owner; | |
| function owned() { | |
| owner = msg.sender; | |
| } | |
| modifier onlyOwner { | |
| if (msg.sender != owner) throw; |
| [ { "constant": false, "inputs": [ { "name": "newSellPrice", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "new Sell Price", "template": "elements_input_uint" }, { "name": "newBuyPrice", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "new Buy Price", "template": "elements_input_uint" } ], "name": "setPrices", "outputs": [], "type": "function", "displayName": "set Prices" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string", "value": "YRT3", "displayName": "" } ], "type": "function", "displayName": "name" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address", "typeShort": "address", "bits": "", "displayName": " <span class=\"punctuation\">_</span> spender", "template": "elements_input_address" }, { "name": "_value", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": " <span class=\"punctuation\">_</span> value", "template": "elements_input_uint" } ], "n |
| [ { "constant": false, "inputs": [ { "name": "newSellPrice", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "new Sell Price", "template": "elements_input_uint" }, { "name": "newBuyPrice", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "new Buy Price", "template": "elements_input_uint" } ], "name": "setPrices", "outputs": [], "type": "function", "displayName": "set Prices" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string", "value": "YRT2", "displayName": "" } ], "type": "function", "displayName": "name" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address", "typeShort": "address", "bits": "", "displayName": " <span class=\"punctuation\">_</span> spender", "template": "elements_input_address" }, { "name": "_value", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": " <span class=\"punctuation\">_</span> value", "template": "elements_input_uint" } ], "n |
| // Solidity by Example — Solidity 0.2.0 documentation http://solidity.readthedocs.org/en/latest/solidity-by-example.html | |
| contract SimpleAuction { | |
| // Parameters of the auction. Times are either | |
| // absolute unix timestamps (seconds since 1970-01-01) | |
| // ore time periods in seconds. | |
| address public beneficiary; | |
| uint public auctionStart; | |
| uint public biddingTime; | |
| // Current state of the auction. |
| [ { "constant": false, "inputs": [], "name": "bid", "outputs": [], "type": "function", "displayName": "bid" }, { "constant": false, "inputs": [], "name": "auctionEnd", "outputs": [], "type": "function", "displayName": "auction End" }, { "constant": true, "inputs": [], "name": "beneficiary", "outputs": [ { "name": "", "type": "address", "value": "0x13a9684203635a4f03e9cb30befdc3e0f69e8163", "displayName": "" } ], "type": "function", "displayName": "beneficiary" }, { "constant": true, "inputs": [], "name": "auctionStart", "outputs": [ { "name": "", "type": "uint256", "value": "1458393276", "displayName": "" } ], "type": "function", "displayName": "auction Start" }, { "constant": true, "inputs": [], "name": "highestBidder", "outputs": [ { "name": "", "type": "address", "value": "0x0000000000000000000000000000000000000000", "displayName": "" } ], "type": "function", "displayName": "highest Bidder" }, { "constant": true, "inputs": [], "name": "biddingTime", "outputs": [ { "name": "", "type": "uint256", "value": "8 |
| // Solidity by Example — Solidity 0.2.0 documentation http://solidity.readthedocs.org/en/latest/solidity-by-example.html | |
| // Ethereum以太坊智能合約環境說明 https://gist.github.com/y12studio/f142cd9789c7d396d8f7 | |
| contract YSOA { | |
| // time periods in seconds. | |
| address public beneficiary; | |
| address public feeDao; | |
| uint public auctionStart; | |
| uint public biddingTime; | |
| uint32 public feePpm; | |
| uint public feeBalance; |