-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
crosschain
contracts, I introduce a new custom errorUnauthorizedCrossChainRelayer
used withinCrossChainEnabledPolygonChild
. The reason why I introduce a new custom error is that I don't want to misuse the existing custom errorInvalidCrossChainSender
and make it more specific to the exact error message.PR Checklist