Skip to content

Instantly share code, notes, and snippets.

View Aziz87's full-sized avatar
💾
Loading saved file...

Aziz Aziz87

💾
Loading saved file...
View GitHub Profile
@Aziz87
Aziz87 / pancake.js
Created July 26, 2021 05:48 — forked from korrio/pancake.js
pancake.js
const ethers = require(`ethers`)
const { ChainId, Token, TokenAmount, Fetcher, Pair, Route, Trade, TradeType, Percent } =
require(`@pancakeswap-libs/sdk`);
const Web3 = require(`web3`);
const { JsonRpcProvider } = require("@ethersproject/providers");
require(“dotenv”).config()
const provider = new JsonRpcProvider(`https://bsc-dataseed1.binance.org/`);
const web3 = new Web3(`wss://apis.ankr.com/wss/c40792ffe3514537be9fb4109b32d257/946dd909d324e5a6caa2b72ba75c5799/binance/full/main`);
@Aziz87
Aziz87 / BulkSender.sol
Created July 26, 2021 05:49 — forked from korrio/BulkSender.sol
BulkSender.sol
// File: contracts/EternalStorage.sol
// Initial code from Roman Storm Multi Sender
// To Use this Dapp: https://bulktokensending.github.io/bulktokensending
pragma solidity ^0.6.6;
import 'VonderToken.sol';
/**
@Aziz87
Aziz87 / wrapUnwrap.js
Created July 26, 2021 05:50 — forked from korrio/wrapUnwrap.js
wrapUnwrap.js
export default function useWrapCallback(
inputCurrency: Currency | undefined,
outputCurrency: Currency | undefined,
typedValue: string | undefined
): { wrapType: WrapType; execute?: undefined | (() => Promise<void>); inputError?: string } {
const { chainId, account } = useActiveWeb3React()
const wethContract = useWETHContract()
const balance = useCurrencyBalance(account ?? undefined, inputCurrency)
// we can always parse the amount typed as the input currency, since wrapping is 1:1
const inputAmount = useMemo(() => tryParseAmount(typedValue, inputCurrency), [inputCurrency, typedValue])