Skip to content

[wip] ApeRewardPool Reflect Token Handling#1

Open
DeFiFoFum wants to merge 29 commits into
feature/pool-factoryfrom
feature/reflect-tokens
Open

[wip] ApeRewardPool Reflect Token Handling#1
DeFiFoFum wants to merge 29 commits into
feature/pool-factoryfrom
feature/reflect-tokens

Conversation

@DeFiFoFum

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

@Apegurus Apegurus left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread contracts/ApeRewardPool.sol Outdated
/// @return wei balace of contract
function totalStakeTokenBalance() public view returns (uint256) {
// Return BEO20 balance
return IBEP20(stakeToken).balanceOf(address(this));

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

Comment thread 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);

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