Skip to content

Instantly share code, notes, and snippets.

@y12studio
y12studio / ysoa2.json
Created March 21, 2016 03:44
YSOA2 JSON Interface
[ { "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": "0x5de46a5fe56e7ebd1d24cf6cd64160ca99542b68", "displayName": "" } ], "type": "function", "displayName": "beneficiary" }, { "constant": true, "inputs": [], "name": "auctionStart", "outputs": [ { "name": "", "type": "uint256", "value": "1458531013", "displayName": "" } ], "type": "function", "displayName": "auction Start" }, { "constant": true, "inputs": [], "name": "feeBalance", "outputs": [ { "name": "", "type": "uint256", "value": "0", "displayName": "" } ], "type": "function", "displayName": "fee Balance" }, { "constant": true, "inputs": [], "name": "highestBidder", "outputs": [ { "name": "", "type": "address", "value": "0x0000000000000000000000000000000000000000", "
@y12studio
y12studio / ysoa3.json
Created March 21, 2016 09:17
YSOA3 JSON Interface
[ { "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": "0x5de46a5fe56e7ebd1d24cf6cd64160ca99542b68", "displayName": "" } ], "type": "function", "displayName": "beneficiary" }, { "constant": true, "inputs": [ { "name": "seed", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "seed", "template": "elements_input_uint" } ], "name": "randomGen", "outputs": [ { "name": "randomNumber", "type": "uint256", "value": "0", "displayName": "random Number" } ], "type": "function", "displayName": "random Gen" }, { "constant": true, "inputs": [], "name": "auctionStart", "outputs": [ { "name": "", "type": "uint256", "value": "1458550980", "displayName": "" } ], "type": "function", "displayName": "auction Start" }, { "co
@y12studio
y12studio / ysoa3.sol
Created March 21, 2016 09:18
Y12 Simple Open Auction 3
// 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;
uint8 public luckPercent;
@y12studio
y12studio / yrk1.sol
Created March 22, 2016 08:12
Y12 Reality Key 1
// Ethereum以太坊智能合約環境說明 https://gist.github.com/y12studio/f142cd9789c7d396d8f7
contract YRealityKey {
uint public realityId;
bytes32 public factHash;
address public factAddress;
uint public baseUnit;
uint public rkResult;
function YRealityKey() {
@y12studio
y12studio / yrk1.json
Created March 22, 2016 08:17
YRK1 JSON Interface
[ { "constant": false, "inputs": [ { "name": "reality_id", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "reality&thinsp;<span class=\"punctuation\">_</span>&thinsp;id", "template": "elements_input_uint" }, { "name": "fact_hash", "type": "bytes32", "typeShort": "bytes", "bits": "32", "displayName": "fact&thinsp;<span class=\"punctuation\">_</span>&thinsp;hash", "template": "elements_input_bytes" }, { "name": "ethereum_address", "type": "address", "typeShort": "address", "bits": "", "displayName": "ethereum&thinsp;<span class=\"punctuation\">_</span>&thinsp;address", "template": "elements_input_address" }, { "name": "base_unit", "type": "uint256", "typeShort": "uint", "bits": "256", "displayName": "base&thinsp;<span class=\"punctuation\">_</span>&thinsp;unit", "template": "elements_input_uint" } ], "name": "setupRealityKey", "outputs": [], "type": "function", "displayName": "setup Reality Key" }, { "constant": true, "inputs": [], "name": "rkResult", "outputs": [ { "name": "", "type": "u
@y12studio
y12studio / ysrp1.sol
Last active April 4, 2016 16:49
Y12 Safe Remote Purchase 1
// 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
//
// 1.賣家建立合約並放入價值商品2倍ETH當押金。
// 2.買家確認賣家合約押金無誤,confirmPurchase()轉入與賣家等值押金。
// 3.買家收到貨物後確認,confirmReceived()賣家收回押金加價金,買家收回押金減去價金。
//
// Testnet Address : 0x4378717cb207EB27BF2f58d8Bb2C2deA66B1BF43
// JSON Interface
// [ { "constant": true, "inputs": [], "name": "seller", "outputs": [ { "name": "", "type": "address", "value": "0x13a9684203635a4f03e9cb30befdc3e0f69e8163", "displayName": "" } ], "type": "function", "displayName": "seller" }, { "constant": false, "inputs": [], "name": "abort", "outputs": [], "type": "function", "displayName": "abort" }, { "constant": true, "inputs": [], "name": "value", "outputs": [ { "name": "", "type": "uint256", "value": "5000000000000000", "displayName": "" } ], "type": "function", "displayName": "value" }, { "constant": true, "inputs": [], "name": "buyer", "outputs": [ { "nam
@y12studio
y12studio / ysrp1.json
Created March 23, 2016 10:06
YSRP1 JSON Interface
[ { "constant": true, "inputs": [], "name": "seller", "outputs": [ { "name": "", "type": "address", "value": "0x13a9684203635a4f03e9cb30befdc3e0f69e8163", "displayName": "" } ], "type": "function", "displayName": "seller" }, { "constant": false, "inputs": [], "name": "abort", "outputs": [], "type": "function", "displayName": "abort" }, { "constant": true, "inputs": [], "name": "value", "outputs": [ { "name": "", "type": "uint256", "value": "5000000000000000", "displayName": "" } ], "type": "function", "displayName": "value" }, { "constant": true, "inputs": [], "name": "buyer", "outputs": [ { "name": "", "type": "address", "value": "0xdb271e79b114348915b0d7fca557f5e42cc90da8", "displayName": "" } ], "type": "function", "displayName": "buyer" }, { "constant": false, "inputs": [], "name": "confirmReceived", "outputs": [], "type": "function", "displayName": "confirm Received" }, { "constant": true, "inputs": [], "name": "state", "outputs": [ { "name": "", "type": "uint8", "value": "2", "displayName": "" } ], "typ
@y12studio
y12studio / ymc1.sol
Last active March 27, 2016 02:45
Y12 Marriage Contract 1
// ---------
// 智能婚約 2016
// 在法律許可的範圍內,作者(們)已將此軟體的著作權、相關權利與鄰接權釋出到全球的公眾領域。此軟體之散布不含任何擔保責任。
// 您應該已經連同軟體取得一份CC0的公眾領域貢獻宣告複本,若沒有收到,則請見:http://creativecommons.org/publicdomain/zero/1.0/。
// ---------
// Ethereum以太坊智能合約環境說明 https://gist.github.com/y12studio/f142cd9789c7d396d8f7
// 有意願測試簽智能婚約可聯絡 https://github.com/y12studio
// 1. 發起方(下記mblue)建立合約,並存入一筆金額(下記A)。
// 2. 發起方求婚執行合約 willYouMarryMe 條款,並填入身份證明的數位檔案摘要(SHA256)。
// 3. 提案受方(下記mred)確認 proposalYes 進入婚姻狀態或是拒絕 proposalSorry。
@y12studio
y12studio / ymc1.json
Created March 26, 2016 03:49
YMC1 JSON Interface
[ { "constant": true, "inputs": [], "name": "giftTime", "outputs": [ { "name": "", "type": "uint256", "value": "300", "displayName": "" } ], "type": "function", "displayName": "gift Time" }, { "constant": true, "inputs": [], "name": "giftValue", "outputs": [ { "name": "", "type": "uint256", "value": "600000000000000000", "displayName": "" } ], "type": "function", "displayName": "gift Value" }, { "constant": false, "inputs": [], "name": "doUsPartByOne", "outputs": [], "type": "function", "displayName": "do Us Part By One" }, { "constant": true, "inputs": [], "name": "mValue", "outputs": [ { "name": "", "type": "uint256", "value": "100000000000000000", "displayName": "" } ], "type": "function", "displayName": "m Value" }, { "constant": false, "inputs": [], "name": "devOnlyClose", "outputs": [], "type": "function", "displayName": "dev Only Close" }, { "constant": false, "inputs": [ { "name": "id_hash", "type": "bytes32", "typeShort": "bytes", "bits": "32", "displayName": "id&thinsp;<span class=\"punctuation\">_<
@y12studio
y12studio / ymc2.sol
Last active March 28, 2016 06:30
Y12 Marriage Contract 2
// ---------
// 智能證券化婚約 2016
// 在法律許可的範圍內,作者(們)已將此軟體的著作權、相關權利與鄰接權釋出到全球的公眾領域。此軟體之散布不含任何擔保責任。
// 您應該已經連同軟體取得一份CC0的公眾領域貢獻宣告複本,若沒有收到,則請見:http://creativecommons.org/publicdomain/zero/1.0/。
// ---------
// Ethereum以太坊智能合約環境說明 https://gist.github.com/y12studio/f142cd9789c7d396d8f7
// 有意願測試簽智能婚約可聯絡 https://github.com/y12studio
// 1. 發起方(下記mblue)建立合約,並存入一筆金額(下記A),得到股份B。
// 2. 發起方求婚執行合約 willYouMarryMe 條款,並填入身份證明的數位檔案摘要(SHA256)。
// 3. 提案受方(下記mred)確認 proposalYes 進入婚姻狀態或是拒絕 proposalSorry。