Class UpdateContractParams
Represents the properties on a contract that can be changed.
Any property set to
null
on this object when submitted to the UpdateContractAsync(ConsensusClient, UpdateContractParams, Action<IConsensusContext>?) method will be left unchanged by the system. The transaction must be appropriately signed as described by the original Administrator endorsement in order to make changes. If there is no administrator endorsement specified, the contract is immutable and cannot be changed.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class UpdateContractParams : TransactionParams<TransactionReceipt>
Examples
Update mutable contract properties (admin key, memo, renew period). Null properties are left unchanged; contracts created without an Administrator are immutable:
// Update mutable contract properties — admin key, memo, renew period,
// auto-association limit. Null properties are left unchanged.
// Contracts created without an Administrator are immutable.
var receipt = await client.UpdateContractAsync(new UpdateContractParams
{
Contract = contract,
Administrator = newAdmin,
Memo = "Rotated admin 2026-Q2"
});
Console.WriteLine($"Update status: {receipt.Status}");
Properties
| Edit this page View SourceAddHooks
Optional list of hooks to add to the contract.
Declaration
public IEnumerable<HookMetadata>? AddHooks { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<HookMetadata> |
Administrator
Replace this Contract's current administrative key signing requirements with new signing requirements.
Declaration
public Endorsement? Administrator { get; set; }
Property Value
| Type | Description |
|---|---|
| Endorsement |
Remarks
For this request to be accepted by the network, both the current private
key(s) for this account and the new private key(s) must sign the transaction.
The existing key must sign for security and the new key must sign as a
safeguard to avoid accidentally changing the key to an invalid value.
The Payer account must carry the old and new
private keys for signing to meet this requirement.
AutoAssociationLimit
If set, updates the maximum number of token or NFTs that this contract may be implicitly associated with (by means of being made a treasury or other related actions).
Declaration
public int? AutoAssociationLimit { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
CancellationToken
Optional Cancellation token that can interrupt the contract update.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
Contract
The network address of the contract to update.
Declaration
public EntityId Contract { get; set; }
Property Value
| Type | Description |
|---|---|
| EntityId |
DeclineStakeReward
If set, updates the flag indicating to the network that this contract does not wish to receive any earned staking rewards.
Declaration
public bool? DeclineStakeReward { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Memo
The memo to be associated with the contract. Maximum of 100 bytes.
Declaration
public string? Memo { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ProxyAccount
If set, updates this contract's staking proxy account. The funds of this contract will be staked to the node that this account is staked to and the specified account will receive the earned reward.
Declaration
public EntityId? ProxyAccount { get; set; }
Property Value
| Type | Description |
|---|---|
| EntityId |
RemoveHooks
Optional list of hook numeric identifiers to remove from the contract.
Declaration
public IEnumerable<long>? RemoveHooks { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<long> |
RenewAccount
If specified updates the 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. Setting the value to
EntityId.None
clears the renewal account.
Declaration
public EntityId? RenewAccount { get; set; }
Property Value
| Type | Description |
|---|---|
| EntityId |
RenewPeriod
Incremental period for auto-renewal of the contract 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 account will be deleted.
Declaration
public TimeSpan? RenewPeriod { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan? |
Signatory
Additional private key, keys or signing callback method required to update this contract. Typically matches the Administrator endorsement associated with this contract.
Declaration
public Signatory? Signatory { get; set; }
Property Value
| Type | Description |
|---|---|
| Signatory |
Remarks
Keys/callbacks added here will be combined with those already identified in the client object's context when signing this transaction to change the state of this account.
StakedNode
If set, updates this contract's staked node. The funds of this contract will be staked to the gossip node with the given ID.
Declaration
public long? StakedNode { get; set; }
Property Value
| Type | Description |
|---|---|
| long? |