Description:
ERC20 token contract with Factory capabilities. Standard implementation for fungible tokens on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/governance/Treasury.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../security/Ownable.sol";
import "../interfaces/IERC20.sol";
contract Treasury is Ownable {
receive() external payable {}
function sweep(address token, address to, uint amount) external onlyOwner {
if (token == address(0)) { payable(to).transfer(amount); }
else { IERC20(token).transfer(to, amount); }
}
}
"
},
"contracts/interfaces/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
"
},
"contracts/security/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); }
modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; }
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "0 addr");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 500
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-11-06 20:48:10
Comments
Log in to comment.
No comments yet.