<p>Some of these are reexported versions of others. This means some of them are not necessary. Also <code>PlutusTx.Prelude</code> should be included in all projects as it maps types into <code>PlutusTx</code> which complies with the bytecode that runs on the chain.</p>
<p>This means if your Data type is in <code>PlutusTx.Prelude</code>, you should not need the other modules in general. The exception is if other parts of your code use that module.</p>

CC BY-SA 4.0
2022-03-02T18:31:35.963Z
2022-03-02T18:31:35.963Z
KryptoKing
<p>Let's say my smartcontract needs <strong>BuiltinData</strong>.
Quicksearch in documentation reveals that <strong>BuiltinData</strong> is in:</p>
<ul>
<li>Plutus.V1.Ledger.Api</li>
<li>Plutus.V2.Ledger.Api</li>
<li>PlutusTx.Builtins.Internal</li>
<li>PlutusTx</li>
<li>PlutusTx.Builtins</li>
<li>PlutusTx.Prelude</li>
<li>...</li>
</ul>
<p>How to know which include I should add? Which ones are preferred and why?</p>

<plutus><haskell><on-chain>
How to know which module to import?
# How to know which module to import?

(Asked by: username_0 on 2022-03-02)

Let's say my smartcontract needs **BuiltinData**.
Quicksearch in documentation reveals that **BuiltinData** is in:

* Plutus.V1.Ledger.Api
* Plutus.V2.Ledger.Api
* PlutusTx.Builtins.Internal
* PlutusTx
* PlutusTx.Builtins
* PlutusTx.Prelude
* ...

How to know which include I should add? Which ones are preferred and why?

**Tags:** plutus, haskell, on-chain

---

## 1 answers

### Answer by username_1 on 2022-03-02. Score: 1 | Accepted answer

Some of these are reexported versions of others. This means some of them are not necessary. Also `PlutusTx.Prelude` should be included in all projects as it maps types into `PlutusTx` which complies with the bytecode that runs on the chain.

This means if your Data type is in `PlutusTx.Prelude`, you should not need the other modules in general. The exception is if other parts of your code use that module.


---

