-
Notifications
You must be signed in to change notification settings - Fork 75
fix(optimism-adapter): handle custom bridges #68
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
Conversation
| l1StandardBridge.depositERC20To(l1Token, l2Token, to, amount, l2GasLimit, ""); | ||
| IL1StandardBridge _l1StandardBridge = l1StandardBridge; | ||
|
|
||
| // Check if the L1 token requires a custom bridge. If so, use that bridge over the standard bridge. |
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.
Only nit is I think it'd be helpful to link to some source where we can look up custom bridges per L1 token. otherwise LGMT
| if (l1Token == 0x6B175474E89094C44Da98b954EedeAC495271d0F) | ||
| _l1StandardBridge = IL1StandardBridge(0x10E6593CDda8c58a1d0f14C5164B376352a55f2F); | ||
| // 2. SNX | ||
| if (l1Token == 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F) | ||
| _l1StandardBridge = IL1StandardBridge(0xCd9D4988C0AE61887B075bA77f08cbFAd2b65068); |
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.
Have you thought about naming these?
Like:
address public immutable dai = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
address public immutable daiBridge = 0x10E6593CDda8c58a1d0f14C5164B376352a55f2F;
...
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.
yea why not
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.
done.
To fully support optimism we need some additional branching logic to change out the bridge address when bridging tokens that require custom bridges. To start with, this includes DAI and SNX.