-
Notifications
You must be signed in to change notification settings - Fork 75
improve(arbitrum-adapter): Use outboundTransferCustomRefund when sending tokens to L2 #181
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
improve(arbitrum-adapter): Use outboundTransferCustomRefund when sending tokens to L2 #181
Conversation
mrice32
left a comment
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.
LGTM!
| if (l1Token == 0x6B175474E89094C44Da98b954EedeAC495271d0F) { | ||
| // Note: outboundTransfer() will ultimately create a retryable ticket and set this contract's address as the | ||
| // refund address. This means that the excess ETH to pay for the L2 transaction will be sent to the aliased | ||
| // contract address on L2 and lost. |
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.
nit: we don't lose the ETH, it's just hard to retrieve (we have a custom adapter for retrieving it now).
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.
Updated
| // Note: Legacy routers don't have the outboundTransferCustomRefund method, so default to using | ||
| // outboundTransfer(). Legacy routers are used for: | ||
| // - DAI | ||
| if (l1Token == 0x6B175474E89094C44Da98b954EedeAC495271d0F) { |
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.
Is DAI the only token this applies to? Or just the only token we currently support that this applies to?
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.
The latter, DAI is the only token we currently support that this applies to, I'll clarify the comment
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.
Sounds good!
| // Note: Legacy routers don't have the outboundTransferCustomRefund method, so default to using | ||
| // outboundTransfer(). Legacy routers are used for: | ||
| // - DAI | ||
| if (l1Token == 0x6B175474E89094C44Da98b954EedeAC495271d0F) { |
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.
Sounds good!
This merged PR is now live for most Arbitrum ERC20 gateways (except DAI), so we can use the new function outboundTransferCustomRefund to receive refunds at an EOA we control instead of the aliased hub pool address, which is the L1 sender of the tokens technically.