Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.3;
import {INFT} from "./INFT.sol";
import {IDInterest} from "./IDInterest.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.3;
contract DummyMPHMinter {
address private constant govTreasury =
0x56f34826Cc63151f74FA8f701E4f73C5EAae52AD;
address private whitehat;
function setWhitehat(address newWhitehat) external {
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./IERC20.sol";
import "./IWETH.sol";
import "./IUniswapV2Pair.sol";
import "./IUniswapV2Router02.sol";
import "./IUpdateableOracle.sol";
import "./IAaveLendingPool.sol";
import "./IFlashLoanReceiver.sol";
pragma solidity ^0.6.0;
import "../bondingcurve/IBondingCurve.sol";
contract Allocator {
constructor(IBondingCurve bondingCurve) public {
// We run this call from a constructor
// to bypass the non-contract check of `allocate()`
bondingCurve.allocate();
}
# This script calculates the optimal values for the exploit to achieve maximum profit.
# It uses GEKKO, a nonlinear (NLP) solver, to maximize the objective function while adhering to constraints.
from gekko import GEKKO
def main():
# The GEKKO model
m = GEKKO()
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./refs/UniRef.sol";
import "./external/UniswapV2Library.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol";
contract Exploit {
using SafeMathCopy for uint256;
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./refs/UniRef.sol";
import "./pcv/IUniswapPCVController.sol";
import "./external/UniswapV2Library.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol";
contract ReweightFrontrun {