Skip to content

Instantly share code, notes, and snippets.

View Ankarrr's full-sized avatar
👨‍💻
Building

Anderson Chen Ankarrr

👨‍💻
Building
View GitHub Profile
  1. name: a string,event 的名稱

  2. type: a string,always "event"

  3. inputs: an array,輸入的參數,包含:

    • name: a string,參數名稱

    • type: a string,參數的 data type(e.g. uint256)

  1. name:a string,function 名稱

  2. type:a string,"function", "constructor", or "fallback"

  3. inputs:an array,function 輸入的參數,包含:

    • name:a string,參數名稱

    • type:a string,參數的 data type(e.g. uint256)

    • components:an array,如果輸入的參數是 tuple(struct) type 才會有這個欄位。描述 struct 中包含的資料型態

  4. outputs:an array,function 的回傳值,和 inputs 使用相同表示方式。如果沒有回傳值可忽略,值為 []

  5. payabletrue,如果 function 可收 Ether,預設為 false

@Ankarrr
Ankarrr / dao.py
Last active March 12, 2018 07:00
from boa.interop.Neo.Runtime import CheckWitness, Notify
from boa.interop.Neo.Action import RegisterAction
from boa.interop.Neo.Storage import *
from boa.builtins import concat
from boa_test.example.demo.nex.token import *
PROPOSAL_LIST_KEY = 'proposalList'
TOTAL_PROPOSAL_AMOUNT = 'totalproposalAmount'
"""
NEX ICO Template
===================================
Author: Thomas Saunders
Email: tom@neonexchange.org
Date: Dec 11 2017
"""
// Workable on Mainnet:
// https://kyber.network/swap/eth_knc
// https://dapp.originprotocol.com
var Web3 = require('web3');
const ProviderEngine = require('web3-provider-engine')
const RpcSubprovider = require('web3-provider-engine/subproviders/rpc.js')
const Web3Subprovider = require("./web3_subprovider.js");
const DappSubprovider = require("./dapp_subprovider_new.js");
{
"name": "webView",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "npm react-native start",
"test": "jest",
"postinstall": "./node_modules/.bin/rn-nodeify --install --hack",
"debug": "open 'rndebugger://set-debugger-loc?host=localhost&port=8081'"
},
const result = await window.web3.eth.personal.sign(
'Hello world!', // The Message
'0x33b8287511ac7F003902e83D642Be4603afCd876', // User Account
'', // Password
);
// Response: Signed Result
'0x0d9273c44a7371c149efb68b100b6aaaf229e8a5502249d84e3febe17f133f7b201b9c3087f507eee684c9a97d08681de5ef1ca8738d26eb5daf63b9adcf69da1b'
const result = await window.web3.eth.sendTransaction({
from: '0x33b8287511ac7F003902e83D642Be4603afCd876',
to: '0x9EE2B16e1FA35E417dB7dE2fDd9377a73D7c2B67',
value: '1000000000000000', // 0.0001 ETH in Wei
gas: 21000, // Gas Amount
});
// Response: Transaction ID (Hash)
'0x3d5ccbe71ace8cbdb63ee210a8121a95120231a976c82eaf9ba948de119c4586'
const accounts = await window.web3.eth.getAccounts();
// Response: An array of user's Ethereum accounts
['0x33b8287511ac7F003902e83D642Be4603afCd876']
const account = window.web3.eth.defaultAccount;
// Response: User's default Ethereum account
'0x33b8287511ac7F003902e83D642Be4603afCd876'