Skip to content

test: add fuzz tests and increase coverage#21

Closed
dadadave80 wants to merge 12 commits into
chore/fixes-and-improvementsfrom
test/foundry-fuzz-and-coverage
Closed

test: add fuzz tests and increase coverage#21
dadadave80 wants to merge 12 commits into
chore/fixes-and-improvementsfrom
test/foundry-fuzz-and-coverage

Conversation

@dadadave80
Copy link
Copy Markdown
Member

Summary

  • Add 31 foundry fuzz tests across Factory, Marketplace, CheckIn, and Ticket test files covering fee calculations, payment accounting, refund timing, buyer accumulation, and ticket creation validation
  • Add 52 coverage tests for previously untested revert paths and edge cases including empty name/URI, sold out, max tickets per user, purchase time checks, admin access control, ERC721 interface support, and royalty info

Test plan

  • All 176 tests pass (forge test)
  • Fuzz tests run 10,000 iterations each per foundry.toml config
  • Verify CI passes on remote

Clean up deployment scripts and fix remapping issues
Remove unused imports from deploy scripts, extract fee constants,
inline facet deployment, add vm labels, and simplify mintTicketETH helper.
Split payment flow: refundable tickets escrow funds in the contract,
non-refundable tickets send the ticket fee directly to the organizer.
For ERC20 non-refundable payments, the fee is sent to the organizer
and the hostIt fee is sent to the contract separately. Also updates
_payWithToken to accept a destination address parameter.
Update assertions for non-refundable tickets where fees go directly
to the organizer. Comment out refund and ticket balance withdrawal
tests (no longer applicable for non-refundable tickets). Add receive()
to test contract for ETH transfers.
…le flows

Expand from 8 to 58 marketplace tests covering:
- Non-refundable direct payment: organizer receives fee, contract
  holds only hostIt fee, no escrow (ETH, USDT, USDC)
- Refundable escrow: funds escrowed, refund claims, withdraw after
  refund period, time-window revert cases (ETH, USDT, USDC)
- Revert cases: insufficient balance/allowance, refund on non-refundable,
  withdraw zero balance, disabled fee type
- Mixed scenarios: hostIt fee accumulation across ticket types
- Add refundable ticket helpers to DeployedHostItTickets base
…nizer

feat: direct payment to organizer for non-refundable tickets
@dadadave80 dadadave80 closed this Apr 3, 2026
@dadadave80 dadadave80 deleted the test/foundry-fuzz-and-coverage branch April 3, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant