Class CallContractParams
Represents the parameters required to call a smart contract on the Hedera network.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class CallContractParams : TransactionParams<TransactionReceipt>
Examples
Call a state-changing method on a deployed contract. The receipt confirms consensus but does not carry the return data — fetch it from the mirror node if you need it:
// Call a state-changing method. The receipt confirms consensus but
// does not carry the return data — fetch the CallContractRecord via
// the mirror node if you need the emitted logs/returns. Arguments in
// MethodArgs are ABI-encoded automatically from CLR types (string,
// long, byte[], etc.).
var receipt = await client.CallContractAsync(new CallContractParams
{
Contract = contract,
Gas = 100_000,
MethodName = "setMessage",
MethodArgs = new object[] { "hello world" }
});
Console.WriteLine($"Call status: {receipt.Status}");
Properties
| Edit this page View SourceCancellationToken
Optional Cancellation token that can interrupt the contract call.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
Contract
The address of the contract to call.
Declaration
public EntityId Contract { get; set; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Gas
The amount of gas that is allowed for the call.
Declaration
public long Gas { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
MethodArgs
The arguments to send with the method call.
Declaration
public object[] MethodArgs { get; set; }
Property Value
| Type | Description |
|---|---|
| object[] |
MethodName
Name of the contract function to call.
Declaration
public string MethodName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
PayableAmount
For payable function calls, the amount of tinybars to send to the contract.
Declaration
public long PayableAmount { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
Signatory
Additional private key, keys or signing callback method required to invoke this contract. Typically not used however there are some edge cases where it may send crypto to accounts that require a signature to receive funds.
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.