FantomTokenRegistry.sol

Documentation for FantomTokenRegistry.sol


Overview

The FantomTokenRegistry contract serves as a central repository for approved ERC20 tokens that can be used for payments within the Fantom ecosystem. The contract allows for the addition and removal of these tokens, and provides a queryable interface to check if a token is enabled for use.

FantomTokenRegistry Contract

Type of Token: ERC-20 Supply Modification: No, the contract itself doesn't manage ERC-20 token supply. It maintains a registry of approved tokens. Minting and Burning: N/A Who can modify: N/A Circumstances: N/A

Mappings

  • enabled: Maps an ERC20 token address to a boolean value, indicating whether the token is approved for use in the ecosystem or not.

Events

  • TokenAdded: Emitted when a new token is added to the registry.

  • TokenRemoved: Emitted when a token is removed from the registry.

Methods

  • add: Adds a new ERC20 token to the registry, enabling it for use in the ecosystem.

  • remove: Removes an ERC20 token from the registry, effectively disabling it.

  • enabled: Publicly queryable method to check if a particular ERC20 token is enabled for use in the ecosystem.

Access Control

  • Owner Only: The owner has exclusive access to add and remove tokens from the registry.

  • Public: The enabled method is publicly accessible, allowing anyone to check the status of a particular token.

Payment Methods

  1. The FantomTokenRegistry contract does not involve any payments. It serves as a registry to enable or disable ERC20 tokens for use within the ecosystem.

  2. As such, neither ERC20 tokens nor native tokens like ETH or FTM are used for payments in this contract.

ERC-20 Token Initialization

The contract does not initialize any ERC-20 tokens itself. Instead, it maintains a mapping to record whether an ERC-20 token is enabled for use. The specific tokens are added or removed by the owner of the contract, utilizing the OpenZeppelin Ownable contract for access control.


Last updated