feat: update _handleCallback, add verifyCallback with docs

This commit is contained in:
royvardhan
2025-02-17 21:51:09 +05:30
parent 14e5c127c6
commit 076586d776
4 changed files with 92 additions and 44 deletions

View File

@@ -2,7 +2,24 @@
pragma solidity ^0.8.26;
interface ICallback {
/**
* @notice Handles callback data from a protocol or contract interaction.
* @dev This method processes callback data and returns a result. Implementations
* should handle the specific callback logic required by the protocol.
*
* @param data The encoded callback data to be processed.
* @return result The encoded result of the callback processing.
*/
function handleCallback(
bytes calldata data
) external returns (bytes memory result);
/**
* @notice Verifies the validity of callback data.
* @dev This view function checks if the provided callback data is valid according
* to the protocol's requirements. It should revert if the data is invalid.
*
* @param data The encoded callback data to verify.
*/
function verifyCallback(bytes calldata data) external view;
}