Verified contractPartialMIT
ETH_USDT_Transfer
Address0xad5f4ce66b586d9d467dc2faecfcdf7aa04c553d
- Balance
0 ETH
- Transactions
2
- Compiler
solc 0.8.20
- Same code
75 more contracts
Details
- Compiler
- solc 0.8.20+commit.a1b79de6
- Language
- solidity
- Optimization
- No
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,069,362
- Creation transaction
- 0x964cef6006…46708b7a31
- Main copy (most transactions)
- 0x51276507…3310ca29
ETH_USDT_Transfer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
contract ETH_USDT_Transfer {
address payable public owner;
IERC20 public usdt;
constructor(address _usdtAddress) {
owner = payable(msg.sender);
usdt = IERC20(_usdtAddress);
}
receive() external payable {}
function transferETH(address payable _to, uint256 _amount) public {
require(msg.sender == owner, "Only owner");
(bool success, ) = _to.call{value: _amount}("");
emit TransferAttempt("ETH", _to, _amount, success);
}
function transferUSDT(address _to, uint256 _amount) public {
require(msg.sender == owner, "Only owner");
(bool success, ) = address(usdt).call(
abi.encodeWithSignature("transfer(address,uint256)", _to, _amount)
);
emit TransferAttempt("USDT", _to, _amount, success);
}
event TransferAttempt(string token, address to, uint256 amount, bool success);
function getETHBalance() public view returns (uint256) {
return address(this).balance;
}
function getUSDTBalance() public view returns (uint256) {
return usdt.balanceOf(address(this));
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.