Skip to content

Instantly share code, notes, and snippets.

Verifying issuance of colored coins asset with ID #U3uPyQeyNRafPy7popDfhZui8Hsw98B5XMUpP
@y12studio
y12studio / RandomToken.sol
Last active March 18, 2016 09:22
RandomToken
// 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;
@y12studio
y12studio / LuckOne.sol
Created March 16, 2016 03:57
LuckOne Ethereum
// OneEther/OneThousand: A simple decentralized raffle https://github.com/OneEther/OneThousand
@y12studio
y12studio / HowToSetupEthContract.md
Last active December 24, 2019 08:16
Ethereum以太坊智能合約環境說明

簡介

目前智能合約(智約)使用以太坊測試網部署測試,以智約驗證概念為主,未來可望新增Linux基金會的HyperLedger專案的商轉網路,或是外掛比特幣網路側鏈的Rootstock平台網路,就2016年來看,智約概念驗證可用網路裡以太坊較主流,次起智約網路預計2017年才會明朗。

Ethereum Project https://ethereum.org/

Hyper Ledger Foundation https://www.hyperledger.org/

環境設定

@y12studio
y12studio / RandomToken2.sol
Last active March 18, 2016 09:22
RandomToken2
// 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;
@y12studio
y12studio / yrt3.json
Created March 18, 2016 10:51
YRT3 Contract JSON Interface
[ { "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": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;spender", "template": "elements_input_address" }, { "name": "_value", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;value", "template": "elements_input_uint" } ], "n
@y12studio
y12studio / yrt2.json
Created March 19, 2016 02:47
YRT2 Contract JSON Interface
[ { "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": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;spender", "template": "elements_input_address" }, { "name": "_value", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;value", "template": "elements_input_uint" } ], "n
@y12studio
y12studio / SimpleOpenAuction.sol
Created March 19, 2016 05:44
Simple Open Auction
// 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.
@y12studio
y12studio / ysoa1.json
Created March 19, 2016 13:17
SimpleOpenAuction Contract JSON
[ { "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
@y12studio
y12studio / Y12SimpleOpenAuction2.sol
Last active March 21, 2016 08:26
Y12 Simple Open Auction 2
// 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;