chore: update unlockCallback and uniswapV3SwapCallback

This commit is contained in:
royvardhan
2025-02-17 22:51:40 +05:30
parent 0d5c55c546
commit 2604935609
4 changed files with 30 additions and 44 deletions

View File

@@ -370,8 +370,8 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
bytes calldata data
) external {
if (data.length < 24) revert TychoRouter__InvalidDataLength();
address executor = address(uint160(bytes20(data[data.length - 20:])));
bytes4 selector = bytes4(data[data.length - 24:data.length - 20]);
bytes4 selector = bytes4(data[data.length - 4:]);
address executor = address(uint160(bytes20(data[data.length - 24:])));
bytes memory protocolData = data[:data.length - 24];
_handleCallback(
selector,
@@ -388,8 +388,9 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
returns (bytes memory)
{
if (data.length < 24) revert TychoRouter__InvalidDataLength();
address executor = address(uint160(bytes20(data[data.length - 20:])));
bytes4 selector = bytes4(data[data.length - 24:data.length - 20]);
bytes4 selector = bytes4(data[data.length - 4:]);
address executor =
address(uint160(bytes20(data[data.length - 24:data.length - 4])));
bytes memory protocolData = data[:data.length - 24];
_handleCallback(selector, executor, protocolData);
return "";