Skip to content

Commit

Permalink
fix: return result from fallback function
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGuru7 committed Sep 6, 2023
1 parent 474fae5 commit bed3821
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contracts/Bridge/XVSBridgeAdmin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bed3821

Please sign in to comment.