Skip to content

Instantly share code, notes, and snippets.

View mhchia's full-sized avatar

Kevin Mai-Husan Chia mhchia

View GitHub Profile
@mhchia
mhchia / rln-trusted-setup-ceremony_attestation.log
Created July 31, 2023 16:20
Attestation for RLN Trusted Setup Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm mhchia-8223657 and I have contributed to the RLN Trusted Setup Ceremony MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (rln-withdraw)
Contributor # 4
Contribution Hash: 8cdbab0b c8fc535e dc160604 4411a8ee
0cc7da86 6af0b640 ba7401a7 073eebdb
e87a9006 c046493f c74edff3 cd0abc2c
a110c252 1f311f09 c474f80c 90d03932
@mhchia
mhchia / rln-trusted-setup-ceremony_attestation.log
Created July 27, 2023 08:38
Attestation for RLN Trusted Setup Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm mhchia-8223657 and I have contributed to the RLN Trusted Setup Ceremony MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (rln-withdraw)
Contributor # 6
Contribution Hash: e89ab16e 20e2fdb4 b7655c58 9eb3c0dd
8b78b88b 63cdcffe 933a511a 92b50de6
13c89621 20467271 aa8fa130 169e8e1f
7ac9334a 8fb17355 f68d928f 9deac1b5

I'm trying the step Instantiate the CosmWasm contract in the tutorial. The command in instantiate_egg.sh is copied-pasted from the tutorial but one argument --node tcp://testnet.palomaswap.com:26656 is added to tell palomad about the node. It keeps failing due to "missing field factory_contract".

Environments:

  • palomad version: v0.11.4.
  • Pretty sure ADDRESS, PALOMA_CHAIN_ID, and ETH_ADDRESS are well set.
@mhchia
mhchia / README.txt
Created November 17, 2021 10:59
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@mhchia
mhchia / attestation.txt
Created March 29, 2021 05:33
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 # 136
Hash: 7cf4214d aa960bfc b496601f ddbae666
f6b1457e 06d36f67 4858b8b2 8eb24924
c119483c 78471897 140a6d4c 496aaf9a
8814ea2f f0a7f905 63d5d957 df82d2bb
@mhchia
mhchia / crawl_ranked_erc20_tokens.py
Last active June 24, 2020 09:24
This script crawls the top-ranked ERC20 tokens' name and abbreviation from etherscan.io
"""
This script crawls the top-ranked ERC20 tokens' name and abbreviation from etherscan.io .
"""
from typing import Tuple, Union
import re
from bs4 import BeautifulSoup
import requests
@mhchia
mhchia / asyncctxmgr_fails_when_exiting.py
Created February 3, 2020 07:48
`async_generator.asynccontextmanager` fails in Python 3.7-dev
import asyncio
from async_generator import asynccontextmanager
@asynccontextmanager
async def async_iterator():
yield 1
import random
from multiaddr.protocols import (
Protocol,
PROTOCOLS,
P_IP6ZONE,
)
protocols = tuple(filter(lambda x: x.code != P_IP6ZONE, PROTOCOLS))
@mhchia
mhchia / test_stream_reader_writer.py
Created March 8, 2019 10:19
timeit benchmark for different implementation of the pipe-like stream reader writer
from io import BytesIO
class BytesIOReaderWriter:
_buf: BytesIO
def __init__(self):
self._buf = BytesIO()
def write(self, data):
@mhchia
mhchia / update_libp2p.sh
Created February 24, 2019 09:23
Copy bindings code from py-libp2p-daemon-bindings to trinity, and modify import paths
#!/bin/bash
# TODO: currently only support "bindings to trinity", probably need the reverse direction as well.
echo "Run this script with a new process spun up because of the usage of \`exit\`"
PATH_BINDINGS="$HOME/projects/ethereum/pyeth/py-libp2p-daemon-bindings"
PATH_TRINITY="$HOME/projects/ethereum/pyeth/trinity"
LIBP2P_BINDINGS_PACKAGE="p2pclient"