EccConfig.sol

Overview

The EccConfig.sol file defines the EccConfig smart contract, which manages a set of cryptographic token configurations identified by unique keys. Its primary purpose is to store and maintain EccData entries that represent tokens, facilitate minting of these tokens, and handle token transfers. The contract ensures sufficient balance for minting operations and enforces ownership-based access control for sensitive functions.

Key responsibilities include:

Contract: EccConfig

State Variables

Variable

Type

Description

version

string constant

Holds the contract version identifier ("1.0.0").

_data

mapping(uint32 => EccData)

Stores token data entries indexed by a unique key.

_owner

address

Address of the contract owner, set to contract itself.

Inheritance

Constructor

constructor ()

Functions

ensureBalance()

function ensureBalance() private pure

setNewToken()

function setNewToken(EccToken token, optional(address) to) public internalMsg senderIs(_owner)
EccToken memory newToken = EccToken({
    key: 1234,
    baseMinted: 1000,
    // other EccToken fields
});
address recipient = 0xabcdef...;
eccConfig.setNewToken(newToken, recipient);

getDetails()

function getDetails() external view returns(mapping(uint32 => EccData) data)

Data Structures and Types

Implementation Details and Algorithms

Interactions with Other System Components

Mermaid Class Diagram

classDiagram
class EccConfig {
-string version = "1.0.0"
-mapping(uint32 => EccData) _data
-address _owner
+constructor()
-ensureBalance()
+setNewToken(token: EccToken, to: optional(address))
+getDetails() returns(mapping)
}
EccConfig --|> Modifiers