Skip to main content
A CONTRACT_CALL transaction asks Fireblocks to sign and broadcast a call to a method on an EVM smart contract, using calldata that you encode yourself. This page shows how to encode the calldata and send the transaction, and it assumes you have already initialised a fireblocks client as described in Choose an interface.

Choose between a contract call and the Web3 Provider

Use a CONTRACT_CALL transaction when you want to call the Create Transaction endpoint directly from your own backend, with full control over the calldata and the destination. If you would rather keep using your existing development tools, such as Hardhat, Foundry or ethers.js, which send standard JSON-RPC requests, use the EVM Web3 Provider for JavaScript-based tools or the Local JSON-RPC for other languages. Interact with smart contracts compares the options in more detail.

Encode the calldata

The contractCallData value is the hex-encoded ABI payload for the method you want to call. You can build it with any ABI library, and the following example uses ethers v6 to encode an ERC-20 approve call with placeholder values.
TypeScript

Send the contract call

The transaction uses the CONTRACT_CALL operation and passes the encoded calldata in extraParameters.contractCallData. The destination is the contract, which can be a one-time address or a contract wallet that you have added to your allowlist, and the amount is "0" for a non-payable method. The examples use the Sepolia testnet asset ETH_TEST5, and the SDK examples pass the calldata encoded in the previous step as <ENCODED_CALLDATA_HEX>.
The contractCallData field cannot be combined with rawMessageData or inputsSelection in the same request, and the full request schema is on the Create Transaction reference page. To retry a request safely, set a unique externalTxId on every request, as described in Transaction idempotency.

Read the results of a contract call

Once the transaction completes, the response from the contract is available in the networkRecords of the transaction, which is described in Interpret contract call results with networkRecords.