This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.24; | |
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
interface IUniswapV2Factory { | |
function createPair( | |
address tokenA, | |
address tokenB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'http'; | |
import httpProxy from 'http-proxy'; | |
const items = Object.values({ | |
'jup.ag': 'https://jupiter-frontend.rpcpool.com', | |
'pump.fun': | |
'https://pump-fe.helius-rpc.com/?api-key=1b8db865-a5a1-4535-9aec-01061440523b', | |
'raydium.io': 'https://raydium-raydium-5ad5.mainnet.rpcpool.com', | |
}); | |
let currentInd = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import puppeteer, { Browser, Page } from 'puppeteer'; | |
class Crawler { | |
private browser: Browser; | |
constructor(private readonly userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36') {} | |
async init() { | |
// Launch the browser and open a new blank page | |
this.browser = await puppeteer.launch({ headless: true }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { readdirSync, readFileSync, writeFileSync } = require('fs'); | |
const { join } = require('path'); | |
function walk(dir, ext = '.rs') { | |
return readdirSync(dir, { withFileTypes: true }) | |
.flatMap((file) => (file.isDirectory() ? walk(join(dir, file.name), ext) : file.name.endsWith(ext) ? join(dir, file.name) : null)) | |
.filter(Boolean); | |
} | |
const reg = /(?<=#\[wasm_bindgen)\]([\n\t\s])+(?=pub\s+fn\s+([\w_]+)\()/g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { toUtf8, fromBech32, toAscii, toBech32 } from '@cosmjs/encoding'; | |
import { sha256 } from '@cosmjs/crypto'; | |
import { Uint64 } from '@cosmjs/math'; | |
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate'; | |
function increaseBytes(bytes: Uint8Array) { | |
for (let i = bytes.length - 1; i >= 0; --i) { | |
if (bytes[i] === 255) { | |
bytes[i] = 0; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Registry, decodeTxRaw } from '@cosmjs/proto-signing'; | |
import { TextProposal } from 'cosmjs-types/cosmos/gov/v1beta1/gov'; | |
import { fromAscii } from '@cosmjs/encoding'; | |
import { | |
defaultRegistryTypes as defaultStargateTypes, | |
Event, | |
logs, | |
StargateClient, | |
} from '@cosmjs/stargate'; | |
import { JsonObject, fromBinary, wasmTypes } from '@cosmjs/cosmwasm-stargate'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob'); | |
const util = require('util'); | |
const globPromise = util.promisify(glob); | |
const importArr = []; | |
const exportArr = ['export default {']; | |
const paths = [ | |
'node_modules/@tharsis/proto/dist/proto/evmos/**/*.js', | |
'node_modules/@tharsis/proto/dist/proto/ethermint/**/*.js', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const client = await Tendermint37Client.create(new WebsocketClient('rpc.orai.io')); | |
const query = { | |
query: buildQuery({ | |
tags: [ | |
{ | |
key: 'wasm._contract_address', | |
value: contracts.engineAddr | |
}, | |
{ | |
key: 'wasm.action', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { decodeTxRaw } from "@cosmjs/proto-signing"; | |
import * as injProto from "@injectivelabs/core-proto-ts"; | |
import { GasFee } from "@injectivelabs/sdk-ts"; | |
import { MsgType } from "@injectivelabs/ts-types"; | |
const typeMap = Object.fromEntries(Object.entries(MsgType).map(([k, v]) => ["/" + v, k])); | |
type TxType = keyof typeof MsgType; | |
const findType = (obj: any, type: string) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hd_path = "m/44'/118'/0'/0/0".into_derivation_path().unwrap(); | |
let secp = Secp256k1::new(); | |
let pk = ExtendedPrivKey::new_master(Network::Bitcoin, seed) | |
.unwrap() | |
.derive_priv(&secp, hd_path) | |
.unwrap(); | |
let pubk = ExtendedPubKey::from_private(&secp, &pk); | |
let path = home::home_dir().unwrap().join(".orga-wallet").join("privkey"); |
NewerOlder