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

Add Solidity compatible address and byte types #2397

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davidsemakula
Copy link
Contributor

@davidsemakula davidsemakula commented Feb 10, 2025

Summary

Closes - N/A

  • [n] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on a specific version of cargo-contract or pallet-revive?

Adds Address and Byte types that can be unambiguously mapped to Solidity's address and bytes<N> (and bytes) types.

Description

See this discussion for rationale and additional details.

Checklist before requesting a review

  • I have added an entry to CHANGELOG.md
  • I have commented on my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@cmichi
Copy link
Collaborator

cmichi commented Feb 12, 2025

As discussed in Element, the PR should also change the function signature of e.g. self.env().address to return Address. I think there's more functions that return an H160 right now, when it's actually an Address.

What should also be done is go through the examples and see where a H160 is used, when it semantically should be an Address.

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.

2 participants