Sherlock

QuantstampFiles named in the report

Quantstamp reviewed Sherlock on 10 Aug 2021: 25 findings, 0 critical; 6 marked fixed, 16 acknowledged, 3 open.

No open critical findings
Open the reportOpen Sherlock’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings25

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High001
Medium041
Low3124
LowGas ConcernsOpen

The following smart contract functions contain loops and could lead to an out-of-gas error if the number of supported ERC20 tokens and/or protocols by Sherlock is too large: 1. `Gov.protocolRemove` loops over the number of ERC20 tokens underlying SHERX. 2. `Payout._doSherX` loops over the number of ERC20 tokens underlying SHERX. 3. `SherX.calcUnderlyingInStoredUSD` loops over the number of ERC20 tokens underlying SHERX. 4. `SherX.harvestFor` loops over the number of ERC20 tokens stakers are allowed to stake in. 5. `SherX.setInitialWeight` loops over the number of ERC20 tokens stakers are allowed to stake in. 6. `SherX.redeem` loops over the number of ERC20 tokens stakers are allowed to stake in. 7. `LibPool.payOffDebtAll` loops over the number of protocols registered in the corresponding pool. 8. `LibSherX.calcUnderlying` loops over the number of ERC20 tokens underlying SHERX. 9. `LibSherX.accrueSherX` loops over the number of ERC20 tokens stakers are allowed to stake in. 10. `Manager.setProtocolPremium` loops over many protocols and tokens. In particular, because is a double loop, the inner call to `LibPool.payOffDebtAll(_token[i][j]);` may be invoked many times for the same token. Note that these are not the only functions with loops. There is a large number of functions with loops in the code base, where the loop boundary is given by the length of one of the input arrays to the corresponding function. Since those functions are external functions we assume that the caller will be notified by their wallet software in case the length of the input array is too large. However, all functions with loops should be in scope for this issue.

LowIgnored Return ValuesOpen

The `AaveV2.withdrawAll` and `AaveV2.withdraw` functions call the Aave lending pool `withdraw` function which returns the final amount withdrawn. Since this is an external contract and we have seen several past attacks where the vulnerable code has made implicit assumptions on calls to external contracts without explicitly checking them, we believe that this poses a risk in case the amount withdrawn from Aave would be much lower than the expected amount.

LowUnlocked DependenciesOpen

All dependency versions inside `package.json` are unlocked due to `^` before the version number. Moreover, the core dependency, namely the [`diamond-2` repo](https://github.com/mudgen/diamond-2) is specified without any version number, which means that the latest commit from the `master` branch will be used when calling `yarn install`. Such a commit might be insecure or unstable since it is not necessarily a release commit.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (50)

  • contracts/facets/Manager.sol
  • contracts/interfaces/aaveV2/IProposalValidator.sol
  • contracts/facets/Payout.sol
  • contracts/interfaces/IManager.sol
  • contracts/util/RemoveMock.sol
  • contracts/ForeignLock.sol
  • contracts/interfaces/IGovDev.sol
  • contracts/interfaces/aaveV2/IAaveIncentivesController.sol
  • contracts/interfaces/aaveV2/IStakeAave.sol
  • contracts/facets/Gov.sol
  • contracts/interfaces/aaveV2/IAaveGovernanceV2.sol
  • contracts/NativeLock.sol
  • contracts/interfaces/IPoolBase.sol
  • contracts/interfaces/aaveV2/IGovernanceV2Helper.sol
  • contracts/interfaces/ISherXERC20.sol
  • contracts/util/StrategyMock.sol
  • contracts/interfaces/IGov.sol
  • contracts/interfaces/aaveV2/ILendingPoolAddressesProvider.sol
  • contracts/interfaces/aaveV2/IAaveDistributionManager.sol
  • contracts/interfaces/IRemove.sol
  • contracts/libraries/LibPool.sol
  • contracts/interfaces/ISherlock.sol
  • contracts/facets/PoolStrategy.sol
  • contracts/facets/SherX.sol
  • contracts/libraries/LibSherXERC20.sol
  • contracts/interfaces/aaveV2/IAToken.sol
  • contracts/storage/SherXERC20Storage.sol
  • contracts/interfaces/ISherX.sol
  • contracts/interfaces/IPoolStrategy.sol
  • contracts/facets/SherXERC20.sol
  • contracts/libraries/LibSherX.sol
  • contracts/facets/PoolOpen.sol
  • contracts/util/Import.sol
  • contracts/interfaces/aaveV2/MockAave.sol
  • contracts/interfaces/aaveV2/IExecutorWithTimelock.sol
  • contracts/facets/PoolBase.sol
  • contracts/facets/PoolDevOnly.sol
  • contracts/interfaces/IPayout.sol
  • contracts/util/ERC20Mock.sol
  • contracts/storage/GovStorage.sol
  • contracts/strategies/AaveV2.sol
  • contracts/interfaces/ILock.sol
  • contracts/storage/PoolStorage.sol
  • contracts/facets/GovDev.sol
  • contracts/storage/PayoutStorage.sol
  • contracts/interfaces/IPoolStake.sol
  • contracts/interfaces/aaveV2/ILendingPool.sol
  • contracts/interfaces/IStrategy.sol
  • contracts/storage/SherXStorage.sol
  • contracts/interfaces/aaveV2/DataTypes.sol

Part of Sherlock’s security record

Sherlock
Audits1 audit by 1 firmLast audit Aug 2021, by Quantstamp.
Critical findingsNo open critical findingsIn 1 report.
Open Sherlock’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something 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