Neo Documentation (2024)

Show / Hide Table of Contents

Smart contracts support to be updated or destroyed after release. Before you can do that you need to implement the Update and Destroy interfaces in the old contracts.

Contract Update

In some cases you want to upgrade the smart contracts deployed on the blockchain or migrate the storage of a contract into another new contract, you need to update smart contracts. Neither the contract hash nor the storage is changed when the contract is upgraded.

Implementing the Update interface

To enable the update function, you need to implement the Update method in the contract. In the contract template this method has been implemented by default, as follows:

public static bool Verify() => IsOwner();public static void Update(ByteString nefFile, string manifest){ if (!IsOwner()) throw new Exception("No authorization."); ContractManagement.Update(nefFile, manifest, null);}

If you want to update the contract later, you must implement the update method in the contract prior to deployment. For more information, refer to Deploying and Invoking Smart Contracts .

Updating the contract

  1. Get the compiled NEF file and Manifest file of the new contract ready

  2. Base64-encode the NEF file with the tool like File to Base64 online

  3. Compress and escape the Manifest file with the tool like JSON compressed and escaped online

  4. Use the invoke command to call the update method of the contract

For information about invoking the contract, refer to Invoking contracts .

Neo Documentation (1)

After the update method is executed, the contract is upgraded and neither the contract hash nor the storage area is changed.

Contract Destruction

To destroy a contract, you need to reserve the destruction method in the contract.

To use the contract destroy feature, you need to implement the destroy method in the original contract. The destroy method has been implemented by default in the contract template as follows.

public static bool Verify() => IsOwner();public static void Destroy(){ if (!IsOwner()) throw new Exception("No authorization."); ContractManagement.Destroy();}

The Destroy method takes no arguments. When it is invoked, the contract and its storage, if any, are deleted. Then the contract is no longer available.

Neo Documentation (2024)

FAQs

What is the unit of NEO? ›

The minimum unit of NEO is 1 and tokens cannot be subdivided. GAS is the fuel token for the realization of Neo network resource control, with a maximum total limit of 100 million.

What is the NEO blockchain? ›

The NEO project's blockchain is designed to digitize identities and assets and use smart contracts to track and transfer ownership—a smart economy. NEO originally described its smart economy system as: Digital Assets + Digital Identity + Smart Contract = Smart Economy.

Is NEO proof of stake? ›

Neo is based on the Proof of Stake protocol in combination with delegated Byzantine Fault Tolerance. NEO can be staked by anyone on the network to receive voting power for participation in the network governance that runs on the combination of PoS and dBFT protocols.

Who is the owner of NEO coin? ›

Neo was founded by Da Hongfei and Erik Zhang in 2014 under the name Antshares. The original source code was published to GitHub in July 2015 and the MainNet subsequently launched in October 2016. In 2017, Antshares was rebranded to Neo as it implemented Smart Contracts 2.0.

Top Articles
The pros and cons of a side hustle
Why candlesticks will remain a home decor essential in 2023 and beyond - AZ Big Media
Katie Pavlich Bikini Photos
Gamevault Agent
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
Walgreens Alma School And Dynamite
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
Rogold Extension
'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
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Sen. Ignacio Ratke

Last Updated:

Views: 6555

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Sen. Ignacio Ratke

Birthday: 1999-05-27

Address: Apt. 171 8116 Bailey Via, Roberthaven, GA 58289

Phone: +2585395768220

Job: Lead Liaison

Hobby: Lockpicking, LARPing, Lego building, Lapidary, Macrame, Book restoration, Bodybuilding

Introduction: My name is Sen. Ignacio Ratke, I am a adventurous, zealous, outstanding, agreeable, precious, excited, gifted person who loves writing and wants to share my knowledge and understanding with you.