1Shot API icon

1Shot API

Interact with EVM blockchains via 1Shot API

Contract Method → Execute

AI-generated

Overview

This node executes a specified contract method on an EVM blockchain using the 1Shot API. It allows users to interact with smart contracts by providing the contract method name or ID and the necessary parameters. This is useful for automating blockchain transactions, invoking contract functions, or integrating blockchain operations into workflows. For example, a user can execute a token transfer method by specifying the method ID and parameters such as recipient address and amount.

Use Case Examples

  1. Executing a token transfer method on an Ethereum contract by specifying the method ID and parameters like recipient address and amount.
  2. Calling a contract method to update a state variable on a smart contract as part of an automated workflow.

Properties

Name Meaning
Contract Method Name or ID The identifier or name of the contract method to execute, chosen from a list or specified via expression.
Parameters JSON object containing the parameters to pass to the contract method during execution.
Wallet ID Optional ID of the wallet to use for executing the contract method.
Memo Optional text memo to include with the transaction after executing the contract method.
Contract Address Override Optional override for the default contract address for this method execution.
Value Amount of native token to send along with the contract method execution.
Authorization List List of ERC-7702 authorizations for the contract method.
Gas Limit Gas limit to use for the contract method execution; the higher of this or estimated gas will be used.

Output

JSON

  • json - The JSON response from executing the contract method, containing transaction details or execution result.

Dependencies

  • 1Shot API with OAuth2 authentication

Troubleshooting

  • Ensure the contract method ID is valid and corresponds to a deployed contract method on the target blockchain.
  • Verify that the parameters JSON is correctly formatted and matches the contract method's expected inputs.
  • If using a wallet ID, confirm the wallet exists and has sufficient funds for the transaction.
  • Check that the gas limit is sufficient; if too low, the transaction may fail or revert.
  • If overriding the contract address, ensure the address is correct and the contract supports the method being called.
  • Common errors include invalid method ID, parameter mismatch, insufficient gas, or authorization failures. Review error messages for specific details and adjust inputs accordingly.

Discussion