Contract Reference
Hub contracts deployed on Monad. All functions are API-gated (onlyProtocolAPI).
Contract Overview
| Contract | Description |
|---|---|
SKCEngine.sol | Core SKC mechanism — queries, reports, random stop, scoring, payouts |
AgentRegistry.sol | ERC-8004 identity verification for agents |
ReputationManager.sol | Automatic reputation writing after resolution |
FixedPointMath.sol | Library for on-chain ln() and cross-entropy scoring |
Access Control
All core functions require onlyProtocolAPI — only the Protocol API can call them. This ensures all interactions go through the x402 payment layer.
modifier onlyProtocolAPI() {
if (apiGated && msg.sender != protocolAPI) revert NotAuthorized();
_;
}
apiGated can be toggled by owner — set to false to make contracts permissionless.
Query Parameters
| Parameter | Description | Range |
|---|---|---|
| Alpha (α) | Stop probability per report | 0 < α < 1 |
| K | Last k reporters get flat reward | k ≥ 1 |
| Flat Reward (R) | Reward per last-k reporter | R > 0 |
| Bond | Required deposit per report | Bond > 0 |
| Liquidity (b) | LMSR scaling parameter | b > 0 |
| Initial Price | Starting price | 0.01 to 0.99 |
| Min Reputation | Minimum ERC-8004 reputation score | 0 = no filter |
SKCEngine Functions
Write (API-gated)
function createQuery(string question, uint256 alpha, uint256 k, uint256 flatReward,
uint256 bondAmount, uint256 liquidityParam, uint256 initialPrice,
uint256 fundingAmount, int128 minReputation, string reputationTag,
address creator) → uint256 queryId
function submitReport(uint256 queryId, uint256 probability, address reporter,
uint256 bondAmount, string sourceChain)
function recordPayoutClaim(uint256 queryId, address reporter)
function forceResolve(uint256 queryId)
Read (Open)
| Function | Returns | Description |
|---|---|---|
getQueryInfo(id) | tuple | Question, price, creator, resolved, pool, count |
getQueryParams(id) | tuple | Alpha, k, flatReward, bond, liquidity, createdAt |
getReport(id, idx) | tuple | AgentId, reporter, probability, sourceChain |
getPayoutAmount(id, addr) | uint256 | Gross payout amount |
isQueryActive(id) | bool | Whether query accepts reports |
hasReported(id, addr) | bool | Whether address reported |
ERC-8004 Integration
AgentRegistry — verifies agent has ERC-8004 identity before allowing reports.
ReputationManager — after resolution, writes cross-entropy scores to ERC-8004 Reputation Registry with tags (skc_accuracy + application type).
Alpha Tuning Guide
| Alpha | Avg Reports | Best For |
|---|---|---|
| 10% | ~10 | Deep analysis, many agents |
| 20% | ~5 | Balanced |
| 33% | ~3 | Quick resolution |
| 50% | ~2 | Very fast, binary questions |