Skip to content

Instantly share code, notes, and snippets.

View onur-ozkan's full-sized avatar

Onur Özkan onur-ozkan

View GitHub Profile

S.o.W: Supporting Entire Cosmos Network for KDF Swaps

Currently KDF only supports swaps on two Cosmos networks: IRIS and Nucleus (which is our own network running on testnet). To swap native ATOM, you would need to send native ATOM to the IRIS network through an IBC channel, swap it there, and then send the resulting IBC asset back to the ATOM network to convert it into a native token. This process is both complicated and risky for users to perform manually, especially when selecting the IBC channel. If users pick a malicious or unsafe channel, they could lose their funds.

This work aims to automate this by doing IBC wrapping and unwrapping logics automatically with various security validations (e.g., adding restrictions and validations on IBC channel selection logic). KDF will either use a trusted IBC channel or notify the user that a trusted channel cannot be found. Users will still have the option to manually force KDF to use specific channels, but they will assume responsibility for the outcome.

H

# Migration: NETID 8762
## Why is this needed?
Because of two reasons;
### 1: Upgraded P2P Stack
We have recently refactored the entire network infrastructure (changes can be seen at https://github.com/KomodoPlatform/komodo-defi-framework/pull/1878), which caused breaking changes at the network layer as expected. This means that any peer using the old network layer will not be able to communicate with a peer using this new layer.
reading file "./heaptrack.mm2.28994.zst" - please wait, this might take some time...
Debuggee command was: ./target/release/mm2
finished reading file, now analyzing data:
MOST CALLS TO ALLOCATION FUNCTIONS
361 calls to allocation functions with 139.58K peak consumption from
sqlite3MemMalloc
in /home/nimda/devspace/KomodoPlatform/atomicDEX-API/target/release/mm2
44 calls with 1.35K peak consumption from:
sqlite3Malloc.part.0
#!/usr/bin/env /usr/bin/python3
import subprocess
import json
def check_unspent(coin, tool_bin, use_ac_name, script_pubkey):
command = [tool_bin]
if use_ac_name == True:
command.append('-ac_name=' + coin)
{
"key1": "value",
"key2": 6150
}

Metamask has their own method for using services in a dapp that require authority. However, I find it pretty unsafe. It took around 1 hour for me to figure out the INFURA_PROJECT_ID.

When you check the source code, you can't see the hard-coded api keys. They use environment variable instead, and provide it from the builder machine. So the key must be inside of the build files.

2022-05-25_09-55

In Metamask's browser extension, all the magic happens in the background.html running background.js which runs like a background worker. So you can't track the network on dev-tools if you don't have background.html page opened.

2022-05-25_10-11

@onur-ozkan
onur-ozkan / cloudSettings
Last active April 23, 2021 13:47
My custom vscode configuration settings
{"lastUpload":"2020-07-14T18:06:52.440Z","extensionVersion":"v3.4.3"}