Giter VIP home page Giter VIP logo

pancake-swap-core's Introduction

Pancake Factory

Actions Status

In-depth documentation on PancakeSwap is available at docs.pancakeswap.finance.

Local Development

The following assumes the use of node@>=10.

Install Dependencies

yarn

Compile Contracts

yarn compile

Run Tests

yarn test

pancake-swap-core's People

Contributors

chriseth avatar danrobinson avatar haydenadams avatar moodysalem avatar mooncakehero avatar noahzinsmeister avatar pancake-swap avatar roman-monk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pancake-swap-core's Issues

Smart Contract getAmountIn is not showing correct value

Hello,

I hope you can help me i think im missing some additional calculation.
When i query your router contract (0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F) and i want to get the amount that i will get i use getAmountsIn or getAmountsOut but the value that it returns is very different then the web app itself...

Are there some additional calculations in play?

And also how can i access getReserves function on the smart contract?

Broken pair

Someone has added inadequate initial liquidity (like 0.00000001 BNB / 1 token) for existing token and swap price became insane, so the pair is now broken - no one can add new liquidity or fix the price because price impact is 99%. Is it possible to recreate pair contract or do something else in this case?

Could you help remove the vulnerabilities in your package?

Hi,

Issue

1 vulnerabilities (medium severity) are introduced in @pancakeswap-libs/pancake-swap-core:
Vulnerability CVE-2021-23358 (medium severity) is detected in package underscore (versions: >=1.3.2 <1.12.1,>=1.13.0-0 <1.13.0-2): https://snyk.io/vuln/SNYK-JS-UNDERSCORE-1080984
The above vulnerable package is referenced by @pancakeswap-libs/pancake-swap-core via:
@pancakeswap-libs/[email protected][email protected][email protected][email protected][email protected]

Solution

Since @pancakeswap-libs/[email protected].* is transitively referenced by 156 downstream projects (e.g., @gravis.finance/uikit 1.1.74 (latest version),
@pancakeswap-libs/sdk-v2 2.2.0 (latest version), kccswap-sdk 0.0.6 (latest version), @gravis.finance/sdk 1.0.9 (latest version), definixswap-sdk 0.0.10-klaytn (latest version),

If @pancakeswap-libs/[email protected].* removes the vulnerable packages from the above version, then its fixed version can help downstream users decrease their pain.

Could you help update packages in this version?

Fixing suggestions

In @pancakeswap-libs/[email protected].*, you can kindly perform the following upgrades (not crossing their major versions):
truffle-hdwallet-provider ^1.0.17 ➔ 1.0.15;

Note:
ruffle-hdwallet-provider 1.0.15 transitively depends on [email protected] (a vulnerability CVE-2018-1109 patched version)

Thanks for your contributions to the npm ecosystem!

Best regards,
Paimon

Wrong route when buying my BEP20 token

Hi,

I am the dev of a BEP20 token and I have an issue when buying it through poocoin. The main LP is IUP/BNB and someone created a pool IUP/BUSD with less than 20 BUSD in it. The price of this pool is 100x less than the price of the main LP. This results in poocoin automatically trying to use this LP to buy the token. As the LP was so small I tried to add some liquidity but it didn't solve the issue.
It seems that the IUP/BUSD pool is bugged and no one can swap using it. I tried to swap directly through router v2 smart contract but the transaction always fails.

Some swaps have been made using this pool so I don't thing the issue comes from our token.

The problem is exactly the same as this one: pancakeswap/pancake-swap-interface-v1#95

Time Lock Contract

I'm going to make a smart contract with time-lock based on pancakeswap core.

Is there any best way to provide on your end?

Fix tests, earn CAKE.

PancakeSwap.finance was previously forked from the mythical UniSwap. Since then we've made a few changed of our own: 6c0f9af

The first task is super simple!

Fix the test and complete the Readme.

The first to complete the task will be rewarded with 100 CAKE (currently around $70).

Suggestion for LP tokens migrations

Token developers need a solution to burn/lock LP tokens and transfer to the new LP token after PancakeSwap releases a new router.

If we transfer LP tokens to 0x000000...dead wallet, we can't take back these LP tokens anymore.

The best solution IMHO is PancakeSwap create a smart contract to lock the LP and allow the owner just move the LP between V1, V2 or V3.

when I sell token, I get "TransferHelper: TRANSFER_FROM_FAILED"

Hello, talent devs.
Now uers can't sell BabyBNB token.
(https://bscscan.com/address/0xc1168b7b85b2bbc8a5c73c007b74e7523b2da209)
image

I checked the reason.
This error comes from follow red part.
image

This token is forked from EverRise.
minimumTokensBeforeSwap = 10,000,000,000 BABYBNB
_maxTxAmount = 1000000000000000000000000000000000000000000000000000000000000000000 BABYBNB
I think that all things are correct.
I don't understand why this issue is appeared.

If you are experienced this issue, please help me.
Thanks.

Error: Callback was already called.

When I run yarn test, the error occured:

yarn run v1.22.10
$ yarn compile
$ yarn clean
$ rimraf ./build/
$ waffle .waffle.json
$ mocha


  PancakeERC20
    1) "before each" hook

  PancakeFactory
    2) "before each" hook

  PancakePair
    3) "before each" hook


  0 passing (360ms)
  3 failing

  1) PancakeERC20
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)
      at runNextTicks (internal/process/task_queues.js:62:3)
      at processImmediate (internal/timers.js:434:9)

  2) PancakeFactory
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  3) PancakePair
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)
      at runNextTicks (internal/process/task_queues.js:62:3)
      at processImmediate (internal/timers.js:434:9)




/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358
                callback(err);
                ^
Error: Callback was already called.
    at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
    at WriteStream.<anonymous> (/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
    at WriteStream.emit (events.js:315:20)
    at WriteStream.destroy (/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/level-ws/level-ws.js:140:8)
    at finish (internal/streams/writable.js:670:14)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
error Command failed with exit code 3.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My nodeJS version is: v14.16.0

Pancakeswap error TRANSFER_FROM_FAILED. How do I fix it?

We deployed our BSC-Contract and added it to Pancakeswap. Now after 7 transactions the error message The transaction cannot succeed due to error: TransferHelper: TRANSFER_FROM_FAILED. This is probably an issue with one of the tokens you are swapping. appears. What is the error and how can I fix it? Would appreciate any fast help! contract adress is: 0xfc69c71d008e8ff7afc406d5b8d7916b519d76f1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.