I know that you can use collectFromScript to take all of the value from a script but is there a way to make it so you only take 1 ADA from a Script that holds 100 ADA?
Thank you
I know that you can use collectFromScript to take all of the value from a script but is there a way to make it so you only take 1 ADA from a Script that holds 100 ADA?
Thank you
Yes. You can just write a grab transaction where the whole 100ADA utxo gift is consumed by creating 2 utxo outputs: 1ADA for the grabber and 99ADA back to the script perhaps with a script update pointing to new output address.
If the 100ADA gifts are made up of smaller UTXOs then just choose from those.
No, it's a utxo system, so any inputs need a corresponding output. Now, the output could be to the script address itself depending on how the smart contract is written. The NFT auction from week 1 of Plutus pioneers showed how this is done for example.