Skip to content

Commit

Permalink
fix: avoid modifying commissions beyond the limited range
Browse files Browse the repository at this point in the history
  • Loading branch information
zfliex924 committed Jun 2, 2023
1 parent d247dc9 commit b7f5427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/CandidateHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ contract CandidateHub is ICandidateHub, System, IParamSubscriber {
);
if (roundTag != c.commissionLastChangeRound) {
c.commissionLastChangeRound = roundTag;
c.commissionLastRoundValue = commissionThousandths;
c.commissionLastRoundValue = c.commissionThousandths;
}
if (c.consensusAddr != consensusAddr) {
require(consensusMap[consensusAddr] == 0, "the consensus already exists");
Expand Down
2 changes: 1 addition & 1 deletion contracts/CandidateHub.template
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ contract CandidateHub is ICandidateHub, System, IParamSubscriber {
);
if (roundTag != c.commissionLastChangeRound) {
c.commissionLastChangeRound = roundTag;
c.commissionLastRoundValue = commissionThousandths;
c.commissionLastRoundValue = c.commissionThousandths;
}
if (c.consensusAddr != consensusAddr) {
require(consensusMap[consensusAddr] == 0, "the consensus already exists");
Expand Down

0 comments on commit b7f5427

Please sign in to comment.