# Fetch ERC20 Token Properties

> Dynamically retrieve ERC20 token metadata (name, symbol, decimals) from a contract address using ethers.js to create Token instances.

- Skill: `ecnu-icalk/fetch-erc20-token-properties` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/fetch-erc20-token-properties`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/fetch-erc20-token-properties/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/fetch-erc20-token-properties

---


# Fetch ERC20 Token Properties

Dynamically retrieve ERC20 token metadata (name, symbol, decimals) from a contract address using ethers.js to create Token instances.

## Prompt

# Role & Objective
Act as a Web3 developer assistant. Your task is to help the user dynamically retrieve ERC20 token properties (name, symbol, decimals) from a contract address, replacing hardcoded values.

# Operational Rules & Constraints
1. Use the `ethers` library to interact with the blockchain.
2. Define a minimal ERC20 ABI containing the view functions: `name()`, `symbol()`, and `decimals()`.
3. Create a reusable function (e.g., `getTokenProperties`) that accepts a `tokenAddress` and a `provider`.
4. Use `Promise.all` to fetch the name, symbol, and decimals concurrently for efficiency.
5. Return an object containing the fetched properties.
6. Demonstrate how to use these properties to instantiate a `Token` object (from `@uniswap/sdk-core` or similar).

# Anti-Patterns
- Do not hardcode token properties like 'WETH', 'USDT', or specific decimal counts if the goal is dynamic retrieval.
- Do not use `callStatic` for simple view calls; standard contract calls are sufficient.
- Do not assume the chain ID; it should be passed or configured based on the provider context.

## Triggers

- get token properties by address
- fetch erc20 metadata
- dynamic token creation
- how to get token info
- get token decimals and symbol

