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

return a new instance of Data in decodeSingleType #803

Merged

Conversation

zhangliugang
Copy link
Contributor

Summary of Changes

Fixes #801

I got the same issue as @6od9i when i tried to decoding ERC20 balances from a multicall contract.
I think the problem is that when decoding bytes type, a slice of the data is returned, resulting in wrong index. retuning a
new Data instance can fix this.

Test Data or Screenshots

By submitting this pull request, you are confirming the following:
  • I have reviewed the Contribution Guidelines.
  • I have performed a self-review of my own code.
  • I have updated my repository to match the develop branch.
  • I have included test data or screenshots that prove my fix is effective or that my feature works.
  • I have checked that all tests work and swiftlint is not throwing any errors/warnings.

@6od9i
Copy link
Contributor

6od9i commented Mar 16, 2023

Yes, I think this commit can fix my problem too, but both PRs should be merged, because it is could be more safe for future changes.

@JeneaVranceanu JeneaVranceanu changed the base branch from develop to fix/abi-decoder March 29, 2023 12:07
@JeneaVranceanu JeneaVranceanu merged commit 203c41a into web3swift-team:fix/abi-decoder Mar 29, 2023
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.

Wrong parsing dynamicBytes and unsafe ABI decoding
3 participants