pancakeswap / pancake-swap-interface-v1

:pancakes: Pancake trading interface V1
https://exchange.pancakeswap.finance
GNU General Public License v3.0
316 stars 944 forks source link

V2 Interface #404

Open saqarmax-arm opened 3 years ago

saqarmax-arm commented 3 years ago

Are you planning to create/sharee new v2 interface repository or you will use this one?

AliWisam commented 3 years ago

They are using Pancake-FrontEnd I think

saqarmax-arm commented 3 years ago

They are using Pancake-FrontEnd I think

Looks like Pancake-FrontEnd didnt include swap part

matbrgz commented 3 years ago

At this moment the v2 isn't available, any plan to release this?

saqarmax-arm commented 3 years ago

If anyone will find solution, please mention here.

matbrgz commented 3 years ago

What is the major difference between both?

If I remove the v1 and start focus on pancakev2 LP it won't work?

g171210375 commented 3 years ago

still waiting :)

fdharamshi commented 3 years ago

With the V3 update, what happens to the tokens using V2 router such as moonshot? https://github.com/moonshot-platform/moonshot-ERC20/blob/main/contracts/Moonshot.sol

captainerd commented 3 years ago

isn't exactly all the same as v1, but it is just replace pancakeswap-libs/sdk with pancakeswap-libs/sdk-v2 ?

sachinkrishna commented 3 years ago

Anyone found a solution to this ? And no, "pancakeswap-libs/sdk-v2" this doesnt work either.

isn't exactly all the same as v1, but it is just replace pancakeswap-libs/sdk with pancakeswap-libs/sdk-v2 ?

atropos0902 commented 3 years ago

Any solution? Also having the same problem. Not sure why they don't release V2 interface like Uniswap.

jcorby24 commented 3 years ago

Worked it out myself, enjoy folks

Installing V2 Pancakeswap Exchange Interface

Optional extras - remove the component for the popup as this isn't needed.

atropos0902 commented 3 years ago

hi @Corbyj1 Thank you for your reply. Now I have a typescript error on src/state/index.ts after adding @overage69/pancake-sdk-v2 library.

Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any] | ((getDefaultMiddleware: CurriedGetDefaultMiddleware<{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }>) => [...]) | undefined'.
  Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any]'.
    Target requires 1 element(s) but source may have fewer.  TS2322

    40 |     toasts
    41 |   },
  > 42 |   middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
       |   ^
    43 |   preloadedState: loadedState,
    44 | })
    45 |

You didn't have that kind of issue?

jcorby24 commented 3 years ago

hi @Corbyj1 You didn't have that kind of issue?

Sorry no didn't have that issue at all - did you try clean clone without modifying anything beforehand?

Did you make sure to run yarn as well before doing the above steps?

I'm running NPM 6.14.12 for reference

atropos0902 commented 3 years ago

@Corbyj1 Amazing!!! It's working!!!! Thank you so much!!!!

sachinkrishna commented 3 years ago

hi @Corbyj1 Thank you for your reply. Now I have a typescript error on src/state/index.ts after adding @overage69/pancake-sdk-v2 library.

Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any] | ((getDefaultMiddleware: CurriedGetDefaultMiddleware<{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }>) => [...]) | undefined'.
  Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any]'.
    Target requires 1 element(s) but source may have fewer.  TS2322

    40 |     toasts
    41 |   },
  > 42 |   middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
       |   ^
    43 |   preloadedState: loadedState,
    44 | })
    45 |

You didn't have that kind of issue?

How did you solve this issue ?

atropos0902 commented 3 years ago

@sachinkrishna Just defined type for middleware. So it could be

middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })] as Middleware[]
sachinkrishna commented 3 years ago

Where did you import the name "Middleware" from ? Im a bit lost here.

atropos0902 commented 3 years ago

From @reduxjs/toolkit library.

sachinkrishna commented 3 years ago

From @reduxjs/toolkit library.

Thank you. But I have already tried that and it is throwing an error

/pancake-swap-interface-v1/src/state/multicall/hooks.ts TypeScript error in /pancake-swap-interface-v1/src/state/multicall/hooks.ts(188,56): Argument of type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface").Interface | undefined' is not assignable to parameter of type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/abi/lib/interface").Interface | undefined'. Type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface").Interface' is not assignable to type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/abi/lib/interface").Interface'. Types of property 'fragments' are incompatible. The type 'readonly Fragment[]' is 'readonly' and cannot be assigned to the mutable type 'Fragment[]'. TS2345

186 | 
187 |   return useMemo(() => {

188 | return results.map((result) => toCallState(result, contract?.interface, fragment, latestBlockNumber)) | ^ 189 | }, [fragment, contract, results, latestBlockNumber]) 190 | } 191 |

atropos0902 commented 3 years ago

Hmm... Weird... That error is really new to me. Can you try to remove node_modules and install again?

sachinkrishna commented 3 years ago

I have tried that. Didint work. I have added the above dependencies with yarn. But i dont think that, that would be the issue. Do you ?

atropos0902 commented 3 years ago

You mean these dependencies?

npm i @reach/portal
npm i @uniswap/v2-core
npm i ajv
npm i cids
npm i ethers
npm i multicodec
npm i multihashes
npm i @types/node

I didn't add the above dependencies since pancake-swap-interface-v1 repo already has those dependencies. I just added @overage69/pancake-sdk-v2

sachinkrishna commented 3 years ago

You mean these dependencies?

npm i @reach/portal
npm i @uniswap/v2-core
npm i ajv
npm i cids
npm i ethers
npm i multicodec
npm i multihashes
npm i @types/node

I didn't add the above dependencies since pancake-swap-interface-v1 repo already has those dependencies. I just added @overage69/pancake-sdk-v2

That was the issue. Thanks a lot man. Its working.

sachinkrishna commented 3 years ago

@atropos0902 Anyway, adding liquidity is working ? No right ?

atropos0902 commented 3 years ago

@sachinkrishna I planned to work only on Swap future for now. Hopefully would work on Liquidity in the earliest future. Thanks!

msolomonTMG commented 3 years ago

has anyone figured out how to get liquidity pools working on a fork with v2? I keep running into "You can't add liquidity in v1" but I'm using the v2 router address on the test net: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1

I followed steps here to add liquidity but no luck: https://forum.openzeppelin.com/t/cant-add-liquidity-on-pancakeswap-with-burnable-erc20-token/6993/10

ubuntutest commented 3 years ago

Worked it out myself, enjoy folks

Installing V2 Pancakeswap Exchange Interface

  • Clone PancakeSwap v1 interface git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git .
  • Run Yarn in console from root yarn
  • Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3 0x10ED43C718714eb63d5aA57B78B54704E256024E
  • Install v2 SDK npm i @overage69/pancake-sdk-v2
  • Install missing dependencies
npm i @reach/portal
npm i @uniswap/v2-core
npm i ajv
npm i cids
npm i ethers
npm i multicodec
npm i multihashes
npm i @types/node
  • Run yarn start and it should boot up using v2
yarn start

Optional extras - remove the component for the popup as this isn't needed.

I did as you said, clone the official repository, change the wallet address, install the dependencies and the sdk-v2.

the application starts up correctly, but if I look for a v2 contract I can't find it, nothing seems to change, it seems to be still using v1.

if I install the dependencies you have listed I get a lot of errors, I also use node 6.14.12.

any suggestions?

EDIT i searched and replaced throughout the project @pancakeswap-libs/sdk with @overage69/pancake-sdk-v2

seems to be working now

EDIT 2 yarn build working on localhost, not working on pages.cloudflare

<!--StartFragment-->
18:57:44.108 | Type '(Middleware \| Middleware&lt;{}, any, Dispatch&lt;AnyAction&gt;&gt;)[]' is not assignable to type '[any] \| ((getDefaultMiddleware: CurriedGetDefaultMiddleware&lt;{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }&gt;) =&gt; [...]) \| undefined'.
-- | --
18:57:44.108 | Type '(Middleware \| Middleware&lt;{}, any, Dispatch&lt;AnyAction&gt;&gt;)[]' is not assignable to type '[any]'.
18:57:44.108 | Target requires 1 element(s) but source may have fewer.  TS2322
18:57:44.109 | &nbsp;
18:57:44.109 | 40 \|     toasts
18:57:44.109 | 41 \|   },
18:57:44.109 | &gt; 42 \|   middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
18:57:44.109 | \|   ^
18:57:44.109 | 43 \|   preloadedState: loadedState,
18:57:44.109 | 44 \| })
18:57:44.109 | 45 \|
18:57:44.109 | &nbsp;
18:57:44.110 | &nbsp;
18:57:44.171 | error Command failed with exit code 1.
18:57:44.172 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
18:57:44.175 | Failed: build command exited with code: 1

<!--EndFragment-->

any tips?

talent-blockchain commented 3 years ago

Hello, dears! I did as follows.

Worked it out myself, enjoy folks

Installing V2 Pancakeswap Exchange Interface

Clone PancakeSwap v1 interface git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git . Run Yarn in console from root yarn Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3 0x10ED43C718714eb63d5aA57B78B54704E256024E Install v2 SDK npm i @overage69/pancake-sdk-v2 Install missing dependencies npm i @reach/portal npm i @uniswap/v2-core npm i ajv npm i cids npm i ethers npm i multicodec npm i multihashes npm i @types/node Run yarn start and it should boot up using v2 yarn start Optional extras - remove the component for the popup as this isn't needed.

But I got such this error. Please help me~~~ Screenshot_56

xenabyte commented 3 years ago

Please it's necessary

Akekarat commented 3 years ago

This code is working for middleware middleware: () => [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],

MartinSchere commented 3 years ago

I followed every step, including @ubuntutest comment but it stills operates on V1. Any tips?

theseige commented 3 years ago

Hello, dears! I did as follows.

Worked it out myself, enjoy folks

Installing V2 Pancakeswap Exchange Interface

Clone PancakeSwap v1 interface git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git . Run Yarn in console from root yarn Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3 0x10ED43C718714eb63d5aA57B78B54704E256024E Install v2 SDK npm i @overage69/pancake-sdk-v2 Install missing dependencies npm i @reach/portal npm i @uniswap/v2-core npm i ajv npm i cids npm i ethers npm i multicodec npm i multihashes npm i @types/node Run yarn start and it should boot up using v2 yarn start Optional extras - remove the component for the popup as this isn't needed.

But I got such this error. Please help me~~~ Screenshot_56

Run npm audit fix - just had this same exact error!

fenixswap commented 3 years ago

Olá queridos! Eu fiz o seguinte.

Eu resolvi sozinho, divirta-se pessoal

Instalando a interface V2 Pancakeswap Exchange Clone PancakeSwap v1 interface git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git . Execute Yarn no console a partir do yarn raiz Atualize ROUTER_ADDRESS para v2 em /src/constants/index.ts linha 3 0x10ED43C718714eb63d5aA57B78B54704E256024E Instale v2 SDK npm i @ overage69 / pancake-sdk-v2 Instale dependências ausentes nwap / npm i @ reach / portal i v2-core npm i ajv npm i cids npm i éteres npm i multicodec npm i multihashes npm i @ types / node Execute o yarn start e ele deve inicializar usando v2 yarn start Extras opcionais - remova o componente do pop-up, pois não é necessário. Mas eu recebi esse erro. Por favor me ajude ~~~ Screenshot_56

Execute npm audit fix- acabou de ter exatamente este mesmo erro!

Mine was giving an error but it was because I didn't start the procedure already at the root of the folder, see where I applied Yarn and then all the other settings /home/ianluis/Downloads/pancake/PancakeSwapClone/pancake-swap-interface-v1/src/constants /

My only problem is that the other functions are redirecting to pancake's website I don't know how to fix it.

Ranofty commented 3 years ago

Please does Pancakeswap have Admin Backend or when you must edit code before adding farm?

gizmotangle commented 3 years ago

Have the same issue =

I followed every step, including @ubuntutest comment but it stills operates on V1. Any tips?

alansoliditydev commented 3 years ago

Hello, if you want to use the testnet-compatible pancakeswap fork, you can use our tool regarding that purpose

https://swap.moonrat.finance/#/swap

And remember to change to BSC testnet.

For mainnet mode, the site works only with Pancake Router v2.

xenabyte commented 3 years ago

You should drop a the repo link

On Wed, 30 Jun 2021, 4:16 am Alan The Achiever, @.***> wrote:

Hello, if you want to use testnet-compatible pancakeswap forks, you can use our tool regarding that purpose

https://swap.moonrat.finance/#/swap

And remember to change to BSC testnet.

For mainnet mode, the site works only with Pancake Router v2.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pancakeswap/pancake-swap-interface-v1/issues/404#issuecomment-871065032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQELH4MNMURJEZ2XTGCSPDTVKECLANCNFSM43X4HHCA .

alansoliditydev commented 3 years ago

You should drop a the repo link On Wed, 30 Jun 2021, 4:16 am Alan The Achiever, @.***> wrote: Hello, if you want to use testnet-compatible pancakeswap forks, you can use our tool regarding that purpose https://swap.moonrat.finance/#/swap And remember to change to BSC testnet. For mainnet mode, the site works only with Pancake Router v2. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#404 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQELH4MNMURJEZ2XTGCSPDTVKECLANCNFSM43X4HHCA .

https://github.com/MoonRat-Finance/dex/

Ranofty commented 3 years ago

You should drop a the repo link On Wed, 30 Jun 2021, 4:16 am Alan The Achiever, @.***> wrote: Hello, if you want to use testnet-compatible pancakeswap forks, you can use our tool regarding that purpose https://swap.moonrat.finance/#/swap And remember to change to BSC testnet. For mainnet mode, the site works only with Pancake Router v2. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#404 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQELH4MNMURJEZ2XTGCSPDTVKECLANCNFSM43X4HHCA .

https://github.com/MoonRat-Finance/dex/

Hello please can you send link to Contributing Guidelines to follow? Or just send it direct here?

saqarmax-arm commented 3 years ago

Anyone can share working v2 interface repository?