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

Implement utility method for zero-padding EVM addresses in the Address class #1262

Closed
Torres-ssf opened this issue Sep 15, 2023 · 1 comment · Fixed by #1309
Closed

Implement utility method for zero-padding EVM addresses in the Address class #1262

Torres-ssf opened this issue Sep 15, 2023 · 1 comment · Fixed by #1309
Assignees

Comments

@Torres-ssf
Copy link
Contributor

When converting an EVM address to a Fuel address, it's essential to pad zeros.

To simplify this process we need to add utility methods within the Address class that will automatically handle this zero-padding for us. This enhancement will reduce potential errors for all applications interacting with the EVM address.

@Torres-ssf Torres-ssf added feat Issue is a feature dev-experience and removed feat Issue is a feature labels Sep 15, 2023
@Torres-ssf Torres-ssf changed the title Utility Method for Zero-Padding EVM Addresses in the Address Class Implement utility method for zero-padding EVM addresses in the Address class Sep 15, 2023
@Torres-ssf Torres-ssf self-assigned this Sep 15, 2023
@danielbate danielbate assigned danielbate and unassigned Torres-ssf Oct 2, 2023
@danielbate
Copy link
Member

danielbate commented Oct 3, 2023

So we do have a couple of functions already implemented that do something similar, however not matching this exact developer experience. Our Address.fromEvmAddress currently expects a wrapped and padded address (to match our EvmAddress type) to obtain an Address.

The use case detailed by @Torres-ssf is more appropriate, as an address would be returned from the EVM unwrapped and unpadded, requiring the user to do such to pass it to our function. I'll raise a PR to improve the dev ex of this function.

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 a pull request may close this issue.

2 participants