Skip to content

Commit

Permalink
docs(excubiae): improve documentation for unwanted access on new excubia
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjei committed Jun 28, 2024
1 parent 8d9c478 commit bb31966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/excubiae/contracts/extensions/ERC721Excubia.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract ERC721Excubia is Excubia {
IERC721 public immutable NFT;

/// @notice Mapping to track which token IDs have been registered by the contract to
/// avoid double checks with the same token ID.
/// avoid passing the gate twice with the same token ID.
mapping(uint256 => bool) public registeredTokenIds;

/// @notice Error thrown when the passerby is not the owner of the token.
Expand All @@ -28,15 +28,15 @@ contract ERC721Excubia is Excubia {
}

/// @notice Internal function to handle the passing logic with check.
/// @dev Calls the parent `_pass` function and registers the NFT ID to avoid double checks.
/// @dev Calls the parent `_pass` function and registers the NFT ID to avoid passing the gate twice.
/// @param passerby The address of the entity attempting to pass the gate.
/// @param data Additional data required for the check (e.g., encoded token ID).
function _pass(address passerby, bytes calldata data) internal override {
super._pass(passerby, data);

uint256 tokenId = abi.decode(data, (uint256));

// Avoiding double check of the same token ID.
// Avoiding passing the gate twice with the same token ID.
if (registeredTokenIds[tokenId]) revert AlreadyRegistered();

registeredTokenIds[tokenId] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract FreeForAllExcubia is Excubia {
function _pass(address passerby, bytes calldata data) internal override {
super._pass(passerby, data);

// Avoiding double check of the same passerby.
// Avoiding passing the gate twice with the same address.
if (registeredPassersby[passerby]) revert AlreadyRegistered();

registeredPassersby[passerby] = true;
Expand Down

0 comments on commit bb31966

Please sign in to comment.