Skip to content

Should not attempt to mint if _reputation == 0 #707

Open
@dkent600

Description

See line 329 of ContributionRewardExt. All the other reward types follow the right pattern except reputation. The idea is to be clear and consistent in the code and to avoid what I am guessing will be a tx when there are 0 reputation to be minted.

        require(
        Controller(
        avatar.owner()).mintReputation(_reputation, _beneficiary, address(avatar)));
        if (_reputation != 0) {
            emit RedeemReputation(address(avatar), _proposalId, _beneficiary, int256(_reputation));
        }
}

should be (note also adding a missing revert string):

        if (_reputation != 0) {

            require(
            Controller(
            avatar.owner()).mintReputation(_reputation, _beneficiary, address(avatar)),
            "with an error message");

            emit RedeemReputation(address(avatar), _proposalId, _beneficiary, int256(_reputation));
        }

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions