Skip to content

Instantly share code, notes, and snippets.

Avatar

Yukishige Nakajo nakajo2011

View GitHub Profile
@nakajo2011
nakajo2011 / web3.eth.filter.watch_sources.js
Last active Feb 26, 2018
web3.eth.filter.watch該当ソースコード
View web3.eth.filter.watch_sources.js
// see https://github.com/ethereum/web3.js/blob/develop/lib/web3/filter.js#L191-L200
Filter.prototype.watch = function (callback) {
this.callbacks.push(callback);
if(this.filterId) {
getLogsAtStart(this, callback);
pollFilter(this);
}
return this;
View keybase_old.md

Keybase proof

I hereby claim:

  • I am nakajo2011 on github.
  • I am y_nakajo (https://keybase.io/y_nakajo) on keybase.
  • I have a public key ASDVHdcqYNHUJmuB-C_nfytsir7fRHTPyn5zrtAJkjKwIgo

To claim this, I am signing this object:

@nakajo2011
nakajo2011 / index.html
Last active May 11, 2018
uPort Simple Application
View index.html
<!doctype html>
<html>
<head>
<title>uPort Sample App</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script src="https://unpkg.com/uport-connect/dist/uport-connect.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
main { padding: 10px 30px; }
View rev_ 27ce4eb78bdf5d9b742ed05babe9b86a434733a1_tx_pool.go
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@nakajo2011
nakajo2011 / broadcast_lines_in_tx_pool.go
Last active Feb 5, 2019
20190206_blog_parts_rev_27ce4eb78bdf5d9b742ed05babe9b86a434733a1_tx_pool
View broadcast_lines_in_tx_pool.go
if list := pool.pending[from]; list != nil && list.Overlaps(tx) {
// Nonce already pending, check if required price bump is met
inserted, old := list.Add(tx, pool.config.PriceBump)
if !inserted {
pendingDiscardCounter.Inc(1)
return false, ErrReplaceUnderpriced
}
// New transaction is better, replace old one
if old != nil {
pool.all.Remove(old.Hash())
@nakajo2011
nakajo2011 / AddRemote_in_tx_pool.go
Last active Feb 5, 2019
20190206 blog parts2 reference from rev:27ce4eb78bdf5d9b742ed05babe9b86a434733a1
View AddRemote_in_tx_pool.go
L798-L803
// AddRemote enqueues a single transaction into the pool if it is valid. If the
// sender is not among the locally tracked ones, full pricing constraints will
// apply.
func (pool *TxPool) AddRemote(tx *types.Transaction) error {
return pool.addTx(tx, false)
}
...
L631-L641
View sample.js
const Web3 = require('web3')
const {Solo, BigNumber} = require('./dist/js/src/index.js')
const {AmountReference, AmountDenomination, ConfirmationType} = require('./dist/js/src/types.js')
process.on('unhandledRejection', console.dir)
const WETH_Market_ID = new BigNumber('0')
const DAI_Market_ID = new BigNumber('1')
const USDC_Market_ID = new BigNumber('2')
/**
View keybase.md

Keybase proof

I hereby claim:

  • I am nakajo2011 on github.
  • I am y_nakajo (https://keybase.io/y_nakajo) on keybase.
  • I have a public key ASDVHdcqYNHUJmuB-C_nfytsir7fRHTPyn5zrtAJkjKwIgo

To claim this, I am signing this object:

@nakajo2011
nakajo2011 / daveauction.vy
Created Oct 9, 2019
Devcon5 Day2 hands-on
View daveauction.vy
# Devcon 5 Auction
# Masked Reveal Auction
#*******************************
#Every user has a bid amount, hash (bidamount,pass), sent masked amount
struct Data:
bidval: wei_value
hashval: bytes32
sentval: wei_value