feat: update new interface in codebase

This commit is contained in:
royvardhan
2025-02-13 20:54:54 +05:30
parent a309825769
commit bd1971334e
10 changed files with 357 additions and 231 deletions

View File

@@ -79,4 +79,24 @@ contract ExecutionDispatcher {
calculatedAmount = abi.decode(result, (uint256));
}
function _handleCallback(address executor, bytes calldata data) internal {
if (!executors[executor]) {
revert ExecutionDispatcher__UnapprovedExecutor();
}
(bool success, bytes memory result) = executor.delegatecall(
abi.encodeWithSelector(IExecutor.handleCallback.selector, data)
);
if (!success) {
revert(
string(
result.length > 0
? result
: abi.encodePacked("Callback failed")
)
);
}
}
}