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

[R4R] Fix bep-131 #7

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contracts/BSCValidatorSet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,11 @@ contract BSCValidatorSet is IBSCValidatorSet, System, IParamSubscriber, IApplica
} else if (Memory.compareStrings(key, "maxNumOfMaintaining")) {
require(value.length == 32, "length of maxNumOfMaintaining mismatch");
uint256 newMaxNumOfMaintaining = BytesToTypes.bytesToUint256(32, value);
require(newMaxNumOfMaintaining < MAX_NUM_OF_VALIDATORS, "the maxNumOfMaintaining must be less than MAX_NUM_OF_VALIDATORS");
uint256 _numOfCabinets = numOfCabinets;
if (_numOfCabinets == 0) {
_numOfCabinets = INIT_NUM_OF_CABINETS;
}
require(newMaxNumOfMaintaining < _numOfCabinets, "the maxNumOfMaintaining must be less than numOfCaninates");
maxNumOfMaintaining = newMaxNumOfMaintaining;
} else if (Memory.compareStrings(key, "maintainSlashScale")) {
require(value.length == 32, "length of maintainSlashScale mismatch");
Expand Down
6 changes: 5 additions & 1 deletion contracts/BSCValidatorSet.template
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,11 @@ contract BSCValidatorSet is IBSCValidatorSet, System, IParamSubscriber, IApplica
} else if (Memory.compareStrings(key, "maxNumOfMaintaining")) {
require(value.length == 32, "length of maxNumOfMaintaining mismatch");
uint256 newMaxNumOfMaintaining = BytesToTypes.bytesToUint256(32, value);
require(newMaxNumOfMaintaining < MAX_NUM_OF_VALIDATORS, "the maxNumOfMaintaining must be less than MAX_NUM_OF_VALIDATORS");
uint256 _numOfCabinets = numOfCabinets;
if (_numOfCabinets == 0) {
_numOfCabinets = INIT_NUM_OF_CABINETS;
}
require(newMaxNumOfMaintaining < _numOfCabinets, "the maxNumOfMaintaining must be less than numOfCaninates");
maxNumOfMaintaining = newMaxNumOfMaintaining;
} else if (Memory.compareStrings(key, "maintainSlashScale")) {
require(value.length == 32, "length of maintainSlashScale mismatch");
Expand Down