secure-transac-contracts 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ contract IdentityVault is Guardian {
24
24
  error NotAuthorizedAuthority(address authority);
25
25
  error DataNotFound(address user);
26
26
 
27
- constructor(address _registry) Guardian(_registry, 600) {
27
+ constructor(address _registry) Guardian(_registry, 60) {
28
28
  // Owner/Registry owner can set authorities
29
29
  }
30
30
 
@@ -7,15 +7,15 @@ import "./CreditSystem.sol";
7
7
  contract ScoringSystem is CreditSystem {
8
8
  mapping(address => uint256) private scores;
9
9
 
10
- uint256 public whitelistThreshold = 800; // 0.8
11
- uint256 public blacklistThreshold = 200; // 0.2
10
+ uint256 public whitelistThreshold = 80; // 0.8
11
+ uint256 public blacklistThreshold = 20; // 0.2
12
12
 
13
13
  event ScoreUpdated(address indexed user, uint256 newScore);
14
14
  event ThresholdUpdated(uint256 whitelistThreshold, uint256 blacklistThreshold);
15
15
  event ScoreRevealed(address indexed target, uint256 score, address indexed viewer);
16
16
 
17
17
  function updateScore(address user, uint256 newScore) external onlyReporter {
18
- require(newScore <= 1000, "Score must be between 0 and 1000");
18
+ require(newScore <= 100, "Score must be between 0 and 100");
19
19
  scores[user] = newScore;
20
20
  emit ScoreUpdated(user, newScore);
21
21
  }
@@ -24,8 +24,8 @@ contract ScoringSystem is CreditSystem {
24
24
  uint256 _whitelistThreshold,
25
25
  uint256 _blacklistThreshold
26
26
  ) external onlyOwner {
27
- require(_whitelistThreshold <= 1000, "Whitelist threshold must be <= 1000");
28
- require(_blacklistThreshold <= 1000, "Blacklist threshold must be <= 1000");
27
+ require(_whitelistThreshold <= 100, "Whitelist threshold must be <= 100");
28
+ require(_blacklistThreshold <= 100, "Blacklist threshold must be <= 100");
29
29
  require(_whitelistThreshold > _blacklistThreshold, "Whitelist must be > blacklist");
30
30
 
31
31
  whitelistThreshold = _whitelistThreshold;
@@ -43,7 +43,7 @@ contract ScoringSystem is CreditSystem {
43
43
  }
44
44
 
45
45
  uint256 score = scores[target];
46
- if (score == 0) score = 500; // Default
46
+ if (score == 0) score = 50; // Default 0.5
47
47
 
48
48
  emit ScoreRevealed(target, score, _msgSender());
49
49
  return score;
@@ -54,12 +54,12 @@ contract ScoringSystem is CreditSystem {
54
54
  */
55
55
  function getScore(address user) external view onlyOwner returns (uint256) {
56
56
  uint256 score = scores[user];
57
- return score == 0 ? 500 : score;
57
+ return score == 0 ? 50 : score;
58
58
  }
59
59
 
60
60
  function isWhitelisted(address user) public view returns (bool) {
61
61
  uint256 score = scores[user];
62
- if (score == 0) score = 500;
62
+ if (score == 0) score = 50;
63
63
  return score >= whitelistThreshold;
64
64
  }
65
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secure-transac-contracts",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Secure Transaction Contracts",
5
5
  "main": "index.js",
6
6
  "scripts": {