Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster-will committed Feb 17, 2024
1 parent 192c49b commit 5dccf7b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contracts/AccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,15 @@ contract AccessController is IAccessController, Governable {
permissions[_encodePermission(ipAccount, signer, to, func)] = permission;
}

/// @dev encode permission to hash (bytes32)
/// @dev Encodes permission parameters into a hash (bytes32) to serve as a unique permission record ID.
/// This function is utilized both when setting permissions and checking permissions to uniquely identify them.
/// In addition to the four permission fields passed by the parameters (ipAccount, signer, to, func),
/// an additional field, "ipAccountOwner", is retrieved on-the-fly when encoding the permission.
/// @param ipAccount The IP account involved in the permission.
/// @param signer The account that signs the transaction.
/// @param to The recipient of the transaction.
/// @param func The function selector involved in the permission.
/// @return A bytes32 hash representing the unique ID of the permission record.
function _encodePermission(
address ipAccount,
address signer,
Expand Down

0 comments on commit 5dccf7b

Please sign in to comment.