How Smart Contracts works in DApps | 10% for @tron-fan-club

in Tron Fan Club2 years ago

Smart contracts (SCs) are basically designed to facilitate, verify and enforce the negotiation or performance of a contract without the need for intermediaries. Thats why it is an important feature of DApps. SCs are a key component of decentralized applications (DApps) that run on blockchain technology. These contracts are self-executing computer programs that automatically execute the terms of a contract when specific conditions are met. SCs are written in code in DApps. These codes are stored on the blockchain network which will help them to be secured. The contract code contains a set of rules and conditions that must be met before the contract can be executed. These conditions are usually specified by the parties involved in the contract and are programmed into the contract code.

istockphoto-1195696110-170667a.jpg
source

When conditions mentioned in the contract are met the contract automatically executes and the parties involved in the contract receive their agreed-upon payments or assets. This automation is the main feature of SCs. These eliminates the need for intermediaries and ensures that the contract is executed according to the agreed-upon terms.

Let consider a decentralized ride-sharing application. If it is a DApp then smart contracts are used to facilitate transactions between drivers and passengers. When a passenger requests a ride, a smart contract is created that specifies the details of the ride, such as the pickup location, destination, and fare. The smart contract is then stored on the blockchain network and is visible to all parties involved in the transaction. Once a driver accepts the ride request, the smart contract is automatically executed. And finally the fare is deducted from the passenger's digital wallet and transferred to the driver's digital wallet. The smart contract also records the transaction on the blockchain. So its transparent and immutable record of the transaction.

Smart contracts can enforce rules and regulations within a DApp like in a decentralized e-commerce platform a smart contract can be created that specifies the conditions under which a buyer can receive a refund. If the buyer is not satisfied with the product and wants a refund they can initiate the refund process through the DApp. The smart contract will then automatically execute and verify whether the conditions for a refund have been met. The refund will be automatically processed when the conditions are met. Finally the buyer's digital wallet will be credited with the refund amount.

Smart contracts can solve many disputes in our day to day life including complex financial transactions, two party settlement, partnership business, government service etc. SCs can help to eliminate the need for intermediaries and streamline the transaction process.
a challenge for DApps that rely on external data sources, such as financial data or weather infor

Coin Marketplace

STEEM 0.19
TRX 0.18
JST 0.032
BTC 88139.36
ETH 3066.37
USDT 1.00
SBD 2.76