code-423n4 / 2021-09-defiprotocol-findings

1 stars 0 forks source link

Require statements do not have an error message #100

Closed code423n4 closed 2 years ago

code423n4 commented 3 years ago

Handle

itsmeSTYJ

Vulnerability details

Impact

Hard to debug where a transaction failed if the require statements do not throw an error message when it fails.

Recommended Mitigation Steps

Add a short descriptive error message indicating the function where this error message was thrown and the reason why it was thrown. For example

require(block.number >= pendingWeights.block + TIMELOCK_DURATION, "publishNewIndex: TIMELOCK_DURATION has not passed.");
GalloDaSballo commented 2 years ago

Duplicate of #10