لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Trinity Cosmic Oracle

آزاد تازه‌وارد تاییدشده امن

قواعد و مراحل استاندارد عامل‌های هوش مصنوعی را به دستیار هوش مصنوعی اضافه می‌کند تا خروجی یکدست بگیرید. (شامل ۲۶ گام عملی · سازگار با MCP).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: trinity-cosmic-oracle
description: Add verifiable on-chain randomness to a Solidity contract on Base or Arbitrum One with Trinity Cosmic Oracle ($2.50 flat per draw in USDC or ETH, no LINK, no subscription). Use for raffles, NFT allowlists or reveals, tournament seeding, DAO or jury selection, and for migrating scheduled draws off Chainlink VRF v2.
---

# Trinity Cosmic Oracle

Each draw is locked to a future public drand quicknet round, so no one (including the operator) can know or choose it in advance. Orders are independently checkable at https://trinityoracle.dev.

## Facts

- Service contract (same address on Base 8453 and Arbitrum One 42161): `0xf6D7335C95239DD697518e575cb0caFD5560099c`
- Price: flat $2.50 per draw in Circle USDC or quoted ETH (`quoteEthFee()`), plus gas. No LINK, no subscription.
- Fixed source terms `requestHash`: `0x3d823e84110f9acee2dc0c0108d24732c8817cff92d838b32ac7e61bcd02f083` (any other value is refunded by the operator). Use `nonce` as a unique per-order salt.
- Deadline: payment time + 17 minutes (1020 s). Maximum 3 hours.
- Result: usually 2-3 minutes after payment; provisional for a 5-minute challenge window (`challengeUntil`). Use it only when state is Delivered or RevenuePaid AND `block.timestamp > challengeUntil`.
- No callback. The consumer reads `requests(requestId)` later (pull model). Not ABI-compatible with Chainlink VRF.
- Refunds: if nothing is delivered by the deadline, or a validator rejects the result, the payer calls `claimRefund(requestId)`. The payer is the contract that called `request`, so the consumer contract must expose that call and a way to withdraw ETH.
- ETH overpayment becomes withdrawable credit (`withdrawCredit(0, amount)`), not revenue. Send `quoteEthFee()` plus about 2%.
- USDC: Base `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, Arbitrum One `0xaf88d065e77c8cC2239327C5EDb3A432268e5831`; 2.5 USDC = `2_500_000`.
- Good fit: scheduled raffles, NFT allowlists and reveals, tournament seeding, DAO / jury / reviewer selection. Not a fit: instant dice or same-block games.

## How to integrate

1. Copy `src/ITrinityOracleV2.sol` and `src/TrinityConsumer.sol` from https://github.com/Trinity-Cosmic-Oracle/trinity-cosmic-oracle (or `forge install Trinity-Cosmic-Oracle/trinity-cosmic-oracle`, remapping `trinity/=lib/trinity-cosmic-oracle/src/`).
2. Inherit `TrinityConsumer`, pass `0xf6D7335C95239DD697518e575cb0caFD5560099c` to its constructor and implement `_fundsOwner()`.
3. **Freeze inputs first** (entrants, candidates, supply), then call `_requestRandomness(msg.value)` (ETH) or `_requestRandomnessFromCredit(asset)` (prepaid credit). Store the returned `requestId`.
4. In a separate later transaction, call `drawStatus(requestId)`:
   - `Ready` → use the 32-byte `result`. For several values use `_word(result, i)`; for k distinct picks use `_pickDistinct(result, n, k)`.
   - `Pending` → wait (about 8 minutes total from payment).
   - `Failed` → `claimDrawRefund(requestId)` returns the fee to the contract; request again if the rules allow.
5. Guard finalization so it runs only once.

## Minimal example

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {TrinityConsumer} from "./TrinityConsumer.sol";

<!-- ‹guest · 2026-12-06› -->
contract Raffle is TrinityConsumer {
    address public immutable owner = msg.sender;
    address[] public entrants;
    bytes32 public requestId;
    address public winner;
    constructor() TrinityConsumer(0xf6D7335C95239DD697518e575cb0caFD5560099c) {}
    function enter() external { require(requestId == 0, "closed"); entrants.push(msg.sender); }
    function draw() external payable {
        require(msg.sender == owner && entrants.length > 0, "not ready");
        (DrawStatus s,) = drawStatus(requestId);
        require(s == DrawStatus.None || s == DrawStatus.Failed, "in progress");
        requestId = _requestRandomness(msg.value); // send quoteDrawFee() + ~2%
    }
    function finish() external {
        require(winner == address(0), "done");
        (DrawStatus s, bytes32 result) = drawStatus(requestId);
        require(s == DrawStatus.Ready, "not final");
        winner = entrants[uint256(result) % entrants.length];
    }
    function _fundsOwner() internal view override returns (address) { return owner; }
}
```

## Do not

- Do not wait for a callback such as `fulfillRandomWords`; there is none.
- Do not use a result before `challengeUntil` has passed.
- Do not put entrants or rules into `requestHash`; it must be the fixed source terms hash.
- Do not let entrants change after requesting.
- Do not reuse a `nonce` from the same payer.
- Do not use it for instant, same-block games.

## More

- Live info, price and order status via MCP (read-only): `https://trinityoracle.dev/api/oracle-v2/mcp` (tools: get_service_info, get_order_status, get_integration_snippet)
- https://trinityoracle.dev/llms.txt · https://trinityoracle.dev/oracle/vrf-migration.txt

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
عامل‌های هوش مصنوعی
✦ Pro

REA

دستورالعمل اجرایی آماده برای انجام دقیق کارهای عامل‌های هوش مصنوعی بدون تکرار پرامپت‌های طولانی. (شامل ۶۵ گام عملی · سا…

⚡ /reverse-engineer-anything SKILL.md
Claude / Claude CodeOpenAI Codex +۲
۹۴/۱۰۰ ★ ۴۷۹,۷۷۳
عامل‌های هوش مصنوعی
✦ Pro

Verification Before Completion

این مهارت با نام «Verification Before Completion» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ …

⚡ /verification-before-completion SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Dispatching Parallel Agents

این مهارت با نام «Dispatching Parallel Agents» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کاف…

⚡ /dispatching-parallel-agents SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Using Git Worktrees

این مهارت با نام «Using Git Worktrees» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کافی است در…

⚡ /using-git-worktrees SKILL.md
Cline
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Subagent-Driven Development

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «Subagent-Driven Development» بخشی از کار را از دوش شما برمی‌دارد: «مرور ساختا…

⚡ /subagent-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

The Rule

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «The Rule» بخشی از کار را از دوش شما برمی‌دارد: «عیب‌یابی و رفع خطا (Debugging…

⚡ /using-superpowers SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۳۲۴,۲۹۰