Conversation
…nable to get expected rewards when fund() again
…eview Fix vestedEscrow and added more tests accordingly after second review
# Conflicts: # contracts/Booster.sol
c-future
left a comment
There was a problem hiding this comment.
please also get latest from main branch
| address[] public allFeeTokens; | ||
|
|
||
| //reward identifier -> distro, execution and virtual pool data | ||
| mapping(address => FeeDistro) public feeTokens; |
There was a problem hiding this comment.
we don't need a mapping for all fee distro info for each veasset project , because we have one booster for each veasset project , so it should be a single state for fee distro , execution hash and array of fee tokens (in case there is multiple fee tokens) you could use openzipplein EnumerableSet for fee tokens , and add new mapping for fee token => lockfee (reward address)
| function setFeeInfo( | ||
| uint256 _lockFeesIncentive, | ||
| uint256 _stakerLockFeesIncentive, | ||
| address _feeToken, |
There was a problem hiding this comment.
we have to pass array of fee tokens even if it is only one to support multiple fee tokens
|
|
||
| address _feeToken = IFeeDistro(feeDistro).token(); | ||
| if (feeToken != _feeToken) { | ||
| if (feeTokens[_feeToken].active != true) { |
There was a problem hiding this comment.
so here we need an iteration on fee tokens and check if it is exist or not
| address lockFees = IRewardFactory(rewardFactory).CreateTokenRewards(_feeToken, lockRewards); | ||
|
|
||
| if (_feeToken != veAsset) { | ||
| IRewards(stakerLockRewards).addReward( |
There was a problem hiding this comment.
it will create new reward pool (lookFees) for each fee tokens and use mapping to save it
|
|
||
| } else { | ||
| feeTokens[_feeToken].distro = _distro; | ||
| feeTokens[_feeToken].executionHash = _executionHash; |
There was a problem hiding this comment.
this could be move to up with these two lines for update the state
lockFeesIncentive = _lockFeesIncentive;
stakerLockFeesIncentive = _stakerLockFeesIncentive;
| //claim fee rewards | ||
| IStaker(staker).claimFees(feeDistro, feeToken); | ||
| //send fee rewards to reward contract | ||
| IStaker(staker).claimFees(feeTokens[feeToken].distro, feeToken, _executionData); |
There was a problem hiding this comment.
as I understand _executionData will have the function signature without the inputs , so I think the inputs are missing here when pass it to function claimFee
There was a problem hiding this comment.
_executionData is both the function signature and the arguments. This is how we enforce that the arguments passed into claimFees can't be tampered with <3
| // transfer to the VE3D Locker and queue the new rewards | ||
| if (_stakerLockFeesIncentive > 0) { | ||
| IERC20Upgradeable(feeToken).safeTransfer(stakerLockRewards, _stakerLockFeesIncentive); | ||
| IRewards(stakerLockRewards).queueNewRewards(feeToken, _stakerLockFeesIncentive); |
There was a problem hiding this comment.
after call the function , it needs iteration for the fee tokens list
| IFeeDistro(_distroContract).claim(); | ||
| // execute arbitrary enforced claim | ||
| (bool success, bytes memory result) = _distroContract.call(executionData); | ||
| require(success, "!fail"); |
There was a problem hiding this comment.
I tested that we were successfully able to claim rewards yup
No description provided.