Web3.0 — #3 Smart contracts

Search for a command to run...

No comments yet. Be the first to comment.
Bun, the hyper-fast JavaScript runtime known for its incredible speed and Zig-based architecture, is being completely rewritten in Rust. For a project that has over 22 million monthly downloads and ea

Next.js 16.3 is almost here, and it's packed with a ton of improvements and let's see them in this post 1.Instant Navigation For a while now, there’s been a valid, lingering debateServer Components vs

It’s official. React has merged its long-awaited Rust port of the React Compiler (formerly known as React Forget) into the main repository. What started as an experimental research project by Joseph S

If you follow modern technology trends, you have likely been led to believe that artificial intelligence is entirely built on Python. Every tutorial, machine learning framework documentation, and open

Just when the JavaScript ecosystem was catching its breath after last week’s TanStack Router compromise, the Mini Shai-Hulud supply chain worm has continued its relentless march. Developed by the thre

Cover Image
If you don’t have time to read but want to know what’s there in this post. Find the quick read 👇

Smart contracts are digital contracts stored on a blockchain that are automatically executed when predetermined terms and conditions are met
In this post, we are going to look at the following about Smartcontracts
What are Smartcontracts
How Smartcontracts works
Benefits of Smartcontracts
Limitations of Smartcontracts
Smartcontracts Languages
A smart contract is a computer program compiled from code that can control events and actions according to the terms set within the contract’s code. Smartcontracts typically are used to automate the execution of an agreement so that all participants can be immediately certain of the outcome, without any intermediary’s involvement or time loss. They can also automate a workflow, triggering the next action when conditions are met.
Much like vending machines, we can program smart contracts with various functions. Vending machines allow consumers to insert a currency and then press a button to execute that transaction. A refreshing soda or a candybar is dispensed, and any leftover change that the consumer is owed is dispensed as well.
Smart contracts can be programmed to accept payment and can return an item in place of that payment. An example of this would be a “mint” button on a project’s website.

Simple “if/when…then” phrases that are typed into code and placed on a blockchain are how smart contracts operate. When predefined circumstances have been verified to have been met, a network of computers will carry out the actions. These can entail paying out money to the right people, registering a car, sending out notices, or writing a ticket. When the transaction is finished, the blockchain is then updated. As a result, the transaction cannot be modified, and only parties to whom permission has been granted can view the outcome.
As many conditions as are required to reassure the participants that the activity will be successfully accomplished can be included in a smart contract. Participants must agree on the “if/when…then” rules that govern those transactions, consider any potential exceptions, and design a framework for resolving disputes in order to set the terms. Participants must also decide how transactions and their data are represented on the blockchain.
A developer can then construct the smart contract, though more and more businesses using blockchain for business are using templates, web interfaces, and other online tools to make creating smart contracts easier.
Speed, efficiency and accuracy — Once a condition is met, the contract is executed immediately. Because smart contracts are digital and automated, there’s no paperwork to process and no time spent reconciling errors that often result from manually filling in documents.
Trust and transparency — Because there’s no third party involved, and because encrypted records of transactions are shared across participants, there’s no need to question whether information has been altered for personal benefit.
Security — Blockchain transaction records are encrypted, which makes them very hard to hack. Moreover, because each record is connected to the previous and subsequent records on a distributed ledger, hackers would have to alter the entire chain to change a single record.
Savings — Smart contracts remove the need for intermediaries to handle transactions and, by extension, their associated time delays and fees.
Smart contracts alone cannot get information about “real-world” events because they can’t send HTTP requests. This is by design. Relying on external information could jeopardise consensus, which is important for security and decentralization.

There are two types of active and Smartcontract languages
Solidity
Vyper
Object-oriented, high-level language for implementing smart contracts.
Curly-bracket language that has been most profoundly influenced by C++.
Statically typed (the type of a variable is known at compile time).
Solidity Supports
Inheritance (you can extend other contracts).
Libraries (you can create reusable code that you can call from different contracts — like static functions in a static class in other object oriented programming languages).
Complex user-defined types.
Pythonic programming language
Strong typing
Small and understandable compiler code
Efficient bytecode generation
Deliberately has less features than Solidity with the aim of making contracts more secure and easier to audit.
Vyper does not supports
Modifiers
Inheritance
Inline assembly
Function overloading
Operator overloading
Recursive calling
Infinite-length loops
Binary fixed points
In this post we have seen the basics of Smartcontracts, how smartcontracts works as well as it’s limitations.
Will catch up in a new post with more interesting crafts till then Happy Learning :)