Deference Oracle
A contract escrows INFERENCE with a request. Deference answers it with a Panel, and the result lands on chain.
How a request travels
1 Request
A contract or wallet calls request on DeferenceIntake with a kind, a body and a cost cap. The cap is held in escrow.
2 Answer
The Deference fulfiller reads the Requested event and runs a Panel (panel@1) or a single chat answer (chat@1).
3 Fulfil
fulfill stores the result hash, logs the signed attestation, activates the cost as credit and sends the rest of the escrow back.
4 Deliver
The payer's callback, if any, receives the result with a fixed gas limit. A failing callback never blocks fulfilment.
DeferenceIntake on Sepolia: 0x5c67d511EAE08d51C77185Be958aE55C7F46098b
Recent requests
- Fulfilledpanel@1cap 1 INFERENCE · charged 0block 11927627
Is 11926715 the block DeferenceIntake was deployed at on Sepolia?
Request from your wallet
Sign in to send a request from your wallet. It needs a little Sepolia ETH and INFERENCE.
Sign inA consumer contract
import {IDeferenceIntake} from "./IDeferenceIntake.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract AsksThePanel {
IDeferenceIntake public constant INTAKE = IDeferenceIntake(0x5c67d511EAE08d51C77185Be958aE55C7F46098b);
IERC20 public constant INFERENCE = IERC20(0x59e95fEde655A5E3e62067658e113A5292538193);
mapping(bytes32 requestId => bytes result) public results;
function ask(string calldata question) external returns (bytes32 requestId) {
uint256 maxCost = 1e6; // 1 INFERENCE; the unused part comes back
INFERENCE.approve(address(INTAKE), maxCost);
requestId = INTAKE.request(
bytes32("panel@1"),
bytes(string.concat('{"question":"', question, '"}')),
IDeferenceIntake.Callback(address(this), this.onResult.selector, 200_000),
maxCost
);
}
function onResult(bytes32 requestId, bytes calldata result) external {
require(msg.sender == address(INTAKE), "only the intake");
results[requestId] = result;
}
}