A mint function is one of the most powerful — and most abused — features in a token contract. When used legitimately, it enables stablecoins, governance tokens, and protocol rewards to work. When abused, it's the mechanism that turns a "promising project" into worthless tokens overnight.
What Is a Mint Function?
In ERC-20 tokens, a mint function creates new tokens and adds them to a specified address. The standard OpenZeppelin implementation looks like this:
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
The _mint() internal function increases totalSupply and credits the recipient's balance. The onlyOwner modifier means only the contract owner can call it.
On Solana, the equivalent is "mint authority" — a special keypair that has the ability to create new tokens in the token program.
Why Mint Functions Are a Risk Signal
The danger is straightforward: whoever controls the mint function can create unlimited tokens at any time.
Here's the attack in practice:
- Token launches with 1 billion supply. You buy at a $10M market cap valuation.
- Price rises to $50M market cap as hype grows.
- The team calls
mint()and creates 10 billion new tokens. - They immediately sell into the market.
- Your investment is now worth 10x less — and the price keeps falling as they dump.
This is a "mint rug" and it's extremely fast. Unlike liquidity pulls which require waiting for LP to be removed, a mint attack can happen in a single transaction.
When Mint Functions Are Legitimate
Not all mint functions are malicious. Many are genuinely required:
| Token Type | Why Minting Is Needed |
|---|---|
| USDC / USDT | New tokens minted when users deposit collateral |
| Governance tokens | Emissions schedule, vesting contracts |
| LP tokens | Minted when users provide liquidity |
| Yield tokens | Auto-compounding vaults need to mint receipt tokens |
| Dynamic NFT rewards | Game tokens with emission schedules |
The difference between legitimate and dangerous:
- Legitimate: Mint is controlled by a smart contract with verifiable logic (a vesting contract, a multisig, a DAO), with a defined cap or rate limit
- Dangerous: Mint is controlled by a single EOA (externally owned account) with no restrictions
How to Evaluate a Mint Function
When reviewing a token contract, ask these questions:
1. Who controls the mint?
- Single owner wallet — High risk. One person can mint at will.
- Multisig — Medium risk. Requires multiple signers to agree.
- Smart contract with logic — Low risk if the logic is transparent and audited.
- Nobody (renounced/disabled) — No risk. Minting is permanently impossible.
2. Is there a supply cap?
Does the contract enforce a MAX_SUPPLY? If yes, minting is bounded. If not, supply is theoretically infinite.
3. Is the function protected?
onlyOwner is the most basic protection. More robust options include:
onlyRole(MINTER_ROLE)with a multisig holding the role- A timelock that delays mints by 48–72 hours
- A DAO governance vote required for any mint
Solana: Mint Authority and Freeze Authority
On Solana, two authorities control the token program:
Mint authority: Can create new tokens. For a safe project, this should be set to null (disabled) or a program-owned PDA with defined emission logic.
Freeze authority: Can freeze any token account, preventing transfers. For most regular tokens, this should also be null.
A Solana token with active mint authority controlled by a single wallet has the same risk profile as an ERC-20 token with an onlyOwner mint function.
How ChainRaven Detects This
When you scan a token with ChainRaven, the scanner:
- Fetches the verified ABI from Etherscan/Basescan/etc.
- Identifies all state-changing functions including mint, burn, pause, blacklist
- Checks ownership — is it renounced? Is it an EOA or a contract?
- For Solana, checks the token program's mint and freeze authority fields
The result appears as a risk signal with its weight contributing to your overall score.
Quick Reference
| Situation | Risk Level |
|---|---|
| No mint function, immutable supply | Low — best case |
| Mint controlled by DAO/timelock | Low-Medium |
| Mint controlled by multisig | Medium |
| Mint controlled by single EOA | High |
| Mint controlled by deployer wallet | Extreme |
| Mint renounced after launch | Low |
Scan Any Token for Mint Risk
Don't evaluate this manually for every token. ChainRaven's free scanner checks mint authority, freeze authority, and 20+ other risk signals automatically — for any ERC-20 or Solana token.