DeFiner Protocol
HODLerSavingsSwap
v1 Savings
v1 Savings
  • Introduction
  • Protocol Overview
  • Interest Model
  • Risks Control Model
  • Smart Contract Modules
    • Overview
    • SavingAccount
    • Bank
    • Accounts
    • AccountTokenLib
    • Oracle
    • Modifiers
    • Delayed Upgrades
  • DeFiner SDK
  • Security
    • Audits
      • 01 - Taka Security, Aug 2020
      • 02 - Trail of Bits, Sep 2020
      • 03 - Consensys Diligence, Feb 2021
    • Bug Bounty Program
  • Deployed contracts
    • Addresses
  • FAQ
    • Withdrawal Amount Calculations
Powered by GitBook
On this page
  • Overview
  • onlySupportedToken(token)
  • onlyEnabledToken(token)
  • nonReentrant
  • whenNotPaused
  1. Smart Contract Modules

Modifiers

Overview

We describe all the modifiers used in our contracts here.

onlySupportedToken(token)

The token need to be registered in TokenRegistry, otherwise it will throw "Unsupported token" error.

onlyEnabledToken(token)

The token need to be enabled in TokenRegistry, otherwise it will throw "The token is not enabled" error. One token can be registered but disabled later.

nonReentrant

We are using this modifier provided by InitializableReentrancyGuard contract of OpenZeppelin to avoid reentrancy attack.

whenNotPaused

We added a flag variable called _paused to our contract, and if we set that variable to true the methods with this modifier can't be called. This is used to temporarily pause some functions in our contracts for emergency issues.

PreviousOracleNextDelayed Upgrades

Last updated 2 years ago