Created
January 14, 2022 13:24
-
-
Save ColinPlatt/1db8b9dfe5b9e95f6ea45482cd2d250e to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.10+commit.fc410830.js&optimize=false&runs=200&gist=
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: MIT | |
pragma solidity 0.8.10; | |
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
interface IUniswapV2Router { | |
function swapExactTokensForTokens( | |
uint amountIn, | |
uint amountOutMin, | |
address[] calldata path, | |
address to, | |
uint deadline | |
) external returns (uint[] memory amounts); | |
} | |
contract ClownsWTF is ERC20 ("ClownsWTF", unicode"🤡") { | |
IERC20 public WTF = IERC20(0xA68Dd8cB83097765263AdAD881Af6eeD479c4a33); | |
address private constant UNISWAP_V2_ROUTER = | |
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; | |
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; | |
// by doing this you understand you will not be able to retrieve your $WTF | |
function mintAClown() external { | |
uint256 wtfBalance = WTF.balanceOf(msg.sender); | |
WTF.transferFrom(msg.sender, address(this), wtfBalance); | |
_mint(msg.sender, wtfBalance * 69); | |
} | |
// anyone holding 🤡 can dump $WTF tokens, why not? | |
function dumpAClown(uint256 amount) external { | |
address[] memory path; | |
path = new address[](2); | |
path[0] = 0xA68Dd8cB83097765263AdAD881Af6eeD479c4a33; | |
path[1] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; | |
IUniswapV2Router(UNISWAP_V2_ROUTER).swapExactTokensForTokens( | |
amount, | |
0, | |
path, | |
address(this), | |
block.timestamp | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment