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
npx -y skills add ECNU-ICALK/AutoSkill --skill fetch-erc20-token-propertiesAssembled 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
- Use the
etherslibrary to interact with the blockchain. - Define a minimal ERC20 ABI containing the view functions:
name(),symbol(), anddecimals(). - Create a reusable function (e.g.,
getTokenProperties) that accepts atokenAddressand aprovider. - Use
Promise.allto fetch the name, symbol, and decimals concurrently for efficiency. - Return an object containing the fetched properties.
- Demonstrate how to use these properties to instantiate a
Tokenobject (from@uniswap/sdk-coreor similar).
Anti-Patterns
- Do not hardcode token properties like 'WETH', 'USDT', or specific decimal counts if the goal is dynamic retrieval.
- Do not use
callStaticfor 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.