Skip to content

Commit 86d481b

Browse files
committed
feat: add unit test for markerplace, fee distribution, auction manager.
- Fix contract design issues
1 parent 9743c03 commit 86d481b

38 files changed

Lines changed: 3317 additions & 1091 deletions

TEST_GUIDE.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ forge test --gas-report --match-contract YourContract
103103
forge test --watch
104104
```
105105

106-
107-
108-
### **Short-Term (Improve Coverage)**
109-
5. Add VerificationRegistry tests
110-
6. Add ReputationManager tests
111-
7. Add NFT contract tests
112-
8. Add integration tests
113-
114106
### **Long-Term (Advanced Testing)**
115107
9. Add invariant tests
116108
10. Add property-based tests

src/access/RoleManager.sol

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ contract RoleManager is AccessControl, Pausable {
3030
error AlreadyHasRole(bytes32 role, address account);
3131
error LengthMismatch(uint256 rolesLength, uint256 accountsLength);
3232

33-
// ============================================
34-
// ROLES
35-
// ============================================
36-
3733
/// @notice General admin role for day-to-day operations
3834
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
3935

@@ -49,10 +45,6 @@ contract RoleManager is AccessControl, Pausable {
4945
/// @notice Can update platform fees and fee collector
5046
bytes32 public constant FEE_MANAGER_ROLE = keccak256("FEE_MANAGER_ROLE");
5147

52-
// ============================================
53-
// STATE VARIABLES
54-
// ============================================
55-
5648
/// @notice Timelock duration for sensitive role changes (24 hours)
5749
uint256 public constant ROLE_CHANGE_TIMELOCK = 24 hours;
5850

@@ -66,42 +58,18 @@ contract RoleManager is AccessControl, Pausable {
6658
// EVENTS
6759
// ============================================
6860

69-
/**
70-
* @notice Emitted when a role grant is scheduled
71-
*/
7261
event RoleGrantScheduled(
7362
bytes32 indexed role, address indexed account, address indexed scheduler, uint256 executeAfter
7463
);
7564

76-
/**
77-
* @notice Emitted when a scheduled role grant is executed
78-
*/
7965
event RoleGrantExecuted(bytes32 indexed role, address indexed account, address indexed executor);
8066

81-
/**
82-
* @notice Emitted when a scheduled role grant is cancelled
83-
*/
8467
event RoleGrantCancelled(bytes32 indexed role, address indexed account, address indexed canceller);
8568

86-
/**
87-
* @notice Emitted when contract is paused
88-
*/
8969
event EmergencyPaused(address indexed pauser, string reason);
9070

91-
/**
92-
* @notice Emitted when contract is unpaused
93-
*/
9471
event EmergencyUnpaused(address indexed unpauser);
9572

96-
// ============================================
97-
// CONSTRUCTOR
98-
// ============================================
99-
100-
/**
101-
* @notice Initialize role manager
102-
* @param initialAdmin Address to receive DEFAULT_ADMIN_ROLE
103-
* @dev Grants all roles to initial admin for initial setup
104-
*/
10573
constructor(address initialAdmin) {
10674
if (initialAdmin == address(0)) {
10775
revert InvalidAddress(initialAdmin);
@@ -122,10 +90,6 @@ contract RoleManager is AccessControl, Pausable {
12290
roleMembers[FEE_MANAGER_ROLE].push(initialAdmin);
12391
}
12492

125-
// ============================================
126-
// ROLE MANAGEMENT WITH TIMELOCK
127-
// ============================================
128-
12993
/**
13094
* @notice Schedule a role grant with timelock (for sensitive roles)
13195
* @param role Role identifier
@@ -242,10 +206,6 @@ contract RoleManager is AccessControl, Pausable {
242206
}
243207
}
244208

245-
// ============================================
246-
// EMERGENCY CONTROLS
247-
// ============================================
248-
249209
/**
250210
* @notice Pause all marketplace operations
251211
* @param reason Reason for pausing
@@ -325,10 +285,6 @@ contract RoleManager is AccessControl, Pausable {
325285
return paused();
326286
}
327287

328-
// ============================================
329-
// UTILITY FUNCTIONS
330-
// ============================================
331-
332288
/**
333289
* @notice Batch grant roles to multiple addresses
334290
* @param roles Array of role identifiers

0 commit comments

Comments
 (0)