Open code423n4 opened 3 years ago
gpersoon
Cether.sol has a function requireNoError to check for errors. This is used most of the time, however in one occasion it isn't used.
function getCashPrior() internal view returns (uint) { (MathError err, uint startingBalance) = subUInt(address(this).balance, msg.value); require(err == MathError.NO_ERROR); return startingBalance; }
Editor
Replace require(err == MathError.NO_ERROR); with: requireNoError(err, "getCashPrior failed");
Technically, the code works but I agree that consistency should be kept. Added to backlog.
Handle
gpersoon
Vulnerability details
Impact
Cether.sol has a function requireNoError to check for errors. This is used most of the time, however in one occasion it isn't used.
Proof of Concept
Tools Used
Editor
Recommended Mitigation Steps
Replace require(err == MathError.NO_ERROR); with: requireNoError(err, "getCashPrior failed");