-
Notifications
You must be signed in to change notification settings - Fork 2
/
ReputationFacet.sol
42 lines (36 loc) · 1.34 KB
/
ReputationFacet.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@contracts/interfaces/IReputation.sol";
import "@contracts/interfaces/IProperty.sol";
import "@contracts/libraries/Errors.sol";
import "@contracts/libraries/Constants.sol";
import "@contracts/libraries/ScoreCounters.sol";
import "@contracts/libraries/AppStorage.sol";
import "@contracts/libraries/Modifiers.sol";
contract ReputationFacet is Modifiers, IReputationReader {
using ScoreCounters for ScoreCounters.ScoreCounter;
/**
* @dev see {IReputationReader-decimals}.
*/
function decimals() external pure returns (uint256) {
return Constants.DECIMALS;
}
/**
* @dev see {IReputationReader-getUserScore}.
*/
function getUserScore(address user) external view not0Address(user) returns (uint256) {
return s.userScores[user].current();
}
/**
* @dev see {IReputationReader-getPropertyScore}.
*/
function getPropertyScore(uint256 property) external view requirePropertyExists(property) returns (uint256) {
return s.propertyScores[property].current();
}
/**
* @dev see {IReputationReader-getUserPaymentPerformanceScore}.
*/
function getUserPaymentPerformanceScore(address user) external view not0Address(user) returns (uint256) {
return s.userPaymentPerformanceScores[user].current();
}
}