-
Notifications
You must be signed in to change notification settings - Fork 4
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
[wip] ApeRewardPool Reflect Token Handling #1
base: feature/pool-factory
Are you sure you want to change the base?
Conversation
- As reflect tokens deduct a fee from a transfer an update was needed to keep track of the number of tokens taken in as well as the number of tokens that the contract earns from the reflect fees - Reflect fees taken in by this contract can be skimmed by the factory owner
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.
Just a small adjustment to leverage the use of the IBEP20 interface with stakeToken
.
I also wonder if we should leverage the fact that pools are an array and make this closer to MasterChef instead of using a smart contract factory.
contracts/ApeRewardPool.sol
Outdated
/// @return wei balace of contract | ||
function totalStakeTokenBalance() public view returns (uint256) { | ||
// Return BEO20 balance | ||
return IBEP20(stakeToken).balanceOf(address(this)); |
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.
As stakeToken
is defined as IBEP20 I believe you can call the function without wrapping it.
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.
Good point! Fixed
contracts/ApeRewardPool.sol
Outdated
/// @dev Remove excess stake tokens earned by reflect fees | ||
function skimStakeTokenFees() external onlyFactoryOwner { | ||
uint256 stakeTokenFeeBalance = getStakeTokenFeeBalance(); | ||
IBEP20(stakeToken).transfer(msg.sender, stakeTokenFeeBalance); |
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.
I believe stakeToken,.safeTransfer
is possible here.
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.
Good catch! Fixed
- Add user to addressList if they have 0 rewardDebt - Clean comments - Rename function to safeTransferRewardInternal - Make various functions external - add SafeERC20 for factory transfers
- Add factory proxy contract
- Replace constructor with initilizer so this contract can be put behind a proxy - Add events for owner update functions
- Replace constructor with initilizer so this contract can be put behind a proxy - Add events for owner update functions
…eswap-pool-factory into feature/reflect-tokens
- add InitOwnable to set the owner through the initilizer function
to keep track of the number of tokens taken in as well as the number
of tokens that the contract earns from the reflect fees