user2228: 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?

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

where typedValidator is the script.

2228: <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>
 6113: <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>
