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
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 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 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 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 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 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 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", |
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 { Wallet, Contract, providers, BigNumber, utils } from 'ethers' | |
import { readFileSync } from 'fs' | |
import { _TypedDataEncoder } from "@ethersproject/hash" | |
async function permitSign( | |
wallet: Wallet, | |
token: any, | |
approve: { | |
spender: string | |
value: BigNumber |
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
[ | |
{ | |
"name": "owner", | |
"type": "address" | |
}, | |
{ | |
"name": "spender", | |
"type": "address" | |
}, | |
{ |
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
package main | |
import ( | |
"math/rand" | |
"runtime" | |
"github.com/pkg/profile" | |
) | |
const count = 100000 |
NewerOlder