Skip to content

Commit

Permalink
fix: N-01 Missing Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Adjimann authored and adjisb committed Jul 29, 2024
1 parent ff3c508 commit 360c657
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/land/contracts/common/LandBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract contract LandBase is
_approveFor(sender, operator, tokenId);
}

/// @notice Set the approval for an operator to manage all the tokens of the sender
/// @notice Set the approval for an operator to manage all the tokens of the msgSender
/// @param operator The address receiving the approval
/// @param approved The determination of the approval
function setApprovalForAll(
Expand All @@ -129,7 +129,7 @@ abstract contract LandBase is
_setApprovalForAll(_msgSender(), operator, approved);
}

/// @notice Set the approval for an operator to manage all the tokens of the sender
/// @notice Set the approval for an operator to manage all the tokens of the sender (may differ from msgSender)
/// @param sender The address giving the approval
/// @param operator The address receiving the approval
/// @param approved The determination of the approval
Expand Down
3 changes: 3 additions & 0 deletions packages/land/contracts/common/LandBaseToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ abstract contract LandBaseToken is IErrors, ILandToken, ERC721BaseToken {
uint256 internal constant LAYER_24x24 = 0x0400000000000000000000000000000000000000000000000000000000000000;
/* solhint-enable const-name-snakecase */

/// @notice emitted when a minter right is changed.
/// @param minter address that will be given/removed minter right.
/// @param enabled set whether the minter is enabled or disabled.
event Minter(address indexed minter, bool enabled);

/// @dev helper struct to store arguments in memory instead of the stack.
Expand Down
10 changes: 7 additions & 3 deletions packages/land/contracts/common/OperatorFiltererUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pragma solidity 0.8.23;
import {IOperatorFilterRegistry} from "../interfaces/IOperatorFilterRegistry.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";

///@title OperatorFiltererUpgradeable
/// @title OperatorFiltererUpgradeable
/// @author The Sandbox
/// @custom:security-contact [email protected]
///@notice This contract would subscribe or copy or just to the subscription provided or just register to default subscription list
///@dev This contract is the upgradeable version of the OpenSea implementation https://github.com/ProjectOpenSea/operator-filter-registry/blob/main/src/OperatorFilterer.sol and adapted to the 0.5.9 solidity version
/// @notice This contract would subscribe or copy or just to the subscription provided or just register to default subscription list
/// @dev This contract is the upgradeable version of the OpenSea implementation https://github.com/ProjectOpenSea/operator-filter-registry/blob/main/src/OperatorFilterer.sol and adapted to the 0.5.9 solidity version
abstract contract OperatorFiltererUpgradeable is Context {
/// @notice emitted when a registry is set
/// @param registry address of the registry to set
Expand All @@ -23,11 +23,15 @@ abstract contract OperatorFiltererUpgradeable is Context {
/// @notice the caller is not the operator
error OperatorNotAllowed();

/// @notice Used in approval operations to check if the operator is allowed to call this contract
/// @param operator The address receiving the approval
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkIsOperatorAllowed(address(this), operator);
_;
}

/// @notice Used in transfer from operations to check if the sender of the token is allowed to call this contract
/// @param from the sender of the token
modifier onlyAllowedOperator(address from) virtual {
IOperatorFilterRegistry registry = _readOperatorFilterRegistry();
// Check registry code length to facilitate testing in environments without a deployed registry.
Expand Down
10 changes: 6 additions & 4 deletions packages/land/contracts/interfaces/IERC173.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ pragma solidity ^0.8.0;
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-173.md
/// Note: the ERC-165 identifier for this interface is 0x7f5828d0
interface IERC173 {
/// @dev This emits when ownership of a contract changes.
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
/// @notice Emitted when ownership of a contract changes.
/// @param previousOwner the old owner
/// @param newOwner the new owner
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

/// @notice Get the address of the owner
/// @return The address of the owner.
function owner() external view returns (address);

/// @notice Set the address of the new owner of the contract
/// @param _newOwner The address of the new owner of the contract
function transferOwnership(address _newOwner) external;
/// @param newOwner The address of the new owner of the contract
function transferOwnership(address newOwner) external;
}

1 comment on commit 360c657

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/land/contracts
   Land.sol100%100%100%100%
   LandMetadataRegistry.sol100%100%100%100%
   PolygonLand.sol100%100%100%100%
packages/land/contracts/common
   ERC721BaseToken.sol100%100%100%100%
   LandBase.sol100%100%100%100%
   LandBaseToken.sol100%100%100%100%
   OperatorFiltererUpgradeable.sol100%100%100%100%
   WithAdmin.sol100%100%100%100%
   WithMetadataRegistry.sol100%100%100%100%
   WithOwner.sol100%100%100%100%
   WithRoyalties.sol100%100%100%100%
   WithSuperOperators.sol100%100%100%100%
packages/land/contracts/interfaces
   IERC173.sol100%100%100%100%
   IERC721BatchOps.sol100%100%100%100%
   IERC721MandatoryTokenReceiver.sol100%100%100%100%
   IErrors.sol100%100%100%100%
   ILandMetadataRegistry.sol100%100%100%100%
   ILandToken.sol100%100%100%100%
   IOperatorFilterRegistry.sol100%100%100%100%
packages/land/contracts/mainnet
   LandStorageMixin.sol100%100%100%100%
packages/land/contracts/polygon
   ERC2771Handler.sol100%100%100%100%
   PolygonLandStorageMixin.sol100%100%100%100%
packages/land/contracts/registry
   LandMetadataBase.sol100%100%100%100%

Please sign in to comment.