Skip to content

Instantly share code, notes, and snippets.

View theSkele's full-sized avatar
🦄
Uniswap is our Lord and Savior

skele the Skeleton theSkele

🦄
Uniswap is our Lord and Savior
View GitHub Profile
@theSkele
theSkele / tokenPriceApi.js
Last active July 12, 2023 17:48 — forked from Linch1/tokenPriceApi.js
find Pairs for token when token/BNB is not a pair, must use 5k block increments in call. Currently extremely messy, will output a shit ton of PairCreated events. Will be finishing when not busy
let pancakeSwapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"interna
@theSkele
theSkele / dydxFlashLoanTemplate.sol
Created October 25, 2020 01:25 — forked from cryptoscopia/dydxFlashLoanTemplate.sol
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }