Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View u2's full-sized avatar
🐢
I may be slow to respond.

zhangyaning u2

🐢
I may be slow to respond.
View GitHub Profile
@u2
u2 / fork.md
Last active October 30, 2018 04:09
gco v0.19

git submodule update

./env.sh

make

// 注释掉最后的 clean nodes
@u2
u2 / account.md
Created June 30, 2018 01:48
account
➜  cita git:(develop) ✗ ganache-cli -l 100000000000000
Ganache CLI v6.1.4 (ganache-core: 2.1.3)

Available Accounts
==================
(0) 0x1bb4e66504ba45303df8d8d7cdd7f6c64841f81d
(1) 0xabdf2f45694aecfa84022579ba49eabd98ec89d2
(2) 0x39bbf572f2deff78b25a5ffad44cffc6ce77a039
(3) 0x803d8f0623782c3be35139d0710d45e5ce7c4312
@u2
u2 / test_token.md
Created June 28, 2018 02:12
test token
pragma solidity ^0.4.18;

contract Token {
    mapping (address => uint256) public balanceOf;

    event Transfer(
        address from,
        address to,
 uint256 tokens
@u2
u2 / permission.md
Created June 26, 2018 06:04
permission
(py3env) ➜  cita git:(develop) ✗ solc scripts/contracts/permission_management/permission_management.sol --hashes --allow-paths ~/cryptape/cita/scripts/contracts/ | grep 0f5aa9f3
0f5aa9f3: setAuthorization(address,address)


 ethabi encode params -v address 6212dd3506a68d6ec231177c6cb9c46dcfd43190 address 0000000000000000000000000000000000000001
0000000000000000000000006212dd3506a68d6ec231177c6cb9c46dcfd431900000000000000000000000000000000000000000000000000000000000000001
@u2
u2 / research.md
Last active June 25, 2018 06:31
dex
@u2
u2 / install-docker-mint.sh
Created March 5, 2018 01:32 — forked from Simplesmente/install-docker-mint.sh
Install docker Linux Mint 18.2
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install docker-engine cgroup-lite apparmor -y
sudo usermod -a -G docker $USER
sudo service docker start
0xb0E38a13B0A18938629dA97bA392c8B43E95D179
@u2
u2 / BlockPropagation.md
Created May 25, 2017 08:36 — forked from gavinandresen/BlockPropagation.md
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@u2
u2 / async.md
Created September 16, 2016 02:46 — forked from chriseth/async.md
Async Solidity Contracts

Having seen @pirapira's sketch of Bamboo ( https://github.com/pirapira/bamboo/ ), which proposed to add better control about the "smart contract program flow", even across calls, I thought that this should certainly be added to Solidity, and actually, it might even be possible now to a certain degree using inline assembly.

The problem is that with many functions in a contract, it is not always clear which can be called at which stage in the contract's lifetime. Certain smart contracts would be easier to understand if written as follows: