Should not attempt to mint if _reputation == 0
- Dominant language
- JavaScript
- Stars
- 50
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
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));
}
```
Contributor guide
Research direction
Start at line 329 of ContributionRewardExt and compare the reputation path with the other reward types. The issue's proposed change defines done: minting is attempted only for nonzero reputation, the reputation event remains in that branch, and the require includes a revert string; no test file is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100