Skip to content

Instantly share code, notes, and snippets.

View huaigu's full-sized avatar

Alex Wang huaigu

View GitHub Profile
@huaigu
huaigu / risc-zero-stark-to-snark-prover_attestation.log
Created May 8, 2024 08:27
Attestation for RISC Zero STARK-to-SNARK Prover MPC Phase 2 Trusted Setup ceremony
Hey, I'm huaigu-626809 and I have contributed to the RISC Zero STARK-to-SNARK Prover MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (stark_verify)
Contributor # 225
Contribution Hash: 69c01d8f 067074a4 9fd00e5d 424a7adf
da6cf160 cecb9c83 21b3323a 63fba819
93235278 6c331bd0 79f6a2c8 1058c358
f140a8bc 11a8d993 cd783ff5 6198529b
@huaigu
huaigu / data
Last active April 22, 2024 14:20
metadata
{
"name": "Bojack",
"website": "https://github.com/huaigu",
"description": "web3 dev",
"logo": "https://img2.imgtp.com/2024/04/22/Xi15cPU7.png",
"twitter": "https://twitter.com/coder_chao"
}
@huaigu
huaigu / kuzco-maint.sh
Created April 12, 2024 01:46
Kuzco Maintain
#!/bin/bash
# Author: https://raw.githubusercontent.com/DreamGallery/Kuzco-maintenance/main/kz-maint.sh
# Directory check
[[ -d kzlog ]] || mkdir kzlog
# Load Discord webhook URL from .env file
if [[ -f .env ]]; then
export $(cat .env | xargs)
fi
@huaigu
huaigu / bevm.md
Created January 19, 2024 13:02 — forked from jim3333/bevm.md

批量部署bevm 节点

编辑 /etc/docker/daemon.json 去除docker默认30个桥接限制, 修改完后, 需要重启docker

{
  "default-address-pools": [
    {
      "base": "172.80.0.0/16",
      "size": 24
#define uint32_t uint
#define uint64_t ulong
#define uint8_t uchar
#define NULL 0
static void memset(uchar *str, int c, size_t n){
for(int i=0;i<n;i++){
str[i] = c;
}
}
@huaigu
huaigu / LSGS
Last active December 21, 2023 03:11
LSGS marketplace - convert amout to tick
// 获取所有匹配的元素
const priceElements = document.querySelectorAll('.marketplace_price__nBpOg');
const amountElements = document.querySelectorAll('.marketplace_inscription-name__d94dM');
const unitElements = Array.from(document.querySelectorAll('.marketplace_unit__k_PNs')).filter(element => element.innerText.includes('LSGS'));
// 检查是否存在符合条件的元素
if (unitElements.length > 0) {
// 遍历并替换价格元素
priceElements.forEach((priceElement) => {
const originalText = priceElement.innerText;
@huaigu
huaigu / celestia-rpc.md
Created December 18, 2023 01:25 — forked from silentnoname/celestia-rpc.md
celestia rpc

基础环境安装

sudo apt update -y &&sudo apt upgrade -y 
sudo apt install curl tar wget lz4 jq build-essential git make   -y

go 安装

@huaigu
huaigu / ordinals...Inscription.sol
Created June 1, 2023 06:24 — forked from jackygu2006/ordinals...Inscription.sol
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./Logarithm.sol";
import "./TransferHelper.sol";
// This is common token interface, get balance of owner's token by ERC20/ERC721/ERC1155.
interface ICommonToken {
function balanceOf(address owner) external returns(uint256);
@huaigu
huaigu / ordinals...Inscription.sol
Created June 1, 2023 06:24 — forked from jackygu2006/ordinals...Inscription.sol
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./Logarithm.sol";
import "./TransferHelper.sol";
// This is common token interface, get balance of owner's token by ERC20/ERC721/ERC1155.
interface ICommonToken {
function balanceOf(address owner) external returns(uint256);
@huaigu
huaigu / tokenPriceApi.js
Created March 9, 2023 09:13 — forked from Linch1/tokenPriceApi.js
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js