Skip to content

Commit

Permalink
Merge pull request #119 from skalenetwork/enhancements/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
DimaStebaev authored Mar 13, 2020
2 parents abb4a48 + e41c931 commit 038143a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions contracts/ContractManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import "./thirdparty/StringUtils.sol";


/**
* @title Main contract in upgradeable approach. This contract contain actual
* contracts for this moment in skale manager system by human name.
* @title Main contract in upgradeable approach. This contract contains the actual
* current mapping from contract IDs (in the form of human-readable strings) to addresses.
* @author Artem Payvin
*/
contract ContractManager is Initializable, Ownable {
Expand All @@ -47,7 +47,7 @@ contract ContractManager is Initializable, Ownable {
* @param newContractsAddress - contracts address in skale manager system
*/
function setContractsAddress(string calldata contractsName, address newContractsAddress) external onlyOwner {
// check newContractsAddress is not equal zero
// check newContractsAddress is not equal to zero
require(newContractsAddress != address(0), "New address is equal zero");
// create hash of contractsName
bytes32 contractId = keccak256(abi.encodePacked(contractsName));
Expand All @@ -58,7 +58,7 @@ contract ContractManager is Initializable, Ownable {
length := extcodesize(newContractsAddress)
}
// check newContractsAddress contains code
require(length > 0, "Given contracts address is not contain code");
require(length > 0, "Given contracts address does not contain code");
// add newContractsAddress to mapping of actual contract addresses
contracts[contractId] = newContractsAddress;
emit ContractUpgraded(contractsName, newContractsAddress);
Expand Down
2 changes: 1 addition & 1 deletion contracts/SkaleToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ contract SkaleToken is LockableERC777, Permissions, IDelegatableToken {
}

/**
* @dev mint - create some amount of token and transfer it to specify address
* @dev mint - create some amount of token and transfer it to the specified address
* @param operator address operator requesting the transfer
* @param account - address where some amount of token would be created
* @param amount - amount of tokens to mine
Expand Down
30 changes: 15 additions & 15 deletions contracts/delegation/DelegationController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract DelegationController is Permissions, ILocker {
uint amount;
uint delegationPeriod;
uint created; // time of creation
uint started; // month of a delegation becomes active
uint started; // month when a delegation becomes active
uint finished; // first month after a delegation ends
string info;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ contract DelegationController is Permissions, ILocker {

require(
validatorService.checkMinimumDelegation(validatorId, amount),
"Amount doesn't meet minimum delegation amount");
"Amount does not meet minimum delegation amount");
require(
validatorService.trustedValidators(validatorId),
"Validator is not authorized to accept request");
Expand All @@ -219,7 +219,7 @@ contract DelegationController is Permissions, ILocker {
// check that there is enough money
uint holderBalance = skaleToken.balanceOf(msg.sender);
uint forbiddenForDelegation = tokenState.getAndUpdateForbiddenForDelegationAmount(msg.sender);
require(holderBalance >= forbiddenForDelegation, "Delegator doesn't have enough tokens to delegate");
require(holderBalance >= forbiddenForDelegation, "Delegator does not have enough tokens to delegate");

emit DelegationRequestIsSent(delegationId);

Expand Down Expand Up @@ -248,7 +248,7 @@ contract DelegationController is Permissions, ILocker {
require(
validatorService.checkValidatorAddressToId(msg.sender, delegations[delegationId].validatorId),
"No permissions to accept request");
require(getState(delegationId) == State.PROPOSED, "Can't set state to accepted");
require(getState(delegationId) == State.PROPOSED, "Cannot set state to accepted");

TimeHelpers timeHelpers = TimeHelpers(contractManager.getContract("TimeHelpers"));
DelegationPeriodManager delegationPeriodManager = DelegationPeriodManager(contractManager.getContract("DelegationPeriodManager"));
Expand Down Expand Up @@ -299,7 +299,7 @@ contract DelegationController is Permissions, ILocker {
}

function requestUndelegation(uint delegationId) external checkDelegationExists(delegationId) {
require(getState(delegationId) == State.DELEGATED, "Can't request undelegation");
require(getState(delegationId) == State.DELEGATED, "Cannot request undelegation");

ValidatorService validatorService = ValidatorService(contractManager.getContract("ValidatorService"));
require(
Expand Down Expand Up @@ -613,7 +613,7 @@ contract DelegationController is Permissions, ILocker {
}

function add(PartialDifferences storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month, "Can't add to the past");
require(sequence.firstUnprocessedMonth <= month, "Cannot add to the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
}
Expand All @@ -622,7 +622,7 @@ contract DelegationController is Permissions, ILocker {
}

function subtract(PartialDifferences storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month, "Can't subtract from the past");
require(sequence.firstUnprocessedMonth <= month, "Cannot subtract from the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
}
Expand Down Expand Up @@ -668,7 +668,7 @@ contract DelegationController is Permissions, ILocker {
}

function add(PartialDifferencesValue storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month, "Can't add to the past");
require(sequence.firstUnprocessedMonth <= month, "Cannot add to the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
sequence.lastChangedMonth = month;
Expand All @@ -685,7 +685,7 @@ contract DelegationController is Permissions, ILocker {
}

function subtract(PartialDifferencesValue storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month.add(1), "Can't subtract from the past");
require(sequence.firstUnprocessedMonth <= month.add(1), "Cannot subtract from the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
sequence.lastChangedMonth = month;
Expand All @@ -702,7 +702,7 @@ contract DelegationController is Permissions, ILocker {
}

function getAndUpdateValue(PartialDifferencesValue storage sequence, uint month) internal returns (uint) {
require(month.add(1) >= sequence.firstUnprocessedMonth, "Can't calculate value in the past");
require(month.add(1) >= sequence.firstUnprocessedMonth, "Cannot calculate value in the past");
if (sequence.firstUnprocessedMonth == 0) {
return 0;
}
Expand All @@ -720,7 +720,7 @@ contract DelegationController is Permissions, ILocker {
}

function reduce(PartialDifferencesValue storage sequence, uint amount, uint month) internal returns (Fraction memory) {
require(month.add(1) >= sequence.firstUnprocessedMonth, "Can't reduce value in the past");
require(month.add(1) >= sequence.firstUnprocessedMonth, "Cannot reduce value in the past");
if (sequence.firstUnprocessedMonth == 0) {
return createFraction(0);
}
Expand Down Expand Up @@ -769,9 +769,9 @@ contract DelegationController is Permissions, ILocker {
uint month,
bool hasSumSequence) internal
{
require(month.add(1) >= sequence.firstUnprocessedMonth, "Can't reduce value in the past");
require(month.add(1) >= sequence.firstUnprocessedMonth, "Cannot reduce value in the past");
if (hasSumSequence) {
require(month.add(1) >= sumSequence.firstUnprocessedMonth, "Can't reduce value in the past");
require(month.add(1) >= sumSequence.firstUnprocessedMonth, "Cannot reduce value in the past");
}
require(reducingCoefficient.numerator <= reducingCoefficient.denominator, "Increasing of values is not implemented");
if (sequence.firstUnprocessedMonth == 0) {
Expand Down Expand Up @@ -820,7 +820,7 @@ contract DelegationController is Permissions, ILocker {
}

function createFraction(uint numerator, uint denominator) internal pure returns (Fraction memory) {
require(denominator > 0, "Devision by zero");
require(denominator > 0, "Division by zero");
Fraction memory fraction = Fraction({numerator: numerator, denominator: denominator});
reduceFraction(fraction);
return fraction;
Expand Down Expand Up @@ -864,7 +864,7 @@ contract DelegationController is Permissions, ILocker {
log.slashes[month].reducingCoefficient = coefficient;
log.slashes[month].nextMonth = 0;
} else {
require(log.lastMonth <= month, "Can't put slashing event in the past");
require(log.lastMonth <= month, "Cannot put slashing event in the past");
if (log.lastMonth == month) {
log.slashes[month].reducingCoefficient = multiplyFraction(log.slashes[month].reducingCoefficient, coefficient);
} else {
Expand Down
2 changes: 1 addition & 1 deletion contracts/delegation/DelegationPeriodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract DelegationPeriodManager is Permissions {
}

function removeDelegationPeriod(uint monthsCount) external onlyOwner {
// remove only if there is no guys that stacked tokens for this period
// remove only if there are no delegators that staked tokens for this period
stakeMultipliers[monthsCount] = 0;
}

Expand Down
6 changes: 3 additions & 3 deletions contracts/delegation/TokenLaunchLocker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ contract TokenLaunchLocker is Permissions, ILocker {
}

function add(PartialDifferencesValue storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month, "Can't add to the past");
require(sequence.firstUnprocessedMonth <= month, "Cannot add to the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
sequence.lastChangedMonth = month;
Expand All @@ -185,7 +185,7 @@ contract TokenLaunchLocker is Permissions, ILocker {
}

function subtract(PartialDifferencesValue storage sequence, uint diff, uint month) internal {
require(sequence.firstUnprocessedMonth <= month.add(1), "Can't subtract from the past");
require(sequence.firstUnprocessedMonth <= month.add(1), "Cannot subtract from the past");
if (sequence.firstUnprocessedMonth == 0) {
sequence.firstUnprocessedMonth = month;
sequence.lastChangedMonth = month;
Expand All @@ -202,7 +202,7 @@ contract TokenLaunchLocker is Permissions, ILocker {
}

function getAndUpdateValue(PartialDifferencesValue storage sequence, uint month) internal returns (uint) {
require(month.add(1) >= sequence.firstUnprocessedMonth, "Can't calculate value in the past");
require(month.add(1) >= sequence.firstUnprocessedMonth, "Cannot calculate value in the past");
if (sequence.firstUnprocessedMonth == 0) {
return 0;
}
Expand Down
16 changes: 8 additions & 8 deletions contracts/delegation/ValidatorService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract ValidatorService is Permissions {
uint public numberOfValidators;

modifier checkValidatorExists(uint validatorId) {
require(validatorExists(validatorId), "Validator with such id doesn't exist");
require(validatorExists(validatorId), "Validator with such ID does not exist");
_;
}

Expand All @@ -65,7 +65,7 @@ contract ValidatorService is Permissions {
{
require(_validatorAddressToId[msg.sender] == 0, "Validator with such address already exists");
require(feeRate < 1000, "Fee rate of validator should be lower than 100%");
uint[] memory epmtyArray = new uint[](0);
uint[] memory emptyArray = new uint[](0);
validatorId = ++numberOfValidators;
validators[validatorId] = Validator(
name,
Expand All @@ -75,7 +75,7 @@ contract ValidatorService is Permissions {
feeRate,
now,
minimumDelegationAmount,
epmtyArray
emptyArray
);
setValidatorAddress(validatorId, msg.sender);
}
Expand Down Expand Up @@ -117,7 +117,7 @@ contract ValidatorService is Permissions {
{
require(
getValidator(validatorId).requestedAddress == msg.sender,
"The validator cannot be changed because it isn't the actual owner"
"The validator cannot be changed because it is not the actual owner"
);
deleteValidatorAddress(validatorId, validators[validatorId].validatorAddress);
validators[validatorId].validatorAddress = msg.sender;
Expand All @@ -132,7 +132,7 @@ contract ValidatorService is Permissions {

function unlinkNodeAddress(address nodeAddress) external {
uint validatorId = getValidatorId(msg.sender);
require(validators[validatorId].validatorAddress == msg.sender, "Such address hasn't permissions to unlink node");
require(validators[validatorId].validatorAddress == msg.sender, "Address does not have permissions to unlink node");
deleteValidatorAddress(validatorId, nodeAddress);
}

Expand Down Expand Up @@ -180,7 +180,7 @@ contract ValidatorService is Permissions {
uint[] memory validatorNodes = validators[validatorId].nodeIndexes;
uint delegationsTotal = delegationController.getAndUpdateDelegatedToValidatorNow(validatorId);
uint msr = IConstants(contractManager.getContract("ConstantsHolder")).msr();
require((validatorNodes.length.add(1)) * msr <= delegationsTotal, "Validator has to meet Minimum Staking Requirement");
require((validatorNodes.length.add(1)) * msr <= delegationsTotal, "Validator must meet Minimum Staking Requirement");
}

function checkPossibilityToMaintainNode(uint validatorId, uint nodeIndex) external allow("SkaleManager") returns (bool) {
Expand Down Expand Up @@ -240,7 +240,7 @@ contract ValidatorService is Permissions {
}

function checkIfValidatorAddressExists(address validatorAddress) public view {
require(validatorAddressExists(validatorAddress), "Validator with such address doesn't exist");
require(validatorAddressExists(validatorAddress), "Validator with such address does not exist");
}

function getValidator(uint validatorId) public view checkValidatorExists(validatorId) returns (Validator memory) {
Expand Down Expand Up @@ -274,7 +274,7 @@ contract ValidatorService is Permissions {
}

function deleteValidatorAddress(uint validatorId, address validatorAddress) internal {
require(_validatorAddressToId[validatorAddress] == validatorId, "Validator hasn't permissions to unlink node");
require(_validatorAddressToId[validatorAddress] == validatorId, "Validator does not have permissions to unlink node");
delete _validatorAddressToId[validatorAddress];
for (uint i = 0; i < _validatorAddresses[validatorId].length; ++i) {
if (_validatorAddresses[validatorId][i] == validatorAddress) {
Expand Down

0 comments on commit 038143a

Please sign in to comment.