refactor: call onCrossChainCall when depositing to a contract#1226
Merged
refactor: call onCrossChainCall when depositing to a contract#1226
onCrossChainCall when depositing to a contract#1226Conversation
kingpinXD
reviewed
Oct 4, 2023
| return false, errors.Wrap(types.ErrUnableToParseContract, err.Error()) | ||
| return false, errors.Wrap(types.ErrUnableToParseAddress, err.Error()) | ||
| } | ||
| if parsedAddress != (ethcommon.Address{}) { |
Member
There was a problem hiding this comment.
Curious why we need allow parsedAddress == ethcommon.Address{} ?
Contributor
Author
There was a problem hiding this comment.
This is the fallback when no address is read from the message, it only contains data. So to will not be updated and will remains msg.Receiver
Currently the fallback is to use msg.Asset but it doesn't seem valid to me since msg.Asset represents an address on the external chain and not ZetaChain #1234
kingpinXD
reviewed
Oct 4, 2023
Member
kingpinXD
left a comment
There was a problem hiding this comment.
looks good, left a minor comment
brewmaster012
approved these changes
Oct 5, 2023
Collaborator
brewmaster012
left a comment
There was a problem hiding this comment.
LGTM
minor suggest for change
kingpinXD
approved these changes
Oct 6, 2023
This file contains hidden or 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
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.
Description
Simplify the method
HandleEVMDeposit,tois replaced by the parsed address in the message if any (previously we separated the parsed address into another variable buttowas not used anymore which added more argument to theZRC20DepositAndCallContractfunction than needed)Check if
tois a contract inZRC20DepositAndCallContractand useDepositZRC20AndCallContractwhen it is the case.The PR also introduces a fix for #1234 since depositing the zrc20 into the
assetaddress could result into the loss of tokensCloses: #1216
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist: