Skip to content

Instantly share code, notes, and snippets.

View monokh's full-sized avatar
🐧

monokh monokh

🐧
View GitHub Profile
@monokh
monokh / gist:68547bb2881050c58f65eacc67531215
Last active October 1, 2025 11:45
Reth network metrics (oom)
# TYPE reth_network_disconnect_requested counter
reth_network_disconnect_requested 2969
# HELP reth_network_occurrences_hash_already_seen_by_peer Total number of occurrences, of a peer announcing a transaction that has already been marked as seen by that peer.
# TYPE reth_network_occurrences_hash_already_seen_by_peer counter
reth_network_occurrences_hash_already_seen_by_peer 3186045
# HELP reth_network_null_node_identity Number of peer disconnects due to `NullNodeIdentity` (0x07)
# TYPE reth_network_null_node_identity counter
reth_network_null_node_identity 0
# HELP reth_network_pool_transactions_send_errors_total Number of failed message deliveries
# TYPE reth_network_pool_transactions_send_errors_total counter
@monokh
monokh / uniswap-sdk-v2-get-price.js
Last active May 12, 2024 02:51
Uniswap V2 SDK Get Price
const { Token, WETH9, CurrencyAmount, TradeType } = require('@uniswap/sdk-core')
const { Route, Trade, Pair } = require('@uniswap/v2-sdk')
const ethers = require('ethers')
;(async () => {
const CHAIN_ID = 1
const daiAddress = '0x6B175474E89094C44Da98b954EedeAC495271d0F'
const tokenA = WETH9[CHAIN_ID]
const tokenB = new Token(CHAIN_ID, daiAddress, 18, 'DAI', 'DAI')
const pairAddress = Pair.getAddress(tokenA, tokenB)
@monokh
monokh / HTLC.sol
Created February 6, 2021 14:03
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// optimize=true&runs=200&evmVersion=null&version=soljson-v0.7.4+commit.3f05b770.js
pragma solidity ^0.7.4;
interface ERC20 {
function balanceOf(address tokenOwner) external view returns (uint balance);
function transfer(address to, uint tokens) external returns (bool success);
}
contract HTLC {
address payable recipientAddress = 0x1111111111111111111111111111111111111111;
address payable refundAddress = 0x2222222222222222222222222222222222222222;