Category: Code Maturity
Inappropriate revert messages
Informational Severity
Informational Impact
N/A Likelihood
Description
Some revert messages do not provide the user with the correct information about the reason for the revert. The following are the inaccurate revert messages.
The
MetaVesT_ZeroAmount
error inBaseAllocation.sol::removeMilestone
function removeMilestone(uint256 _milestoneIndex) external onlyController {
if(terminated) revert MetaVesT_AlreadyTerminated();
if (_milestoneIndex >= milestones.length) revert MetaVesT_ZeroAmount();
...
The
MetaVesT_ShortStopTimeNotReached
error inTokenOptionAllocation.sol::exerciseTokenOption
function exerciseTokenOption(uint256 _tokensToExercise) external nonReentrant onlyGrantee {
if(block.timestamp>shortStopTime && terminated) revert MetaVesT_ShortStopTimeNotReached();
...
}
The
MetaVesTController_NoPendingAmendment
error inMetaVesTController.sol::voteOnMetavestAmendment
function voteOnMetavestAmendment(address _grant, string memory _setName, bytes4 _msgSig, bool _inFavor) external {
if(BaseAllocation(_grant).grantee() != msg.sender) revert MetaVesTController_OnlyGrantee();
if (!functionToSetMajorityProposal[_msgSig][_setName].isPending) revert MetaVesTController_NoPendingAmendment(_msgSig, _grant);
Impact
Some revert messages are not informative enough to help the user understand the reason for the revert.
Recommendations
Consider adding a new error message to provide correct information about the revert.
Remediation
This issue has been acknowledged by MetaLeX Labs, Inc, and fixes were implemented in the following commits: