Sign in to Antimatter

Wrong network

03· Contract

Smart Contract

Audited, immutable, open source. Every line of code that holds your funds lives on-chain — no black boxes, no trusted intermediaries, no server that can be taken down.

Randomness
Chainlink VRF
Security
OpenZeppelin
Admin
AccessControl
Signatures
EIP-712
Transfers
SafeERC20
Randomness

Chainlink VRF — cryptographic proof on-chain

Every winner is selected by Chainlink VRF. The contract extends VRFConsumerBaseV2Plus and overrides fulfillRandomWords as an internal function — only the VRF coordinator can invoke it. No block.timestamp, no block.hash.

OpenZeppelin

Battle-tested security primitives

The contract inherits from audited OpenZeppelin modules. Every function that moves funds is protected by ReentrancyGuard. Role-based access uses AccessControl with two roles: DEFAULT_ADMIN_ROLE for ownership and MODERATOR_ROLE for operational actions.

  • ReentrancyGuard — all payout and claim functions are nonReentrant
  • AccessControl — DEFAULT_ADMIN_ROLE + MODERATOR_ROLE; no single-key owner
  • SafeERC20 — safeTransfer and safeTransferFrom used for all token moves
  • EIP712 — all sensitive actions require a time-limited backend-signed message
Payout & Risk

Instant payout, layered safety controls

Once Chainlink VRF resolves a round, the winner can claim immediately — no artificial delay. A 90-day dead man switch lets anyone force-cancel any non-terminal round if the protocol stops responding — no funds are ever locked permanently.

  • Instant claim — no waiting period between resolution and prize claim
  • disqualifyAndReroll — bad actors removed and VRF re-requested atomically
  • forceRefund — 90-day dead man switch; anyone can trigger after DEAD_MAN_SWITCH_DELAY
Audit & Testing

100% coverage, external audit

The full test suite runs across both Hardhat and Foundry — every branch, including reverting paths, is exercised. An emergency withdrawal path exists for surplus tokens, protected by a 48-hour timelock. Treasury claims are rate-limited to once per hour.

  • 100% line and branch coverage across Hardhat and Foundry
  • Emergency withdrawal requires a 48-hour timelock before execution
  • External security audit by CertiK or Hacken
  • All source verified on-chain — no unverified proxies
Anti-Fraud

Signature-gated participation

Every participate() call requires a time-limited EIP-712 signature from the backend signer — there is no open deposit function that can be called freely. Nonces prevent replay attacks. Disqualified participants are excluded from payouts and their ticket fees flow to the treasury.

  • participate() requires a backend EIP-712 signature with deadline and nonce
  • userNonces mapping prevents signature replay across all actions
  • isDisqualified mapping — flagged participants cannot claim refunds
  • cancelStuckVRFRound — anyone can cancel a round stuck in VRF for 24+ hours
On-chain events

Every outcome is publicly verifiable.

The contract emits a structured event for every round resolution, prize claim, and cancellation. You can query the full history directly from a node — no API, no database, no trust required.

event RoundResolved(
  uint256 indexed leagueId,
  uint256 indexed roundId,
  address winner,
  uint256 prize,
  uint256 fee
);
event PrizeClaimed(
  uint256 indexed leagueId,
  uint256 indexed roundId,
  address indexed winner,
  uint256 amount
);

Want to understand the full flow?

Read How It Works for a step-by-step walkthrough, or jump straight into a league.