OpShin / opshin-pioneer-program

This repository hosts an opshin/python implementation of the lectures of the Plutus Pioneers Program, a training course for Cardano Smart Contract Engineers.
MIT License
43 stars 11 forks source link

Week05 -> Burn Tokens #50

Closed Ursify closed 1 year ago

Ursify commented 1 year ago

Hi Guys,

Could you please take a look to mint.py? I was trying to burn tokens after minting them, but is not working with negative values. First, I notice that minting script is creating a UTxO with 2000000 lovelace + Native Assets, and I when running mint.py it will not pick the right UTxO since is looking for those with at least 3000000 lovelace.

Forcing my original UTxOs created with mint.py gave me an error that they don't have enough funds.( Inputs / Outputs doesn't match)

Then, I tried adding more than one input to have enough funds for this transaction, also I created another Native Asset with enough funds to be able to load it to the script, both gave me an error in Ogmios.

Input UTxO with enough funds gave me this error: image

Let me know in case that you need more information from my side. Cheers,

nielstron commented 1 year ago

https://github.com/OpShin/opshin-pioneer-program/blob/5800218a35dd3ecd3ce90d4cbee329206bd8df2e/src/week05/scripts/mint.py#L84

In this line, the mint value must be ommitted from the output in case the mint amount is negative.