> For the complete documentation index, see [llms.txt](https://docs.ante.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ante.org/technical-stuff/dms.sol.md).

# DMS.sol

Dead man's switch contract: what it does, source, address, audit status.

DMS.sol is the dead man’s switch: a \~70-line timer and the only contract Ante wrote for Ante Vaults. It is **not audited**; the other contracts a vault uses are Safe and Zodiac code, listed with their audits on [Audits & Security Reviews](https://docs.ante.org/audits-and-security-reviews.md). It holds no funds, makes no external calls and can’t be upgraded.

The owner calls `checkIn()` to reset the timer. Once the check-in interval passes without one, guardians can start a handoff, which then waits out the grace period before assets can move to the recipient.

Each vault runs its own copy, owned by the vault, so only the vault's owner can check in or change the interval. The address below is the mastercopy those copies are cloned from; it is locked (owner `0x…0001`).

Verified source: [Etherscan](https://etherscan.io/address/0xb3EEC2e74F6bEF3Fd7362459eB39BD75C5aBCC52#code) (exact match) and [Sourcify](https://repo.sourcify.dev/1/0xb3EEC2e74F6bEF3Fd7362459eB39BD75C5aBCC52) for `0xb3EEC2e74F6bEF3Fd7362459eB39BD75C5aBCC52`. The full source is below.

License: LGPL-3.0-only.

**Found an issue?** Email <security@ante.org>.

#### DMS.sol

```
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.23;

import { ICustomCondition } from "./interfaces/ICustomCondition.sol";
import { Enum } from "@safe-global/safe-smart-account/common/Enum.sol";
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { IDMS } from "./interfaces/IDMS.sol";

contract DMS is IDMS, ICustomCondition, OwnableUpgradeable {
  /// @notice The check-in interval
  uint256 public checkInInterval;

  /// @notice The last time the owner checked in
  uint256 public lastCheckIn;

  /// @param _owner Address of the owner
  /// @param _checkInInterval Check-in interval in seconds that should be required for owner to check in
  /// @dev A check-in interval equal to 0 means this module is disabled
  constructor(address _owner, uint256 _checkInInterval) {
    bytes memory initParams = abi.encode(_owner, _checkInInterval);
    setUp(initParams);
  }

  function setUp(bytes memory initParams) public initializer {
    (address _owner, uint256 _checkInInterval) = abi.decode(initParams, (address, uint256));
    if (_owner == address(0)) revert InvalidOwner();

    _transferOwnership(_owner);
    checkInInterval = _checkInInterval;

    // Initialize the check in. Otherwise this will start from a dead state
    lastCheckIn = block.timestamp;

    emit DMSSetup(msg.sender, _owner);
    emit CheckInIntervalSet(_checkInInterval);
  }

  /// @inheritdoc IDMS
  function setCheckInInterval(uint256 _checkInInterval) public onlyOwner {
    checkInInterval = _checkInInterval;
    emit CheckInIntervalSet(_checkInInterval);
  }

  /// @inheritdoc IDMS
  function checkIn() public onlyOwner {
    lastCheckIn = block.timestamp;
    emit CheckedIn();
  }

  /// @inheritdoc IDMS
  function isDead() public view returns (bool) {
    return block.timestamp - lastCheckIn > checkInInterval;
  }

  /// @inheritdoc ICustomCondition
  function check(
    address,
    uint256,
    bytes calldata,
    Enum.Operation,
    uint256,
    uint256,
    bytes12
  ) external view override returns (bool success, bytes32 reason) {
    if (isDead()) {
      return (true, bytes32(0));
    }
    // keccak256("NotDead()")
    return (false, bytes32(uint256(0x951f0bd2)));
  }
}

```

**Notes**

* **Check-in interval of 0.** A check-in interval of 0 is allowed. It makes the vault guardian-triggered: guardians can start a handoff at any time, and the grace period still applies, so the owner can check in from the Ante app to cancel. The source comment saying 0 "disables" the module is misleading, and the interface's `InvalidCheckInInterval` error is never used. Verified source can't be changed, so we correct it here.
* **Check-in and a queued handoff.** `checkIn()` only updates a timestamp. It stops guardians from queuing a new handoff, but does not void one already queued. The Ante app's check-in also skips the Delay queue; see [Cancelling a handoff](https://docs.ante.org/technical-stuff/how-a-vault-is-wired.md#cancelling-a-handoff).
* **Ownership.** The contract inherits `renounceOwnership` and `transferOwnership`. The Ante app never proposes either on a vault's DMS: without the vault as owner, no one could check in, and guardians could start a handoff once the interval passes.
