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 tokenFetchers = [ | |
[uWeth, uDai, sDai, sWeth, sLink, uLink, uWeth] | |
]; |
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 tokenPairs = [ | |
['WETH', 'DAI', 'LINK'] | |
]; |
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
// same Fetcher by the SDK | |
// https://uniswap.org/docs/v2/javascript-SDK/fetching-data/ | |
const [uDai, uWeth, uUsdt, uUsdb, uWbtc, uComp, uLink, uRari, uSnx, uYfi] = await Promise.all( | |
[ | |
addresses.tokens.dai, | |
addresses.tokens.weth, | |
addresses.tokens.usdt, | |
addresses.tokens.usdc, | |
addresses.tokens.wbtc, | |
addresses.tokens.comp, |
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
// use @sushiswap/sdk@3.0.0 | |
const { | |
ChainId: sChainId, | |
Token: sToken, | |
WETH: sWETH, | |
Fetcher: sFetcher, | |
Trade: sTrade, | |
Route: sRoute, | |
TokenAmount: sTokenAmount, | |
TradeType: sTradeType } = require('@sushiswap/sdk'); |
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 pytest | |
import click | |
@pytest.fixture(scope='function', autouse=True) | |
def isolation(fn_isolation): | |
pass | |
def test_flashloan(accounts, interface, chain, Flashloan): | |
# prepare contracts | |
user = accounts[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
import pytest | |
import click | |
@pytest.fixture(scope='function', autouse=True) | |
def isolation(fn_isolation): | |
pass | |
def test_flashloan(accounts, interface, chain, Flashloan): | |
# prepare contracts | |
user = accounts[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
import pytest | |
import click | |
configurations = { | |
'dai': {'token': '0x6b175474e89094c44da98b954eedeac495271d0f', 'whale': '0x70178102AA04C5f0E54315aA958601eC9B7a4E08'}, | |
'usdt': {'token': '0xdac17f958d2ee523a2206206994597c13d831ec7', 'whale': '0x1062a747393198f70f71ec65a582423dba7e5ab3'}, | |
'usdc': {'token': '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 'whale': '0xa191e578a6736167326d05c119ce0c90849e84b7'}, | |
'eth': {'token': '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', 'whale': '0x2f0b23f53734252bda2277357e97e1517d6b042a'}, | |
'yfi': {'token': '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', 'whale': '0xba37b002abafdd8e89a1995da52740bbc013d992'}, | |
'link': {'token': '0x514910771AF9Ca656af840dff83E8264EcF986CA', 'whale': '0x98c63b7b319dfbdf3d811530f2ab9dfe4983af9d'}, |
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
# https://eth-brownie.readthedocs.io/en/latest/config.html | |
compiler: | |
evm_version: null # the EVM version, byzantium, constantinople, petersburg | |
solc: | |
version: null # the version of the solc to use | |
optimizer: | |
enabled: true | |
runs: 200 | |
network: | |
default: development |
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
def test_with_compound_token(pm): | |
compound = pm('defi.snakecharmers.eth/compound@1.1.0').CToken |
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
require('dotenv').config(); | |
const Web3 = require('web3'); | |
const web3 = new Web3( | |
new Web3.providers.HttpProvider('http://127.0.0.1:8545') | |
); | |
const { address: admin } = web3.eth.accounts.wallet.add(process.env.PRIVATE_KEY); | |
const { ethers } = require("ethers"); | |
const init = async () => { |