forked from AmazingAng/WTF-Solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectorClash.sol
More file actions
24 lines (19 loc) · 821 Bytes
/
SelectorClash.sol
File metadata and controls
24 lines (19 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: MIT
// por 0xAA
pragma solidity ^0.8.21;
contract SelectorClash {
// O ataque foi bem-sucedido
function putCurEpochConPubKeyBytes(bytes memory _bytes) public {
require(msg.sender == address(this), "Not Owner");
solved = true;
}
function executeCrossChainTx(bytes memory _method, bytes memory _bytes) public returns(bool success){
(success, ) = address(this).call(abi.encodePacked(bytes4(keccak256(abi.encodePacked(_method, "(bytes,bytes,uint64)"))), abi.encode(_bytes)));
}
function secretSlector() external pure returns(bytes4){
return bytes4(keccak256("putCurEpochConPubKeyBytes(bytes)"));
}
function hackSlector() external pure returns(bytes4){
return bytes4(keccak256("f1121318093(bytes,bytes,uint64)"));
}
}