CertiK reviewed Communis (Communis - Audit) on 3 Jan 2023: 5 findings, 0 critical; 1 marked fixed, 4 open.
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 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 4 | 0 | 1 |
Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=753 uint256 recalculatedStakeShares = (s.stakedHearts + getRecalculatedBonusHearts(s)) * (10 ** 17) / stakesOriginalShareRate; ``` ```solidity=758 uint256 penalty = (s.stakedDays * (10 ** 15)) / 5555; ``` ```solidity=759 pr.maxPayout = (recalculatedStakeShares * penalty) / (10 ** 15); ``` --- ```solidity=770 bonusPercentage = ((3 * (10 ** 10)) * bonusPercentage) / (10 ** 10); ``` ```solidity=775 bonusPercentage = ((6 * (10 ** 10)) * bonusPercentage) / (10 ** 10); ``` --- ```solidity=784 payout = (maxPayout * (10 ** 10)) / bonusPercentage; ``` ```solidity=787 uint256 penalty = (stakesOriginalShareRate * (10 ** 15)) / globalShareRate; ``` ```solidity=788 payout = (payout * penalty) / (10 ** 15); ``` --- ```solidity=819 uint256 payout = (stakedCodeak / 80) * numberOfPayouts; ```
The contract lacks comments or documentation explaining the methodology of each function and the reasoning behind the decisions taken. Specifically, there is no explanation on the calculation of the reward as well as the rules for users to participate in the projects. We treat the calculation in the contract blackbox, and make several assumptions based on the error message/function name during the audit.
The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assume their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=545 _HEX private HEX; ``` - The contract `Communis` interacts with third party contract with `_HEX` interface via `HEX`.
```solidity=651 (uint256(uint128(payout))) ``` - The type conversion `uint128(payout)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=652 | (uint256(uint128(recalculatedStakeShares)) << 128) ``` - The type conversion `uint128(recalculatedStakeShares)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=654 | (uint256(uint16(stakedDays)) << 40) ``` - The type conversion `uint16(stakedDays)` from larger type uint256 to smaller type uint16 may truncate data. --- ```solidity=655 | (uint256(uint40(stakesOriginalShareRate)) << 56) ``` - The type conversion `uint40(stakesOriginalShareRate)` from larger type uint256 to smaller type uint40 may truncate data. --- ```solidity=656 | (uint256(uint72(stakedHearts)) << 96) ``` - The type conversion `uint72(stakedHearts)` from larger type uint256 to smaller type uint72 may truncate data. --- ```solidity=669 | (uint256(uint112(payout)) << 16) ``` - The type conversion `uint112(payout)` from larger type uint256 to smaller type uint112 may truncate data. --- ```solidity=679 uint256(uint128(amount)) ``` - The type conversion `uint128(amount)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=680 | (uint256(uint128(stakedCodeak)) << 128) ``` - The type conversion `uint128(stakedCodeak)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=689 uint256(uint128(amount)) ``` - The type conversion `uint128(amount)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=690 | (uint256(uint128(stakedCodeak)) << 128) ``` - The type conversion `uint128(stakedCodeak)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=701 if(red.endBonusPayoutDay < currentDay) red.endBonusPayoutDay = uint16(currentDay); ``` - The type conversion `uint16(currentDay)` from larger type uint256 to smaller type uint16 may truncate data. --- ```solidity=702 if(red.stakedDays < s.stakedDays) red.stakedDays = uint16(s.stakedDays); ``` - The type conversion `uint16(s.stakedDays)` from larger type uint256 to smaller type uint16 may truncate data. --- ```solidity=704 red.sharesDebt += uint72(s.stakeShares); ``` - The type conversion `uint72(s.stakeShares)` from larger type uint256 to smaller type uint72 may truncate data. --- ```solidity=823 ebd.nextPayoutDay += uint16(numberOfPayouts * 91); ``` - The type conversion `uint16(numberOfPayouts * 91)` from larger type uint256 to smaller type uint16 may truncate data. --- ```solidity=952 uint128 payoutDebt = uint128(payout / 2); ``` - The type conversion `uint128(payout / 2)` from larger type uint256 to smaller type uint128 may truncate data. --- ```solidity=990 HEX.stakeGoodAccounting(address(stakeOwner), stakeIndex, uint40(stakeID)); ``` - The type conversion `uint40(stakeID)` from larger type uint256 to smaller type uint40 may truncate data.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
1,045 projects reviewed · 1,376 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