Skip to content

Instantly share code, notes, and snippets.

View swazidr's full-sized avatar

Sheikh Wazid swazidr

View GitHub Profile
@swazidr
swazidr / flashswaps.sol
Created May 24, 2023 19:48 — forked from yuyasugano/flashswaps.sol
Flash Swaps arbitrage
function startArbitrage(
address token0,
address token1,
uint amount0,
uint amount1
) external {
address pairAddress = IUniswapV2Factory(pancakeFactory).getPair(token0, token1);
require(pairAddress != address(0), 'This pool does not exist');
IUniswapV2Pair(pairAddress).swap(
// 1. Import everything
import { Wallet, BigNumber, ethers, providers } from 'ethers'
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle')
/*
Mainnet
const provider = new providers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
const wsProvider = new providers.WebSocketProvider('wss://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
*/
@swazidr
swazidr / 01_deployContracts.js
Created December 26, 2022 23:58 — forked from BlockmanCodes/01_deployContracts.js
Uniswap V3 Flashloans and Arbitrage
const { Contract, ContractFactory, utils, BigNumber } = require("ethers")
const WETH9 = require("../WETH9.json")
const artifacts = {
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"),
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"),
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"),
NonfungibleTokenPositionDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json"),
NonfungiblePositionManager: require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"),
WETH9,
@swazidr
swazidr / constants
Created October 5, 2022 15:08 — forked from adrianhajdin/constants
project_hoobank
import { people01, people02, people03, facebook, instagram, linkedin, twitter, airbnb, binance, coinbase, dropbox, send, shield, star } from "../assets";
export const navLinks = [
{
id: "home",
title: "Home",
},
{
id: "features",
title: "Features",
@swazidr
swazidr / App.scss
Created September 22, 2022 16:35 — forked from adrianhajdin/App.scss
Build and Deploy the Ultimate Web Development Portfolio
.app {
background-color: var(--primary-color);
font-family: var(--font-base);
}
.app__whitebg {
background-color: var(--white-color);
}
.app__primarybg {
@swazidr
swazidr / laravel_xampp_setup.md
Created September 21, 2022 20:01 — forked from bradtraversy/laravel_xampp_setup.md
Laravel Xampp setup on Mac and Windows

Laravel Xampp Setup (Windows & Mac)

Install Xampp

Install Xampp from https://www.apachefriends.org/index.html

  • Run the Xampp installer and open the Xampp control panel
  • Make sure that you enable the Apache and MySQL services
  • On mac you need to click "Start" on the Home tab, "Enable" on the Network tab and "Mount" on the Location Tab. Click "Explore" on the location tab to open your Xampp/Lampp folder

Install Composer

@swazidr
swazidr / laravel_valet_setup.md
Created September 21, 2022 20:01 — forked from bradtraversy/laravel_valet_setup.md
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@swazidr
swazidr / App.css
Created September 21, 2022 19:24 — forked from adrianhajdin/App.css
Build and Deploy a Modern React 18 Fitness Exercises App With APIs | Golds Gym
body {
font-family: 'Josefin Sans';
background-color: #FFFAFB;
}
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
import { useEffect, useState } from 'react';
import { Flex, Select, Box, Text, Input, Spinner, Icon, Button } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { MdCancel } from 'react-icons/md';
import Image from 'next/image';
import { filterData, getFilterValues } from '../utils/filterData';
import { baseUrl, fetchApi } from '../utils/fetchApi';
import noresult from '../assets/images/noresult.svg';
@swazidr
swazidr / AuthStyles.js
Created September 21, 2022 08:53 — forked from adrianhajdin/AuthStyles.js
MERN Auth Materials
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles((theme) => ({
paper: {
marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
padding: theme.spacing(2),
},