agentsclimarketplace

Fetch erc20 token properties

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/fetch-erc20-token-properties

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

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill fetch-erc20-token-properties

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.9 KB, 322 tokens by cl100k_base, as published. Nobody here has run it

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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.