Skip to content

Conversation

@chrismaree
Copy link
Member

@chrismaree chrismaree commented Mar 3, 2022

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.

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
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.
Copy link
Member

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

@nicholaspai nicholaspai changed the title fix for optimism fix(optimism-adapter): handle custom bridges Mar 4, 2022
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Comment on lines 82 to 86
if (l1Token == 0x6B175474E89094C44Da98b954EedeAC495271d0F)
_l1StandardBridge = IL1StandardBridge(0x10E6593CDda8c58a1d0f14C5164B376352a55f2F);
// 2. SNX
if (l1Token == 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F)
_l1StandardBridge = IL1StandardBridge(0xCd9D4988C0AE61887B075bA77f08cbFAd2b65068);
Copy link
Contributor

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;
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea why not

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants