-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(protocol): fix recall not working with bridged tokens #15679
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adaki2004
approved these changes
Feb 8, 2024
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.
adaki2004
reviewed
Feb 8, 2024
adaki2004
reviewed
Feb 8, 2024
adaki2004
reviewed
Feb 8, 2024
Brechtpd
changed the title
fix(protocol): fix recall token deduction (maybe)
fix(protocol): fix recall not working with bridged tokens
Feb 8, 2024
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dantaik
approved these changes
Feb 10, 2024
Co-authored-by: xiaodino <[email protected]> Co-authored-by: jeff <[email protected]> Co-authored-by: d1onys1us <[email protected]> Co-authored-by: D <[email protected]> Co-authored-by: Keszey Dániel <[email protected]> Co-authored-by: Daniel Wang <[email protected]>
# Conflicts: # packages/protocol/test/tokenvault/ERC20Vault.t.sol
This was referenced Apr 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The token passed into
receiveToken
is always the canonical token, but the recall code checks ifbridgedToCanonical[ctoken.addr].addr
exists to know if it's a bridged or canonical token, which seems incorrect because it's never a bridged token that is passed in. So the current code does not support recalling on bridged token contracts correctly because all tokens are always seen as canonical.Previous code:
The first check would always be false because
ctoken.addr
is always a canonical token and so the bridged path would never be taken. So if indeed the bridged token needs to be used on the chain, it would not work because it would also go through the canonical token path.I believe the code to transfer the tokens in
onMessageRecalled
should be the same code that is used inreceiveToken
with the same token address deduction to know if the bridged variant needs to be used or the canonical one.There also seems to be no test that tests the ERC20 recall, so I'm trying to add one but it's not working yet because I'm no familiar with the test code. But working on it!