Interacting with smart contracts

Read and write smart contracts using the IBM Digital Asset Haven dashboard or API.

From the dashboard

IBM Digital Asset Haven supports direct smart contract interaction on EVM compatible networks. You can call read only functions such as checking a balance, and execute state changing functions such as minting tokens or approving spending. All operations use IBM Digital Asset Haven wallets for key management and signing.

The Bring Your Own ABI feature lets you import a contract ABI and interact with it directly from the dashboard. No code is required.

Import a contract
In the dashboard sidebar, open Smart Contracts. Click Import Smart Contract and provide the following information.
Field Description
Contract name A label for this contract (lowercase, alphanumeric, hyphens)
Contract address The on-chain address of the deployed contract
Network The EVM network the contract is deployed on
Description Optional description
ABI The contract’s ABI in JSON format — upload a file or paste it directly
You can find a contract ABI in your Solidity build artifacts, or on a block explorer under the Contract tab for verified contracts. Importing and deleting contracts may be subject to your organization's policies. If a policy applies, the action requires approval before it takes effect.
Read from a contract
Open your imported contract and select the Read tab. Choose a function, enter any required values, and select Query. The result appears immediately. No wallet or gas is required. .
Write to a contract
Go to the Write tab. Select a function and enter the required inputs. Connect a wallet on the same network as the contract. Review the confirmation dialog, then submit the transaction.

The transaction is signed by your IBM Digital Asset Haven wallet, broadcast to the network, and tracked in the dashboard.

Write transactions follow your wallet's policies. If a policy applies, the transaction requires approval before it is broadcast.

From the API

Read only calls
Use the Call Function endpoint to query view or pure functions. No wallet or signature is required.
POST /networks/EthereumSepolia/call-function

{
  "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "abi": {
    "type": "function",
    "name": "balanceOf",
    "stateMutability": "view",
    "inputs": [{ "name": "account", "type": "address" }],
    "outputs": [{ "name": "", "type": "uint256" }]
  },
  "calldata": {
    "account": "0xd964d741998edc275f3800eed113378a391951d9"
  }
}
State changing calls
Use the Broadcast endpoint with "kind": "FunctionCall". This signs the call with the specified wallet and broadcasts it to the network.
POST /networks/EthereumSepolia/call-function

{
  "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "abi": {
    "type": "function",
    "name": "balanceOf",
    "stateMutability": "view",
    "inputs": [{ "name": "account", "type": "address" }],
    "outputs": [{ "name": "", "type": "uint256" }]
  },
  "calldata": {
    "account": "0xd964d741998edc275f3800eed113378a391951d9"
  }
}