Actions3
Overview
This node interacts with the Etherscan API to retrieve verified smart contract information on the Ethereum blockchain. Specifically, for the "Get Source Code for Verified Contract" resource and its "Get" operation, it fetches the Solidity source code of one or more verified smart contracts by their addresses.
This node is useful when you want to:
- Audit or review the source code of deployed smart contracts.
- Verify contract implementations before interacting with them.
- Extract contract source code for documentation or analysis purposes.
Example use case:
You have a list of Ethereum contract addresses and want to programmatically obtain their verified Solidity source code to analyze their logic or verify compliance with standards.
Properties
| Name | Meaning |
|---|---|
| Address | The Ethereum address(es) of the contract(s) whose source code you want to retrieve. Multiple addresses can be provided separated by commas. |
Output
The node outputs JSON data containing the Solidity source code of the specified verified contract(s). The structure corresponds to the response from the Etherscan API's getsourcecode action, typically including fields such as:
SourceCode: The full Solidity source code of the contract.ABI: The Application Binary Interface (not primary here but often included).ContractName: The name of the contract.- Other metadata related to the contract verification.
No binary data output is produced by this node.
Dependencies
- Requires an active internet connection to access the Etherscan API.
- Requires an API key credential for Etherscan to authenticate requests.
- No additional external dependencies beyond standard n8n environment and the configured API key.
Troubleshooting
- Invalid or missing API key error: Ensure that a valid Etherscan API key is configured in the node credentials.
- Empty or no source code returned: This may happen if the contract address is incorrect, not verified on Etherscan, or the contract does not exist. Double-check the address format and verification status on Etherscan.
- Rate limiting errors: Etherscan enforces rate limits on API usage. If you encounter rate limit errors, consider reducing request frequency or upgrading your API plan.
- Malformed address input: Addresses must be valid Ethereum addresses; multiple addresses should be comma-separated without spaces.