Skip to content

Safe Guard Mode Explained

Safe Guard Mode is the recommended way to borrow on NFT Loans. It provides the strongest security guarantees for lenders, which means better terms for you as a borrower.


How It Works

The Setup

Your Safe wallet gets two components:

  1. TDH Collateral Guard

    • Installed as a Guard on your Safe
    • Checks every transaction before execution
    • Blocks transfers of locked NFTs
  2. TDH Liquidation Module

    • Installed as a Module on your Safe
    • Can execute NFT transfers on valid defaults
    • Only callable by the NFT Loans contract

During a Loan

┌─────────────────────────────────────────┐
│            Your Safe Wallet             │
│                                         │
│  ┌─────────┐                           │
│  │  Your   │  ← Guard blocks transfers │
│  │   NFT   │                           │
│  └─────────┘                           │
│                                         │
│  Guard: TDHCollateralGuard    ✓        │
│  Module: TDHLiquidationModule ✓        │
└─────────────────────────────────────────┘

         │ If you try to transfer NFT

    ❌ BLOCKED by Guard


         │ If loan defaults + liquidation called

    ✓ Module transfers NFT to lender

The 24-Hour Activation Delay

Safe Guard loans have a security feature: a 24-hour waiting period before funds are released.

Why?

The delay protects lenders from setup manipulation:

  • Borrower sets up Safe correctly ✓
  • Borrower accepts loan offer
  • NFT gets locked, loan enters "Pending Activation"
  • 24-hour window opens
  • If borrower transferred NFT before accepting, it's detected
  • If anything suspicious happens, loan can be cancelled
  • After 24 hours, loan activates and borrower receives ETH

Timeline

You Accept Offer


[PENDING_ACTIVATION] ─── NFT locked, ETH escrowed

       │ 24 hours

Anyone calls activateLoan()


[ACTIVE] ─── ETH sent to you, interest starts accruing

       │ Loan duration

Maturity ─── You should repay by now

       │ 24-hour grace period

Default ─── Liquidation enabled

What Can Cancel During Waiting Period

  • You no longer own the NFT
  • NFT lock was somehow bypassed
  • Guard was removed (shouldn't be possible, but checked)

If any of these are true, anyone can call cancelPendingLoan and the lender's ETH is returned.


What the Guard Blocks

When you have locked NFTs, the Guard blocks:

Direct Transfers

  • transferFrom(from, to, tokenId)
  • safeTransferFrom(from, to, tokenId)
  • safeTransferFrom(from, to, tokenId, data)

Approvals for Locked NFTs

  • approve(spender, tokenId) - blocked for locked tokens
  • setApprovalForAll(operator, approved) - blocked if you have ANY locked NFTs

Destructive Actions

  • burn(tokenId) - blocked for locked tokens

Guard/Module Removal

  • setGuard(newGuard) - blocked while you have active loans
  • disableModule(module) - blocked for liquidation module while loans active

What's NOT Blocked

  • Transferring NFTs that aren't locked
  • Receiving NFTs
  • Approving non-locked NFTs (if you have no setApprovalForAll lock)
  • All other Safe transactions (ETH, other tokens, contract calls)

What the Module Can Do

The Liquidation Module is very limited:

It CAN

  • Transfer a specific NFT from your Safe to the lender
  • But ONLY when called by NFT Loans Core
  • And ONLY when the loan is validly defaulted

It CANNOT

  • Transfer any other assets
  • Execute any other transactions
  • Act before default conditions are met
  • Be called by anyone except NFT Loans Core

Liquidation Conditions

For a liquidation to succeed:

  1. Loan status must be ACTIVE
  2. Current time > maturity + grace period
  3. Called through NFT Loans Core (not directly)

Security Requirements

Why Only One Module?

Other Safe modules might allow bypassing the Guard. For example:

  • A "recovery module" could transfer NFTs
  • A "spending module" could approve operators

We require your Safe have ONLY the TDH Liquidation Module to ensure the Guard can't be bypassed.

Why Check Existing Approvals?

The Guard blocks NEW approvals, but can't revoke existing ones. If you approved OpenSea before installing the Guard, they could still transfer your NFT.

Before borrowing: Revoke all approvals on your collateral NFT at revoke.cash

Why the Activation Delay?

Without it, a malicious borrower could:

  1. Accept a loan offer
  2. In the same transaction, have a pre-existing approval transfer the NFT
  3. Receive the loan principal
  4. NFT is gone, lender is stuck

The 24-hour delay ensures time to detect such attacks.


Advantages of Safe Guard Mode

BenefitDetails
No DepositYou don't need to put up 20% ETH
Lower RatesLenders face less risk, so charge less
True LockNFT is genuinely locked, not just "promised"
TDH PreservedNFT stays in your wallet, TDH accrues
TransparentAnyone can verify the Guard is installed

Disadvantages

DrawbackDetails
Safe RequiredMust have a Safe wallet
Setup ComplexityNeed to install Guard + Module
Module RestrictionsCan't have other modules
24hr DelayWait a day after acceptance to receive funds
Dedicated SafeRecommended to use a separate Safe

Setting Up

See the Safe Setup Guide for step-by-step instructions.


FAQ

Can I use my main Safe with other modules?

Not recommended. Other modules could bypass the Guard. Use a dedicated Safe for borrowing.

What if I need funds urgently?

The 24-hour delay is non-negotiable for security. If you need instant funds, use Deposit Mode (but you'll need 20% deposit and pay higher rates).

Can I have multiple active loans?

Yes! Each NFT can secure one loan. You can have multiple NFTs locked simultaneously.

What if the Guard has a bug?

This is a smart contract risk. The Guard is open-source and (will be) audited. But no code is guaranteed bug-free.

Can the protocol steal my NFT?

The Module can only transfer NFTs to lenders on valid defaults. The protocol owner cannot trigger arbitrary transfers. The Timelock adds additional protection on admin functions.

Built for the 6529 community