From a0b6cfd5ffc04a3ca0f1bb15bbe325db6d916f8e Mon Sep 17 00:00:00 2001 From: steven <12021290+stevennevins@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:12:04 -0400 Subject: [PATCH] fix: typos and missed renames (#91) * fix: typos and missed renames * fix: additional typos --- .../script/IncredibleSquaringDeployer.s.sol | 24 ++++++++-------- contracts/script/utils/Utils.sol | 2 +- .../src/IIncredibleSquaringTaskManager.sol | 8 +++--- .../src/IncredibleSquaringServiceManager.sol | 8 +++--- .../src/IncredibleSquaringTaskManager.sol | 28 +++++++++---------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/contracts/script/IncredibleSquaringDeployer.s.sol b/contracts/script/IncredibleSquaringDeployer.s.sol index 01eec860..1d5af207 100644 --- a/contracts/script/IncredibleSquaringDeployer.s.sol +++ b/contracts/script/IncredibleSquaringDeployer.s.sol @@ -38,7 +38,7 @@ import "forge-std/StdJson.sol"; import "forge-std/console.sol"; // # To deploy and verify our contract -// forge script script/CredibleSquaringDeployer.s.sol:CredibleSquaringDeployer --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv +// forge script script/IncredibleSquaringDeployer.s.sol:IncredibleSquaringDeployer --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv contract IncredibleSquaringDeployer is Script, Utils { // DEPLOYMENT CONSTANTS uint256 public constant QUORUM_THRESHOLD_PERCENTAGE = 100; @@ -48,12 +48,12 @@ contract IncredibleSquaringDeployer is Script, Utils { address public constant AGGREGATOR_ADDR = 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720; address public constant TASK_GENERATOR_ADDR = 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720; - // ERC20 and Strategy: we need to deploy this erc20, create a strategy for it, and whitelist this strategy in the strategymanager + // ERC20 and Strategy: we need to deploy this ERC20, create a strategy for it, and whitelist this strategy in the strategymanager ERC20Mock public erc20Mock; StrategyBaseTVLLimits public erc20MockStrategy; - // Credible Squaring contracts + // Incredible Squaring contracts ProxyAdmin public incredibleSquaringProxyAdmin; PauserRegistry public incredibleSquaringPauserReg; @@ -104,20 +104,20 @@ contract IncredibleSquaringDeployer is Script, Utils { stdJson.readAddress(eigenlayerDeployedContracts, ".addresses.rewardsCoordinator") ); - address credibleSquaringCommunityMultisig = msg.sender; - address credibleSquaringPauser = msg.sender; + address incredibleSquaringCommunityMultisig = msg.sender; + address incredibleSquaringPauser = msg.sender; vm.startBroadcast(); _deployErc20AndStrategyAndWhitelistStrategy( eigenLayerProxyAdmin, eigenLayerPauserReg, baseStrategyImplementation, strategyManager ); - _deployCredibleSquaringContracts( + _deployIncredibleSquaringContracts( delegationManager, avsDirectory, rewardsCoordinator, erc20MockStrategy, - credibleSquaringCommunityMultisig, - credibleSquaringPauser + incredibleSquaringCommunityMultisig, + incredibleSquaringPauser ); vm.stopBroadcast(); } @@ -153,13 +153,13 @@ contract IncredibleSquaringDeployer is Script, Utils { strategyManager.addStrategiesToDepositWhitelist(strats, thirdPartyTransfersForbiddenValues); } - function _deployCredibleSquaringContracts( + function _deployIncredibleSquaringContracts( IDelegationManager delegationManager, IAVSDirectory avsDirectory, IRewardsCoordinator rewardsCoordinator, IStrategy strat, address incredibleSquaringCommunityMultisig, - address credibleSquaringPauser + address incredibleSquaringPauser ) internal { // Adding this as a temporary fix to make the rest of the script work with a single strategy // since it was originally written to work with an array of strategies @@ -172,7 +172,7 @@ contract IncredibleSquaringDeployer is Script, Utils { // deploy pauser registry { address[] memory pausers = new address[](2); - pausers[0] = credibleSquaringPauser; + pausers[0] = incredibleSquaringPauser; pausers[1] = incredibleSquaringCommunityMultisig; incredibleSquaringPauserReg = new PauserRegistry(pausers, incredibleSquaringCommunityMultisig); @@ -264,7 +264,7 @@ contract IncredibleSquaringDeployer is Script, Utils { { uint256 numQuorums = 1; - // for each quorum to setup, we need to define + // for each quorum to set up, we need to define // QuorumOperatorSetParam, minimumStakeForQuorum, and strategyParams regcoord.IRegistryCoordinator.OperatorSetParam[] memory quorumsOperatorSetParams = new regcoord.IRegistryCoordinator.OperatorSetParam[](numQuorums); diff --git a/contracts/script/utils/Utils.sol b/contracts/script/utils/Utils.sol index 408580e9..52b518a7 100644 --- a/contracts/script/utils/Utils.sol +++ b/contracts/script/utils/Utils.sol @@ -9,7 +9,7 @@ import "forge-std/Script.sol"; import "forge-std/StdJson.sol"; contract Utils is Script { - // Note that this fct will only work for the ERC20Mock that has a public mint function + // Note that this function will only work for the ERC20Mock that has a public mint function function _mintTokens( address strategyAddress, address[] memory tos, diff --git a/contracts/src/IIncredibleSquaringTaskManager.sol b/contracts/src/IIncredibleSquaringTaskManager.sol index 978ebec1..d6dc7c01 100644 --- a/contracts/src/IIncredibleSquaringTaskManager.sol +++ b/contracts/src/IIncredibleSquaringTaskManager.sol @@ -34,7 +34,7 @@ interface IIncredibleSquaringTaskManager { } // Task response is hashed and signed by operators. - // these signatures are aggregated and sent to the contract as response. + // These signatures are aggregated and sent to the contract as response. struct TaskResponse { // Can be obtained by the operator from the event NewTaskCreated. uint32 referenceTaskIndex; @@ -46,12 +46,12 @@ interface IIncredibleSquaringTaskManager { // It thus cannot be signed by operators, so we keep it in a separate struct than TaskResponse // This metadata is needed by the challenger, so we emit it in the TaskResponded event struct TaskResponseMetadata { - uint32 taskResponsedBlock; + uint32 taskRespondedBlock; bytes32 hashOfNonSigners; } // FUNCTIONS - // NOTE: this function creates new task. + // NOTE: this function creates a new task. function createNewTask( uint256 numberToBeSquared, uint32 quorumThresholdPercentage, @@ -61,7 +61,7 @@ interface IIncredibleSquaringTaskManager { /// @notice Returns the current 'taskNumber' for the middleware function taskNumber() external view returns (uint32); - // // NOTE: this function raises challenge to existing tasks. + // NOTE: this function raises a challenge to existing tasks. function raiseAndResolveChallenge( Task calldata task, TaskResponse calldata taskResponse, diff --git a/contracts/src/IncredibleSquaringServiceManager.sol b/contracts/src/IncredibleSquaringServiceManager.sol index aa6b4432..1f33eae1 100644 --- a/contracts/src/IncredibleSquaringServiceManager.sol +++ b/contracts/src/IncredibleSquaringServiceManager.sol @@ -6,7 +6,7 @@ import "./IIncredibleSquaringTaskManager.sol"; import "@eigenlayer-middleware/src/ServiceManagerBase.sol"; /** - * @title Primary entrypoint for procuring services from IncredibleSquaring. + * @title Primary entry point for procuring services from IncredibleSquaring. * @author Layr Labs, Inc. */ contract IncredibleSquaringServiceManager is ServiceManagerBase { @@ -14,11 +14,11 @@ contract IncredibleSquaringServiceManager is ServiceManagerBase { IIncredibleSquaringTaskManager public immutable incredibleSquaringTaskManager; - /// @notice when applied to a function, ensures that the function is only callable by the `registryCoordinator`. + /// @notice When applied to a function, ensures that the function is only callable by the `incredibleSquaringTaskManager`. modifier onlyIncredibleSquaringTaskManager() { require( msg.sender == address(incredibleSquaringTaskManager), - "onlyIncredibleSquaringTaskManager: not from credible squaring task manager" + "onlyIncredibleSquaringTaskManager: not from incredible squaring task manager" ); _; } @@ -36,7 +36,7 @@ contract IncredibleSquaringServiceManager is ServiceManagerBase { } /// @notice Called in the event of challenge resolution, in order to forward a call to the Slasher, which 'freezes' the `operator`. - /// @dev The Slasher contract is under active development and its interface expected to change. + /// @dev The Slasher contract is under active development and its interface is expected to change. /// We recommend writing slashing logic without integrating with the Slasher at this point in time. function freezeOperator( address operatorAddr diff --git a/contracts/src/IncredibleSquaringTaskManager.sol b/contracts/src/IncredibleSquaringTaskManager.sol index f8371d33..7dcf4da6 100644 --- a/contracts/src/IncredibleSquaringTaskManager.sol +++ b/contracts/src/IncredibleSquaringTaskManager.sol @@ -29,7 +29,7 @@ contract IncredibleSquaringTaskManager is // The number of blocks from the task initialization within which the aggregator has to respond to uint32 public immutable TASK_RESPONSE_WINDOW_BLOCK; uint32 public constant TASK_CHALLENGE_WINDOW_BLOCK = 100; - uint256 internal constant _THRESHOLD_DENOMINATOR = 100; + uint256 internal constant THRESHOLD_DENOMINATOR = 100; /* STORAGE */ // The latest task index @@ -44,7 +44,7 @@ contract IncredibleSquaringTaskManager is // mapping of task indices to hash of abi.encode(taskResponse, taskResponseMetadata) mapping(uint32 => bytes32) public allTaskResponses; - mapping(uint32 => bool) public taskSuccesfullyChallenged; + mapping(uint32 => bool) public taskSuccessfullyChallenged; address public aggregator; address public generator; @@ -122,7 +122,7 @@ contract IncredibleSquaringTaskManager is bytes calldata quorumNumbers = task.quorumNumbers; uint32 quorumThresholdPercentage = task.quorumThresholdPercentage; - // check that the task is valid, hasn't been responsed yet, and is being responsed in time + // check that the task is valid, hasn't been responded to yet, and is being responded to in time require( keccak256(abi.encode(task)) == allTaskHashes[taskResponse.referenceTaskIndex], "supplied task does not match the one recorded in the contract" @@ -145,12 +145,12 @@ contract IncredibleSquaringTaskManager is (QuorumStakeTotals memory quorumStakeTotals, bytes32 hashOfNonSigners) = checkSignatures(message, quorumNumbers, taskCreatedBlock, nonSignerStakesAndSignature); - // check that signatories own at least a threshold percentage of each quourm + // check that signatories own at least a threshold percentage of each quorum for (uint256 i = 0; i < quorumNumbers.length; i++) { // we don't check that the quorumThresholdPercentages are not >100 because a greater value would trivially fail the check, implying // signed stake > total stake require( - quorumStakeTotals.signedStakeForQuorum[i] * _THRESHOLD_DENOMINATOR + quorumStakeTotals.signedStakeForQuorum[i] * THRESHOLD_DENOMINATOR >= quorumStakeTotals.totalStakeForQuorum[i] * uint8(quorumThresholdPercentage), "Signatories do not own at least threshold percentage of a quorum" ); @@ -158,7 +158,7 @@ contract IncredibleSquaringTaskManager is TaskResponseMetadata memory taskResponseMetadata = TaskResponseMetadata(uint32(block.number), hashOfNonSigners); - // updating the storage with task responsea + // updating the storage with task response allTaskResponses[taskResponse.referenceTaskIndex] = keccak256(abi.encode(taskResponse, taskResponseMetadata)); @@ -191,13 +191,13 @@ contract IncredibleSquaringTaskManager is "Task response does not match the one recorded in the contract" ); require( - taskSuccesfullyChallenged[referenceTaskIndex] == false, + taskSuccessfullyChallenged[referenceTaskIndex] == false, "The response to this task has already been challenged successfully." ); require( uint32(block.number) - <= taskResponseMetadata.taskResponsedBlock + TASK_CHALLENGE_WINDOW_BLOCK, + <= taskResponseMetadata.taskRespondedBlock + TASK_CHALLENGE_WINDOW_BLOCK, "The challenge period for this task has already expired." ); @@ -231,10 +231,10 @@ contract IncredibleSquaringTaskManager is ); // get the address of operators who didn't sign - address[] memory addresssOfNonSigningOperators = + address[] memory addressesOfNonSigningOperators = new address[](pubkeysOfNonSigningOperators.length); for (uint256 i = 0; i < pubkeysOfNonSigningOperators.length; i++) { - addresssOfNonSigningOperators[i] = BLSApkRegistry(address(blsApkRegistry)) + addressesOfNonSigningOperators[i] = BLSApkRegistry(address(blsApkRegistry)) .pubkeyHashToOperator(hashesOfPubkeysOfNonSigningOperators[i]); } @@ -275,14 +275,14 @@ contract IncredibleSquaringTaskManager is // bool wasSigningOperator = true; // for ( // uint k = 0; - // k < addresssOfNonSigningOperators.length; + // k < addressesOfNonSigningOperators.length; // k++ // ) { // if ( - // operatorAddress == addresssOfNonSigningOperators[k] + // operatorAddress == addressesOfNonSigningOperators[k] // ) { // // if the operator was a non-signer, then we set the flag to false - // wasSigningOperator == false; + // wasSigningOperator = false; // break; // } // } @@ -297,7 +297,7 @@ contract IncredibleSquaringTaskManager is // } // the task response has been challenged successfully - taskSuccesfullyChallenged[referenceTaskIndex] = true; + taskSuccessfullyChallenged[referenceTaskIndex] = true; emit TaskChallengedSuccessfully(referenceTaskIndex, msg.sender); }