Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk.proto
Interface SmartContractServiceGrpc.AsyncService
- All Known Implementing Classes:
SmartContractServiceGrpc.SmartContractServiceImplBase
- Enclosing class:
SmartContractServiceGrpc
public static interface SmartContractServiceGrpc.AsyncService
The Hedera Smart Contract Service (HSCS) provides an interface to an EVM compatible environment to create, store, manage, and execute smart contract calls. Smart Contracts implement useful and often highly complex interactions between individuals, systems, and the distributed ledger.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcallEthereum(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Make an Ethereum transaction "call" with all data in Ethereum formats, including the contract alias.default voidcontractCallLocalMethod(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Call a query function of a given smart contract, providing function parameter inputs as needed.<br/> This is performed locally on the particular node that the client is communicating with.default voidcontractCallMethod(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Call a function of a given smart contract, providing function parameter inputs as needed.default voidcontractGetBytecode(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) A standard query to read the current bytecode for a smart contract.default voidcreateContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Create a new smart contract.default voiddeleteContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Delete a smart contract, and transfer any remaining HBAR balance to a designated account.default voidgetBySolidityID(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Deprecated.default voidgetContractInfo(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) A standard query to obtain detailed information for a smart contract.default voidgetTxRecordByContractID(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Deprecated.default voidhookStore(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Update zero or more slots of an EVM hook's storage.default voidsystemDelete(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Deprecated.default voidsystemUndelete(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Deprecated.default voidupdateContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Modify a smart contract.<br/> Any change other than updating the expiration time requires that the contract be modifiable (has a valid `adminKey`) and that the transaction be signed by the `adminKey` <p> Fields _not set_ on the request SHALL NOT be modified.
-
Method Details
-
createContract
default void createContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Create a new smart contract. <p> If this transaction succeeds, the `ContractID` for the new smart contract SHALL be set in the transaction receipt.<br/> The contract is defined by the initial bytecode (or `initcode`). The `initcode` SHALL be provided either in a previously created file, or in the transaction body itself for very small contracts.<br/> As part of contract creation, the constructor defined for the new smart contract SHALL run with the parameters provided in the `constructorParameters` field.<br/> The gas to "power" that constructor MUST be provided via the `gas` field, and SHALL be charged to the payer for this transaction.<br/> If the contract _constructor_ stores information, it is charged gas for that storage. There is a separate fee in HBAR to maintain that storage until the expiration, and that fee SHALL be added to this transaction as part of the _transaction fee_, rather than gas.
-
updateContract
default void updateContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Modify a smart contract.<br/> Any change other than updating the expiration time requires that the contract be modifiable (has a valid `adminKey`) and that the transaction be signed by the `adminKey` <p> Fields _not set_ on the request SHALL NOT be modified.
-
contractCallMethod
default void contractCallMethod(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Call a function of a given smart contract, providing function parameter inputs as needed. <p> Resource ("gas") charges SHALL include all relevant fees incurred by the contract execution, including any storage required.<br/> The total transaction fee SHALL incorporate all of the "gas" actually consumed as well as the standard fees for transaction handling, data transfers, signature verification, etc... -
contractCallLocalMethod
default void contractCallLocalMethod(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Call a query function of a given smart contract, providing function parameter inputs as needed.<br/> This is performed locally on the particular node that the client is communicating with. Executing the call locally is faster and less costly, but imposes certain restrictions. <p> The call MUST NOT change the state of the contract instance. This also precludes any expenditure or transfer of HBAR or other tokens.<br/> The call SHALL NOT have a separate consensus timestamp.<br/> The call SHALL NOT generate a record nor a receipt.<br/> The response SHALL contain the output returned by the function call.<br/> <p> This is generally useful for calling accessor functions which read (query) state without changes or side effects. Any contract call that would use the `STATICCALL` opcode MAY be called via contract call local with performance and cost benefits. <p> Unlike a ContractCall transaction, the node SHALL always consume the _entire_ amount of offered "gas" in determining the fee for this query, so accurate gas estimation is important.
-
getContractInfo
A standard query to obtain detailed information for a smart contract.
-
contractGetBytecode
default void contractGetBytecode(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) A standard query to read the current bytecode for a smart contract.
-
getBySolidityID
@Deprecated default void getBySolidityID(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Deprecated.A standard query to obtain account and contract identifiers for a smart contract, given the Solidity identifier for that contract.
-
getTxRecordByContractID
@Deprecated default void getTxRecordByContractID(Query request, io.grpc.stub.StreamObserver<Response> responseObserver) Deprecated.<blockquote>This query is no longer supported.</blockquote> This query always returned an empty record list.
-
deleteContract
default void deleteContract(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Delete a smart contract, and transfer any remaining HBAR balance to a designated account. <p> If this call succeeds then all subsequent calls to that smart contract SHALL fail.<br/>
-
systemDelete
@Deprecated default void systemDelete(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Deprecated.Delete a smart contract, as a system-initiated deletion, this SHALL NOT transfer balances. <blockquote> This call is an administrative function of the Hedera network, and SHALL require network administration authorization.<br/> This transaction MUST be signed by one of the network administration accounts (typically `0.0.2` through `0.0.59`, as defined in the `api-permission.properties` file). </blockquote> If this call succeeds then all subsequent calls to that smart contract SHALL fail.<br/>
-
systemUndelete
@Deprecated default void systemUndelete(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Deprecated.Un-Delete a smart contract, returning it (mostly) to its state prior to deletion. <p> The contract to be restored MUST have been deleted via `systemDelete`. If the contract was deleted via `deleteContract`, it SHALL NOT be recoverable. <blockquote> This call is an administrative function of the Hedera network, and SHALL require network administration authorization.<br/> This transaction MUST be signed by one of the network administration accounts (typically `0.0.2` through `0.0.59`, as defined in the `api-permission.properties` file). </blockquote> If this call succeeds then subsequent calls to that smart contract MAY succeed.<br/>
-
callEthereum
default void callEthereum(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Make an Ethereum transaction "call" with all data in Ethereum formats, including the contract alias. <p> Call data MAY be in the transaction, or stored within a "File".<br/> The caller MAY offer additional gas above what is offered in the call data, but MAY be charged up to 80% of that value if the amount required is less than this "floor" amount.
-
hookStore
default void hookStore(Transaction request, io.grpc.stub.StreamObserver<TransactionResponse> responseObserver) Update zero or more slots of an EVM hook's storage.
-