View getProfit.sol
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
/// @notice Calculate how much profit we can by arbitraging between two pools | |
function getProfit(address pool0, address pool1, address adjustedpair, address adjustedtoken, uint256 adjustment0, uint256 adjustment1) external view returns (uint256 profit, address baseToken) { | |
(bool baseTokenSmaller, , ) = isbaseTokenSmaller(pool0, pool1); | |
baseToken = baseTokenSmaller ? IUniswapV2Pair(pool0).token0() : IUniswapV2Pair(pool0).token1(); | |
Adjustments memory adj; | |
adj.adjustmentPool = adjustedpair; | |
adj.adjustmentToken = adjustedtoken; | |
adj.adjustment0 = adjustment0; | |
adj.adjustment1 = adjustment1; |
View hex-to-weth.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
{ | |
"status": "pending-simulation", | |
"monitorId": "Geth_1_F_PROD", | |
"monitorVersion": "0.117.1", | |
"pendingTimeStamp": "2022-11-07T10:47:51.244Z", | |
"pendingBlockNumber": 15917644, | |
"hash": "0x4d3ba81f78b1da44994b7d0a36a2b074cb502b01bc3890a34285131abbde17d2", | |
"from": "0x4065149108A615930114Bb511818fc0909AA9269", | |
"to": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", | |
"value": "0", |
View hardhat.config.ts
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 { task, HardhatUserConfig } from 'hardhat/config'; | |
import '@typechain/hardhat'; | |
import '@nomiclabs/hardhat-waffle'; | |
import deployer from './.secret'; | |
require("dotenv").config(); | |
const BSC_ENDPOINT = process.env.BSC_ENDPOINT; | |
const config: HardhatUserConfig = { |
View hardhat.config.js
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
/** | |
* @type import('hardhat/config').HardhatUserConfig | |
*/ | |
require("@nomiclabs/hardhat-ethers"); | |
require("@nomiclabs/hardhat-waffle"); | |
require("@nomiclabs/hardhat-etherscan"); | |
require("dotenv").config(); | |
const mainnetEndpoint = process.env.MAINNET_ENDPOINT; |
View Flashswap.sol
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IERC20.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; |
View flashloan.js
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
// test a flashloan in Multipler V1 | |
require('dotenv').config(); | |
const Web3 = require('web3'); | |
const BigNumber = require('bignumber.js'); | |
const abis = require('./abis'); | |
const instance = require('./build/contracts/Flashloan.json'); | |
const web3 = new Web3( | |
new Web3.providers.HttpProvider(process.env.BSC_HTTPS) | |
); |
View Flashloan.sol
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
pragma solidity ^0.5.0; | |
import "./base/FlashLoanReceiverBase.sol"; | |
import "./interfaces/ILendingPoolAddressesProvider.sol"; | |
import "./interfaces/ILendingPool.sol"; | |
contract Flashloan is FlashLoanReceiverBase { | |
address public receiver = address(this); | |
address public constant BNB_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; |
View metrics.py
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 json | |
import requests | |
headers = {'Content-Type': 'application/json'} | |
url = "https://community-api.coinmetrics.io/v2/metrics" | |
m = requests.get(url, headers=headers) | |
metrics = json.loads(m.text)['metrics'] | |
print("Metrics: {}".format(len(metrics))) | |
Metrics: 145 |
View Flashswap.sol
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './utils/SafeMath.sol'; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IERC20.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; |
NewerOlder