Can we use only 1 smart contract script for every trading pair? #6
-
I see that we need to specify offered/asked assets in spending script to help it knows which assets can be swapped. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@thuannguyen2010 Yes, it is possible to push that information into the datum and use only a single spending script. It would require different logic for the beacons since there would need to be a beacon stored with every UTxO to tell them apart. I am not sure of all the trade-offs of this approach but I intend to try something like this in the next version. |
Beta Was this translation helpful? Give feedback.
-
If we use a single spending script, we only need deploy spending script once. Then when users create swap, they don't need to create spending script again, just UTxO which contains price and swap data (asked/offered assets) (ada savings) |
Beta Was this translation helpful? Give feedback.
-
This is now how cardano-swaps works so I will be closing this discussion. |
Beta Was this translation helpful? Give feedback.
This is now how cardano-swaps works so I will be closing this discussion.