Skip to content

Instantly share code, notes, and snippets.

View Fantasim's full-sized avatar

Fantasim

View GitHub Profile
@BlockmanCodes
BlockmanCodes / 01_impersonateSigner.js
Created August 11, 2023 01:31
Hardhat: impersonate signer when forking
const SwapRouterArtifact = require('@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json')
const erc20Abi = [
{
"inputs": [
{"internalType": "address", "name": "spender", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"}
],
"name": "approve",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
@BlockmanCodes
BlockmanCodes / getPrice.js
Created June 16, 2023 12:25
Uni V3: getPriceFromTick
const JSBI = require('jsbi')
const { TickMath, FullMath } = require('@uniswap/v3-sdk')
const baseToken = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' // WETH
const quoteToken = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' // WBTC
async function main(
baseToken,
quoteToken,
inputAmount,
@JamieMason
JamieMason / unfollow.js.md
Last active May 16, 2024 03:26
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//