> For the complete documentation index, see [llms.txt](https://dagora.gitbook.io/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dagora.gitbook.io/guides/intermediate/tutorials-and-guides/ethereum/lessons/smart-contracts.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://dagora.gitbook.io/guides/intermediate/tutorials-and-guides/ethereum/lessons/smart-contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
