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

[HIP 632][HIP 631] Create class to handle address translation functionality for Hedera Account Service #4622

Closed
Tracked by #4619
lukelee-sl opened this issue Jan 12, 2023 · 3 comments · Fixed by #15281
Assignees

Comments

@lukelee-sl
Copy link
Contributor

Problem

Epic: #4619

There is no implementation of a class to handle address translation functionality for the Hedera Account Service.

Solution

Create and unit test a new class - AddressTranslatePrecompile to handle the following calls to the Hedera Account Service.

hash signature return description
e9482d42 getVirtualAddresses(address) address[] returns an array of virtual addresses for a given Hedera Account ID
a4e310ba getHederaAddress(address) (responseCode, address) returns the top level Hedera Account ID if applicable
d501235a isVirtualAddress(address) bool true if valid virtual address, false if long-zero or non existing account

Create additional wrapper classes and utility functionality as needed to be consistent with the implementation of precompile contract handlers in the rest of the system

Alternatives

No response

@lukelee-sl lukelee-sl self-assigned this Jan 12, 2023
@Nana-EC Nana-EC changed the title Create class to handle address translation functionality for Hedera Account Service [HIP 632][HIP 631] Create class to handle address translation functionality for Hedera Account Service Jul 12, 2024
@Nana-EC Nana-EC moved this from Backlog to Sprint Backlog in Smart Contract Sprint Board Jul 12, 2024
@david-bakin-sl
Copy link
Contributor

Method signatures here may change with HIP-632 update.

@david-bakin-sl david-bakin-sl moved this from Sprint Backlog to Tasks In Progress in Smart Contract Sprint Board Jul 22, 2024
@david-bakin-sl
Copy link
Contributor

Per draft HIP-632 revision (but agreed upon) methods look like this:

hash signature return description
0xdea3d081 getEvmAddressAlias(address) address given a Hedera Account ID (account num alias) returns the EVM address alias, if present
0xbbf12d2e getHederaAccountNumAlias(address) address given an alias returns the top level Hedera Account ID (as account num alias), if applicable
0x308ef301 isValidAlias(address) bool true if an account num alias or evm address alias), false if non existing account

@david-bakin-sl
Copy link
Contributor

and per discussion with Luke just now: getEvmAddressAlias and getHederaAccountNumAlias will return (responseCode,address) (isValidAddress will still return (bool)) and I'll edit the draft HIP to match.

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