<p>The benefit is limiting scope of addresses to scan to the beneficiary (and deadline). The reason you'd want to do this is say 1 million people are using this contract. Someone redeeming would need to filter through millions of utxos with the first approach but in the second only has to look at utxos associated with them. The homework switching this to 50/50 approach takes the best of both worlds. All utxos found are for the beneficiary but then you can filter on the datum for all transactions that are vested to redeem.</p>

CC BY-SA 4.0
2022-02-01T13:34:08.730Z
2022-02-01T13:34:08.730Z
Samuel Leathers
<p>Here is a real example on Cardano mainnet and how one of the decentralized exchanges uses it. <a href="https://twitter.com/adax_pro/status/1488524779686608903" rel="nofollow noreferrer">https://twitter.com/adax_pro/status/1488524779686608903</a>
<a href="https://i.sstatic.net/tgiXa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tgiXa.png" alt="Cardano DEX" /></a></p>

CC BY-SA 4.0
2022-02-01T20:13:13.127Z
2022-02-01T20:13:13.127Z
stake_pool
<pre><code>In class 3 example, now there cannot be a grabAll endpoint because the 
deadline is a parameter, so I did not see a benefit in this approach, 
please enlighten me.

Can you please provide more examples where this is actually useful?
</code></pre>
<p>As you said, the deadline is the parameter and as I understand it one can actually 'grabAll' as long as the deadline parameter of that particular grab is after all the deadlines specified by the gifts.</p>
<p>I think the example is useful in cases if you want to stagger the redemption of the gifts by beneficiaries into different deadlines or slots or specific times.</p>

CC BY-SA 4.0
2022-02-01T06:59:07.260Z
2022-02-01T06:59:07.260Z
d_fajardo
<p>In the auction example (Class 2), the endpoint for Grab just only requires the Wallet as parameter. The wallet and the validator will retrieve all UTxOs for that wallet that are available (past their deadline).</p>
<p>In class 3 example, now there cannot be a grabAll endpoint because the deadline is a parameter, so I did not see a benefit in this approach, please enlighten me.</p>
<p>Can you please provide more examples where this is actually useful?</p>

<plutus-pioneer-program>
(ppp Class 3). Parameterized contracts. What's the benefit for given example? and more use cases
# (ppp Class 3). Parameterized contracts. What's the benefit for given example? and more use cases

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

In the auction example (Class 2), the endpoint for Grab just only requires the Wallet as parameter. The wallet and the validator will retrieve all UTxOs for that wallet that are available (past their deadline).

In class 3 example, now there cannot be a grabAll endpoint because the deadline is a parameter, so I did not see a benefit in this approach, please enlighten me.

Can you please provide more examples where this is actually useful?

**Tags:** plutus-pioneer-program

---

## 3 answers

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

The benefit is limiting scope of addresses to scan to the beneficiary (and deadline). The reason you'd want to do this is say 1 million people are using this contract. Someone redeeming would need to filter through millions of utxos with the first approach but in the second only has to look at utxos associated with them. The homework switching this to 50/50 approach takes the best of both worlds. All utxos found are for the beneficiary but then you can filter on the datum for all transactions that are vested to redeem.


---

### Answer by username_2 on 2022-02-01. Score: 1

Here is a real example on Cardano mainnet and how one of the decentralized exchanges uses it. <https://twitter.com/adax_pro/status/1488524779686608903>
[![Cardano DEX](https://i.sstatic.net/tgiXa.png)](https://i.sstatic.net/tgiXa.png)


---

### Answer by username_3 on 2022-02-01. Score: 1

In class 3 example, now there cannot be a grabAll endpoint because the 
deadline is a parameter, so I did not see a benefit in this approach, 
please enlighten me.

Can you please provide more examples where this is actually useful?

As you said, the deadline is the parameter and as I understand it one can actually 'grabAll' as long as the deadline parameter of that particular grab is after all the deadlines specified by the gifts.
I think the example is useful in cases if you want to stagger the redemption of the gifts by beneficiaries into different deadlines or slots or specific times.


---

