From bed382163a59d6ed783b0459a89c34fd3599771e Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:53:33 +0530 Subject: [PATCH] fix: return result from fallback function --- contracts/Bridge/XVSBridgeAdmin.sol | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contracts/Bridge/XVSBridgeAdmin.sol b/contracts/Bridge/XVSBridgeAdmin.sol index c4ca7d19d..23a0b5b62 100644 --- a/contracts/Bridge/XVSBridgeAdmin.sol +++ b/contracts/Bridge/XVSBridgeAdmin.sol @@ -24,12 +24,13 @@ contract XVSBridgeAdmin is AccessControlledV8 { /** * @notice Invoked when called function does not exist in the contract */ - fallback() external { - string memory res = _getFunctionName(msg.sig); - require(bytes(res).length != 0, "Function not found"); - _checkAccessAllowed(res); - (bool ok, ) = address(XVSBridge).call(msg.data); + fallback(bytes calldata data) external payable returns (bytes memory) { + string memory fun = _getFunctionName(msg.sig); + require(bytes(fun).length != 0, "Function not found"); + _checkAccessAllowed(fun); + (bool ok, bytes memory res) = address(XVSBridge).call(msg.data); require(ok, "call failed"); + return res; } function initialize(address accessControlManager_) external initializer {