java.lang.Object
com.hedera.hashgraph.sdk.Executable<ContractDeleteTransaction,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<ContractDeleteTransaction>
com.hedera.hashgraph.sdk.ContractDeleteTransaction
Delete a smart contract, and transfer any remaining HBAR balance to a
designated account.
If this call succeeds then all subsequent calls to that smart contract
SHALL execute the `0x0` opcode, as required for EVM equivalence.
### Requirements
- An account or smart contract MUST be designated to receive all remaining
account balances.
- The smart contract MUST have an admin key set. If the contract does not
have `admin_key` set, then this transaction SHALL fail and response code
`MODIFYING_IMMUTABLE_CONTRACT` SHALL be set.
- If `admin_key` is, or contains, an empty `KeyList` key, it SHALL be
treated the same as an admin key that is not set.
- The `Key` set for `admin_key` on the smart contract MUST have a valid
signature set on this transaction.
- The designated receiving account MAY have `receiver_sig_required` set. If
that field is set, the receiver account MUST also sign this transaction.
- The field `permanent_removal` MUST NOT be set. That field is reserved for
internal system use when purging the smart contract from state. Any user
transaction with that field set SHALL be rejected and a response code
`PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION` SHALL be set.
### Block Stream Effects
None
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) ContractDeleteTransactionBody.Builderbuild()Build the transaction body.Extract the contract id.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Extract the permanent removal flag.Extract the transfer account id.Extract the transfer contract id.(package private) voidInitialize from the transaction body.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.setContractId(ContractId contractId) Sets the contract ID which should be deleted.setPermanentRemoval(boolean permanentRemoval) Sets the permanent removal flag.setTransferAccountId(AccountId transferAccountId) Sets the account ID which will receive all remaining hbars.setTransferContractId(ContractId transferContractId) Sets the contract ID which will receive all remaining hbars.(package private) voidvalidateChecksums(Client client) Validates tha the contract id, transfer contract id and the transfer account id are valid.Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
ContractDeleteTransaction
public ContractDeleteTransaction()Constructor. -
ContractDeleteTransaction
ContractDeleteTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
ContractDeleteTransaction
ContractDeleteTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getContractId
Extract the contract id.- Returns:
- the contract id
-
setContractId
Sets the contract ID which should be deleted.- Parameters:
contractId- The ContractId to be set- Returns:
this
-
getTransferAccountId
Extract the transfer account id.- Returns:
- the account id that will receive the remaining hbars
-
setTransferAccountId
Sets the account ID which will receive all remaining hbars.This is mutually exclusive with
setTransferContractId(ContractId).- Parameters:
transferAccountId- The AccountId to be set- Returns:
this
-
getTransferContractId
Extract the transfer contract id.- Returns:
- the contract id that will receive the remaining hbars
-
setTransferContractId
Sets the contract ID which will receive all remaining hbars.This is mutually exclusive with
setTransferAccountId(AccountId).- Parameters:
transferContractId- The ContractId to be set- Returns:
this
-
getPermanentRemoval
Extract the permanent removal flag.- Returns:
- the permanent removal flag
-
setPermanentRemoval
Sets the permanent removal flag.This field is reserved for system use. User transactions setting this field may be rejected by the network with status
Status.PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION.- Parameters:
permanentRemoval- The permanent removal flag to be set- Returns:
this
-
validateChecksums
Validates tha the contract id, transfer contract id and the transfer account id are valid.- Specified by:
validateChecksumsin classTransaction<ContractDeleteTransaction>- Parameters:
client- the configured client- Throws:
BadEntityIdException- if entity ID is formatted poorly
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<ContractDeleteTransaction,Transaction, TransactionResponse, TransactionResponse>
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
build
Build the transaction body.- Returns:
ContractDeleteTransactionBody
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<ContractDeleteTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<ContractDeleteTransaction>
-