Audit · firm’s term: audit report
QuillAudits reviewed Prime Numbers Labs (Prime Number Staking Contract) on 7 Apr 2025: 7 findings, 0 critical; 5 marked fixed, 2 open.
Report hosted on quillaudits.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 0 | 0 |
| Medium | 0 | 0 | 2 |
| Low | 2 | 0 | 3 |
The contract defines custom errors like ZeroStakeAmount(), RewardApyTooHigh(), and others. These are intended to be used as a clearer and more efficient alternative to revert strings. However, in multiple places, these errors are incorrectly passed as arguments to require(): require(amount > 0, ZeroStakeAmount()); // incorrect This is not the correct pattern for using custom errors. According to Solidity documentation, custom errors should be used with an if statement followed by a revert: if (amount == 0) revert ZeroStakeAmount(); // correct Using require(..., CustomError()) still compiles because custom errors are interpreted as expressions, but this pattern is invalid as it leads to inconsistent error handling and poor readability.
Throughout the reward calculation logic in the contract, the code uses Solidity’s tryAdd, trySub, and<br>tryMul functions from the Math library to perform arithmetic operations. These functions return a (bool success, uint256 result) and in the current implementation, the success flag is ignored in most cases.<br>(bool success, uint256 result) = rewardPerToken().trySub(s.userRewardPerTokenPaid[account]);<br>(success, result) = result.tryMul(balanceOf(account));<br>(success, result) = result.tryDiv(WHOLE);<br>(success, result) = result.tryAdd(_rewards[account]);<br>
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (3)
350 projects reviewed · 459 reports · latest Apr 2025
See QuillAudits’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us