<p>you need to import either the whole module like this:</p>
<pre><code>import Ledger
</code></pre>
<p>or the specific type like this:</p>
<pre><code>import Ledger (PaymentPubKeyHash)
</code></pre>

CC BY-SA 4.0
2022-05-10T15:04:41.347Z
Still not working when i import the whole module. When i was importing specific type it said it does not export PaymentPubKeyHash.
szhang9921
CC BY-SA 4.0
2022-05-11T08:18:20.713Z
Also check you have the right git commits (precisely the commit of `plutus-apps` as found in the `cabal.project`). `PaymentPub...` is relatively new. It used to just be `Pub...`
waalge
CC BY-SA 4.0
2022-05-11T10:45:51.780Z
If it can’t be found, you most probably have an older version of plutus-apps. You can change the tags in the file cabal.project.
Jey
CC BY-SA 4.0
2022-05-09T21:10:05.773Z
2022-05-09T21:10:05.773Z
Jey
<p>You neeed to import PaymentPubKeyHash it like the following:</p>
<p><code>import Ledger.Address qualified as Address                      (Address, PaymentPubKeyHash(..))</code></p>
<p>This works for me and you can checkout my working code on testnet here:</p>
<p><a href="https://github.com/lley154/cardano-lottery/blob/main/src/OnChain.hs" rel="nofollow noreferrer">https://github.com/lley154/cardano-lottery/blob/main/src/OnChain.hs</a></p>
<p>Cheers,</p>
<p>Lawrence</p>

CC BY-SA 4.0
2022-05-11T00:13:31.127Z
2022-05-11T00:13:31.127Z
lley154
<p>I have the following datum type</p>
<pre><code>data ProjectSubmitDatum = ProjectSubmitDatum
  { vProjectOwner :: PaymentPubKeyHash,
    vProjectRegistrationFee :: Integer,
    vProjectCategory :: BuiltinByteString,
    vFundPayIdentifier :: PaymentPubKeyHash
  }
  deriving (Show)
</code></pre>
<p>I also have the module imported like this</p>
<pre><code>import Ledger.Address 
</code></pre>
<p>The following error pops up when i run cabal repl</p>
<pre><code>src/QuadraticVFSC.hs:45:19: error:
    Not in scope: type constructor or class ‘PaymentPubKeyHash’
   |
45 |   { vFundOwner :: PaymentPubKeyHash,
   |                   ^^^^^^^^^^^^^^^^^
</code></pre>

<types>
Type PaymentPubKeyHash not found
# Type PaymentPubKeyHash not found

(Asked by: username_0 on 2022-05-09)

I have the following datum type
data ProjectSubmitDatum = ProjectSubmitDatum
  { vProjectOwner :: PaymentPubKeyHash,
    vProjectRegistrationFee :: Integer,
    vProjectCategory :: BuiltinByteString,
    vFundPayIdentifier :: PaymentPubKeyHash
  }
  deriving (Show)

I also have the module imported like this
import Ledger.Address 

The following error pops up when i run cabal repl
src/QuadraticVFSC.hs:45:19: error:
    Not in scope: type constructor or class ‘PaymentPubKeyHash’
   |
45 |   { vFundOwner :: PaymentPubKeyHash,
   |                   ^^^^^^^^^^^^^^^^^

**Tags:** types

---

## 2 answers

### Answer by username_1 on 2022-05-09. Score: 2 | Accepted answer

you need to import either the whole module like this:
import Ledger

or the specific type like this:
import Ledger (PaymentPubKeyHash)

> **Comments:**
> **username_0**: Still not working when i import the whole module. When i was importing specific type it said it does not export PaymentPubKeyHash.  
> **username_2**: Also check you have the right git commits (precisely the commit of `plutus-apps` as found in the `cabal.project`). `PaymentPub...` is relatively new. It used to just be `Pub...`  
> **username_1**: If it can’t be found, you most probably have an older version of plutus-apps. You can change the tags in the file cabal.project.  

---

### Answer by username_3 on 2022-05-11. Score: 2

You neeed to import PaymentPubKeyHash it like the following:

`import Ledger.Address qualified as Address (Address, PaymentPubKeyHash(..))`

This works for me and you can checkout my working code on testnet here:

<https://github.com/lley154/cardano-lottery/blob/main/src/OnChain.hs>

Cheers,

Lawrence


---

