Add custom error to CrossChainEnabledPolygonChild #3380
Conversation
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
|
Hello @pcaversaccio and thank you for raising that interesting point. I realize that the This makes me think we should probably not introduce a new error and do What do you think ? |
|
@Amxx good point - fully agreed; will fix this now! Quick suggestion: why not include the address of the emitter in all custom errors (i.e. here). This helps end-users identify which contract was reverted with a failed transaction, which is especially useful for complex transactions involving multiple contracts? What do you think? error SomeError(address emitter, ..., ..., ...);
emit SomeError(address(this), ..., ..., ...);PS: Just fixed a typo in |
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
|
Ok - so let's first get this PR merged (if you agree) and thereafter I will open another PR with the custom errors that include the emitter address. How would you think about creating a dedicated error interface |
I'm not sure, we'll have to discuss that internally. |
|
Sure, will work on the other PR in the meantime. |
In order to preserve custom error consistency within the
crosschaincontracts, I introduce a new custom errorUnauthorizedCrossChainRelayerused withinCrossChainEnabledPolygonChild. The reason why I introduce a new custom error is that I don't want to misuse the existing custom errorInvalidCrossChainSenderand make it more specific to the exact error message.PR Checklist