Skip to content

Comments

MasterChef Updated#2

Open
TehilaFavourite wants to merge 5 commits intomainfrom
masterChef
Open

MasterChef Updated#2
TehilaFavourite wants to merge 5 commits intomainfrom
masterChef

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.

2 participants