-
Notifications
You must be signed in to change notification settings - Fork 54
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
Can't get HTS token address when creating the token using the interface IHederaTokenService #901
Comments
As you stated in your ticket there are indeed two possible solutions here.
cc: @Nana-EC |
Thanks @ed-marquez these are fair points and @konstantinabl has highlighted some tradeoffs. Ethers offers the contractFactory which handles both the deployment and getting the new contract address. @konstantinabl expanding on the second suggestion of I'm biased towards a non CN change except we'd also have to consider how the MN web3 module would replicate this on direct calls to it's API outside of the relay |
@Nana-EC so regarding adding the tx.contractAddress I tested it and it currently returns the field, but it has the 0x167 address. So what we need to do is return the actual address of the token that was created. This can be done without extra calls, in the receipt we have the data and the function selector + the result of the function, which in this case is the responseCode + tokenAddress. |
Thanks @konstantinabl good idea. |
Description
Problem:
When creating an HTS token using the interface
IHederaTokenService
, a developer can't get the token address using Ethers JS.Context:
IHederaTokenService
(see file here) has the functioncreateNonFungibleToken
whichreturns (int64 responseCode, address tokenAddress);
createNonFungibleToken
.-- Decomposing the transaction output does not return the responseCode or the tokenAddress. I think this works when creating the token through a wrapper/intermediary contract, but it doesn’t seem to work when calling the system contract using the interface…
-- The logs of the tx receipt are empty and there are no events.
For devs working with Ethers/Hardhat, those tools only return a transaction hash (no tx ID).
The mirror node REST API supports querying transactions with our 48-byte form of the tx hash, not the Ethereum 32-bytes one. So querying mirror nodes with the tx hashed obtained would not be seamless either.
Possible Solution:
Thanks to everyone who provided feedback and input!
Steps to reproduce
npx hardhat test
on the terminalAdditional context
No response
Hedera network
mainnet, testnet
Version
v0.52
Operating system
macOS
The text was updated successfully, but these errors were encountered: