Skip to content

Commit

Permalink
fix: fixes from Care X
Browse files Browse the repository at this point in the history
  • Loading branch information
GalloDaSballo committed Mar 28, 2022
1 parent c5b5c53 commit 4f7cca2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions contracts/RewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ contract RewardsManager is ReentrancyGuard {

mapping(uint256 => mapping(address => uint256)) public lastAccruedTimestamp; // Last timestamp in which vault was accrued - lastAccruedTimestamp[epochId][vaultAddress]
mapping(uint256 => mapping(address => mapping(address => uint256))) public lastUserAccrueTimestamp; // Last timestamp in we accrued user to calculate rewards in epochs without interaction lastUserAccrueTimestampepochId][vaultAddress][userAddress]
mapping(address => uint256) public lastVaultDeposit; // Last Epoch in which any user deposited in the vault, used to know if vault needs to be brought to new epoch
// Or just have the check and skip the op if need be

mapping(uint256 => mapping(address => mapping(address => uint256))) public shares; // Calculate points per each epoch shares[epochId][vaultAddress][userAddress]
mapping(uint256 => mapping(address => uint256)) public totalSupply; // Sum of all deposits for a vault at an epoch totalSupply[epochId][vaultAddress]
Expand Down Expand Up @@ -399,13 +397,13 @@ contract RewardsManager is ReentrancyGuard {
/// === Bulk Claims END === ///

/// @notice Utility function to specify a group of emissions for the specified epochs, vaults with tokens
function addRewards(uint256[] calldata epochIds, address[] calldata tokens, address[] calldata vaults, uint256[] calldata amounts) external {
function addRewards(uint256[] calldata epochIds, address[] calldata vaults, address[] calldata tokens, uint256[] calldata amounts) external {
require(vaults.length == epochIds.length); // dev: length mismatch
require(vaults.length == amounts.length); // dev: length mismatch
require(vaults.length == tokens.length); // dev: length mismatch

for(uint256 i = 0; i < vaults.length; ++i){
addReward(epochIds[i], tokens[i], vaults[i], amounts[i]);
addReward(epochIds[i], vaults[i], tokens[i], amounts[i]);
}
}

Expand All @@ -424,9 +422,6 @@ contract RewardsManager is ReentrancyGuard {
rewards[epochId][vault][token] += endBalance - startBalance;
}


// Total Points per epoch = Total Deposits * Total Points per Second * Seconds in Epoch

/// **== Notify System ==** ///

/// @dev This is used by external contracts to notify a change in balances
Expand Down

0 comments on commit 4f7cca2

Please sign in to comment.