Delete a smart contract | Hedera (2024)

A transaction that deletes a smart contract from a Hedera network. Once a smart contract is marked deleted, you will not be able to modify any of the contract's properties. **** If a smart contract did not have an admin key defined, you cannot delete the smart contract. You can verify the smart contract was deleted by submitting a smart contract info query to the network. If a smart contract has an associated hbar balance, you will need to transfer the balance to another Hedera account.

Transaction Signing Requirements

Transaction Fees

Methods

MethodTypeDescriptionRequirement

setContractId(<contractId>)

Sets the contract ID (x.z.y) which should be deleted.

Required

setTransferAccountId(<transferAccountId>)

Sets the account ID (x.z.y) which will receive all remaining hbars

Optional

setTransferContractId(<contractId>)

Sets the contract ID (x.z.y) which will receive all remaining hbars.

Optional

//Create the transactionContractDeleteTransaction transaction = new ContractDeleteTransaction() .setContractId(contractId);//Freeze the transaction for signing, sign with the admin key on the contract, sign with the client operator private key and submit to a Hedera networkTransactionResponse txResponse = transaction.freezeWith(client).sign(adminKey).execute(client);//Get the receipt of the transactionTransactionReceipt receipt = txResponse.getReceipt(client);//Get the transaction consensus statusStatus transactionStatus = receipt.status;System.out.println("The transaction consensus status is " +transactionStatus);//v2.0.0
//Create the transactionconst transaction = await new ContractDeleteTransaction() .setContractId(contractId) .freezeWith(client);//Sign with the admin key on the contractconst signTx = await transaction.sign(adminKey)//Sign the transaction with the client operator's private key and submit to a Hedera networkconst txResponse = await signTx.execute(client);//Get the receipt of the transactionconst receipt = await txResponse.getReceipt(client);//Get the transaction consensus statusconst transactionStatus = receipt.status;console.log("The transaction consensus status is " +transactionStatus);//v2.0.5
//Create and freeze the transactiontransaction := hedera.NewContractDeleteTransaction(). SetContractID(contractID) FreezeWith(client)//Sign with the admin key on the contract, sign with the client operator private key and submit to a Hedera networktxResponse. err := transaction.Sign(adminKey).Execute(client)if err != nil {panic(err)}//Get the receipt of the transactionreceipt, err := txResponse.GetReceipt(client)if err != nil {panic(err)}//Get the transaction consensus statustransactionStatus := receipt.Statusfmt.Printf("The transaction consensus status %v\n", transactionStatus)//v2.0.0

Last updated

Delete a smart contract | Hedera (2024)

FAQs

Is it possible to delete a smart contract? ›

A transaction that deletes a smart contract from a Hedera network. Once a smart contract is marked deleted, you will not be able to modify any of the contract's properties. **** If a smart contract did not have an admin key defined, you cannot delete the smart contract.

How to terminate a smart contract? ›

In the legal sense, only the legal contract can be terminated. A smart contract cannot be considered void; it is not subject to avoidance for mistake or the consumer right of withdrawal because it is not a contract.

How do I cancel my smart contract? ›

Here are the usual steps taken when revoking smart contracts on the Ethereum mainnet:
  1. Step 1: Revoke access tools. Users can track and revoke smart contracts connected to their addresses using several third-party revoke access tools. ...
  2. Step 2: Connect the wallet. ...
  3. Step 3: Select smart contract. ...
  4. Step 4: Revoke access.
Jan 27, 2024

Can you destroy a smart contract? ›

Smart contracts are immutable, meaning the contract cannot be changed once deployed. So, if a bug or security flaw is found on the smart contract after deployment, it can not be fixed. Destroying the smart contract is the only viable option in this case.

Can smart contracts be reversed? ›

Can Smart Contracts Be Reversed? Smart contracts, as programs, are irreversible once executed unless they have been programmed otherwise.

Can you withdraw from a smart contract? ›

Add a Withdraw Function

This function will send all funds stored in the Smart Contract to the person who calls the "withdrawMoney()" function.

Can a smart contract be terminated? ›

Termination of smart contracts is one of the legal possibilities that can be used by its participants, if necessary; however, it is currently not available in all situations, unlike the traditional contractual format.

How do I terminate a contract immediately? ›

The best way to end a contract early is to speak with the party you're in contract with. Simple negotiation is often all it takes to reach a favorable resolution. If they don't agree to ending the contract early, consider getting a lawyer to help you determine your next best step.

Are smart contracts reversible? ›

A smart contract is a self-executing program that automates the actions required in a blockchain transaction. Once completed, the transactions are trackable and irreversible.

How long do smart contracts last? ›

Yes, the smart contract already deployed, unless destroyed using 'selfdestruct', will stay forever on the blockchain. It's by design. Every time you interact with the blockchain your nonce (number only used once) attached to your wallet increases.

Can I edit smart contract? ›

Smart contracts are immutable, meaning that once they are deployed on the blockchain, they cannot be changed or deleted.

How do I cancel a contract without penalty? ›

To cancel a contract without penalty, you need to send a written cancellation notice to the other party within a certain notification period. If the other entity refuses to honor the cancellation notice, you can take them to court or the governing authority.

Can you burn a smart contract? ›

The NFT's smart contract can also allow another entity to initiate the burning of an NFT. An NFT is “burned” when it becomes disabled from individual ownership.

Can smart contracts be broken? ›

Because smart contracts operate on the blockchain, they offer the benefits of a blockchain-based system. For example, transactions between parties in a contract can be monitored on the blockchain, promoting transparency. Smart contracts are immutable, which means they cannot be modified.

Are smart contracts legally enforceable? ›

"Smart contracts are a type of contract, and therefore they're enforced like all contracts in state and federal court systems," Marcushamer says. "However, with smart contracts, it's unlikely that enforcement will be needed because they automatically execute." But what happens if someone breaks a smart contract?

Are smart contracts permanent? ›

Immutability – When a smart contract is written and executed, it cannot be changed, and thus is permanent. Since computers running the blockchain, known as nodes, store an identical copy of the contract, any change to the contract is impossible without consensus on the network.

Is it possible to change a smart contract? ›

Smart contracts are immutable, meaning that once they are deployed on the blockchain, they cannot be changed or deleted. This ensures that they are tamper-proof and reliable, but also limits their flexibility and adaptability.

Top Articles
Basketball Nutrition, What to Eat, Coach's Clipboard Basketball
Handling Counterfeit Currency
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5886

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.