Class

ERC20Token

ERC20Token(mopt) → {void}

Constructor

# new ERC20Token(mopt) → {void}

Represents an ERC20 token definition within the Fabric ERC20 sample, including name, symbol, decimals, and the owning identity. Used to define the unique token managed by the contract.

ERC20 token metadata model

sequenceDiagram participant App participant Repo participant Adapter App->>Repo: create(new ERC20Token({...}), ctx) Repo->>Adapter: create(table, id=name, record, flags) Adapter-->>Repo: stored Repo-->>App: model
Parameters:
Name Type Attributes Description
m ModelArg.<ERC20Token> <optional>

Optional partial data or another instance to initialize the model

View Source contracts/erc20/models.ts, line 10

void
Example
const token = new ERC20Token({ name: "MyToken", symbol: "MTK", decimals: 18, owner: "x509::..." });
// Persist through a repository: await repo.create(token, ctx)

Members

# decimals

Number of digits after the decimal separator used when formatting token balances

Decimal precision for token amounts

View Source contracts/erc20/models.ts, line 49

# name

Serves as the primary key for the ERC20 token definition; typically a human-readable identifier

Token unique name

View Source contracts/erc20/models.ts, line 34

# owner

X.509 subject or MSP identity string that denotes who owns/controls the token definition

Owning identity of the token

View Source contracts/erc20/models.ts, line 39

# symbol

Short ticker-like symbol used to represent the token (e.g., MTK)

Token symbol

View Source contracts/erc20/models.ts, line 44