Cask Audit 2

CertiKFiles named in the report

CertiK reviewed Cask (Cask Audit 2) on 18 Dec 2022: 17 findings, 0 critical; 4 marked fixed, 13 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings17

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

SeverityOpenAcknowledgedFixed
Critical000
High900
Medium000
Low404
LowMaxSkips Strategy is Not Activated When `_checkMiFixed

As the function `processWorkUnit` implementation, DCA is paused when `dca.numSkips >= maxSkips`. ```solidity=163 if (maxSkips > 0 && dca.numSkips >= maxSkips) { caskDCA.managerCommand(_dcaId, ICaskDCA.ManagerCommand.Pause); } ``` But in the logic branch `_checkMinMaxPrice`, DCA is only skipped without checking maxSkips and returned. ```solidity=139 if (!_checkMinMaxPrice(_dcaId, inputAsset, outputAsset)) { scheduleWorkUnit(_queueId, _dcaId, bucketAt(dca.processAt + dca.period)); try caskVault.protocolPayment(dca.user, address(this), dcaFeeMin) { caskDCA.managerSkipped(_dcaId, ICaskDCA.SkipReason.OutsideLimits); } catch (bytes memory) { caskDCA.managerCommand(_dcaId, ICaskDCA.ManagerCommand.Cancel); } return; } ``` Thus, if a DCA always could not meet the price restriction in `_checkMinMaxPrice`, it will be skipped and charged `dcaFeeMin` ceaselessly until it's canceled due to the balance running out.

LowMissing `PausableUpgradeable` UsageFixed

The contract `CaskDCA` `CaskP2P` and `CaskChainlinkTopup`inherit the contract `@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol`, but the `paused` flag or `whenPaused`/`whenNotPaused` modifier is not used anywhere in the `CaskDCA`, `CaskP2P` or `CaskChainlinkTopup`. So the function `pause()` and `unpause()` are redundant. The contract `CaskJobQueue` also inherits `PausableUpgradeable.sol` and uses the `whenNotPaused` modifier. However, public or external `pause()` and `unpause()` functions are not implemented.

LowMissing Zero Address ValidationFixed

Addresses should be checked before assignment or external call to make sure they are not zero addresses. The linked code does not zero-check the address when setting `feeDistributor`, regarding the initialization and update of this variable in contract `CaskDCAManager` and `CaskChainlinkTopupManager`. ```solidity=91 feeDistributor = _feeDistributor; ```

LowRedundant codeFixed

`assetsMerkleRoot` is defined but not initialized or used in the contract `CaskDCAManager`.

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 (10)

  • contracts/subscriptions/CaskSubscriptionManager.sol
  • contracts/dca/CaskDCA.sol
  • contracts/chainlink_topup/CaskChainlinkTopup.sol
  • contracts/p2p/CaskP2PManager.sol
  • contracts/p2p/CaskP2P.sol
  • contracts/subscriptions/CaskSubscriptions.sol
  • contracts/chainlink_topup/CaskChainlinkTopupManager.sol
  • contracts/subscriptions/CaskSubscriptionPlans.sol
  • contracts/job_queue/CaskJobQueue.sol
  • contracts/dca/CaskDCAManager.sol

Part of Cask’s security record

Cask
Audits1 audit by 1 firmLast audit Dec 2022, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Cask’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’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