CertiK reviewed Opticash (Opticash - Audit) on 10 Mar 2023: 9 findings, 0 critical; all marked fixed.
Report hosted on skynet.certik.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 | 1 |
| Medium | 0 | 0 | 0 |
| Low | 0 | 0 | 8 |
In the contract `OPCH` the role `_owner` has authority over the functions `unlockERC()` and `setAllocation`. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and withdraw any tokens held by the contract and initialize the allocation of the OPCH token.
Boolean constants can be used directly and do not need to be compared to true or false. ```solidity=57 require(mintCalled == false, "Allocation already done."); ```
One or more declarations do not conform to the [Solidity style guide](https://solidity.readthedocs.io/en/v0.7.3/style-guide.html#naming-conventions) with regards to its naming convention. Particularly: - `camelCase`: Should be applied to function names, argument names, local and state variable names, modifiers - `UPPER_CASE`: Should be applied to `constant` variables - `CapWords`: Should be applied to contract names, struct names, event names and enums
Multiple lines of code were found to be duplicated and could make use of inheritance and be declared in external files.
There should always be events emitted in the sensitive functions that are controlled by centralization roles.
The **require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.
Addresses should be checked before assignment or external call to make sure they are not zero addresses.
Comparisons that are always true or always false may be incorrect or unnecessary. ```solidity=89 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=88 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=66 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=78 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=89 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=66 require(amount >= 0, "Invalid allocation amount"); ``` --- ```solidity=65 require(amount >= 0, "Invalid allocation amount"); ```
The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (9)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’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