eth_getCode
does not use blockNumber
when address
corresponds to an HTS token
#3155
Labels
bug
Something isn't working
Description
The JSON-RPC method
eth_getCode
does not take into account theblockNumber
when theaddress
corresponds to an HTS token. It always returns the redirect bytecode, specified by HIP-719, regardless of the providedblockNumber
.This means that is the
blockNumber
provided is less than the block number where the HTS token was created, the returned bytecode is incorrect.Steps to reproduce
We use USDC on
mainnet
as an example. It was created at block22193323
. Running the following command we get the right bytecodeHowever, when we specify
22193322 (0x152a4aa)
as theblockNumber
(the previous block where USDC was created), we still get the same bytecode as beforeHowever, the response in this case should have been
0x
, empty bytecode.Additional context
When querying the Mirror Node, it correctly uses the
timestamp
(determined by theblockNumber
).With block
22193323
(block where USDC Token was created).We get the
timestamp
for block22193323
and use it to query for the USDC Token at that timestamp
With block
22193322
(just before USDC Token was created).Hedera network
any
Version
v0.58.0
Operating system
macOS
The text was updated successfully, but these errors were encountered: