Skip to content

Instantly share code, notes, and snippets.

@achiko
achiko / attestation.txt
Created April 5, 2021 13:14
ZKOPRU trusted setup attestation
I contributed to the ZKOPRU Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: zk_transaction_1_2
Contributor # 401
Hash: c7311557 11066d98 25ac859d fa8d6f5a
23cea494 91d86a11 40700a34 fc880aa1
cd4e6115 d33cc634 5278d805 15f0086c
5d3a843f cfa6b527 54f42d10 543bde59
@achiko
achiko / sendRawTransaction.js
Created November 15, 2019 13:40 — forked from raineorshine/sendRawTransaction.js
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
@achiko
achiko / A.sol
Created September 19, 2018 15:54
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.18;
import './B.sol';
contract C {
// (2**256 - 1) + 1 = 0
function overflow() returns (uint256 _overflow) {
uint256 max = 2**256 - 1;
return max + 1;
}
{
"query":{
"bool":{
"filter":[
{
"term":{
"event.keyword":"Transfer"
}
},
{
{
"query":{
"bool":{
"filter":{
"term":{
"address":" 0x9F7DD5Ea934D188A599567Ee104E97Fa46cb4496"
}
}
}
}
@achiko
achiko / calculate.js
Created September 12, 2018 10:28
Calculate Ethereum Transaction capacity per second
const data = {
"data": {
"blocksRange": [
{
"timestamp": "1535801181",
"transactionCount": 170,
"gasUsed": 7990448,
"gasLimit": 8007815
},
0x0d303398124be9C21bf345a59d2b27d450F29f70
const Web3 = require('web3');
const web3 = new Web3('ws://localhost:8546');
const shh = web3.shh;
// Generate Symkey From password
// https://github.com/ethereum/go-ethereum/wiki/Whisper-Usage#generatesymkeyfrompassword
shh.generateSymKeyFromPassword("hello").then((symKeyID) => {
console.log('This is symkey ID unique foe every run: ', symKeyID);
admin.addPeer("enode://03f178d5d4511937933b50b7af683b467abaef8cfc5f7c2c9b271f61e228578ae192aaafc7f0d8035dfa994e734c2c2f72c229e383706be2f4fa43efbe9f94f4@163.172.149.200:30303");
admin.addPeer("enode://0a3c4c4f5b2f46c5b343fd9c4ad28e6413d475d2c4d41b454e50c51ecdb1c2f3e6002fdac5e9639eaf0cb9425efff95cd89c1bdd2d167217e0becf28f3b8660f@88.95.162.200:30303");
admin.addPeer("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303");
admin.addPeer("enode://138ec659b5ec02029c0c08d4a8f377174622c4d4f8684cf22bd6393a1e46e731ed1bf87249f4003f4c47f7a39611c39e0dc7004091604183d6e5781f1eaf81be@79.98.29.93:30303");
admin.addPeer("enode://158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6@13.75.154.138:30303");
admin.addPeer("enode://1a5a1fc361f3f25d3d8e0dfd2f059cd4b6fb7228c7163d232d657377818dc5f7f89426fdcb92d6cc9fd49f2f96fbe4a14c3a8d070e56ed7bee536f1bb014065
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD