Skip to content

MasterChef Updated#2

Open
TehilaFavourite wants to merge 5 commits into
mainfrom
masterChef
Open

MasterChef Updated#2
TehilaFavourite wants to merge 5 commits into
mainfrom
masterChef

Conversation

@TehilaFavourite

Copy link
Copy Markdown

No description provided.

Comment thread contracts/UserYieldFarming.sol Outdated
user.amount = user.amount.add(_amount);
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);
uint256 userPct = ((_amount * 1.3E18) / 100E18);
uint256 newAmt = (_amount - userPct);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should'nt remove 1.3% from all deposit, it should only have effect on external pool.

Comment thread contracts/UserYieldFarming.sol Outdated
uint256 newAmt = (_amount - userPct);
user.amount = user.amount.add(newAmt);
}
if (pool.extPool == true) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (pool.extPool == true) can be changed to
if (pool.extPool) to reduce lines of codes

Comment thread contracts/UserYieldFarming.sol Outdated
}
if (pool.extPool == true) {
uint256 userPct = ((_amount * 1.3E18) / 100E18);
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause multiple withdrawal from a user using external pools kindly delete this line.
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);

Comment thread contracts/UserYieldFarming.sol Outdated
pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);
if (pool.extPool) {
uint256 userPct = ((_amount * 1.3E18) / 100E18);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safemath usage consistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants