hats-finance / SeeR-PM-0x899bc13919880db76edf4ccd72bdfa5dfa666fb7

1 stars 0 forks source link

Lack of Opening Time Validation in Market Creation #26

Open hats-bug-reporter[bot] opened 4 hours ago

hats-bug-reporter[bot] commented 4 hours ago

Github username: -- Twitter username: atharv_181 Submission hash (on-chain): 0xbc167ac64e1203ba5d2e0f02f21215630f06de9088035bcba0d40abcbd139528 Severity: low

Description:

TITLE: Lack of Opening Time Validation in Market Creation

Severity: Low

Description:

When creating a market, the functions responsible for setting up the market parameters do not validate whether the openingTime is greater than the current block timestamp. This missing validation means that markets can be created with an openingTime that has already passed, which is logically incorrect and can lead to unexpected behavior.

Impact:

Recommendation:

Add validation checks within market creation functions to ensure that the openingTime is greater than the current block timestamp. This can be implemented by adding a simple require statement:

require(openingTime > block.timestamp, "Opening time must be in the future");
greenlucid commented 3 hours ago

That will mean that the market can be answered immediately, but not incur in loss of funds of other legitimate markets. Markets are allowed to be inane, anyone can create them, so it's an UI issue at best