This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cp = require('child_process'); | |
const _ = require('lodash'); | |
const p = require('path'); | |
const fs = require('fs'); | |
const nodeModules = p.join(process.cwd(), 'node_modules'); | |
const bin = p.join(nodeModules, '.bin'); | |
cp.execSync(`mkdir ${bin} || true`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
Text, | |
View, | |
StyleSheet, | |
ListView, | |
ActivityIndicator, | |
Button, | |
} from 'react-native'; | |
import { Constants } from 'expo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { BN } = require("bn.js"); | |
const Web3 = require("web3"); | |
const web3 = new Web3(); | |
const value = new BN("12345"); | |
console.log( | |
web3.eth.abi.encodeParameters( | |
[{ internalType: "uint256", name: "input1", type: "uint256" }], | |
[value] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const team = "0xC200f98F3C088B868D80d8eb0aeb9D7eE18d604B"; | |
const date = new Date(Date.UTC(2022, 11, 31, 23, 59, 59)); | |
console.log(date); | |
const block = await findBlock(date.getTime()); | |
await resetNetworkFork(block.number); | |
const c = contract(abi as any, "0x01D59Af68E2dcb44e04C50e05F62E7043F2656C3"); //ETH | |
// const c = contract(abi as any, "0xEeAE6791F684117B7028b48Cb5dD21186dF80B9c");//POLY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset | |
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { | |
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); | |
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); | |
uint amountInWithFee = amountIn.mul(997); | |
uint numerator = amountInWithFee.mul(reserveOut); | |
uint denominator = reserveIn.mul(1000).add(amountInWithFee); | |
amountOut = numerator / denominator; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b506101076102 |