pancakeswap / pancake-farm Goto Github PK
View Code? Open in Web Editor NEWLicense: Do What The F*ck You Want To Public License
License: Do What The F*ck You Want To Public License
We are tryting to make pancakeswap to work on bsc testnet. What we have done is as follows.
We have renamed the cake token to another token e.g BarToken with Symbol BARS
We have added liquidity using Router V2 and Factory V2 and we have added liquidity using pancakeswap swap interface and everything seems to be working fine on this side. We renamed the Lp tokens on factory contract.
Than we fork the pancake-swap frontend and deployed the contracts for.
We have added these contracts in config files for contracts, pools, farms and tokens. We also updated wbnb bsc testnet contract.
The problem is that we are not able to approve pool and not able to farm which has pair BARS-BNB(we double check the address). The wallet address is also the contract owners for all these contract.
After some debugging we find that the allownaces are getting undefined for pools and farms.
Did we miss anything?
Hello, I found a conditional competition vulnerability. I want to know how to submit vulnerability details and vulnerability reward rules. You can contact me through TG(@RedTeamPing).
Not an issue but im unsure where to ask this to the correct people.
Is there any plan to have the smart contracts audited by an external third party? It would go a long way in providing confidence to trade on the BSC and pancakeswap.
Could you check it, please?
Yesterday, I was stake in cake-bnb (may be I misremember) but I see total staked is 0 .
Here is my transaction, what does it do?
0x32071da305c8ccbdb7c71c89701c774ebe4471fd4760f393e1da3e1d3ec837fc
I was track it and know that it sent to 0x73feaa1ee314f8c655e354234017be2193c9e24e Chief Master
The problem is how i can get it back or I just can't see it temporally(I will see it show in the pancakeswapV.2 farm) ?
enterStaking
mint the syrup, leaveStaking
burn the syrup, but emergencyWithdraw
did not burn the syrup
// Stake CAKE tokens to MasterChef
function enterStaking(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[0][msg.sender];
updatePool(0);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt);
if(pending > 0) {
safeCakeTransfer(msg.sender, pending);
}
}
if(_amount > 0) {
pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
user.amount = user.amount.add(_amount);
}
user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12);
syrup.mint(msg.sender, _amount);
emit Deposit(msg.sender, 0, _amount);
}
// Withdraw CAKE tokens from STAKING.
function leaveStaking(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[0][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(0);
uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt);
if(pending > 0) {
safeCakeTransfer(msg.sender, pending);
}
if(_amount > 0) {
user.amount = user.amount.sub(_amount);
pool.lpToken.safeTransfer(address(msg.sender), _amount);
}
user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12);
syrup.burn(msg.sender, _amount);
emit Withdraw(msg.sender, 0, _amount);
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.sender, _pid, user.amount);
user.amount = 0;
user.rewardDebt = 0;
}
The attacker can attack like this:
function attack() external {
masterChef.enterStaking(100);
masterChef.emergencyWithdraw(0);
}
i Would suggest removing!
// Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
function migrate(uint256 _pid) public {
require(address(migrator) != address(0), "migrate: no migrator");
PoolInfo storage pool = poolInfo[_pid];
IBEP20 lpToken = pool.lpToken;
uint256 bal = lpToken.balanceOf(address(this));
lpToken.safeApprove(address(migrator), bal);
IBEP20 newLpToken = migrator.migrate(lpToken);
require(bal == newLpToken.balanceOf(address(this)), "migrate: bad");
pool.lpToken = newLpToken;
}
Hi PancakeSwap, I am looking for some support. I connected PancakeSwap to a Binance wallet, I added some liquidity, but when I try to Stake LP tokens (DITTO-BNB LP) the popup window blocks on "Pending Confirmation" after I confirmed the operation on the Binance popup. Am I doing something wrong (and is it the correct place for asking) ?
On Apr-24-2021 11:52:46 AM +UTC, We added the Nuls-busd LP and got error Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' after that It returns only Nuls but doesn't return BUSD. We guessed gas not enough.
We expected to validate users able to process the transaction to success or reverted contact and return all coin when transaction break.
Address: 0xDC744F3d275AEE66BABDA02626DE83dae4783a9f
Transaction Hash:
0x2163302c0b964cac50ed1693e035d9be5acd6bdfb540e3311274870cd6f7ec1d
thank you
Having LP for PNT-PBTC
Steps to reproduce:
Actual result
The screen got blank and if you press F12 then you can see the following error: Cannot read property 'pid' of undefined
Expected result
The user should be able to see the PNT-PBTC LP tokens
NOTE: this is not a cache issue because I have cleared the cache and this error remains
Failed to compile.
src/Providers.tsx
Line 4:32: Unable to resolve path to module 'react-helmet-async' import/no-unresolved
Search for the keywords to learn more about each error.
I have tried to run "yarn install" and yarn add react-helmet-async
However when I look under the problems tab in vscode I see "initializer provides no value for this binding element and the binding element has no default value"
Can someone please help thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.