Skip to content

feat: implement ledger-based timestamp validation for deadlines #335

@greatest0fallt1me

Description

@greatest0fallt1me

Description:

Use ledger close time (or equivalent) for event end, bet deadline, and dispute window so that timing is deterministic and consistent with the chain.

Requirements and Context:

  • Must be secure, tested, and documented
  • Should use env.ledger().timestamp() (or equivalent) for “current time” in deadline checks
  • Should store and compare event end, bet deadline in same time domain
  • Should document that clients must use ledger time for display/estimation
  • Must not rely on off-chain timestamps for enforcement
  • Should integrate with existing event and bet deadline logic

Suggested Execution:

  1. Fork the repo and create a branch

    git checkout -b feature/ledger-timestamp-validation
  2. Implement changes

    • Write contract: replace any non-ledger time with ledger timestamp
    • Update validation and storage; add documentation and NatSpec-style comments
  3. Test and commit

    • Run tests; cover deadline at ledger boundary, testutils ledger advance
    • Include test output and security notes

Example Commit Message:

feat: implement ledger-based timestamp validation for deadlines

Guidelines:

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 48 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions