feat: Implement generic callback
--- don't change below this line --- ENG-4047 Took 26 minutes Took 4 minutes Took 8 seconds Took 59 seconds Took 22 seconds
This commit is contained in:
@@ -79,7 +79,22 @@ 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,
|
||||
uint256 amountReceived,
|
||||
address tokenOwed,
|
||||
uint16 offset // I think we actually don't need this!
|
||||
) = _callVerifyCallback(msgData);
|
||||
|
||||
IERC20(tokenOwed).safeTransfer(msg.sender, amountOwed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user