Is it correct to say that even a Solidity code that doesn't contain any financial transactions to exchange digital assets or tokens and it only stores some information on the blockchain is a Smart Contract?

Regarding to this fact that the term of "Contract" usually refers to a mutual convention between two or more parties to determine the missions of every party. And if this contract is financial, usually an asset is exchanged between parties.

Am I wrong?


Like many other words, "contract" has multiple meanings.

A contract has historically tended to refer to something like the definition in your last paragraph.

In computer science, it is often used to talk about the promise that a piece of code makes to people trying to use it in other code. For example, see this discussion of "design by contract": https://en.m.wikipedia.org/wiki/Design_by_contract

"Smart" has taken on the meaning of something that has modern technology in it, or in practice something that can get hacked or explode.

Nick Szabo coined the term "Smart Contract" to talk about an agreement between people, enforced by a machine. He proposed that a vending machine was a kind of "smart contract". http://firstmonday.org/ojs/index.php/fm/article/view/548/469-publisher=First

Ethereum uses the term "contract" to refer to an independent computer program deployed to its blockchain, with a set piece of code, and a dedicated area of storage. Arguably this isn't a great term, and some people have suggested it should instead be called something like "agent". People also sometimes call this a "smart contract".

A single "contract" in Ethereum may be used to enforce a wide range of arrangements between people. A multisig contract may involve multiple signatures from keys that are all intended to be used by one person. A betting contract may handle a large number of different bets, each of which is arguably a human-to-human contract in its own right.

So yes, every bit of code deployed to the Ethereum is blockchain a smart contract in one sense, but this will not necessarily coincide with a smart contract in another sense, and that in turn may or may not coincide with a contract in the more traditional, quasi-legal sense of an agreement between humans.

One final twist: Because of the way Solidity inheritance works, you will sometimes have two hunks of code each entitled "contract", but they will only end up deploying one contract (defined as a piece of code with its own storage) to the blockchain.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.