Skip to content
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

feat: add an L2 token retriever contract which calls exported spoke pool functions #605

Open
wants to merge 14 commits into
base: bz/l2ForwarderInterface
Choose a base branch
from

Conversation

bmzig
Copy link
Contributor

@bmzig bmzig commented Sep 13, 2024

There will be shared logic between L2 token retrievers which need to bridge funds from L3 back to L1 and L2 spoke pool logic. We may be able to factor this out for each chain and create another adapter-like contract which can be delegatecall-ed by both L2 token retriever and spoke pool contracts.

contracts/L2_TokenRetriever.sol Outdated Show resolved Hide resolved
contracts/L2_TokenRetriever.sol Outdated Show resolved Hide resolved
contracts/chain-adapters/l2/WithdrawalAdapter.sol Outdated Show resolved Hide resolved
@bmzig bmzig changed the title [WIP] refactor: export bridging logic to l2 adapter contracts feat: add an L2 token retriever contract which calls exported spoke pool functions Sep 17, 2024
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

Looks great -- just a few comments

contracts/L2_TokenRetriever.sol Outdated Show resolved Hide resolved
} else {
// Check that the Ethereum counterpart of the L2 token is stored on this contract.
// Tokens will only be bridged if they are whitelisted by the spoke pool.
address ethereumTokenToBridge = spokePool.whitelistedTokens(l2TokenAddress);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love the dependency on the spoke pool, especially since we may end up wanting the spoke pool to call into this contract.

But I can't really think of a way to get this list elsewhere without adding a lot of complexity or additional args that wouldn't apply on non-arbitrum chains... maybe we could add a bytes arg that can be used to supply extra context when needed, but that makes the interface sort of convoluted.

Any ideas?

@bmzig bmzig marked this pull request as ready for review September 20, 2024 16:53
@bmzig bmzig changed the base branch from master to bz/ArbitrumForwarders September 23, 2024 13:50
@bmzig bmzig changed the base branch from bz/ArbitrumForwarders to bz/l2ForwarderInterface September 23, 2024 14:57
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.

3 participants