Skip to content

Instantly share code, notes, and snippets.

View savageops's full-sized avatar

Savage savageops

View GitHub Profile
@savageops
savageops / 01_simpleSwap.js
Created March 28, 2024 18:10 — forked from BlockmanCodes/01_simpleSwap.js
Uniswap: Universal Router: ETH to USDC
const { SwapRouter } = require('@uniswap/universal-router-sdk')
const { TradeType, Ether, Token, CurrencyAmount, Percent } = require('@uniswap/sdk-core')
const { Trade: V2Trade } = require('@uniswap/v2-sdk')
const { Pool, nearestUsableTick, TickMath, TICK_SPACINGS, FeeAmount, Trade: V3Trade, Route: RouteV3 } = require('@uniswap/v3-sdk')
const { MixedRouteTrade, Trade: RouterTrade } = require('@uniswap/router-sdk')
const IUniswapV3Pool = require('@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json')
const JSBI = require('jsbi')
const erc20Abi = require('../abis/erc20.json')
@savageops
savageops / .env
Created March 26, 2024 09:40 — forked from BlockmanCodes/.env
Get spot prices on Uniswap
INFURA_URL=<your_url>
ETHERSCAN_API_KEY=<your_api_key>
@savageops
savageops / .deps...npm...@0x...contracts-erc20...contracts...src...ERC20Token.sol
Created March 5, 2024 19:49
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.8.24+commit.e11b9ed9.js&optimize=true&runs=200&gist=
/*
Copyright 2019 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@savageops
savageops / .deps...npm...@openzeppelin...contracts...access...Ownable.sol
Created July 5, 2023 16:09
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.8.9+commit.e5eed63a.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@savageops
savageops / .deps...npm...@openzeppelin...contracts...access...Ownable.sol
Created July 5, 2023 16:05
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.8.9+commit.e5eed63a.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@savageops
savageops / .deploys...upgradeable-contracts...Sepolia...UUPS.json
Created July 5, 2023 16: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.8.9+commit.e5eed63a.js&optimize=true&runs=200&gist=
{
"id": 11155111,
"network": "Sepolia",
"deployments": {
"0x6E474F7ea095dBb569Fe066E0A5aD71351c744B8": {
"date": "2023-07-05T13:01:25.966Z",
"contractName": "PowerBlock",
"fork": "london",
"implementationAddress": "0x8CE4f949da4f7fD81268CcF95537Db6DBf6d143B"
}