<p>Your minting policy should have a parameter related to the address of the contract.</p>
<pre><code>mkPolicy :: Address -&gt; () -&gt; ScriptContext -&gt; Bool
</code></pre>
<p>In your off chain code, you send that parameter to your minting policy with something like this:</p>
<pre><code>let val = Value.singleton (mySymbol $ scrAddress cp1) tn 1
</code></pre>
<p>Where:</p>
<ul>
<li>mySymbol is the CurrencySymbol of your minting policy</li>
<li>scrAddress is the Address of your validator script</li>
<li>cp1 is the Parameter of your validator script</li>
</ul>

CC BY-SA 4.0
2021-09-21T17:14:01.690Z
2021-09-21T17:14:01.690Z
georgeos
<p>Suppose I have one contract, Contract 1, that is parameterized by type</p>
<pre><code>Contract1Params{
   tokenName :: BuiltinByteString
}
</code></pre>
<p>and I have a minting policy that will only mint a token with <code>tokenName</code> <em><strong>tn</strong></em> to the address of Contract 1 parameterized by <code>c1p</code> where <code>tokenName c1p</code> is <em><strong>tn</strong></em>.</p>
<p>So I need to get the address of parameterized contract from the token name of the token that is attempting to be minted from within the minting policy. Not sure how to do this with on chain code. Any ideas?</p>

<plutus><smart-contract><plutus-pioneer-program><nft><minting>
Getting the address of a parameterized contract from within the validator of another script
# Getting the address of a parameterized contract from within the validator of another script

(Asked by: username_0 on 2021-09-17)

Suppose I have one contract, Contract 1, that is parameterized by type
Contract1Params{
   tokenName :: BuiltinByteString
}

and I have a minting policy that will only mint a token with tokenName tn to the address of Contract 1 parameterized by c1p where tokenName c1p is tn.
So I need to get the address of parameterized contract from the token name of the token that is attempting to be minted from within the minting policy. Not sure how to do this with on chain code. Any ideas?

**Tags:** plutus, smart-contract, plutus-pioneer-program, nft, minting

---

## 1 answers

### Answer by username_1 on 2021-09-21. Score: 1

Your minting policy should have a parameter related to the address of the contract.
mkPolicy :: Address -> () -> ScriptContext -> Bool

In your off chain code, you send that parameter to your minting policy with something like this:
let val = Value.singleton (mySymbol $ scrAddress cp1) tn 1

Where:

mySymbol is the CurrencySymbol of your minting policy
scrAddress is the Address of your validator script
cp1 is the Parameter of your validator script


---

