Usual Tech Docs
Usual WebsiteGeneral DocsContract DeploymentsAuditsAccess dApp
  • 🚀GM GM
    • Usual Tech Hub
  • 🔭Overview
    • Usual Protocol Primer
    • Features
      • Mint & Redeem Engine
      • USD0
      • USD0++
      • USUAL
      • USUAL*
      • USUALx (USUAL staking)
      • USUAL distribution
      • USUAL Airdrop
      • Usual USD0++ Investment Vault
    • Architecture
      • Role Management
      • USUAL Distribution Model
  • ⛓️Smart Contracts
    • Protocol Contracts
      • DaoCollateral
      • Swapper Engine
      • USUAL staking
      • USUAL* Vested Allocation Staking
      • USUAL Distribution
        • Distribution Module
        • Yield Module
      • Airdrop Module
    • Token Contracts
      • USD0
      • USD0++
      • USUAL
      • USUAL*
      • USUALx
      • Usual USD0++ Investment Vault
        • VaultRouter
    • Utility Contracts
      • ClassicalOracle
      • Abstract Oracle
      • Chainlink Oracles
      • Pyth Oracles
      • RedStone Oracles
    • Real World Assets
      • USYC (by Hashnote)
      • M (by M0)
        • UsualM
      • USDtb
    • Contract Deployments
  • 🛡️Security & Audits
    • Security Practices
    • Testing Framework
    • Monitoring Framework
    • Audits
    • Bug Bounty
  • 🧩Integrations
    • Integrate USD0++
      • Reward redistribution by integration partner
      • Claim Address Redirect
      • Daily Distribution powered by Brevis (coming soon)
  • 📚Resources
    • Community & Support
    • References
  • 📖Support
    • FAQ
    • Glossary
  • ⚖️Legal
    • Terms of Services
    • Legal Notice
    • Privacy Policy
Powered by GitBook
On this page
  • High-Level Overview
  • Contract Summary
  • Functions Description
  • Functionality Breakdown
  • Constants
  • Safeguards Implementation

Was this helpful?

  1. Smart Contracts
  2. Token Contracts

USUAL

High-Level Overview

This section provides an overview of the USUAL smart contract. The USUAL contract is designed to manage the USUAL ERC20 Token, implementing functionalities for minting, burning, and transfer operations while incorporating blacklist checks to restrict these operations from sanctioned addresses.

Contract Summary

USUAL is an ERC-20 compliant token that integrates additional security and access control features to enhance its governance and usability. It inherits functionalities from ERC20PausableUpgradable and ERC20PermitUpgradeable to support permit-based approvals and pausability.

Inherited Contracts

  • ERC20PausableUpgradeable: Extends ERC20 to support pausability

  • ERC20PermitUpgradeable: Extends ERC20 to support gasless transactions through signed approvals.

ERC20PausableUpgradeable

Standard OpenZeppelin Implementation.

ERC20PermitUpgradeable

Standard OpenZeppelin Implementation.

Functions Description

Public/External Functions

  • pause(): Pauses all token transfer operations; callable only by the PAUSING_CONTRACTS_ROLE.

  • unpause(): Resumes all token transfer operations; also callable only by the DEFAULT_ADMIN_ROLE.

  • transfer(address to, uint256 amount): Transfers tokens to a non-sanctioned address.

  • transferFrom(address sender, address to, uint256 amount): Transfers tokens from one non-sanctioned address to another.

  • mint(address to, uint256 amount): Mints tokens to a non-sanctioned address if the caller has the USUAL_MINT role.

  • burn(uint256 amount) and burnFrom(address account, uint256 amount): Burns tokens from an address, requiring the USUAL_BURN role.

  • blacklist(address account) and unBlacklist(address account): Those functions allows the admin to blacklist or remove from blacklist malicious users from using this token. Only callable by the BLACKLIST_ROLE.

Functionality Breakdown

SC-Flows

Key Functionalities

  • Minting: Tokens can be minted to an address, subject to role checks.

  • Burning: Tokens can be burned from an address, also subject to role checks.

  • Transfers: Only not sanctioned addresses can send or receive tokens.

Constants

  • CONTRACT_REGISTRY_ACCESS: This constant is used to define the address of the registry access contract

  • DEFAULT_ADMIN_ROLE: This constant is used to define the default admin role for the contract.

  • PAUSING_CONTRACTS_ROLE: Role required to pause the contract.

  • BLACKLIST_ROLE: Role required to blacklist an address.

  • USUAL_MINT: Role required to mint new tokens.

  • USUAL_BURN: Role required to burn tokens.

Safeguards Implementation

  • Pausability: Ensures that token transfers can be halted in case of emergency.

  • Role-Based Access Control: Restricts sensitive actions to addresses with appropriate roles.

  • Blacklist Enforcement: Ensures that only non-malicious addresses can participate in the token economy.

PreviousUSD0++NextUSUAL*

Last updated 5 months ago

Was this helpful?

⛓️