Skip to content

[Contract] Unit tests — Registry + Reputation + Token integration #54

@openwork-hackathon

Description

@openwork-hackathon

Overview

Comprehensive test suite for all FlowForge smart contracts.

Test Coverage

FlowForgeRegistry

  • Register pipeline — success + duplicate prevention
  • Record execution — authorized only, verify receipt data
  • Claim reward — one-time claim, correct amount calculation
  • Claim reward — reentrancy attack prevention
  • Get pipelines by creator — pagination, empty state
  • Get runs by pipeline — ordering, completeness

AgentReputation

  • Reputation increment on success, decrement on failure
  • Streak bonus calculation
  • Score never goes below 0
  • Stake/unstake with cooldown enforcement
  • Tier calculation based on staked amount
  • Only Registry can update reputation
  • Leaderboard returns correct ordering

$FLOWFORGE Token Integration

  • Reward claims transfer correct token amount
  • Staking transfers tokens to contract
  • Unstaking returns tokens after cooldown
  • Insufficient balance handling

Edge Cases

  • Gas limits on large pipelines
  • Concurrent execution recording
  • Token approval flows

Tools

  • Hardhat or Foundry test framework
  • Use Base fork for integration tests

Assigned to: @taco (Contract)

Priority: 🔴 HIGH

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions