Class ContractInfo
The information returned from the GetContractInfoAsync ConsensusClient method call.
It represents the details concerning a Hedera Network Contract instance, including
the EVM address used in smart contract interaction.
Implements
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed record ContractInfo : IEquatable<ContractInfo>
Properties
| Edit this page View SourceAccount
The ID of the Crypto Currency Address paired with this contract instance.
Declaration
public EntityId Account { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Administrator
An optional endorsement that can be used to modify the contract details.
If null, the contract is immutable.
Declaration
public Endorsement? Administrator { get; }
Property Value
| Type | Description |
|---|---|
| Endorsement |
AutoAssociationLimit
The maximum number of tokens (fungible or NFT) that this contract may be automatically associated with, which happens when it receives a token it is not yet associated with. A value of -1 means no limit; 0 means every token must be associated explicitly.
Declaration
public int AutoAssociationLimit { get; }
Property Value
| Type | Description |
|---|---|
| int |
Balance
Contract's Address's Crypto Balance in Tinybars
Declaration
public ulong Balance { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
Contract
ID of the contract instance.
Declaration
public EntityId Contract { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Deleted
True
if this contract has been deleted.
Declaration
public bool Deleted { get; }
Property Value
| Type | Description |
|---|---|
| bool |
EvmAddress
The identity of both the contract ID and the associated crypto currency Hedera Address in a form to be used with smart contracts.
Declaration
public EvmAddress EvmAddress { get; }
Property Value
| Type | Description |
|---|---|
| EvmAddress |
Expiration
The consensus time at which this instance of the contract (and associated account) is set to expire.
Declaration
public ConsensusTimeStamp Expiration { get; }
Property Value
| Type | Description |
|---|---|
| ConsensusTimeStamp |
Ledger
Identification of the Ledger (Network) this contract information was retrieved from.
Declaration
public BigInteger Ledger { get; }
Property Value
| Type | Description |
|---|---|
| BigInteger |
Memo
The memo associated with the contract instance.
Declaration
public string Memo { get; }
Property Value
| Type | Description |
|---|---|
| string |
RenewAccount
Optional address of the account supporting the auto renewal of the contract at expiration time. The contract lifetime will be extended by the RenewPeriod at expiration time if this account contains sufficient funds. The private key associated with this account must sign the transaction if RenewAccount is specified.
Declaration
public EntityId? RenewAccount { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
RenewPeriod
Incremental period for auto-renewal of the contract and account. If account does not have sufficient funds to renew at the expiration time, it will be renewed for a period of time the remaining funds can support. If no funds remain, the contract instance and associated account will be deleted.
Declaration
public TimeSpan RenewPeriod { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Size
The number of bytes required to store this contract instance. This value impacts the cost of extending the expiration time.
Declaration
public long Size { get; }
Property Value
| Type | Description |
|---|---|
| long |
StakingInfo
Staking metadata information for the contract.
Declaration
public StakingInfo StakingInfo { get; }
Property Value
| Type | Description |
|---|---|
| StakingInfo |
Tokens
[DEPRECATED] Balances of tokens associated with this contract.
Declaration
[Obsolete("Deprecated by HIP-367: the network caps this list and does not report truncation, so it may be silently incomplete. Use MirrorRestClient.GetAccountTokenHoldingsAsync for a complete, paged result.")]
public IReadOnlyList<TokenBalance> Tokens { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<TokenBalance> |
Remarks
This list may be silently incomplete. HIP-367 removed the limit on how many tokens an account or contract may be associated with, so the network caps what it returns here and does not report that it has done so. A contract with few associations yields a correct list; one with many yields a truncated list and no error — which makes the shortfall easy to miss in testing and easy to hit in production.
For a complete result, query the Mirror Node instead: GetAccountTokenHoldingsAsync(MirrorRestClient, EntityId, CancellationToken, params IMirrorQueryParameter[]) pages through every holding, and GetAccountTokenBalanceAsync(MirrorRestClient, EntityId, EntityId, CancellationToken, params IMirrorQueryParameter[]) fetches one token's balance directly. Both accept this contract's EntityId.
This member is retained because the network still populates it and turning it off has been deferred repeatedly; removing it would break systems that depend on it today.