daostack / daostack/arc

Should not attempt to mint if _reputation == 0

Open
#707 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.