Skip to content

Instantly share code, notes, and snippets.

View huaigu's full-sized avatar

Alex Wang huaigu

View GitHub Profile
@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 / 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
@huaigu
huaigu / metamask_api.md
Created November 5, 2022 09:10 — forked from pipepi/metamask_api.md
wallet_switchEthereumChain wallet_addEthereumChain wallet_watchAsset
@huaigu
huaigu / launch.json
Created September 30, 2022 06:12 — forked from 0xGabi/launch.json
VSCode configuration to debug using hardhat in a monorepo
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "hardhat test",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${workspaceFolder}/packages/hardhat/node_modules/.bin/hardhat",
"args": ["test", "--network", "localhost"],
@huaigu
huaigu / index.html
Created August 7, 2022 05:36 — forked from maheshmurthy/index.html
index.html with ethers.js
<!DOCTYPE html>
<html>
<head>
<title>Hello World DApp</title>
<link href='https://fonts.googleapis.com/css?family=Open Sans:400,700' rel='stylesheet' type='text/css'>
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
</head>
<body class="container">
<h1>A Simple Hello World Voting Application</h1>
<div class="table-responsive">
@huaigu
huaigu / BABYCAKE.sol
Created February 9, 2022 09:52 — forked from CryptoInvestorPro/BABYCAKE.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.6.2+commit.bacdbe57.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
//
// $BabyCake proposes an innovative feature in its contract.
//
// DIVIDEND YIELD PAID IN CAKE! With the auto-claim feature,
// simply hold$BabyCake and you'll receive CAKE automatically in your wallet.
//
// Hold Baby Cake and get rewarded in Cake on every transaction!
//