hats-finance / Euro-Dollar-0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd

Audit competition repository for Euro-Dollar (0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd)
https://hats.finance
MIT License
1 stars 0 forks source link

commitPrice function skips committing during the exact block timestamp. #91

Open hats-bug-reporter[bot] opened 1 week ago

hats-bug-reporter[bot] commented 1 week ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0x6dbad2c2af356d13011806526789b2888dabdf5d4e229f4dc1c60f3a0317d04e Severity: medium

Description: Description\ The issue under commitPrice function is that it skips the price commit, when lastUpdate + commitDelay is strictly equals to block.timestamp, which means if commit price function get called to commit for the lastUpdate + commitDelay block , it completely neglects to price commit and skips committing the price for that timestamp and makes the commit function revert to start over again.

// Enforce at least commitDelay after the last update
        require(lastUpdate + commitDelay < block.timestamp, "Insufficient commit delay");

Make sure to make a commit on the strict case as well,

        require(lastUpdate + commitDelay <= block.timestamp, "Insufficient commit delay");
AndreiMVP commented 1 week ago

Dup of https://github.com/hats-finance/Euro-Dollar-0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd/issues/18