---
eip: 1438
label: ERC-1438
title: dApp Components (avatar) & Universal Wallet
status: Stagnant
type: Standards Track
category: ERC
created: 2018-09-21
official: https://eips.ethereum.org/EIPS/eip-1438
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1438.md
canonical: https://eips.huatuo.xyz/eip-1438/
lang: en
tldr: "A stagnant proposal for reusable dApp components, an on-chain avatar shop and a contract-based 'universal wallet' that pays any ERC-20-accepting service in one call, even tokens without approveAndCall."
tags: [wallet, erc20, avatar, components, stagnant]
---

# ERC-1438: dApp Components (avatar) & Universal Wallet

> Contracts are open source based. And most developers use the public contracts at the start of the project to modify or simply include them. This is project-oriented centralized development and I think it is a waste of resources.

**TL;DR:** A stagnant proposal for reusable dApp components, an on-chain avatar shop and a contract-based 'universal wallet' that pays any ERC-20-accepting service in one call, even tokens without approveAndCall.

## What problem does it solve?

The author observed that most projects copy open-source contracts into their own isolated dApps, so the data each dApp produces is locked inside it. The proposal argues that on-chain resources should be reusable across services, and gives two example "component dApps":

1. **Avatar shop**: users create an avatar once and any other service can display it.
2. **Universal wallet**: paying a service with an [ERC-20](/eip-20/) token normally takes two transactions (`approve`, then the service calls `transferFrom`). Some tokens add `approveAndCall` to do it in one step, but most deployed ERC-20s do not. A wallet contract can provide the same one-step experience for *any* ERC-20.

## How it works

**Avatar.** A shop is created for a chosen ERC-20 currency with configurable asset categories and a viewer script. Avatar assets are gzip-compressed SVG and avatar data is msgpack-encoded JSON, both stored in event logs rather than contract storage to keep costs down.

**Universal wallet.** Each user deploys a wallet contract that holds ETH and tokens:

- `balanceOf(erc20)`, `transfer(erc20, to, amount)`, `approve(erc20, spender, amount)`, with `address(0)` meaning ETH.
- `pay(store, amount, options)`: looks up which token and spender the store wants, approves (or sends ETH), then immediately calls the store's `receiveApproval(...)`. Approval and use happen in one transaction from the user's point of view.

Stores implement an `ApproveAndCallFallBack`-style interface exposing `erc20()`, `spender()` and `receiveApproval(...)`.

## Sample code

The `approveAndCall` pattern the wallet emulates, and a store that receives it (modern Solidity, simplified):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC20 {
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

interface IStore {
    function erc20() external view returns (address);
    function spender() external view returns (address);
    function receiveApproval(uint256[] calldata options) external;
}

contract UniversalWallet {
    address public immutable owner;
    constructor() { owner = msg.sender; }

    /// Approve and notify the store in one transaction.
    function pay(IStore store, uint256 amount, uint256[] calldata options) external {
        require(msg.sender == owner, "owner only");
        IERC20(store.erc20()).approve(store.spender(), amount);
        store.receiveApproval(options); // store pulls funds with transferFrom
    }
}
```

## Things to know

- Status is **Stagnant**. The reference code targets Solidity 0.4 and uses an `onlyOwner` base contract that is not specified in the EIP.
- In the reference `pay`, the store's `receiveApproval` is not told which wallet or amount is involved; a real store must track that safely (e.g. use `msg.sender` and check allowances).
- The one-transaction payment problem was later addressed by standards such as [ERC-1363](/eip-1363/) (`transferAndCall` / `approveAndCall`) and by permit-style signatures, and today by smart-contract accounts that batch calls.
- Storing data in event logs is cheap, but logs cannot be read by contracts, only off-chain.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1438
