A deadline looks simple in a product mock-up: a clock reaches zero and an action closes. In a contract system, users may sign before the deadline but have an action included later, while the interface and network observe time differently. Design the rule from the product commitment first. Then explain the relevant boundary and test it precisely instead of assuming a visual countdown establishes eligibility.

Choose the decisive event

Determine whether eligibility depends on the time an authorisation is created, a transaction is included or another verifiable event. Avoid promising that clicking before a deadline guarantees completion when the contract evaluates a later condition. If the programme needs a grace period, define it explicitly rather than relying on support discretion. The rule should identify which system supplies the authoritative time information. Review the supported network's timing characteristics with engineers and current documentation, especially where a small difference could have a large effect on the outcome.

Use time for the right purpose

A timestamp can help express a window, but it should not be treated as a source of secure randomness or an exact real-world appointment without considering the environment. Keep the required precision proportional to the product. A claim window measured in days usually needs a different design from a contest decided by a tiny timing margin. If fairness depends on extremely precise ordering, reconsider the mechanism. The interface should not suggest a level of timing certainty that the underlying system cannot reliably provide to ordinary participants.

Specify the equality case

Write down what happens exactly at the start and end boundaries. Test just before, exactly at and just after each relevant value. Include calculations that derive one deadline from another and confirm the unit used. These small cases are easy to overlook when tests use widely separated timestamps. Preserve the expected behaviour in readable tests and product documentation. Support should be able to explain why a particular action qualified using the same rule, without translating an undocumented comparison operator into an improvised policy after the launch.

Handle delayed and replaced attempts

Test an action prepared before the deadline but submitted later, an authorisation that expires while the wallet is open and a transaction delayed after submission. The interface should refresh relevant information before confirmation and avoid implying that a pending action is guaranteed to succeed. Provide a clear final status and transaction reference. If a service outage affects the programme, follow a predefined extension or resolution process. Changing the deadline after some users have acted can create new expectations, so review the consequences rather than treating an extension as a harmless text edit.

Align every surface with the rule

Use consistent dates and time-zone presentation in the website, account view and support materials. Distinguish the end of earning eligibility from the end of claiming where both exist. Test the countdown across locale and device settings without relying on the device clock as the authoritative contract input. A good deadline design gives users enough time and clarity to act sensibly. Precise boundary tests protect the implementation, while honest communication protects the expectation that a visible timer creates.

TAKE IT FORWARD

The key decisions.

  • Write down what happens exactly at the start and end boundaries.
  • Test an action prepared before the deadline but submitted later, an authorisation that expires while the wallet is open and a transaction delayed after submission.
  • Use consistent dates and time-zone presentation in the website, account view and support materials.

Sources & further reading

Primary references for the concepts discussed. Check the applicable documentation when planning implementation.

  1. Solidity units and global variables