Skip to content

Instantly share code, notes, and snippets.

View shanev's full-sized avatar
💭
#BUIDL

shane.stars shanev

💭
#BUIDL
View GitHub Profile
ics title stage category author created modified
999
One Channel
draft
IBC/APP
Larry Engineer <gm@larry.engineer>
2023-03-02
2023-03-02
@dakom
dakom / cosmwasm notes.md
Last active November 19, 2023 08:49
Cosmwasm notes

Wasmd setup

Basic WASMD Setup

after make install (or on apple silicon: LEDGER_ENABLED=false make install)

our chain-id is going to be localwasmd our gas denomination is going to be configured to uwasm staking denomination is the default ustake

the following sortof mimics the explicit steps in https://github.com/CosmWasm/wasmd/blob/main/contrib/local/setup_wasmd.sh

@bloqhub
bloqhub / gist:ba04d09891bd59c21d9ff228eefadb62
Created October 29, 2021 15:15
Stargaze cosmovisor setup
0. Upgrade node to resease 1.0.0 Using docs:
https://github.com/public-awesome/mainnet/tree/main/stargaze-1
1. setup cosmovisor
cd ~
git clone https://github.com/cosmos/cosmos-sdk
cd cosmos-sdk
git checkout v0.42.7
@webmaster128
webmaster128 / json-schema-ref-parser-cli.js
Created October 13, 2021 20:15
CosmWasm schema to TypeScript .d.ts
#!/usr/bin/env node
const $RefParser = require("@apidevtools/json-schema-ref-parser");
function printUsage() {
console.info("Usage: json-schema-ref-parser-cli FILE")
}
async function main(args) {
if (args.length !== 1) {
@fxn
fxn / 01 main.rs
Last active August 23, 2021 15:13
Mandelbrot set generator from "Programming Rust", with ports to Crystal and Ruby.
// Mandelbrot set generator from "Programming Rust", with I/O removed (the
// original code writes a PNG file).
use std::env;
use std::str::FromStr;
use num::Complex;
fn main() {
let args: Vec<String> = env::args().collect();

ICS: Cinderella Tokens: An Async/IBC friendly alternative to flash loans

Flashloans are a fascinating economic coordination mechanism that has emerged out the Ethereum architecture as a result of a synchronous, sequential, atomic transaction system. It allows anonymous coordination between capital providers and arbitrageurs because the capital providers can condition providing any capital on protocol enforced guarantee that the entire arbitrage is profitable denominated in the token being lent.

One of the effects of this process has been the it ensures an efficient and healthy liquidation market for the collateral in long term debt instruments. It also enables low cost scaling of economic exploits.

Why don’t flash loans exist in IBC world?

Flash loans are impossible in an IBC world because IBC semantics require finalizing a block on the origin chain rather than on the receiving chain. This makes atomicity for the lender difficult and moves us into the domain of over collateralized lending.

@progrium
progrium / README.md
Last active April 7, 2024 21:42
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

Anonymous: a proof-of-unique-human system

Anonymous is a coordination game for global proof-of-unique-human, through monthly pseudonym events that last 15 minutes, where every single person on Earth is randomly paired together with another person, 1-on-1, to verify that the other is a human being, in a pseudo-anonymous context. The proof-of-unique-human is that you are with the same person for the whole event. The proof-of-unique-human is untraceable from month to month, much like cash. True anonymity.

When you register for Anonymous, you use register(). You need a “registrationToken” that you got if you were verified in the last event. You can see one be deducted from your account with registrationToken[msg.sender]--. The purpose of the registration tokens is that you can easily mix them, so that your personhood is not traceable from month to month.

function register() public scheduler {

require(isReg(msg.sender) == false && data[schedule].tokens[1

@hdevalence
hdevalence / arb.md
Created March 25, 2020 06:22
Anonymous Retrospective Broadcasts
  • Anonymous Retrospective Broadcasts
    • If we don't assume a centralized party that can be trusted to verify information, what we're left with is not really a contact tracing application but a particular kind of messaging application, where users create tracks through space and time, and can retrospectively broadcast anonymous messages to users whose tracks were spatially nearby to theirs in a particular time range.
    • This messaging system should be privacy-preserving, in the sense that:
      • Server Privacy: An honest-but-curious server should not learn information about any user's space-time tracks;
      • Locality Integrity: A user should not be able to broadcast messages to users who were not nearby to them;
      • User Privacy:
        • A passive adversary cannot not learn any information about a user's space-time track outside of the segments they have broadcast messages to. This means that users who do not broadcast reveal no information about their movements.
@srvice-temp
srvice-temp / localStorageUtility.ts
Last active December 12, 2023 09:46
localStorage utility for typescript - keep track of types! 😀
// store objects and keep track of types with Window.localStorage
// (https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
interface Bar {}
export enum CacheKey {
Foo = 'Foo'
}
interface CacheValues {