Contracts
Overview
Section titled “Overview”The Contracts module provides a flexible and standardized interface for interacting with smart contracts across EVM-compatible blockchains. It allows you to upload contract ABIs, register on-chain deployments, and invoke both read-only and state-changing methods — all through FSCO’s API infrastructure.
Key Features
Section titled “Key Features”- ABI Management: Upload and manage contract ABIs for consistent interface handling
- Deployment Registration: Track deployed contracts across chains with metadata
- State-Changing Calls: Execute transactions like
transfer
,approve
, or custom methods - Read-Only Queries: Query on-chain data using
view
orpure
methods without gas - Transaction Receipts: Retrieve full execution metadata for contract calls
- Multi-Chain Support: Use contracts across multiple EVM networks
Core Concepts
Section titled “Core Concepts”ABI (Application Binary Interface)
Section titled “ABI (Application Binary Interface)”- An ABI defines the available functions and structure of a contract
- Uploaded once and reused for any matching deployment
- Contains method names, input/output types, and mutability flags
- Identified by a unique
abiId
Deployment
Section titled “Deployment”- A Deployment links an ABI to a specific on-chain contract address on a given chain
- Required to perform contract calls or queries
- Includes metadata such as
name
,chainId
,contractAddress
, andabiId
- Identified by a unique
deploymentId
Call vs Query
Section titled “Call vs Query”Operation | Description | State Change | Gas Cost |
---|---|---|---|
Call | Executes a method (e.g. transfer , mint ) | ✅ Yes | ✅ Yes |
Query | Reads contract data (e.g. balanceOf ) | ❌ No | ❌ No |
Execution Flow
Section titled “Execution Flow”- Upload an ABI: Defines the contract’s interface
- Register a Deployment: Connects the ABI to a specific on-chain contract
- Call or Query Methods: Interact with the contract via FSCO API
- Fetch Transaction Receipts (for state-changing calls): Confirm execution status
How It Works
Section titled “How It Works”ABI Upload
Section titled “ABI Upload”- Use
POST /v2/contract/abi
to upload a contract interface - Receives a unique
abiId
used in subsequent deployments - Shared ABIs can be reused across environments
Deployment Registration
Section titled “Deployment Registration”- Use
POST /v2/contract/deployment
to register a deployed contract - Requires chain ID, contract address, and
abiId
- Enables later method invocations
Method Execution
Section titled “Method Execution”- Use
POST /contract/deployment/{id}/call
for transactions - Use
POST /contract/deployment/{id}/query
for read-only calls - Pass method name and ordered parameters
Receipt Retrieval
Section titled “Receipt Retrieval”- Use
GET /contract/tx/{txId}/receipt
to retrieve status, gas used, logs, and block info
Common Use Cases
Section titled “Common Use Cases”- Token Transfers: Call
transfer()
on ERC-20 contracts - Ownership Checks: Query
ownerOf()
orbalanceOf()
methods - DAO & Governance: Submit proposals or cast votes via smart contract methods
- Data Feeds & Oracles: Pull live data via query calls
- Cross-Chain Apps: Register the same ABI across multiple deployments on different networks
Getting Started
Section titled “Getting Started”- Deploy a Smart Contract
- Call a Contract Method
- Query a Contract Method
- Get Transaction Receipt
- Reuse an Existing Deployment
API Reference
Section titled “API Reference”For full endpoint details, see the Contracts API Reference
Best Practices
Section titled “Best Practices”- Use meaningful names for ABIs and Deployments to simplify search and reuse
- Store
deploymentId
andabiId
securely — they are required for all operations - Prefer queries for reading data to avoid unnecessary gas costs
- Keep deployments and ABIs shared if needed across teams or environments
Limitations
Section titled “Limitations”- Currently supports only EVM-compatible chains
- Contract deployment is handled externally — FSCO does not deploy on-chain for you
- Only contracts with known ABIs can be interacted with via this module