A smart contract is simply code. The code is neither savvy, nor is it an agreement in the customary sense. In any case, we call it savvy since it executes itself under specific conditions, and it could be viewed as an agreement in that it upholds understandings between parties.
PC researcher Nick Szabo can be credited with the thought, which he proposed in the late 1990s. He utilized the case of a candy machine to clarify the idea, expressing that it could be seen as a forerunner to the cutting edge smart contract. On account of a candy machine, there is a straightforward agreement being executed. Clients embed coins, and consequently, the machine administers a result based on their personal preference.
A smart contract applies this sort of rationale in a computerized setting. You could indicate something basic in the code like return “Hi, World!” when two ether is sent to this agreement.
In Ethereum, the designer would code this with the goal that it can later be perused by the EVM. They at that point distribute it by sending it to an uncommon location that enrolls the agreement. By then, anybody can utilize it. Also, the agreement can’t be erased, except if a condition is determined by the engineer when composing it.
Presently, the agreement has a location. To connect with it, clients simply need to send 2 ETH to that address. This will trigger the contract’s code – all the PCs on the system will run it, see that the installment has been made to the agreement, and record its yield (“Hello, World!”).
The above is maybe one of the most fundamental instances of what should be possible with Ethereum. Increasingly modern applications that associate numerous contracts can – and have – been constructed.