[wip] ApeRewardPool Reflect Token Handling#1
Open
DeFiFoFum wants to merge 29 commits into
Open
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
Apegurus
requested changes
Apr 5, 2021
Apegurus
left a comment
Contributor
There was a problem hiding this comment.
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.
| /// @return wei balace of contract | ||
| function totalStakeTokenBalance() public view returns (uint256) { | ||
| // Return BEO20 balance | ||
| return IBEP20(stakeToken).balanceOf(address(this)); |
Contributor
There was a problem hiding this comment.
As stakeToken is defined as IBEP20 I believe you can call the function without wrapping it.
Contributor
Author
There was a problem hiding this comment.
Good point! Fixed
| /// @dev Remove excess stake tokens earned by reflect fees | ||
| function skimStakeTokenFees() external onlyFactoryOwner { | ||
| uint256 stakeTokenFeeBalance = getStakeTokenFeeBalance(); | ||
| IBEP20(stakeToken).transfer(msg.sender, stakeTokenFeeBalance); |
Contributor
There was a problem hiding this comment.
I believe stakeToken,.safeTransfer is possible here.
Contributor
Author
There was a problem hiding this comment.
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
Apegurus
approved these changes
Apr 20, 2021
Apegurus
approved these changes
Apr 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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