@@ -188,6 +188,7 @@ abstract contract MetaTxModule is BaseModule
188188 address (gasSetting[4 ])
189189 );
190190 require (gasSettings.limit > 0 , "INVALID_GAS_LIMIT " );
191+ require (gasSettings.recipient == controller.collectTo (), "INVALID_GAS_RECIPIENT " );
191192
192193 address wallet = extractWalletAddress (data);
193194 bytes32 metaTxHash = EIP712.hashPacked (
@@ -232,7 +233,7 @@ abstract contract MetaTxModule is BaseModule
232233
233234 emit MetaTxExecuted (msg .sender , wallet, nonce, metaTxHash, gasUsed, success, returnData);
234235
235- if (gasSettings.price != 0 ) {
236+ if (gasSettings.price != 0 && reimbursable ( extractMethod (data)) ) {
236237 reimburseGasFee (wallet, gasSettings, gasUsed);
237238 }
238239 }
@@ -301,6 +302,14 @@ abstract contract MetaTxModule is BaseModule
301302 return (signers.length == 1 && signers[0 ] == signer);
302303 }
303304
305+ function reimbursable (bytes4 method )
306+ internal
307+ view
308+ virtual
309+ returns (bool ) {
310+ return true ;
311+ }
312+
304313 /// @dev For all relayed method, the first parameter must be the wallet address.
305314 function extractWalletAddress (bytes memory data )
306315 internal
@@ -392,7 +401,7 @@ abstract contract MetaTxModule is BaseModule
392401 uint gasCost = gasUsed.add (gasSettings.overhead).mul (gasSettings.price);
393402 updateQuota (wallet, gasSettings.token, gasCost);
394403
395- address feeRecipient = (gasSettings.recipient == address ( 0 )) ? msg . sender : gasSettings.recipient;
404+ address feeRecipient = gasSettings.recipient;
396405 if (gasSettings.token == address (0 )) {
397406 transactCall (wallet, feeRecipient, gasCost, "" );
398407 } else {
0 commit comments