You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a great fit for contributors who are ready to own a solution end-to-end.
Intermediate Issues involve exploring existing patterns, reasoning about trade-offs, and choosing an implementation approach with confidence. You'll navigate multiple related files and explain your decisions in review — the implementation details are yours to work out.
Important
Prerequisite: You must have completed at least 3 Beginner Issues in this repository before being assigned. The /assign bot enforces this automatically.
👾 Description of the Task
The Hiero C++ SDK TCK server does not yet implement the contractInfoQuery JSON-RPC method. This method is required by the TCK test suite to verify that the SDK can correctly retrieve full metadata about a deployed smart contract — including its admin key, staking info, expiration time, memo, and other properties.
This is the most field-rich of the contract query endpoints. The response must map all ContractInfo member fields to their expected JSON keys as defined by the TCK test suite.
The TCK server exposes a JSON-RPC interface that maps incoming method calls to SDK transactions and queries. The contract service scaffolding (ContractService.h, ContractService.cc) either already exists (from the createContract issue) or needs to be created following the same pattern as AccountService.
Follow the query pattern established in AccountService::getAccountInfo — it is the closest existing parallel, since getAccountInfo also returns a rich info object with nested staking info, keys, and optional fields.
The main implementation challenge is correctly mapping all ContractInfo fields to their expected JSON keys. Investigate:
How mAdminKey (a std::shared_ptr<Key>) should be serialized to a string
How mStakingInfo should be serialized (it is a nested struct)
Which fields are optional and how to handle their absence in the response
How mContractAccountId (EVM address) should be formatted
Review the TCK test file to understand exactly which response keys are asserted and in what format before writing the JSON construction.
If ContractService.h and ContractService.cc do not yet exist, create them first following the pattern of AccountService.h and AccountService.cc, and ensure ContractService.cc is listed in src/tck/CMakeLists.txt.
👩💻 Implementation Steps
Check whether src/tck/include/contract/ContractService.h and src/tck/src/contract/ContractService.cc already exist
If not, create them following the pattern of AccountService.h and AccountService.cc, and add src/contract/ContractService.cc to src/tck/CMakeLists.txt
Read src/sdk/main/include/ContractInfo.h to understand all member fields and their types
Read src/tck/src/account/AccountService.cc (getAccountInfo) to understand how complex info objects are mapped to JSON responses in the TCK
Review the TCK test file (src/tests/contract-service/test-contract-info-query.ts in the hiero-sdk-tck repo) to confirm the exact expected JSON response keys and value formats
Create src/tck/include/contract/params/ContractInfoQueryParams.h with the following optional fields:
🛠️ Intermediate Issue
This issue is a great fit for contributors who are ready to own a solution end-to-end.
Intermediate Issues involve exploring existing patterns, reasoning about trade-offs, and choosing an implementation approach with confidence. You'll navigate multiple related files and explain your decisions in review — the implementation details are yours to work out.
Important
Prerequisite: You must have completed at least 3 Beginner Issues in this repository before being assigned. The
/assignbot enforces this automatically.👾 Description of the Task
The Hiero C++ SDK TCK server does not yet implement the
contractInfoQueryJSON-RPC method. This method is required by the TCK test suite to verify that the SDK can correctly retrieve full metadata about a deployed smart contract — including its admin key, staking info, expiration time, memo, and other properties.This is the most field-rich of the contract query endpoints. The response must map all
ContractInfomember fields to their expected JSON keys as defined by the TCK test suite.The TCK server exposes a JSON-RPC interface that maps incoming method calls to SDK transactions and queries. The contract service scaffolding (
ContractService.h,ContractService.cc) either already exists (from thecreateContractissue) or needs to be created following the same pattern asAccountService.Relevant files to create:
Relevant files to modify:
Reference SDK classes:
💡 Proposed Approach
Follow the query pattern established in
AccountService::getAccountInfo— it is the closest existing parallel, sincegetAccountInfoalso returns a rich info object with nested staking info, keys, and optional fields.The main implementation challenge is correctly mapping all
ContractInfofields to their expected JSON keys. Investigate:mAdminKey(astd::shared_ptr<Key>) should be serialized to a stringmStakingInfoshould be serialized (it is a nested struct)mContractAccountId(EVM address) should be formattedReview the TCK test file to understand exactly which response keys are asserted and in what format before writing the JSON construction.
If
ContractService.handContractService.ccdo not yet exist, create them first following the pattern ofAccountService.handAccountService.cc, and ensureContractService.ccis listed insrc/tck/CMakeLists.txt.👩💻 Implementation Steps
src/tck/include/contract/ContractService.handsrc/tck/src/contract/ContractService.ccalready existAccountService.handAccountService.cc, and addsrc/contract/ContractService.cctosrc/tck/CMakeLists.txtsrc/sdk/main/include/ContractInfo.hto understand all member fields and their typessrc/tck/src/account/AccountService.cc(getAccountInfo) to understand how complex info objects are mapped to JSON responses in the TCKsrc/tests/contract-service/test-contract-info-query.tsin the hiero-sdk-tck repo) to confirm the exact expected JSON response keys and value formatssrc/tck/include/contract/params/ContractInfoQueryParams.hwith the following optional fields:mContractId(std::optional<std::string>) — JSON key"contractId"mMaxQueryPayment(std::optional<std::string>) — JSON key"maxQueryPayment"(tinybars as string)mQueryPayment(std::optional<std::string>) — JSON key"queryPayment"(tinybars as string)contractInfoQuerydeclaration tosrc/tck/include/contract/ContractService.hcontractInfoQueryinsrc/tck/src/contract/ContractService.cc:ContractInfoQuerysetGrpcDeadline(SdkClient::DEFAULT_TCK_REQUEST_TIMEOUT)mContractId,mMaxQueryPayment,mQueryPaymentif presentContractInfo info = query.execute(SdkClient::getClient())ContractInfofields:contractId,accountId,contractAccountId(EVM address)adminKey(investigate correct serialization for optional shared_ptr)expirationTime,autoRenewPeriod,autoRenewAccountIdstorage,memo,balance,isDeletedmaxAutomaticTokenAssociations,ledgerIdstakingInfoas a nested JSON objectaddMethodcall, and explicit template instantiation forContractInfoQueryParamstosrc/tck/src/TckServer.cccmake --preset linux-x64-debug && cmake --build --preset linux-x64-debug✔️ Acceptance Criteria
ContractInfoQueryParams.his created following the established params patterncontractInfoQueryis declared inContractService.hand implemented inContractService.cccontractInfoQueryis registered inTckServer.ccwith its explicit template instantiationContractInfofields are correctly mapped to their expected JSON keys and formatsadminKey,autoRenewAccountId) are omitted from the response when not present📋 Step-by-Step Contribution Guide
/assignto request the issueREADME.md-s -SRead Workflow Guide for step-by-step workflow guidance. Read README.md for setup instructions.
❗ Pull requests cannot be merged without
Sandssigned commits. See the Signing Guide.🤔 Additional Information
src/tck/src/account/AccountService.cc(getAccountInfo) — closely analogoussrc/tests/contract-service/test-contract-info-query.tssrc/sdk/main/include/ContractInfoQuery.hsrc/sdk/main/include/ContractInfo.hIf you have questions while working on this issue, feel free to ask! Hiero-SDK-C++ Discord