matter-labs / v2-testnet-contracts

62 stars 32 forks source link

Mailbox address alias is not applied to refundRecipient #16

Open antonper opened 1 year ago

antonper commented 1 year ago

Hello,

The requestL2Transaction function applies the applyL1ToL2Alias to the msg.sender if the sender is smart contract. However, in _requestL2Transaction the params.refundRecipient is assigned as:

 params.refundRecipient = _refundRecipient == address(0) ? msg.sender : _refundRecipient;

I think 2 things are not clear in this context and can be potential bugs:

1) The submitted refundRecipient address needs to be already aliased address, which is not clear from the docs. 2) The address(0) as refundRecipient will set wrong address if sender is a contract.

Please let me know if those concerns are valid. Thank you

ghost commented 1 year ago

sorry but if you could nudgebme in the right direction ill try to do my best.. i have tons of tinkering files on the test and all kinds of adresses. i was just getting those gears going... hope i didnt piss off too many