Share on Twitter
Share on Facebook
Share on Reddit
Share via Email
Share on LinkedIn
Share via RSS

NGD Seattle’s head of development, John deVadoss, and blockchain strategist, Peng Huang, recently co-authored an article on programming smart contracts in C# for the Microsoft Developer Network (MSDN).

The article is the second item of Neo content to be shared on MSDN. In October, deVadoss teamed up with Neo core developer and co-founder Erik Zhang to produce an article on blockchain consensus and dBFT.

Programming Smart Contracts in C#

Primarily focused at traditional C# developers that are unfamiliar with blockchain, the article begins with an introduction to smart contracts:

“Smart contracts provide an execution environment for the economic and transactional logic that encompasses elements of a real-world contract, as well as execution of the terms of the contract. Running on massively scalable, decentralized and immutable blockchain platforms, they have the potential to reshape our economic institutions and the economic relationships and transactions that constitute these institutions.”

Huang and deVadoss go on to outline the history of smart contracts and their potential uses, before providing a simple Hello World contract example. The basic contract structure is discussed alongside details on how data is stored and retrieved on the Neo blockchain.

Further, details are provided on an example real-world application; a simple DNS registration service. This contract can be used to register, query, or delete domain names owned by certain users.

The DNS contract section also serves as an introduction to application and verification triggers, used by Neo to determine whether the contract will be executed as an invocation or to check the validity of a particular transaction.

In the remainder of the article, the reader is led through the process of creating and debugging a contract, running a Neo express instance, and deploying then invoking the contract. A more comprehensive version of this walkthrough, along with installation instructions, can be found in the quickstart guide.

The original article may be read at the following link:
https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/november/blockchain-programming-smart-contracts-in-csharp