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
base: main
Are you sure you want to change the base?
Conversation
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); |
There was a problem hiding this comment.
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.
contracts/UserYieldFarming.sol
Outdated
uint256 newAmt = (_amount - userPct); | ||
user.amount = user.amount.add(newAmt); | ||
} | ||
if (pool.extPool == true) { |
There was a problem hiding this comment.
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
contracts/UserYieldFarming.sol
Outdated
} | ||
if (pool.extPool == true) { | ||
uint256 userPct = ((_amount * 1.3E18) / 100E18); | ||
pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount); |
There was a problem hiding this comment.
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);
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safemath usage consistency
No description provided.