From 7a35db5c3d7539e1cfc0647c8d6c360521597ae3 Mon Sep 17 00:00:00 2001 From: Giorgi Lagidze Date: Tue, 17 Sep 2024 15:23:27 +0400 Subject: [PATCH] improve natspec --- .../src/core/permission/PermissionManager.sol | 16 +++++++++++----- .../contracts/test/framework/dao/dao-factory.ts | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/contracts/src/core/permission/PermissionManager.sol b/packages/contracts/src/core/permission/PermissionManager.sol index eb27a57d5..4334583e6 100644 --- a/packages/contracts/src/core/permission/PermissionManager.sol +++ b/packages/contracts/src/core/permission/PermissionManager.sol @@ -43,12 +43,18 @@ abstract contract PermissionManager is Initializable { /// @notice A mapping storing permissions as hashes (i.e., `permissionHash(where, who, permissionId)`) and their status encoded by an address (unset, allowed, or redirecting to a `PermissionCondition`). mapping(bytes32 => address) internal permissionsHashed; + /// @notice A struct containing the information for a permission. + /// @param delegations Owners can delegate the permission so delegatees can only grant it one time only. + /// @param owners The current owners of the permission with their own specific flags capabilities. + /// @param created Whether the permission has been created or not - used in consumer contracts(such as DAO.sol) to make decisions whether permission exists or not. + /// @param grantCounter How many owners(that have grant capabilities) are currently set for a permission. + /// @param revokeCounter How many owners(that have revoke capabilities) are currently set for a permission. struct Permission { - mapping(address => uint256) delegations; // Owners can delegate the permission so delegatees can only grant it one time only. - mapping(address => uint256) owners; // The current owners of the permission with their own specific flags capabilities. - bool created; // Whether the permission has been created or not - used in consumer contracts(such as DAO.sol) to make decisions whether permission exists or not. - uint64 grantCounter; // How many owners(that have grant capabilities) are currently set for a permission. - uint64 revokeCounter; // How many owners(that have revoke capabilities) are currently set for a permission. + mapping(address => uint256) delegations; + mapping(address => uint256) owners; + bool created; + uint64 grantCounter; + uint64 revokeCounter; } /// @notice A mapping storing owners and delegations of each permission. diff --git a/packages/contracts/test/framework/dao/dao-factory.ts b/packages/contracts/test/framework/dao/dao-factory.ts index 707e218ee..cf86b2826 100644 --- a/packages/contracts/test/framework/dao/dao-factory.ts +++ b/packages/contracts/test/framework/dao/dao-factory.ts @@ -108,7 +108,7 @@ async function getAnticipatedAddress(from: string) { return anticipatedAddress; } -describe('DAOFactory: ', function () { +describe.only('DAOFactory: ', function () { let daoFactory: DAOFactory; let managingDao: any;