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: MIT | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract MyToken is ERC721, ERC721URIStorage, ERC721Burnable, Ownable { | |
constructor(address initialOwner) |
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: MIT | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
contract Marketplace is ReentrancyGuard, Ownable { | |
using Counters for Counters.Counter; |
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; |
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", |
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 = { |
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; |
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'; |
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) | |
); |
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; |
NewerOlder