Skip to content

Instantly share code, notes, and snippets.

Avatar

Zaki Manian zmanian

  • Iqlusioninc
  • United States
View GitHub Profile
View CinderellaTokens.md

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.

@zmanian
zmanian / Notes.md
Last active Jan 10, 2021
Notes on building Gaiad on Windows without WSL
View Notes.md

Build gaia on windows without the Windows Subsystem for Linux and with Ledger support.

  1. Install chocolatey

  2. Install git, go and mingw

choco install mingw git go
View tendermintpanic.md

E[2020-08-12|06:37:15.745] CONSENSUS FAILURE!!! module=consensus err="Int64() out of bound" stack="goroutine 177 [running]:\nruntime/debug.Stack(0xc000fce530, 0x15fad20, 0x1cfa510)\n\t/snap/go/6123/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2(0xc000f98e00, 0x1aae108)\n\t/home/zakimanian/go/pkg/mod/github.com/tendermint/tendermint@v0.34.0-rc2.0.20200806175020-3413a0dbd8c3/consensus/state.go:675 +0x57\npanic(0x15fad20, 0x1cfa510)\n\t/snap/go/6123/src/runtime/panic.go:969 +0x166\ngithub.com/cosmos/cosmos-sdk/types.Int.Int64(0xc000e8dbe0, 0x1d5dd20)\n\t/home/zakimanian/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.34.4-0.20200811112237-b0884e919b55/types/int.go:148 +0xa1\ngithub.com/cosmos/cosmos-sdk/x/mint.BeginBlocker(0x1d5dd20, 0xc00003e068, 0x1d77e60, 0xc0004af440, 0xb, 0x0, 0xc000bf3e80, 0x12, 0x1, 0x330e547c, ...)\n\t/home/zakimanian/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.34.4-0.20200811112237-b0884e919b55/x/mint/abci.

View backtrace.log
ERROR 2020-06-22 03:26:52 common/crash-handler/src/lib.rs:38 details = '''panicked at 'Invalid Proof', /Users/zakimanian/.rustup/toolchains/1.44.0-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/macros.rs:13:23'''
backtrace = '''
0: 0x10ef2487c - backtrace::backtrace::libunwind::trace::h728c1cdc231a0cf6
at /Users/zakimanian/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/libunwind.rs:86
backtrace::backtrace::trace_unsynchronized::h6f9ce700d1d0c782
at /Users/zakimanian/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/mod.rs:66
backtrace::backtrace::trace::hf06a6b725a5dec68
at /Users/zakimanian/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/mod.rs:53
1: 0x10ef26a18 - backtrace::capture::Backtrace::create::hc95b3ea3c9fcb08d
View olerror.txt
libra% ol s 0 aa 100 001eef1120c0b13b46adae770d866308a5db6fdc1f408c6b8b6a7376e9146dc94586bdf1f84d276d5f65d1b1a7cec888706b680b5e19b248871915bb4319bbe13e7a2e222d28ef9e5e95d3709b46d88424c52140e1d48c1f123f2a1341448b9239e40509a604b1c54cc6c2750ae1255287308d7b2dd5353bae649d4b1bcb65154cffe2e189ec6960d5fa88eef4aa4f1c1939ce8b4808c379562a45ffcda8c502b9558c0999a595dddc02601e837634081977be9195345fae0e858b2cf402e03844ccda24977966ca41706e84c3bf4a841c3845c7bb519547b735cb5644fb0f8a78384827a098b3c80432a4db1135e3df70ade040444d67936b949bd17b68f64fde810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
View zero_to_usb_on_the_armistice.txt
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
export PATH=$PATH:$HOME/.cargo/bin
git clone https://github.com/iqlusioninc/usbarmory.rs
cd usbarmory.rs
git checkout develop
cd host/usbc
cargo install --path .
cd ../usd && cargo install --path .
cargo install --git https://github.com/japaric/flip-lld
rustup component add llvm-tools-preview
View gameofzoneshub-3-unsigned.json
{
"genesis_time": "2020-05-23T15:46:17.050233167Z",
"chain_id": "gameofzoneshub-3",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
View make_gent_tx.sh
mkdir -p ~/gentxes
rm -f ~/gentxes/*.json
rm -f ~/.gaiad/config/gentx/*.json
rm -rf ~/.gaiacli
gaiacli config keyring-backend test
for valnum in 0 1 2 3 4 5; do
echo "*** valnum: $valnum"
cp ~/private_keys/val_$valnum.key ~/.gaiad/config/priv_validator_key.json
View eventbuildup.json
{"network":"freeflix-media-hub-2","node":"19A3E9203FF48BB6246B28A8A28D357FC11720CF","ts":"2020-05-26T16:23:19.109384462Z","msg":[{"event_ibc":{"PacketTransfer":{"data":{"send_packet.packet_data":["{\"type\":\"ibc/transfer/PacketDataTransfer\",\"value\":{\"amount\":[{\"amount\":\"1\",\"denom\":\"transfer/ortghghqqj/mdm\"}],\"receiver\":\"cosmos1ljd64u6uf5x23c85e6t0v7rquss3weqff6x3mj\",\"sender\":\"freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t\"}}"],"tm.event":["Tx"],"transfer.recipient":["freeflix17xpfvakm2amg962yls6f84z3kell8c5luku8d2","freeflix1qayej76lxrdpyg6uq9huaz4tmlsw08ke29xy49"],"message.sender":["freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t"],"send_packet.packet_dst_port":["transfer"],"send_packet.packet_dst_channel":["ortghghqqj"],"send_packet.packet_src_channel":["dehgzjabrr"],"send_packet.packet_sequence":["12831"],"transfer.amount":["200fmt","1m
View valid_clients.csv
kira-1-1b 4m0s gznznsajtk
supernovachain-1b 5m0s clkgzwcgfe
starcluster-1337-1b 6m0s uvzwirnwgo
interstation-1b 7m0s jacljmvdoa
Compass-1b 9m55s snkxcvarit
dawnsworld-1b 9m55s oziibvphlw
plex-1b 10m0s xypdggzvlb
kugs-030-1b 10m0s xbqxjatnnbq
stakebird-1b 10m0s lasmbeybiz
dos-ibc-1b 11m0s zxihpmutac