Skip to content

Commit

Permalink
fix: typos in contract and comments (#594)
Browse files Browse the repository at this point in the history
* fix typo in error message

* fix: typo in comments

* fix: typo in custom error and fix tests

* fix: undo change in tests since it is testing a previous contract version
  • Loading branch information
clauBv23 authored May 15, 2024
1 parent 1743e85 commit f607746
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packages/contracts/src/core/dao/DAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ contract DAO is
/// @notice The internal constant storing the maximal action array length.
uint256 internal constant MAX_ACTIONS = 256;

/// @notice The first out of two values to which the `_reentrancyStatus` state variable (used by the `nonReentrant` modifier) can be set inidicating that a function was not entered.
/// @notice The first out of two values to which the `_reentrancyStatus` state variable (used by the `nonReentrant` modifier) can be set indicating that a function was not entered.
uint256 private constant _NOT_ENTERED = 1;

/// @notice The second out of two values to which the `_reentrancyStatus` state variable (used by the `nonReentrant` modifier) can be set inidicating that a function was entered.
/// @notice The second out of two values to which the `_reentrancyStatus` state variable (used by the `nonReentrant` modifier) can be set indicating that a function was entered.
uint256 private constant _ENTERED = 2;

/// @notice Removed variable that is left here to maintain the storage layout.
Expand Down Expand Up @@ -100,7 +100,7 @@ contract DAO is
/// @param index The index of the action in the action array that failed.
error ActionFailed(uint256 index);

/// @notice Thrown if an action has insufficent gas left.
/// @notice Thrown if an action has insufficient gas left.
error InsufficientGas();

/// @notice Thrown if the deposit amount is zero.
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/src/core/permission/PermissionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract contract PermissionManager is Initializable {

/// @notice Thrown if a condition contract does not support the `IPermissionCondition` interface.
/// @param condition The address that is not a contract.
error ConditionInterfacNotSupported(IPermissionCondition condition);
error ConditionInterfaceNotSupported(IPermissionCondition condition);

/// @notice Thrown for `ROOT_PERMISSION_ID` or `EXECUTE_PERMISSION_ID` permission grants where `who` or `where` is `ANY_ADDR`.
error PermissionsForAnyAddressDisallowed();
Expand Down Expand Up @@ -385,7 +385,7 @@ abstract contract PermissionManager is Initializable {
type(IPermissionCondition).interfaceId
)
) {
revert ConditionInterfacNotSupported(_condition);
revert ConditionInterfaceNotSupported(_condition);
}

if (_where == ANY_ADDR && _who == ANY_ADDR) {
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/src/core/utils/CallbackHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.8;
/// @title CallbackHandler
/// @author Aragon X - 2022-2023
/// @notice This contract handles callbacks by registering a magic number together with the callback function's selector. It provides the `_handleCallback` function that inheriting contracts have to call inside their `fallback()` function (`_handleCallback(msg.callbackSelector, msg.data)`). This allows to adaptively register ERC standards (e.g., [ERC-721](https://eips.ethereum.org/EIPS/eip-721), [ERC-1115](https://eips.ethereum.org/EIPS/eip-1155), or future versions of [ERC-165](https://eips.ethereum.org/EIPS/eip-165)) and returning the required magic numbers for the associated callback functions for the inheriting contract so that it doesn't need to be upgraded.
/// @dev This callback handling functionality is intented to be used by executor contracts (i.e., `DAO.sol`).
/// @dev This callback handling functionality is intended to be used by executor contracts (i.e., `DAO.sol`).
/// @custom:security-contact [email protected]
abstract contract CallbackHandler {
/// @notice A mapping between callback function selectors and magic return numbers.
Expand All @@ -17,7 +17,7 @@ abstract contract CallbackHandler {
/// @notice Thrown if the callback function is not registered.
/// @param callbackSelector The selector of the callback function.
/// @param magicNumber The magic number to be registered for the callback function selector.
error UnkownCallback(bytes4 callbackSelector, bytes4 magicNumber);
error UnknownCallback(bytes4 callbackSelector, bytes4 magicNumber);

/// @notice Emitted when `_handleCallback` is called.
/// @param sender Who called the callback.
Expand All @@ -36,7 +36,7 @@ abstract contract CallbackHandler {
) internal virtual returns (bytes4) {
bytes4 magicNumber = callbackMagicNumbers[_callbackSelector];
if (magicNumber == UNREGISTERED_CALLBACK) {
revert UnkownCallback({callbackSelector: _callbackSelector, magicNumber: magicNumber});
revert UnknownCallback({callbackSelector: _callbackSelector, magicNumber: magicNumber});
}

emit CallbackReceived({sender: msg.sender, sig: _callbackSelector, data: _data});
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/src/framework/dao/DAOFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ contract DAOFactory is ERC165, ProtocolVersion {
.APPLY_INSTALLATION_PERMISSION_ID();

// Grant the temporary permissions.
// Grant Temporarly `ROOT_PERMISSION` to `pluginSetupProcessor`.
// Grant Temporarily `ROOT_PERMISSION` to `pluginSetupProcessor`.
createdDao.grant(address(createdDao), address(pluginSetupProcessor), rootPermissionID);

// Grant Temporarly `APPLY_INSTALLATION_PERMISSION` on `pluginSetupProcessor` to this `DAOFactory`.
// Grant Temporarily `APPLY_INSTALLATION_PERMISSION` on `pluginSetupProcessor` to this `DAOFactory`.
createdDao.grant(
address(pluginSetupProcessor),
address(this),
Expand Down Expand Up @@ -138,8 +138,8 @@ contract DAOFactory is ERC165, ProtocolVersion {
// Set the rest of DAO's permissions.
_setDAOPermissions(createdDao);

// Revoke the temporarly granted permissions.
// Revoke Temporarly `ROOT_PERMISSION` from `pluginSetupProcessor`.
// Revoke the temporarily granted permissions.
// Revoke Temporarily `ROOT_PERMISSION` from `pluginSetupProcessor`.
createdDao.revoke(address(createdDao), address(pluginSetupProcessor), rootPermissionID);

// Revoke `APPLY_INSTALLATION_PERMISSION` on `pluginSetupProcessor` from this `DAOFactory` .
Expand All @@ -149,12 +149,12 @@ contract DAOFactory is ERC165, ProtocolVersion {
applyInstallationPermissionID
);

// Revoke Temporarly `ROOT_PERMISSION_ID` from `pluginSetupProcessor` that implicitly granted to this `DaoFactory`
// Revoke Temporarily `ROOT_PERMISSION_ID` from `pluginSetupProcessor` that implicitly granted to this `DaoFactory`
// at the create dao step `address(this)` being the initial owner of the new created DAO.
createdDao.revoke(address(createdDao), address(this), rootPermissionID);
}

/// @notice Deploys a new DAO `ERC1967` proxy, and initialize it with this contract as the intial owner.
/// @notice Deploys a new DAO `ERC1967` proxy, and initialize it with this contract as the initial owner.
/// @param _daoSettings The trusted forwarder, name and metadata hash of the DAO it creates.
function _createDAO(DAOSettings calldata _daoSettings) internal returns (DAO dao) {
// Create a DAO proxy and initialize it with the DAOFactory (`address(this)`) as the initial owner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ contract PluginSetupProcessor is ProtocolVersion {
pluginState.currentAppliedSetupId = appliedSetupId;
pluginState.blockNumber = block.number;

// If the list of requested permission changes is not empy, process them.
// If the list of requested permission changes is not empty, process them.
// Note, that this requires the `PluginSetupProcessor` to have the `ROOT_PERMISSION_ID` permission on the
// installing DAO. Make sure this permission is only granted TEMPORARILY.
if (_params.permissions.length > 0) {
Expand All @@ -396,7 +396,7 @@ contract PluginSetupProcessor is ProtocolVersion {
/// @param _params The struct containing the parameters for the `prepareUpdate` function.
/// @return initData The initialization data to be passed to upgradeable contracts when the update is applied
/// @return preparedSetupData The data struct containing the array of helper contracts and permissions that the setup has prepared.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the update is prepared for.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happened) on which the update is prepared for.
function prepareUpdate(
address _dao,
PrepareUpdateParams calldata _params
Expand Down Expand Up @@ -535,7 +535,7 @@ contract PluginSetupProcessor is ProtocolVersion {
_upgradeProxy(_params.plugin, newImplementation, _params.initData);
}

// If the list of requested permission changes is not empy, process them.
// If the list of requested permission changes is not empty, process them.
// Note, that this requires the `PluginSetupProcessor` to have the `ROOT_PERMISSION_ID` permission on the
// updating DAO. Make sure this permission is only granted TEMPORARILY.
if (_params.permissions.length > 0) {
Expand All @@ -554,7 +554,7 @@ contract PluginSetupProcessor is ProtocolVersion {
/// @param _dao The address of the uninstalling DAO.
/// @param _params The struct containing the parameters for the `prepareUninstallation` function.
/// @return permissions The list of multi-targeted permission operations to be applied to the uninstalling DAO.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the uninstallation was prepared for.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happened) on which the uninstallation was prepared for.
function prepareUninstallation(
address _dao,
PrepareUninstallationParams calldata _params
Expand Down Expand Up @@ -614,7 +614,7 @@ contract PluginSetupProcessor is ProtocolVersion {
/// @param _dao The address of the DAO.
/// @param _dao The address of the uninstalling DAO.
/// @param _params The struct containing the parameters for the `applyUninstallation` function.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the uninstallation was prepared for.
/// @dev The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happened) on which the uninstallation was prepared for.
function applyUninstallation(
address _dao,
ApplyUninstallationParams calldata _params
Expand All @@ -637,7 +637,7 @@ contract PluginSetupProcessor is ProtocolVersion {
pluginState.blockNumber = block.number;
pluginState.currentAppliedSetupId = bytes32(0);

// If the list of requested permission changes is not empy, process them.
// If the list of requested permission changes is not empty, process them.
// Note, that this requires the `PluginSetupProcessor` to have the `ROOT_PERMISSION_ID` permission on the
// uninstalling DAO. Make sure this permission is only granted TEMPORARILY.
if (_params.permissions.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract contract InterfaceBasedRegistry is UUPSUpgradeable, DaoAuthorizableUpgr
error ContractERC165SupportInvalid(address registrant);

/// @notice Initializes the component.
/// @dev This is required for the UUPS upgradability pattern.
/// @dev This is required for the UUPS upgradeability pattern.
/// @param _managingDao The interface of the DAO managing the components permissions.
/// @param _targetInterfaceId The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface id of the contracts to be registered.
function __InterfaceBasedRegistry_init(
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/core/dao/callback-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('CallbackHandler', function () {
)
.to.be.revertedWithCustomError(
callbackHandlerMockHelper,
'UnkownCallback'
'UnknownCallback'
)
.withArgs(callbackSelector, UNREGISTERED_INTERFACE_RETURN);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/core/dao/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ describe('DAO', function () {
data: id,
})
)
.to.be.revertedWithCustomError(dao, 'UnkownCallback')
.to.be.revertedWithCustomError(dao, 'UnknownCallback')
.withArgs(id, UNREGISTERED_INTERFACE_RETURN);

await dao.registerStandardCallback(id, id, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('Core: PermissionManager', function () {
nonConditionContract.address
)
)
.to.be.revertedWithCustomError(pm, 'ConditionInterfacNotSupported')
.to.be.revertedWithCustomError(pm, 'ConditionInterfaceNotSupported')
.withArgs(nonConditionContract.address);
});

Expand Down

0 comments on commit f607746

Please sign in to comment.