```\nfunction recoverSignature(\n  bytes32 transactionId,\n  uint256 relayerFee,\n  string memory functionIdentifier,\n  bytes calldata signature\n) internal pure returns (address) {\n  // Create the signed payload\n  SignedData memory payload = SignedData({\n    transactionId: transactionId,\n    relayerFee: relayerFee,\n    functionIdentifier: functionIdentifier\n  });\n\n  // Recover\n  return ECDSA.recover(ECDSA.toEthSignedMessageHash(keccak256(abi.encode(payload))), signature);\n}\n```\n