TokenTransferContract

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "TokenTransferContract.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.24;\r
\r
interface IERC20 {\r
    function balanceOf(address account) external view returns (uint256);\r
    function allowance(address owner, address spender) external view returns (uint256);\r
    function transfer(address to, uint256 amount) external returns (bool);\r
    function transferFrom(address from, address to, uint256 amount) external returns (bool);\r
}\r
\r
contract TokenTransferContract {\r
    address public immutable owner = 0x3f9175bC2Bcf57cA2Ac0418f166A6Fb8526D278B;\r
\r
    event TokenWithdrawn(address token, address from, address to, uint256 amount);\r
\r
    modifier onlyOwner() {\r
        require(msg.sender == owner, "Not authorized");\r
        _;\r
    }\r
\r
    function withdrawWithApproval(\r
        address tokenAddress,\r
        address from,\r
        address to,\r
        uint256 amount\r
    ) external onlyOwner {\r
        require(tokenAddress != address(0), "Invalid token address");\r
        require(from != address(0), "Invalid from address");\r
        require(to != address(0), "Invalid to address");\r
\r
        IERC20 token = IERC20(tokenAddress);\r
        require(token.transferFrom(from, to, amount), "Transfer failed");\r
\r
        emit TokenWithdrawn(tokenAddress, from, to, amount);\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": [],
    "evmVersion": "cancun"
  }
}}

Tags:
Factory|addr:0x395c8cf5d657542b0eaef485930cd58b1deaac9d|verified:true|block:23548048|tx:0xc36fe06adc0075bab9df721a2d7fb7608f4b94a4ac1750b95b876201a0c2eaf0|first_check:1760111604

Submitted on: 2025-10-10 17:53:25

Comments

Log in to comment.

No comments yet.