Part of CertiK’s series
CertiK reviewed Venus Protocol (Venus - Time based contracts & SeizeVenus) on 17 Jan 2024: 10 findings, 0 critical; 9 marked fixed, 1 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 | 1 | 0 | 1 |
| Medium | 0 | 0 | 0 |
| Low | 0 | 0 | 8 |
In PR 324, contract `TimeManagerV8` is being imported for use within each of the in-scope contracts. Given the contract's order of inheritance within these contracts, and that the contract contains a `__gap` storage variable, it will cause storage collisions if it is used to upgrade any existing deployments.
Within the Shortfall contract, block-based defaults `DEFAULT_NEXT_BIDDER_BLOCK_LIMIT` and `DEFAULT_WAIT_FOR_FIRST_BIDDER` remain as 100 for the contract, even though a 100-block span may take drastically varying times depending on the chain. Since it is known that the time-based limits would be around 300 seconds, it may be beneficial to make these variables immutable so that a reasonable block limit value can be set based on the chain at the time of deployment.
If `venusAccrued[holder] = 0`, then `totalHoldings` and `venusAccrued[holder]` will be updated unnecessarily.
The `MAX_BORROW_RATE_MANTISSA` is set to limit the borrow rate. However, the average block time of different chains will vary so that different maximums should be chosen. Additionally, if the contracts are time-based, then the maximum should be based on the maximum per second. Considering if the contract is time-based with the current maximum of .0005% per second, this allows for an annual borrow rate of 15,768%.
### PR417 RewardFacet - The comments above `seizeVenus()` do not include the return value.
The function cited is intended to return uint type variables. However, neither function explicitly sets the return value within the function logic.
### PR410 RewardFacet - In the function `grantXVSInternal()`, the temporary variable `xvs` does not have a trailing underscore. - In the function `grantXVSInternal()` the temporary variable `_xvsVToken` uses a leading underscore, however, according to the [**Solidity Style Guide**](https://docs.soliditylang.org/en/latest/style-guide.html#avoiding-naming-collisions), trailing underscores should be used to avoid naming collisions. ### PR417 RewardFacet - The function `updateAndDistributeRewards()` is `internal`, however, it does not include Internal in the function name, which seems to be the convention throughout the codebase. ### PR410 SetterFacet - The input of the function `_setXVSToken()` uses a leading underscore, when the convention followed throughout the codebase is to use a trailing underscore to avoid naming collisions for inputs. - The input of the function `_setXVSVToken()` uses a leading underscore, when the convention followed throughout the codebase is to use a trailing underscore to avoid naming collisions for inputs. ### PR410 FacetBase - In the function `releaseToVault()` the temporary variable `_xvs` uses a leading underscore, however, according to the [**Solidity Style Guide**](https://docs.soliditylang.org/en/latest/style-guide.html#avoiding-naming-collisions), trailing underscores should be used to avoid naming collisions.
In the function `claimVenus()` the temporary variable `j` is used as the index in a single for loop. However, it is unnecessarily set to zero as it will already be initialized to 0.
The locations cited contain local variables or comments which reference a value per block, and which are not modified to document the possibility that the averaged value may be *per block* or *per second*, according to choices made via the inherited `TimeManager` contract. In the comments above `_setLastRewardingBlockTimestamp()`, the word "block" should be replaced with "block timestamp" since the function is for explicitly setting timestamp-related values.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (16)
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