Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MasterChef Updated #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

MasterChef Updated #2

wants to merge 5 commits into from

Conversation

TehilaFavourite
Copy link

No description provided.

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
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.

uint256 newAmt = (_amount - userPct);
user.amount = user.amount.add(newAmt);
}
if (pool.extPool == true) {
Copy link
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

}
if (pool.extPool == true) {
uint256 userPct = ((_amount * 1.3E18) / 100E18);
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);
Copy link
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);

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
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.

None yet

2 participants