arc
arc copied to clipboard
Should not attempt to mint if _reputation == 0
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));
}