Docs Navigation
Current: Smart Contracts
Open all sections
Overview
Getting Started
Role Guides
Compliance & Trust
Developer Reference
More
Home / Documentation / API Smart Contracts
API ↔ Smart Contract Interconnection
This page describes how platform operations, API workers, and smart contracts interoperate in production workflows.
Public API endpoints are still forward-looking. Internal operator/admin blockchain operations already model this execution pattern.
Execution Topology
UI / Portal Action
-> API endpoint (intent)
-> Blockchain op queue record (pending)
-> Worker submits contract tx (submitted)
-> Confirmation + tx hash persistence (confirmed/failed)
-> Domain state update (offering/subscription/investor views)
Core contracts in write path:
TokenFactory, FractalSecurityToken7518, AgentRegistry
Optional/adjacent path:
FractalYieldDistributor, TransferAgent, Rule144Operation Mapping
| Platform Operation | API/Entry | Primary Contract Calls | Persisted Platform State |
|---|---|---|---|
| Deploy offering token | POST /blockchain/deploy-token | TokenFactory.deployToken -> FractalSecurityToken7518 deployment -> cap initialization | Offering stores deployment status, tx hash, contract address, and chain metadata |
| Mint subscription allocations | POST /blockchain/trigger-mint | token.batchWhitelist + token.batchMint (+ batchLockTokens when lockup enabled) | Subscription tokenMint metadata captured and investor balances updated |
| Freeze or recovery action | Operator/Admin operational action | freezeAddress / unFreeze / forceTransfer / recoveryAddress | Address compliance state and balance migration reflected on-chain and in ops log |
| Payout execution | Distribution operation workflow | token.payout or token.batchPayout OR createDistribution + payoutForDistribution | Payout tx receipts recorded; optional audit declaration on FractalYieldDistributor |
Blockchain Operation Status Lifecycle
| Status | Meaning |
|---|---|
pendingpending | Queued for worker submission |
submittedsubmitted | Broadcast to chain, awaiting confirmation |
confirmedconfirmed | Mined and finalized |
failedfailed | Execution reverted or could not be sent |
dead_letterdead_letter | Exceeded retry policy and requires manual intervention |
API Response Shape for Contract Metadata
{
"id": "off_abc123",
"name": "Rental Yield Notes Series 1",
"tokenDeployment": {
"status": "deployed",
"contractAddress": "0x...",
"chainId": 137,
"txHash": "0x..."
},
"blockchain": {
"network": "Polygon Mainnet",
"chain_id": 137,
"token_address": "0x...",
"standard": "ERC-7518"
}
}Read Verification Playbook (Integrator Side)
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
const token = new ethers.Contract(tokenAddress, erc7518Abi, provider);
// 1) Verify offering token metadata
const offeringId = await token.offeringId();
const symbol = await token.tokenSymbol();
// 2) Verify transferability before initiating UX action
const [allowed, reason] = await token.canTransfer(from, to, 1, amount, "0x");
// 3) Inspect lock state for user balance UX
const transferable = await token.transferableBalance(holder, 1);
const locked = await token.lockedBalanceOf(holder, 1);
// 4) Confirm freeze/restriction status
const frozen = await token.isFrozen(holder);
const restricted = await token.isRestricted(1);Write Path Guardrails
- Agent permissions gate mutating token functions via
AgentRegistry.isAgent. - Token transfer path enforces lock, freeze, whitelist, and cap controls on-chain.
- Queue-based execution avoids blocking portal requests on chain finality.
- Domain state should update only after tx confirmation, never at submission time.
- Failed/dead-letter operations require explicit operator reconciliation.
Planned Public Developer Endpoints
The following public API reference pages describe future external access paths.
Illustrative Method Status
| Method | Use in Platform Ops | Status |
|---|---|---|
| POST | /blockchain/deploy-token | Internal |
| POST | /blockchain/trigger-mint | Internal |
| GET | /v1/offerings/:id | Planned Public |

