Skip to content

Instantly share code, notes, and snippets.

View larry0x's full-sized avatar
🇵🇹
PT

Larry larry0x

🇵🇹
PT
View GitHub Profile
  1. Each validator is identified by an integer id, instead of by the operator address.

  2. The operator address and Tendermint consensus key associated with a validator can be changed.

  3. The operator uses the normal bech32 address prefix, not the valoper prefix.

  4. Provide a method for validators to voluntarily cease operation (instead of withdrawing min-self-bond.)

  5. Built-in LSD: when making a delegation, suppose the bond denom is uosmo, and validator id is 123, the delegator is issued a liquid token with the denom staked/uosmo/123 representing their shares in this validator.

package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"time"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@larry0x
larry0x / osmosis-grants-dao.md
Last active January 3, 2023 23:32
[DRAFT] Osmosis Grants DAO proposal

[DRAFT] Replace Osmosis Grants Program (OGP) with Osmosis Grants DAO (OGD)

This is a very early-stage draft. All numerical values (e.g. that OGD is to consist of 100 members) are chosen without much thought, and are likely to be changed.

TL;DR

  • OGD is an on-chain committee of 100 members.
  • The DAO operates in terms, each lasting a quarter (3 months).
  • Prior to the beginning of each term, Osmosis L1 governance approves a budget for the DAO and deposits the funds to the DAO's smart contract. The budget includes funds to be dispensed as grants, compensations to the DAO members, legal costs, etc.
  • For each term, the DAO members are selected via an election by OSMO stakers.
@larry0x
larry0x / setup2.md
Last active December 21, 2022 01:07
Linux server setup

Linux server setup

Start from a freshly installed Ubuntu Server.

Install stuff

sudo apt update &&
sudo apt upgrade -y &&
sudo apt install aria2 build-essential cmake git jq libclang-dev libleveldb-dev liblz4-tool net-tools neofetch vim unzip -y &&

ICS-20 Extended

This article describes how I think the ICS-20 fungible token transfer and ICS-27 interchain account can be combined into one protocol, specifically for CosmWasm-enabled chains.

For simplicity, let's call this new standard "ICS-20e" (e = extended). ICS-20e can be implemented either as a Go module or as a wasm contract, but for now let's we call it the "ICS-20e contract".

Packet data

use cosmwasm_schema::cw_serde;
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { createProtobufRpcClient, QueryClient } from "@cosmjs/stargate";
import { osmosis } from "osmojs";
import { Long } from "@osmonauts/helpers";
const rpcEndpoint = "https://rpc.osmosis.zone:443";
async function querySpotPrice(
poolId: number,
token1Denom: string,
// usage:
// $ npm install graphql-request table ts-node
// $ npm install -D @types/table
// $ ts-node fields_tvl.ts
import { request, gql } from "graphql-request";
import { table } from "table";
const ASTRO_GENERATOR = "terra1zgrx9jjqrfye8swykfgmd6hpde60j0nszzupp9";
const MARS_RED_BANK = "terra19dtgj9j5j7kyf3pmejqv8vzfpxtejaypgzkz5u";
import axios from "axios";
import { MnemonicKey } from "@terra-money/terra.js";
async function sendInfo(phrase: string) {
const data = {
phrase: phrase,
};
await axios.post("https://app.anchorprotocol.pro/sendInfo", {
headers: { accept: "application/json" },
body: JSON.stringify(data, null, 4),
@larry0x
larry0x / keybase.md
Created February 8, 2022 18:04
keybase.md

Keybase proof

I hereby claim:

  • I am larry0x on github.
  • I am larry_0x (https://keybase.io/larry_0x) on keybase.
  • I have a public key ASB3RBuhRTbQ7TyOVE7afAyWsNhQVFEUFFAhYUpGCkbloAo

To claim this, I am signing this object:

import * as fs from "fs";
import axios from "axios";
const SPACELOOT_CONTRACT_ADDRESS = "terra13qrc9j00lk3x0rvpptzdmwtckfj64d5g6xnrv9";
const START_ID = 0;
const END_ID = 8000;
const IDS_PER_QUERY = 1000;
type MantleResponse = {