# Smart Contracts

In very simple terms, a smart contract is a contract that is written in computer code and stored on a blockchain. When the conditions of the contract are met, the contract automatically executes the terms of the contract. This means that there is no need for a third party, such as a bank, to act as an intermediary to make sure that the contract is executed. They are usually automated so that all participants can be sure of the outcome of the contract.

{% tabs %}
{% tab title="Benefits of Smart Contracts" %}
\- The code cannot be changed once it has been deployed (tamperproof)

\- All parties can see the code and the transactions that have been executed (transparent)

\- No third party is needed to oversee the execution of the contract (trustless)

\- Transactions can be executed quickly and automatically (fast)
{% endtab %}

{% tab title="Downsides of Smart Contracts" %}
\- Once a transaction has been executed, it cannot be undone (irreversible)

\- The code can be difficult to understand and debug (complex)

\- Transactions can be publicly visible on the blockchain (public)
{% endtab %}
{% endtabs %}

Since deploying a contract is a transaction "Gas Fees" are required to pay, meaning the deployer will need enough Ether in their wallet to deploy. The Gas cost for deploying a contract is far higher than a normal ETH transfer.

{% hint style="info" %}
For example, Smart contracts are used by NFT projects to automate the minting, sale, and transfer of ownership of NFTs.
{% endhint %}


---

# 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://dagora.gitbook.io/guides/intermediate/tutorials-and-guides/ethereum/lessons/smart-contracts.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.
