mlabs-haskell / seabug-contracts

3 stars 1 forks source link

Add set price contract, refactor buy contract #45

Closed samuelWilliams99 closed 2 years ago

samuelWilliams99 commented 2 years ago

This ticket is acting in preparation for the gifting contract, which will submit 2 transactions, a set price then a buy. This also allows for greater code reuse when running transactions against seabug not on the marketplace, which the gifting transaction will be. Lastly, this changes the buying logic to now return the bought token to the user, rather than immediated putting it back up for sale on the market. There is a simple sum type for defining this behaviour, if you need to change it for debugging.

samuelWilliams99 commented 2 years ago

Ah neat, thanks! Would you mind running the formatter?

rynoV commented 2 years ago

For some reason in at least one case the buyer isn't covering the full price of the nft, and it looks like marketplace script's ada is being used to cover part of it. This can be seen in the previous tx I linked (unless I'm reading wrong). Still checking if this was introduced by these changes

samuelWilliams99 commented 2 years ago

Oh that makes sense, this was always possible, its just that returning the utxo to the market place meant you still had to cover that min ada - we'll have to discuss whether this should be addressed, and if so - how. We could increase the expected payment to the owner by the ada in the input utxos with the sgnft, if said utxos is on a validator, but thats some rather involved behaviour

samuelWilliams99 commented 2 years ago

See here, we'll address this later. @rynoV please do review when you get a chance :)