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

[Core] Implement getTokenInfo on HTS to retrieve the treasury account and token info #108

Closed
acuarica opened this issue Nov 5, 2024 · 0 comments · Fixed by #128
Closed
Assignees
Labels
feature Enhancing an existing feature driven by business requirements. Typically backwards compatible.

Comments

@acuarica
Copy link
Contributor

acuarica commented Nov 5, 2024

HTS allows the user to set up a treasury account which acts as the receiver when newly minted tokens are created. In order to support mint (and burn) operations1, we need to have access to the treasury account. The treasury account2 is retrievable through the getTokenInfo(address)3 as specified in HIP-514.

Implement the getTokenInfo(address) as part of HtsSystemContract. Provide the necessary slots to store the corresponding information per token, i.e., TokenInfo4

    struct TokenInfo {
        /// Basic properties of a Hedera Token
        HederaToken token;

        /// The number of tokens (fungible) or serials (non-fungible) of the token
        int64 totalSupply;

        /// Specifies whether the token is deleted or not
        bool deleted;

        /// Specifies whether the token kyc was defaulted with KycNotApplicable (true) or Revoked (false)
        bool defaultKycStatus;

        /// Specifies whether the token is currently paused or not
        bool pauseStatus;

        /// The fixed fees collected when transferring the token
        FixedFee[] fixedFees;

        /// The fractional fees collected when transferring the token
        FractionalFee[] fractionalFees;

        /// The royalty fees collected when transferring the token
        RoyaltyFee[] royaltyFees;

        /// The ID of the network ledger
        string ledgerId;
    }

Footnotes

  1. https://github.com/hashgraph/hedera-forking/issues/78

  2. IHederaTokenService.sol#L148 treasury

  3. IHederaTokenService.sol#L668-L674 getTokenInfo

  4. IHederaTokenService.sol#L173-L200 TokenInfo

@acuarica acuarica added the feature Enhancing an existing feature driven by business requirements. Typically backwards compatible. label Nov 5, 2024
@acuarica acuarica moved this from Backlog to Sprint Backlog in Smart Contract Sprint Board Nov 5, 2024
@victor-yanev victor-yanev self-assigned this Nov 6, 2024
@victor-yanev victor-yanev moved this from Sprint Backlog to Tasks In Progress in Smart Contract Sprint Board Nov 6, 2024
@acuarica acuarica changed the title Implement getTokenInfo on HTS to retrieve the treasury account and token info [Core] Implement getTokenInfo on HTS to retrieve the treasury account and token info Nov 12, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Smart Contract Sprint Board Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Enhancing an existing feature driven by business requirements. Typically backwards compatible.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants