Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop hello world through Ethernet Square Wallet with Solidity language

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

The main content of this article is to explain "how to use Solidity language to develop hello world through Ethernet Square Wallet", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to develop hello world through Ethernet Square Wallet in Solidity language".

Use ethersquare wallet to develop and implement the classic HelloWord intelligent contract class.

Solidity's contract syntax is actually very similar to classes in object-oriented programming languages. Smart contracts have functions that we can call and variables that we can store and read.

Our Counter contract will store the number of times it is called, making this value available to everyone to read from the blockchain.

Pragma solidity ^ 0.4.11; contract Counter {/ * define variable count of the type uint * / uint count = 0; / * this runs when the contract is executed * / function increment () public {count = count + 1;} / * used to read the value of count * / function getCount () constant returns (uint) {return count;}}

1. First of all, to publish our smart contract to the blockchain, open the ethernet square wallet Ethereum Wallet, and click the "smart contract" contracts.

two。 Then click deploy a new contract Deploy a new contract.

3. Fill in our Counter contract code in the code text editing area of Ethernet Square Wallet.

4. Select the contract you want to deploy on the right side of the ethersquare wallet: our Counter smart contract.

5. Enter your password and press "send transaction" Send transaction. The gas price is the amount required to publish your contract to the blockchain. Another article discusses how to calculate the smart contract gas.

You can see that the counter value is equal to 0. On the blockchain, it doesn't cost anything to read a value, which is why you can see the value shown here.

Now, if you execute our value-added function, guess what happens? Our counter value is equal to 1. This may take some time, because when a block is mined, the execution of the code must be written in the block chain.

If you execute the increment function again, you will see a change in the counter value!

In this way, you developed and deployed your first Ethernet Square smart contract through Ethernet Square Wallet, and interacted with each other.

At this point, I believe that everyone has a deeper understanding of "how to develop hello world through Ethernet Square Wallet with Solidity language". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report