This file contains hidden or 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
// Updated: Aug. 15, 2024 | |
// Run: node testRegex.js testText.txt | |
// Used in https://jina.ai/tokenizer | |
const fs = require('fs'); | |
const util = require('util'); | |
// Define variables for magic numbers | |
const MAX_HEADING_LENGTH = 7; | |
const MAX_HEADING_CONTENT_LENGTH = 200; | |
const MAX_HEADING_UNDERLINE_LENGTH = 200; |
This file contains hidden or 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
// NOTE: it's experimental. | |
// https://gist.github.com/sc0Vu/09e7f1838785825de800cd3422e4511a | |
// https://github.com/paulmillr/scure-starknet/blob/main/index.ts | |
const PEDERSEN_POINTS = [ | |
new ProjectivePoint(2089986280348253421170679821480865132823066470938446095505822317253594081284n, 1713931329540660377023406109199410414810705867260802078187082345529207694986n, 1n), | |
new ProjectivePoint(996781205833008774514500082376783249102396023663454813447423147977397232763n, 1668503676786377725805489344771023921079126552019160156920634619255970485781n, 1n), | |
new ProjectivePoint(2251563274489750535117886426533222435294046428347329203627021249169616184184n, 1798716007562728905295480679789526322175868328062420237419143593021674992973n, 1n), | |
new ProjectivePoint(2138414695194151160943305727036575959195309218611738193261179310511854807447n, 113410276730064486255102093846540133784865286929052426931474106396135072156n, 1n), | |
new ProjectivePoint(2379962749567351885752724891227938183011949129833673362440656643086 |
This file contains hidden or 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
from ecdsa.curves import Curve | |
from ecdsa.ellipticcurve import CurveFp, Point | |
from .signature import ( | |
ALPHA, | |
BETA, | |
CONSTANT_POINTS, | |
EC_ORDER, | |
FIELD_PRIME, | |
N_ELEMENT_BITS_HASH, |
This file contains hidden or 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
RPC_HOST="https://solana-api.projectserum.com" | |
API_HOST="https://api.raydium.io" | |
FARM_POOL_JSON="https://api.raydium.io/v2/sdk/farm/mainnet.json" |
This file contains hidden or 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 { ethers } from "hardhat" | |
async function main() { | |
const factoryAddress = '6b6960949B595b22548F4FBf3561Be459cA4F964' | |
const bytecode = '60806040527312c85994c04520f5216ce788414fdde2b591e1a06000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006457600080fd5b5061018e806100746000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610051578063380c7a6714610084575b600080fd5b34801561005d57600080fd5b5061006661009b565b60405180826000191660001916815260200191505060405180910390f35b34801561009057600080fd5b506100996100c3565b005b60007f736d617278000000000000000000000000000000000000000000000000000000905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663380c7a676040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b158015610148 |
This file contains hidden or 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 { fetchMultiReserveInfo, DECIMAL, RAY, YEAR_TO_SECONDS, toBN } from "./subgraph" | |
const main = async () => { | |
const ids = [ | |
"0x6b175474e89094c44da98b954eedeac495271d0f0xb53c1a33016b2dc2ff3653530bff1848a515c8c5", | |
"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae90xb53c1a33016b2dc2ff3653530bff1848a515c8c5" | |
] | |
const rewardToken = "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9" | |
const { reserves } = (await fetchMultiReserveInfo(ids)) | |
const reward = reserves.filter((r: Record<string, any>) => r.underlyingAsset === rewardToken)[0] |
This file contains hidden or 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
[{"inputs":[{"internalType":"contract IAuthorizer","name":"authorizer","type":"address"},{"internalType":"contract IWETH","name":"weth","type":"address"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAuthorizer","name":"newAuthorizer","type":"address"}],"name":"AuthorizerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExternalBalanceTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IFlashLoanRecipient","name":"recipient", |
This file contains hidden or 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 BigNumber = require('bignumber.js'); | |
import { JsonRpcProvider } from '@ethersproject/providers'; | |
import { | |
SOR as SOR2, | |
SwapTypes, | |
DisabledOptions, | |
SwapOptions, | |
PoolFilter, | |
fetchSubgraphPools | |
} from '@balancer-labs/sor2'; |
This file contains hidden or 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
interface url: | |
https://thegraph.com/explorer/subgraph/consenlabs/tokenlon-v5-staking | |
api url: | |
https://api.thegraph.com/subgraphs/name/consenlabs/tokenlon-v5-staking | |
feeTokens(where: { enabled: true }) { | |
id | |
} |
This file contains hidden or 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
[ | |
"TUSD", | |
"LON", | |
"BOND", | |
"RAI", | |
"UMA", | |
"YFI", | |
"BAT", | |
"MANA", | |
"1INCH", |
NewerOlder