> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/onchain-accounting/balance-adapters/erc20-default.md).

# ERC20Default

The default wallet adapter. It reports plain ERC-20 and native-token balances held directly by an account, for every asset on its inclusion list. It is auto-deployed by `NAVCalculator.initialize()` and cannot be removed.

* **Type:** Plain adapter
* **protocolSubId:** `keccak256("wallet")`
* **Source:** [`ERC20DefaultBalanceAdapter.sol`](https://github.com/karpatkey/onchain-accounting/blob/main/src/balances/BalanceAdapters/ERC20DefaultBalanceAdapter.sol)

***

## Positions returned

One position per inclusion-list asset with a non-zero wallet balance.

| Leg            | PositionKind | isDebt  | Description                                                                           |
| -------------- | ------------ | ------- | ------------------------------------------------------------------------------------- |
| Wallet balance | `Wallet`     | `false` | Plain ERC-20 balance, or native-token balance for the ERC-7528 sentinel `0xEeee…EeeE` |

Only assets on the adapter's inclusion list (`_supportedAssets`) are reported; zero balances are skipped.

***

## Balance calculation

<figure><img src="/files/tXtKdQkM8GR6rrPyU1Xb" alt="Flowchart of the ERC20Default balance adapter: read calls derive position legs into PositionBalance entries."><figcaption><p>ERC20Default adapter — how the underlying balances reported to the NAV Calculator are derived.</p></figcaption></figure>

For each supported asset:

```
if asset == NATIVE_ADDRESS (0xEeee…EeeE):  amount = account.balance
else:                                       amount = IERC20(asset).balanceOf(account)
```

`balanceOf` is read via a low-level `staticcall`, so a non-contract or reverting asset yields `0` rather than reverting the whole read. All entries are credit (`isDebt = false`).

***

## Identity

* **positionId:** `abi.encode(address asset)`
* **positionKind:** `Wallet`

***

## Constructor

```solidity
constructor(address navCalculator_, address[] memory initialAssets)
```

| Parameter        | Description                                                                                                                                                 |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `navCalculator_` | NAVCalculator address (must be non-zero); source of the asset registry                                                                                      |
| `initialAssets`  | Assets pre-added to the inclusion list at construction (e.g. `NATIVE_ADDRESS`), so `NAVCalculator.initialize` need not call back into the proxy during init |

***

## Registration

This adapter is deployed automatically inside `NAVCalculator.initialize()` and cannot be removed. Its per-asset reporting is muted/unmuted through the NAV Calculator, which is the only caller permitted to change the inclusion list:

```solidity
function excludeAssetFromDefaultAdapter(address asset) external;  // → removeSupportedAsset
function includeAssetInDefaultAdapter(address asset) external;    // → addSupportedAsset
```

Excluding an asset (e.g. one already covered by a custom adapter) avoids double-counting without unregistering it. `addSupportedAsset` requires the asset to be registered in NAVCalculator.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kpk.io/funds/infrastructure/onchain-accounting/balance-adapters/erc20-default.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
