-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix: comment for excess fee refund address #167
Conversation
Co-authored-by: gzeon <hng@offchainlabs.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also sync these change with the inbox e.g.
nitro-contracts/src/bridge/IInbox.sol
Line 80 in 90037b9
* @param excessFeeRefundAddress gasLimit x maxFeePerGas - execution cost gets credited here on L2 balance |
Co-authored-by: gzeon <hng@offchainlabs.com>
src/bridge/IERC20Inbox.sol
Outdated
@@ -53,7 +53,7 @@ interface IERC20Inbox is IInboxBase { | |||
* @param to destination L2 contract address | |||
* @param l2CallValue call value for retryable L2 message | |||
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee | |||
* @param excessFeeRefundAddress gasLimit x maxFeePerGas - execution cost gets credited here on L2 balance | |||
* @param excessFeeRefundAddress (gasLimit x maxFeePerGas - execution cost) + (maxSubmission - (autoredeem ? 0 : submission cost)) gets credited here on L2 balance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is actually a little bit more nuanced for the unsafe entrypoint since you might have l1callvalue < l2callvalue + fees, and you can only get fee refund for at most l1callvaue - l2callvalue
i.e.
max(0,min(l1callvalue - l2callvalue, gasLimit x maxFeePerGas + maxSubmission)) - execution cost - (autoredeem ? 0 : submission cost)
lol
I am thinking if we want to be so elaborated here or we should just put a high level description here while have the detail example in docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree to put max(0,min(l1callvalue - l2callvalue, gasLimit x maxFeePerGas + maxSubmission)) - execution cost - (autoredeem ? 0 : submission cost)
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you missed the l1callvalue - l2callvalue
part
see if we have time to discuss in standup
No description provided.