feat: Change signature of _handleCallback to take only bytes calldata
The selector and executor are decoded inside this function now. For Uniswap V3 I had to manually slice the msg.data from uniswapV3SwapCallback to get the data that matters for the callback Took 3 hours 12 minutes
This commit is contained in:
@@ -82,11 +82,10 @@ contract Dispatcher {
|
||||
calculatedAmount = abi.decode(result, (uint256));
|
||||
}
|
||||
|
||||
function _handleCallback(
|
||||
bytes4 selector,
|
||||
address executor,
|
||||
bytes memory data
|
||||
) internal {
|
||||
function _handleCallback(bytes calldata data) internal {
|
||||
bytes4 selector = bytes4(data[data.length - 4:]);
|
||||
address executor = address(uint160(bytes20(data[data.length - 24:])));
|
||||
|
||||
if (!executors[executor]) {
|
||||
revert Dispatcher__UnapprovedExecutor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user