> For the complete documentation index, see [llms.txt](https://doc.histopia.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.histopia.io/technical-specifications/smart-contracts.md).

# Smart Contracts

## $ERA TOKEN

The $ERA token is an ERC20 token which is a standard capped OpenZeppelin token with mint access for the FoE contract.

## NFT contract

This contract supports generic token type that helps the platform to create different type of NFTs(like lands, histopia, building, equipments and etc) with various characteristics for each type.

* Type Name
* What type of tokens can be assigned to this type
* Wether it's breadable or not and the address of the breading manager of this type
* Maximum supply of this type

## FOE contract

This contract is based on MasterChef contract but users will stake their NFTs instead of LP tokens. The Histopians characteristic will be used for calculating the military power of players and then they can claim their $ERA token.

The reward per block on each planet is adjusted every week based on the military power of that planet compared to other planets.

The Histopia $ERA mint rate will be decreased 10 percent every 6 months. The sum of $ERA token after x year can be calculated like this:

$$f(x) = \frac{60M \* (1-0.9^{2x})}{1-0.9}$$

So for example after 1 year 114M of ERA tokens will be minted(11.4 of total supply). And it will take infinity years(mathematically) that 600M of $ERA tokens get distributed between Histopia players.

$$\sum\limits\_{k = 1}^\infty {ar^{2k - 1} = \frac{a}{{1 - r}}}  = \frac{60M}{0.1} = 600M$$

##


---

# 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://doc.histopia.io/technical-specifications/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.
