0

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?

3 Answers 3

1

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.

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.