In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to realize C++ intelligent contract". The editor shows you the operation process through an actual case, and the operation method is simple, fast and practical. I hope this article "how to realize C++ Intelligent contract" can help you solve the problem.
A Ricardian Contracts is a digital document that defines the terms and conditions for interaction between two or more parties.
In the 1990s, Ian Grigg learned to digitize assets after looking for friends with a vision of creating digital cash. Ian Grigg sees the need to digitize bonds and tries to issue the same bonds on the internet because they are also financial assets and the world is starting to create businesses over the internet. In the process of trying to solve the problem, Ian Grigg developed the Ricardo contract.
# what is the difference between the Ricardian contract and our smart contract today?
The intelligent contract is a set of machine-readable instructions, while the Ricardian contract is a document that specifies the instruction intention followed by the intelligent contract.
The smart contract looks like this:
`# include class simpletoken: public eosio::contract {public: simpletoken (account_name self): contract (self), _ accounts (_ self, _ self) {} void transfer (account_name from, account_name to, uint64_t quantity) {require_auth (from); const auto& fromacnt = _ accounts.get (from); eosio_assert (fromacnt.balance > = quantity, "overdrawn balance") _ accounts.modify (fromacnt, from, [&] (auto& a) {a.balance-= quantity;}); add_balance (from, to, quantity);} void issue (account_name to, uint64_t quantity) {require_auth (_ self); add_balance (_ self, to, quantity);} private: struct account {account_name owner Uint64_t balance; uint64_t primary_key () const {return owner;}}; eosio::multi_index _ accounts; void add_balance (account_name payer, account_name to, uint64_t Q) {auto toitr = _ accounts.find (to) If (toitr = = _ accounts.end ()) {_ accounts.emplace (payer, [&] (auto& a) {a.owner = to; a.balance = Q;});} else {_ accounts.modify (toitr, 0, [&] (auto& a) {a.balance + = Q Eosio_assert (a.balance > = Q, "overflow detected");});}; EOSIO_ABI (simpletoken, (transfer) (issue)) `
The above example shows a C++ smart contract designed to release a new token.
Although the Ricardian contract looks like this:
TOKENNAME = XYZINFLATION = 5%INITIALISSUE = 1000000000The Community hereby creates a currency known as {{TOKENNAME}}, possession of which is evidence of a contribution to the community. The quantity of {{TOKENNAME}} shall increase no more than INFLATION per year after the first {{INITIALISSUE}} of {{TOKENNAME}} are distributed.
The front part of the Ricardian contract looks like an ordinary software contract.
Use tick marks to specify conditions and click buttons to agree to the specified conditions and the entire contract.
Are they safe?
Yes, the Ricardian contract is extremely secure because of the encrypted signature. Each Ricardian contract document can be uniquely identified by its hash. It is difficult to edit a document, and once all parties agree and sign it with a private key, it becomes immutable.
How does it work with smart contracts?
I found a self-evident image on iang.org:
Remember: Ricardian contracts are first human-readable and then machine-readable.
Visual representation of Ricardo's contract:
Visual representation of open bazaar contract model:
Who enforces it on the network?
Constitution and arbitrator on the EOS network!
I hope it will help you better understand the Ricardian contract. Thank you for reading.
Why does the world need EOS contracts?
@ iang explains this very well in one of his articles. Suppose we have a contract to transfer some token in exchange for $100.
This is a smart contract:
{Alice,Bob,100,dollarsvalue,token}
The dollar may be Singapore dollars or Hong Kong dollars. How does the computer know that the specified dollar is US dollars and how does the reader of the contract know that the above dollar is US dollars?
In order to clarify the intention of the smart contract, a detailed Ricardo contract is needed. Like the EOS network, stakeholders agree to the Constitution and are likely to go through arbitration proceedings if they take action against others. The Ricardian contract helps arbitrators and members to accept the trial of contractual intent. Remember: not everyone is a technician.
That's all for the content of "how to realize C++ Smart contract". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.