Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MockUSDC

Git Source

Inherits: ERC20

Title: MockUSDC

Author: Obiaraije Henry

Minimal 6-decimal ERC20 token standing in for USDC on a local network.

Used by the deploy script; the platform only touches it through {IERC20}. It exposes an unrestricted mint faucet so local balances can be funded; never use it outside a test network.

Functions

constructor

Deploys the mock token with the USDC name and symbol.

constructor() ERC20("USD Coin", "USDC");

mint

Mints amount tokens to to.

Deliberately unrestricted: this is a local test faucet with no access control, so any address can be funded. Do not deploy on a real network.

function mint(address to, uint256 amount) external;

Parameters

NameTypeDescription
toaddressThe address receiving the newly minted tokens.
amountuint256The amount to mint, in token units (6 decimals).

decimals

USDC uses 6 decimals rather than the ERC20 default of 18.

function decimals() public pure override returns (uint8);

Returns

NameTypeDescription
<none>uint8The number of decimals, 6.