Assessment reports>Metavest>Informational findings>Inappropriate revert messages
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.

  1. The MetaVesT_ZeroAmount error in BaseAllocation.sol::removeMilestone

function removeMilestone(uint256 _milestoneIndex) external onlyController {
    if(terminated) revert MetaVesT_AlreadyTerminated();
    if (_milestoneIndex >= milestones.length) revert MetaVesT_ZeroAmount();
    ...
  1. The MetaVesT_ShortStopTimeNotReached error in TokenOptionAllocation.sol::exerciseTokenOption

function exerciseTokenOption(uint256 _tokensToExercise) external nonReentrant onlyGrantee {
    if(block.timestamp>shortStopTime && terminated) revert MetaVesT_ShortStopTimeNotReached();
    ...
}
  1. The MetaVesTController_NoPendingAmendment error in MetaVesTController.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:

Zellic © 2024Back to top ↑