Verified contractPartial
EthSend
Address0x561e1e1ebcfcb9b4f174436478287cafa930bd20
- Balance
0 ETH
- Transactions
189
- Compiler
solc 0.8.12
- Same code
Only this contract
Details
- Compiler
- solc 0.8.12+commit.f00d7308
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 14,329,829
- Creation transaction
- 0xb6e6a9cd5b…4602ba2167
EthSend.sol
pragma solidity 0.8.12;
contract EthSend {
IWETH weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
function sendEth(address recipient) public payable {
uint256 length;
assembly {
length := extcodesize(recipient)
}
if (length == 0) {
payable(recipient).call{ value: msg.value }("");
} else {
uint256 amount = msg.value;
weth.deposit{ value: msg.value }();
weth.transfer(recipient, amount);
}
}
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.