Skip to content

Commit

Permalink
using separate mapping for groups and validators score keeping
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Sep 24, 2024
1 parent 8a560f8 commit 29f7acd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/protocol/contracts-0.8/common/ScoreManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import "../../contracts/common/interfaces/ICeloVersionedContract.sol";
import "@openzeppelin/contracts8/access/Ownable.sol";

contract ScoreManager is Initializable, Ownable {
mapping(address => uint256) public scores;
mapping(address => uint256) public groupScores;
mapping(address => uint256) public validatorsScores;

/**
* @notice Sets initialized == true on implementation contracts
Expand All @@ -22,19 +23,19 @@ contract ScoreManager is Initializable, Ownable {
}

function setGroupScore(address group, uint256 score) external onlyOwner {
scores[group] = score;
groupScores[group] = score;
}

function setValidatorScore(address validator, uint256 score) external onlyOwner {
scores[validator] = score;
validatorsScores[validator] = score;
}

function getGroupScore(address group) external view returns (uint256) {
return scores[group];
return groupScores[group];
}

function getValidatorScore(address validator) external view returns (uint256) {
return scores[validator];
return validatorsScores[validator];
}

/**
Expand Down

0 comments on commit 29f7acd

Please sign in to comment.