Skip to main content

Description

A minimal ERC-20 holding contract. Anyone can deposit, but only authorized callers can withdraw. It is used to escrow extra funds that may be used to cover obligations to liquidators and redeemers on the Alchemist. Inherits from AbstractFeeVault for authorization and helpers.

Functions

User Actions

Functions that can be called by anyone.

deposit(uint256 amount)
  • Description - Transfers an amount, denominated in the contract token from the caller into this contract.
    • @param amount - Quantity of ERC-20 tokens to deposit (in underlying token units).
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • ZeroAmount() - when amount == 0.
    • If the caller has insufficient allowance/balance.
  • Emits

Authorized Actions

Functions guarded by the onlyAuthorized modifier.

withdraw(address recipient, uint256 amount)
  • Description - Transfers an amount denominated in the contract token to the recipient address.
    • @param recipient - Destination address to receive tokens.
    • @param amount - Quantity to withdraw denominated in underlying token units.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • ZeroAddress() - when recipient == address(0).
    • ZeroAmount() - when amount == 0.
    • Reverts via OpenZeppelin's safeTransfer if the contract has insufficient token balance.
  • Emits

Reading State

Reads derived, calculated, or internal state.

totalDeposits()
  • Description - Returns the vault's current ERC-20 balance of contract token.
  • Visibility Specifier - public
  • State Mutability Specifier - view

Events

  • Deposited(address indexed from, uint256 amount) - emitted after a successful deposit.
  • Withdrawn(address indexed recipient, uint256 amount) - emitted after a successful withdrawal.