Skip to content
This repository has been archived by the owner on Jul 31, 2021. It is now read-only.

V2 Interface #404

Open
saqarmax-arm opened this issue Apr 28, 2021 · 40 comments
Open

V2 Interface #404

saqarmax-arm opened this issue Apr 28, 2021 · 40 comments

Comments

@saqarmax-arm
Copy link

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

@AliWisam
Copy link

AliWisam commented May 1, 2021

They are using Pancake-FrontEnd I think

@saqarmax-arm
Copy link
Author

They are using Pancake-FrontEnd I think

Looks like Pancake-FrontEnd didnt include swap part

@matbrgz
Copy link

matbrgz commented May 6, 2021

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

@saqarmax-arm
Copy link
Author

If anyone will find solution, please mention here.

@matbrgz
Copy link

matbrgz commented May 8, 2021

What is the major difference between both?

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

@g171210375
Copy link

still waiting :)

@fdharamshi
Copy link

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
Copy link

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

@sachinkrishna
Copy link

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
Copy link

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

@jcorby24
Copy link

jcorby24 commented May 14, 2021

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.

@atropos0902
Copy link

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
Copy link

jcorby24 commented May 14, 2021

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
Copy link

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

@sachinkrishna
Copy link

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
Copy link

atropos0902 commented May 14, 2021

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

middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })] as Middleware[]

@sachinkrishna
Copy link

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

@atropos0902
Copy link

From @reduxjs/toolkit library.

@sachinkrishna
Copy link

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
Copy link

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

@sachinkrishna
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@atropos0902
Copy link

atropos0902 commented May 14, 2021

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

@msolomonTMG
Copy link

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
Copy link

ubuntutest commented May 20, 2021

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
Copy link

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
Copy link

Please it's necessary

@Akekarat
Copy link

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

@MartinSchere
Copy link

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

@theseige
Copy link

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
Copy link

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
Copy link

Ranofty commented Jun 14, 2021

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

@gizmotangle
Copy link

Have the same issue =

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

@alansoliditydev
Copy link

alansoliditydev commented Jun 30, 2021

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
Copy link

xenabyte commented Jun 30, 2021 via email

@alansoliditydev
Copy link

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
Copy link

Ranofty commented Jul 2, 2021

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
Copy link
Author

Anyone can share working v2 interface repository?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests