Skip to content
This repository was archived by the owner on Aug 25, 2023. It is now read-only.

Latest commit

 

History

History

test

Test Suite

Test Cases

  • Create new market
  • Only factory admin can create market
  • Set oracle role
  • Set Escrow role
  • Remove escrow role
  • Remove oracle role
  • Make single prediction
  • Make multi prediction
  • Can't cashout if market has not finalized
  • Cashout if market has finalized, winning prediction only
  • Pause market
  • Can't act upon a market that is not yet open
  • Can't buy invalid prediction option
  • Can't cashout prediction not held in wallet
  • Can't act upon a paused market
  • unPause market
  • Can act upon an unpaused market
  • Can't cashout losing prediction
  • Can't externally call burn function (not escrow)
  • Submit market result
  • Can't submit market result unless oracle
  • Can't submit market result unless market is closed
  • Can't mint more of a token than the allowed individual supply cap
  • Set rev share recipients
  • Clear rev share recipients
  • Can't set rev share recipients unless factory admin
  • Can't set rev share to invalid sum (not equal to 100)
  • Payout rev share

Invariants

1

If market is not finalized: Sum(all circulating nft tokens) = pot

2

Sum(totalDeposited - totalPaidOut) = paymentToken.balanceOf(escrow)

This assumes no one has "maliciously" sent funds to the escrow wallet. This is a reasonable assumption because the funds are un-redeemable.

3

Sum(totalDeposited + totalFee) = totalPot

4

token supply <= individual supply cap