# Solidity Fundamentals

**Level: Beginner**\
**Module Title:** *Build Your First Smart Contract with Solidity*

**🧠 What You’ll Learn:**

* The role of Solidity in Ethereum development
* Solidity syntax and data types
* Writing and understanding a basic smart contract
* Deploying a contract using Remix IDE

**📘 Lesson 1: What is Solidity?**

Solidity is the main programming language for writing smart contracts on Ethereum. It’s statically typed, supports inheritance, libraries, and complex custom types. Inspired by JavaScript and C++, Solidity allows you to encode logic that executes directly on the blockchain.

Use cases:

* Token creation (ERC-20, ERC-721)
* Decentralized applications (dApps)
* Voting systems
* Escrow and automated payments

<br>

**📘 Lesson 2: Writing Your First Contract**

```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract HelloWorld {
    string public message = "Hello, Ethereum!";
}

```

**Explanation:**

* `pragma`: Compiler version
* `contract`: Smart contract declaration
* `string public`: A readable string stored on-chain<br>

**📘 Lesson 3: Understanding Variables & Functions**

```
uint public count;

function increment() public {
    count += 1;
}
```

* `uint`: Unsigned integer
* `public`: Accessible externally
* `function`: Defines callable logic

**📘 Lesson 4: Deploying with Remix IDE**

1. Visit Remix
2. Create a new `.sol` file
3. Paste your Solidity code
4. Compile with the Solidity Compiler plugin
5. Deploy using JavaScript VM or Injected Web3 (MetaMask)
6. Interact with your contract using Remix's UI


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://decanectcoin.gitbook.io/decanect/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
