Skip to content

Instantly share code, notes, and snippets.

View reecepbcups's full-sized avatar

Reece Williams reecepbcups

View GitHub Profile
@reecepbcups
reecepbcups / noisd_airdrop_bruteforce.py
Created November 13, 2023 00:09
Cosmos: Missing Mnemonic brute force
# https://x.com/kais_kat/status/1723844153685971400?s=20
# flake8: noqa
import random
import string
import subprocess
from httpx import get
# rm -rf ~/.noisd/keyring-test
@reecepbcups
reecepbcups / cosmos_chain_apy.sh
Last active June 25, 2024 13:46
Script to query a Cosmos chains values and return the staking APY
#!/bin/bash
LCD_URL="https://juno-api.polkachu.com"
DENOM="ujuno"
# {"pool":{"not_bonded_tokens":"2431244061010","bonded_tokens":"58093075821304"}}
BONDED=$(curl -s $LCD_URL/cosmos/staking/v1beta1/pool | jq -r '.pool.bonded_tokens') && echo $BONDED
# {"inflation":"0.100000000000000000"}
INFLATION=$(curl -s $LCD_URL/cosmos/mint/v1beta1/inflation | jq -r '.inflation') && echo $INFLATION
@reecepbcups
reecepbcups / validator_update_readiness.py
Created October 13, 2023 00:21
Easy to paste Cosmos chain information for upgrade coordination
# pip install httpx (or use requests)
from httpx import get
# cosmos.directory
API = "https://juno-api.reece.sh"
ENDPOINT = "cosmos/staking/v1beta1/validators?pagination.limit=1000"
URL = f"{API}/{ENDPOINT}"
get_validators = get(URL).json().get("validators", [])
@reecepbcups
reecepbcups / interchain_queries_test.go
Created October 4, 2023 15:14
Interchain test for Quasars ICQ demo
package ibc_test
import (
"context"
"encoding/json"
"fmt"
"strconv"
"testing"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
@reecepbcups
reecepbcups / interchain_accounts_test.go
Created October 4, 2023 15:11
Deprecated intertx module interchaintest
package ibc
import (
"context"
"encoding/json"
"strings"
"testing"
"time"
"cosmossdk.io/math"
@reecepbcups
reecepbcups / feeshare.rs
Created September 22, 2023 15:05
Feeshare Register with Anybuf
// from kaku | Yieldmos/Dexmos
chain_daemon
.commit_any::<cosmrs::Any>(
vec![feeshare_msg(
withdraw_tax.address().unwrap().to_string(),
chain_daemon.sender().to_string(),
chain_daemon.sender().to_string(),
)],
None,
@reecepbcups
reecepbcups / archway-ledger.md
Last active July 10, 2023 05:21
Archway Airdrop Claim With Ledger

of course only claim if you are in a legal jurisdiction not geo-blocked blah blah.

installa da archwayd

git clone https://github.com/archway-network/archway.git
cd archway
git checkout v1.0.1
make install (go install ./...)
@reecepbcups
reecepbcups / juno_fees_since_genesis.json
Last active May 3, 2023 01:54
Each section in 1 week of time. divide a number by 1 million to get its human readable form. + # of Txs per week
{
"total_ujuno_fees": 46552893454,
"weekly_fees": {
"1": {
"ujuno": 73824570
},
"100801": {
"ujuno": 949559253
},
"201601": {
# Uses https://github.com/Reecepbcups/cosmos-indexer against an archive node to get all MsgAck Txs
CHAIN="juno-1"
BLOCK_START = 5779000
BLOCK_END = 7200000
channels = {
"cosmos": "channel-1",
"osmosis": "channel-0",
"evmos": "channel-70",
@reecepbcups
reecepbcups / juno_inactive_accounts.py
Last active April 25, 2023 15:09
Gets all inactive sequence 0 accounts and gets how much of unclaimed airdrop there is.
import json
# exports.reece.sh/juno
auth_file = "7980000_auth.json"
bank_file = "7980000_bank.json"
accounts_to_ignore = [
# They moved funds to new wallet 30 days ago
"juno1ws8d7f234jtnda3ea22hhejzx5qsfu3dl50shx"
]