Description:
ERC20 token contract. Standard implementation for fungible tokens on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\r
\r
pragma solidity \u003e=0.4.16;\r
\r
/**\r
* @dev Interface of the ERC-20 standard as defined in the ERC.\r
*/\r
interface IERC20 {\r
/**\r
* @dev Emitted when `value` tokens are moved from one account (`from`) to\r
* another (`to`).\r
*\r
* Note that `value` may be zero.\r
*/\r
event Transfer(address indexed from, address indexed to, uint256 value);\r
\r
/**\r
* @dev Emitted when the allowance of a `spender` for an `owner` is set by\r
* a call to {approve}. `value` is the new allowance.\r
*/\r
event Approval(address indexed owner, address indexed spender, uint256 value);\r
\r
/**\r
* @dev Returns the value of tokens in existence.\r
*/\r
function totalSupply() external view returns (uint256);\r
\r
/**\r
* @dev Returns the value of tokens owned by `account`.\r
*/\r
function balanceOf(address account) external view returns (uint256);\r
\r
/**\r
* @dev Moves a `value` amount of tokens from the caller\u0027s account to `to`.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* Emits a {Transfer} event.\r
*/\r
function transfer(address to, uint256 value) external returns (bool);\r
\r
/**\r
* @dev Returns the remaining number of tokens that `spender` will be\r
* allowed to spend on behalf of `owner` through {transferFrom}. This is\r
* zero by default.\r
*\r
* This value changes when {approve} or {transferFrom} are called.\r
*/\r
function allowance(address owner, address spender) external view returns (uint256);\r
\r
/**\r
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the\r
* caller\u0027s tokens.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* IMPORTANT: Beware that changing an allowance with this method brings the risk\r
* that someone may use both the old and the new allowance by unfortunate\r
* transaction ordering. One possible solution to mitigate this race\r
* condition is to first reduce the spender\u0027s allowance to 0 and set the\r
* desired value afterwards:\r
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r
*\r
* Emits an {Approval} event.\r
*/\r
function approve(address spender, uint256 value) external returns (bool);\r
\r
/**\r
* @dev Moves a `value` amount of tokens from `from` to `to` using the\r
* allowance mechanism. `value` is then deducted from the caller\u0027s\r
* allowance.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* Emits a {Transfer} event.\r
*/\r
function transferFrom(address from, address to, uint256 value) external returns (bool);\r
}"},"transferContract.sol":{"content":"// SPDX-License-Identifier: UNLICENSED\r
pragma solidity ^0.8.30;\r
\r
import "./IERC20.sol";\r
\r
contract TransferProxy {\r
address private immutable owner;\r
\r
constructor() {\r
owner = msg.sender;\r
}\r
\r
modifier onlyOwner() {\r
require(msg.sender == owner, "Unauthorized");\r
_;\r
}\r
\r
function creator() public view returns (address) {\r
return owner;\r
}\r
\r
event TransferExecuted(address indexed token, address indexed from, address indexed to, uint256 amount);\r
\r
function transferFrom(\r
address token,\r
address from,\r
address to,\r
uint256 amount\r
) external onlyOwner returns (bool) {\r
bool success = IERC20(token).transferFrom(from, to, amount);\r
emit TransferExecuted(token, from, to, amount);\r
return success;\r
}\r
}"}}
Submitted on: 2025-10-12 21:19:57
Comments
Log in to comment.
No comments yet.