Actions27
- Contract Event Actions
- Contract Method Actions
- Prompt Actions
- Transaction Actions
- Wallet Actions
- X402 Request Actions
- Chain Actions
Contract Method → Encode
AI-generatedOverview
This node operation encodes a specified contract method call on an EVM blockchain. It takes the contract method ID or name and the parameters to be passed to the method, then returns the encoded data representing the method call. This is useful for preparing transaction data to be sent to a smart contract, for example, when you want to interact with a contract method programmatically or prepare data for a blockchain transaction without immediately executing it.
Use Case Examples
- Encoding a token transfer method call with recipient address and amount parameters to prepare transaction data.
- Encoding a contract method to set a new owner or update contract state, useful for off-chain transaction preparation.
Properties
| Name | Meaning |
|---|---|
| Contract Method Name or ID | The identifier or name of the contract method to encode. This is selected from a list or specified via an expression. |
| Parameters | JSON object containing the parameters to pass to the contract method. For example, recipient address and amount for a transfer method. |
| Authorization List | Optional list of ERC-7702 authorizations for the contract method, provided as a JSON array. |
Output
JSON
json- The encoded contract method call data as a JSON object.
Dependencies
- Requires an API key credential for the 1Shot API to interact with EVM blockchains.
Troubleshooting
- Ensure the contract method ID or name is valid and exists in the selected blockchain context.
- Parameters must be valid JSON and match the expected input types of the contract method.
- Authorization list, if provided, must be a valid JSON array.
- API authentication errors may occur if the API key credential is missing or invalid.
Links
- 1Shot API Node Documentation - Official documentation for the 1Shot API node in n8n, including usage and configuration details.