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

[wip] ApeRewardPool Reflect Token Handling #1

Open
wants to merge 29 commits into
base: feature/pool-factory
Choose a base branch
from

Conversation

DeFiFoFum
Copy link
Contributor

  • 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

- 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
Copy link
Contributor

@Apegurus Apegurus left a 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.

/// @return wei balace of contract
function totalStakeTokenBalance() public view returns (uint256) {
// Return BEO20 balance
return IBEP20(stakeToken).balanceOf(address(this));
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed

DeFiFoFum added 22 commits April 5, 2021 18:52
- 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
@DeFiFoFum DeFiFoFum changed the title ApeRewardPool Reflect Token Handling [wip] ApeRewardPool Reflect Token Handling Sep 7, 2021
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