fix: Remove amountReceived and dataOffset from the callback verification

--- don't change below this line ---
ENG-4047 Took 20 minutes
This commit is contained in:
Diana Carvalho
2025-01-29 10:23:17 +00:00
parent fafeba9248
commit 63b94b5584
3 changed files with 18 additions and 42 deletions

View File

@@ -50,12 +50,7 @@ contract CallbackVerificationDispatcher {
function _callVerifyCallback(bytes calldata data)
internal
view
returns (
uint256 amountOwed,
uint256 amountReceived,
address tokenOwed,
uint16 dataOffset
)
returns (uint256 amountOwed, address tokenOwed)
{
address verifier;
bytes4 decodedSelector;
@@ -87,8 +82,7 @@ contract CallbackVerificationDispatcher {
}
}
(amountOwed, amountReceived, tokenOwed, dataOffset) =
abi.decode(result, (uint256, uint256, address, uint16));
(amountOwed, tokenOwed) = abi.decode(result, (uint256, address));
}
// slither-disable-next-line dead-code

View File

@@ -87,12 +87,7 @@ contract TychoRouter is
* @param msgData encoded data. It must includes data for the verification.
*/
function _executeGenericCallback(bytes calldata msgData) internal {
(
uint256 amountOwed,
uint256 amountReceived,
address tokenOwed,
uint16 offset // I think we actually don't need this!
) = _callVerifyCallback(msgData);
(uint256 amountOwed, address tokenOwed) = _callVerifyCallback(msgData);
IERC20(tokenOwed).safeTransfer(msg.sender, amountOwed);
}