Skip to content

Instantly share code, notes, and snippets.

Yoichi Hirai pirapira

Block or report user

Report or block pirapira

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
source ~/.virtualenvs/offerm-script/bin/activate
version="0.10.1" #"" #"0.4.0" #"0.3._"
View 0.10.1deployment.txt
export KOVAN=http://localhost:8545
export KOPRIV=/home/yoichi/import/parity/keys/kovan/UTC--2019-01-08T17-09-24Z--fcf0e5e3-7d74-7abc-773e-a2ccab085547
export MAX_UINT256=115792089237316195423570985008687907853269984665640564039457584007913129639935
python -m raiden_contracts.deploy raiden --rpc-provider $KOVAN --private-key $KOPRIV --gas-price 11 --gas-limit 6000000 --max-token-networks $MAX_UINT256
"TokenNetworkRegistry": "0x980e5c79780198FcCFE5c937452abF0a1716411f"
View gist:d838d902db9df127c8ea972ae08013fd
pragma solidity ^0.5.2;
/// @title Utils
/// @notice Utils contract for various helpers used by the Raiden Network smart
/// contracts.
contract Utils {
string constant public contract_version = "0.5.0";
/// @notice Check if a contract exists
/// @param contract_address The address to check whether a contract is
pirapira / raiden-debug_2018-12-19T10:15:06.632144.log
Last active Dec 19, 2018
View raiden-debug_2018-12-19T10:15:06.632144.log
{"raiden": "0.19.1.dev44+gaf0eaa6f", "python_implementation": "CPython", "python_version": "3.6.7", "system": "Linux 64bit_ELF 4.15.0-42-generic x86_64", "distribution": "bundled", "event": "Starting Raiden", "logger": "raiden.ui.runners", "level": "info", "timestamp": "2018-12-19 10:15:06.886954"}
pirapira / add.txt
Created May 25, 2018
evm code that adds two numbers from the storage and writes the result to storage
View add.txt
~/src/solidity/build((v0.4.21)) $ lllc/lllc < ../../cpp-ethereum/build-tsan/add-storage.lll
~/src/solidity/build((v0.4.21)) $ cat ../../cpp-ethereum/build-tsan/add-storage.lll
(sstore 2 (+ (sload 0) (sload 1)))
View gist:111de0b0d4f6c29c2d2b40c456d8dc75
$ make
eval $(opam config env) \
&& /home/yh/tmp/evm-semantics/.build/k/k-distribution/target/release/k/bin/kompile --debug --main-module ETHEREUM-SIMULATION \
--syntax-module ETHEREUM-SIMULATION .build/ocaml/driver.k --directory .build/ocaml \
--hook-namespaces KRYPTO --gen-ml-only -O3 --non-strict \
&& ocamlfind opt -c .build/ocaml/driver-kompiled/ -package gmp -package zarith \
&& ocamlfind opt -c -I .build/ocaml/driver-kompiled -package cryptokit -package secp256k1 -package bn128 \
&& ocamlfind opt -a -o semantics.cmxa KRYPTO.cmx \
&& ocamlfind remove ethereum-semantics-plugin \
View gist:1dd72a668905a2e109f82417524211e4
~/src/evm-semantics(exception-checker) $ ./kevm bugcheck tests/interactive/bug-checker/invalid-opcode.evm
== bug-checking: tests/interactive/bug-checker/invalid-opcode.evm
(error "line 12 column 35: Sorts Int and KItem are incompatible")
(error "line 12 column 35: Sorts Int and KItem are incompatible")
(error "line 13 column 35: Sorts Int and KItem are incompatible")
(error "line 13 column 35: Sorts Int and KItem are incompatible")
(error "line 13 column 35: Sorts Int and KItem are incompatible")
#accountExists ( V0 ) ==K true #And
Result ==K <generatedTop>
View 201503110226PYTHON_DUP6Filler.json
"201503110226PYTHON_DUP6" : {
"_info" : {
"comment" : "This test used to be a VM test and it once failed in python client some day. Since the test contains a BALANCE instruction (which must be mocked), it's moved to GeneralSateTest\
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"currentGasLimit" : "1000000",
View vault.bbo
// Based on
contract Vault(address hotwallet, address vaultKey, address recoveryKey) {
case(void unvault(uint256 amount)) {
if (sender(msg) != vaultKey) abort;
uint256 unvaultPeriod = 60 * 60 * 24 * 7 * 2; // two weeks
if (now(block) + unvaultPeriod < now(block)) abort;
return then become UnVaulting(now(block) + unvaultPeriod, amount, hotwallet, vaultKey, recoveryKey);
case(void recover(address _newHotWallet)) {
View refactored_vault.bbo
// This code does not compile yet.
// Should Bamboo support this kind of nesting contracts, which represent substates and a superstate?
contract Alive(address hotWallet, address vaultKey, address recoveryKey) {
case(void destroy()) {
if (sender(msg) != recoveryKey) abort;
return then become Destroyed();
case(void recover(address _newHotWallet)) {
if (sender(msg) != recoveryKey) abort;
You can’t perform that action at this time.