Skip to content

Instantly share code, notes, and snippets.

@cuiweixie
cuiweixie / get_enode_url_from_nodekeyhex.go
Created November 14, 2025 09:52
get enode url from nodekeyhex
package main
import (
"crypto/ecdsa"
"fmt"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
)
@cuiweixie
cuiweixie / gen_enode.go
Created November 12, 2025 08:16
gen_enode.go
package main
import (
"crypto/ecdsa"
"fmt"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
)
@cuiweixie
cuiweixie / download_gh.sh
Created November 6, 2025 07:05
download latest gh cli
# 获取最新版本号
VERSION=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep '"tag_name"' | cut -d'"' -f4 | sed 's/v//')
# 下载
wget https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz
# 解压
tar -xvf gh_${VERSION}_linux_amd64.tar.gz
@cuiweixie
cuiweixie / extract_event_id.go
Created March 26, 2025 06:20
extract_event_id.go
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/fs"
"os"
"path/filepath"
@cuiweixie
cuiweixie / Nested.sol
Created August 5, 2024 04:18
revert test
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { OwnerControlled } from "./set.sol";
contract Nested {
constructor() {
}
// address 0x5FbDB2315678afecb367f032d93F642f64180aa3
function callSet(address addr, uint256 value) public {
@cuiweixie
cuiweixie / group.go
Last active July 1, 2023 17:15
problem of solving polynomial equations of quintic and higher degree
package main
import (
"fmt"
"strconv"
"strings"
)
func permute(nums []int) [][]int {
if len(nums) == 0 {