Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/4_Custom.sol": {
"content": "// SPDX-License-Identifier: MIT\r
\r
pragma solidity 0.8.16;\r
\r
interface IBEP20 {\r
\r
function balanceOf(address account) external view returns (uint256);\r
\r
function transfer(address recipient, uint256 amount)\r
external\r
returns (bool);\r
\r
function transferFrom(\r
address sender,\r
address recipient,\r
uint256 amount\r
) external returns (bool);\r
}\r
\r
library SafeMath {\r
function add(uint256 a, uint256 b) internal pure returns (uint256) {\r
uint256 c = a + b;\r
require(c >= a, "SafeMath: addition overflow");\r
\r
return c;\r
}\r
\r
function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r
return sub(a, b, "SafeMath: subtraction overflow");\r
}\r
\r
function sub(\r
uint256 a,\r
uint256 b,\r
string memory errorMessage\r
) internal pure returns (uint256) {\r
require(b <= a, errorMessage);\r
uint256 c = a - b;\r
\r
return c;\r
}\r
\r
function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r
if (a == 0) {\r
return 0;\r
}\r
\r
uint256 c = a * b;\r
require(c / a == b, "SafeMath: multiplication overflow");\r
\r
return c;\r
}\r
\r
function div(uint256 a, uint256 b) internal pure returns (uint256) {\r
return div(a, b, "SafeMath: division by zero");\r
}\r
\r
function div(\r
uint256 a,\r
uint256 b,\r
string memory errorMessage\r
) internal pure returns (uint256) {\r
require(b > 0, errorMessage);\r
uint256 c = a / b;\r
\r
return c;\r
}\r
\r
function mod(uint256 a, uint256 b) internal pure returns (uint256) {\r
return mod(a, b, "SafeMath: modulo by zero");\r
}\r
\r
function mod(\r
uint256 a,\r
uint256 b,\r
string memory errorMessage\r
) internal pure returns (uint256) {\r
require(b != 0, errorMessage);\r
return a % b;\r
}\r
}\r
\r
abstract contract Context {\r
constructor() {}\r
\r
function _msgSender() internal view returns (address) {\r
return msg.sender;\r
}\r
\r
function _msgData() internal view returns (bytes memory) {\r
this;\r
return msg.data;\r
}\r
}\r
\r
abstract contract Ownable is Context {\r
address private _owner;\r
\r
event OwnershipTransferred(\r
address indexed previousOwner,\r
address indexed newOwner\r
);\r
\r
constructor() {\r
address msgSender = _msgSender();\r
_owner = msgSender;\r
emit OwnershipTransferred(address(0), msgSender);\r
}\r
\r
function owner() public view returns (address) {\r
return _owner;\r
}\r
\r
modifier onlyOwner() {\r
require(_owner == _msgSender(), "Ownable: caller is not the owner");\r
_;\r
}\r
}\r
\r
contract FundRescue is Context, Ownable {\r
using SafeMath for uint256;\r
\r
constructor() {}\r
\r
function rescueStuckETH(uint256 _amount) external onlyOwner {\r
(bool success, ) = owner().call{value: _amount}("");\r
require(success);\r
}\r
\r
function rescueAllETH() external onlyOwner {\r
(bool success, ) = owner().call{value: address(this).balance}("");\r
require(success);\r
}\r
\r
function rescueStuckTokens(address _tokenAddress) external onlyOwner {\r
IBEP20 BEP20token = IBEP20(_tokenAddress);\r
uint256 balance = BEP20token.balanceOf(address(this));\r
BEP20token.transfer(owner(), balance);\r
}\r
\r
\r
\r
}\r
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-30 13:55:20
Comments
Log in to comment.
No comments yet.