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

eth_getCode to return the redirect bytecode for HTS tokens #594

Closed
Kalina-Todorova opened this issue Oct 6, 2022 · 0 comments · Fixed by #598
Closed

eth_getCode to return the redirect bytecode for HTS tokens #594

Kalina-Todorova opened this issue Oct 6, 2022 · 0 comments · Fixed by #598
Assignees
Labels
bug Something isn't working limechain P2
Milestone

Comments

@Kalina-Todorova
Copy link

Kalina-Todorova commented Oct 6, 2022

Description

As reported here: #583 when we perfrom eth_getCode for HTS tokens, currently the result for HTS token addresses is INVALID_CONTRACT_ID as we do not return the redirect bytecode.

As described in the issue logged in the consensus node: hiero-ledger/hiero-consensus-node#3659
Although a consensus node change could be made, it will be more cost efficient (hbar cost) if the contract bytecode call to the mirror node fails to then see if it is a HTS token (checking mirror node) and then apply the proxy code to it. Similar network load, but the GetContractBytecode call will cost on the first hit if not cached.

Steps to reproduce

Described in an example here: #583

Additional context

Redirect bytecode:

6080604052348015600f57600080fd5b506000610167905077618dc65efefefefefefefefefefefefefefefefefefefefe600052366000602037600080366018016008845af43d806000803e8160008114605857816000f35b816000fdfea2646970667358221220d8378feed472ba49a0005514ef7087017f707b45fb9bf56bb81bb93ff19a238b64736f6c634300080b0033

fefefefefefefefefefefefefefefefefefefefe should be replaced with token address

Hedera network

mainnet

Version

v0.8.0

Operating system

No response

@Kalina-Todorova Kalina-Todorova added bug Something isn't working P2 labels Oct 6, 2022
@Kalina-Todorova Kalina-Todorova added this to the 0.10 milestone Oct 6, 2022
@Kalina-Todorova Kalina-Todorova changed the title eth_getCode for that address, but currently the result for HTS token addresses is INVALID_CONTRACT_ID eth_getCode to return the redirect bytecode for HTS tokens Oct 6, 2022
@georgi-l95 georgi-l95 self-assigned this Oct 6, 2022
@georgi-l95 georgi-l95 linked a pull request Oct 7, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working limechain P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants