Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dkent600 opened this issue Jan 15, 2020 · 0 comments
Open

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

dkent600 opened this issue Jan 15, 2020 · 0 comments

Comments

@dkent600
Copy link
Contributor

dkent600 commented Jan 15, 2020

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));
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant