<p>It doesn't need the script address in this case because later he uses:</p>
<pre><code>ledgerTx &lt;- submitTxConstraints typedValidator tx
</code></pre>
<p>where <strong>typedValidator</strong> is the script.</p>

CC BY-SA 4.0
2022-01-23T05:08:31.087Z
Why didn't you give the OP an upvote?
gRebel
CC BY-SA 4.0
2022-01-23T10:43:52.350Z
Yeah, good point. Done
kindofdev
CC BY-SA 4.0
2022-01-22T21:12:47.620Z
2022-01-22T21:12:47.620Z
kindofdev
<p>On the plutus pioneer program, lesson 02, Lars shows the parameterized contracts and on the off-chain code he makes use of the <code>mustPayToTheScript</code> function to create the transaction. Different from other similar functions, this one doesn't take the hash of the script as an input. Therefore, how does it know what is the script address to use?</p>

<plutus-pioneer-program><transaction>
Where does the `mustPayToTheScript` function gets the script address from?
# Where does the `mustPayToTheScript` function gets the script address from?

(Asked by: username_0 on 2022-01-22)

On the plutus pioneer program, lesson 02, Lars shows the parameterized contracts and on the off-chain code he makes use of the `mustPayToTheScript` function to create the transaction. Different from other similar functions, this one doesn't take the hash of the script as an input. Therefore, how does it know what is the script address to use?

**Tags:** plutus-pioneer-program, transaction

---

## 1 answers

### Answer by username_1 on 2022-01-22. Score: 2 | Accepted answer

It doesn't need the script address in this case because later he uses:
ledgerTx <- submitTxConstraints typedValidator tx

where typedValidator is the script.

> **Comments:**
> **username_2**: Why didn't you give the OP an upvote?  
> **username_1**: Yeah, good point. Done  

---

