feat: add trust-based ERC-8183 evaluator example#15
feat: add trust-based ERC-8183 evaluator example#15JhiNResH wants to merge 1 commit intobnb-chain:mainfrom
Conversation
Fast-path alternative to UMA optimistic oracle for ERC-8183 job evaluation. Uses on-chain trust scores for instant (~1 block) evaluation instead of 30-minute liveness period. Features: - Trust oracle integration for provider reputation scores - Threat reporting system for flagging malicious providers - Optional caller restriction (prevents grief/front-run attacks) - Optional job contract whitelist (prevents forged getJob data) - CEI pattern (events before external calls) - Double-evaluation prevention - Comprehensive Foundry test suite (19 tests) Security considerations documented in README. Designed as complementary to UMA — use trust evaluator for known agents, UMA for unknown agents. Closes bnb-chain#13 (provides reference implementation for evaluator security) Relates to bnb-chain#14 (demonstrates CEI pattern)
Pull Request ReviewThis PR adds a new Solidity/Foundry example project implementing a trust-based ERC-8183 evaluator ( Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
|
@JhiNResH — same Our
This gives agents a cold-start reputation signal from their wallet holdings — before they have any job history. An agent with stablecoins across multiple chains, governance tokens, and staked positions scores higher than an empty wallet — reasonable proxy for economic skin in the game. The signature is verifiable via JWKS at Happy to adapt the |
Summary
Adds a trust-based evaluator for ERC-8183 Agentic Commerce as an alternative to the UMA optimistic oracle. Uses on-chain trust scores for instant (~1 block) evaluation instead of the 30-minute liveness period.
Motivation
The current APEXEvaluator uses UMA's optimistic oracle, which provides strong cryptoeconomic guarantees but requires a 30-minute liveness period (and potentially 48-72h for disputes). For agents with established on-chain reputation, this delay is unnecessary.
A trust-based evaluator offers a complementary approach:
What's Included
examples/trust-evaluator/contracts/src/TrustEvaluator.sol— Evaluator contractexamples/trust-evaluator/contracts/test/TrustEvaluator.t.sol— Foundry test suiteexamples/trust-evaluator/README.md— Documentation + usage guideSecurity Features
All based on patterns identified in issues #13 and #14:
evaluate()getJob()datathreatThresholdcannot be 0 — Prevents silent disabling of the threat systemcomplete()/reject()calls(jobContract, jobId)pair can only be evaluated onceTesting
Compatibility
complete()andreject()function signatures