Merge branch 'main' into router/tnl/ENG-4034-usv3-executor
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -79,7 +79,17 @@ contract TychoRouter is
|
||||
* caller is not a pool.
|
||||
*/
|
||||
fallback() external {
|
||||
// TODO execute generic callback
|
||||
_executeGenericCallback(msg.data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Check if the sender is correct and executes callback actions.
|
||||
* @param msgData encoded data. It must includes data for the verification.
|
||||
*/
|
||||
function _executeGenericCallback(bytes calldata msgData) internal {
|
||||
(uint256 amountOwed, address tokenOwed) = _callVerifyCallback(msgData);
|
||||
|
||||
IERC20(tokenOwed).safeTransfer(msg.sender, amountOwed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user