IntersectMBO / plutus-apps

The Plutus application platform
Apache License 2.0
306 stars 214 forks source link

Merge uniswap example from plutus-pioneer-program to plutus-pab #18

Open kelizarov opened 3 years ago

kelizarov commented 3 years ago

Area

[] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code [x] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries [] Marlowe Related to Marlowe [] Other Any other topic (Playgrounds, etc.)

Describe the feature you'd like

Currently there are two versions of the Uniswap example: one in plutus and another one is in https://github.com/input-output-hk/plutus-pioneer-program. The suggestion is try and merge the pioneer version of starting Uniswap example and make one unique version that can be used as a reference for Plutus example.

ghost commented 3 years ago

The actual Uniswap pab uses the contract from plutus (https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week10/app/uniswap-pab.hs#L25). I guess the question why there is yet another Uniswap contract should be asked in the issue in the plutus-pioneer-program repo.

kelizarov commented 3 years ago

That was a part of Lars's Pioneer Program lectures where it is explained how Uniswap is working and example usage to launch locally. The difference is that the plutus's version of PAB for uniswap starts some pools before starting to accept requests from the outside. But the pioneer's version does not, since it tries to walk through developers to get to work with the dApp from clean slate.

So the point of an issue is try to merge these changes back to plutus repository and make as a sinlge source of truth to help guide developers to get familiar with this contract example.

j-mueller commented 3 years ago

Had a brief chat about this with @kelizarov - this issue is just about making the "Create liquidity pool" bit of the initialization code optional in the plutus-pab example:

https://github.com/input-output-hk/plutus/blob/master/plutus-pab/examples/uniswap/Main.hs#L73-L81

I'll reopen this, we can tackle it in the next sprint, if nobody else gets to it first.