Skip to content

Commit

Permalink
fix: N-06 Redundant Code
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 56c6fa1 commit c711ced
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/land/contracts/common/LandBaseToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ abstract contract LandBaseToken is IErrors, ILandToken, ERC721BaseToken {

/// @notice return the owner of a quad given his size and coordinates or zero if is not minted yet.
/// @param size The size of the quad
/// @param x The bottom left x coordinate of the quad
/// @param y The bottom left y coordinate of the quad
/// @param x coordinate inside the quad
/// @param y coordinate inside the quad
/// @return the address of the owner
function _ownerOfQuad(uint256 size, uint256 x, uint256 y) internal view returns (address) {
(uint256 layer, uint256 parentSize, ) = _getQuadLayer(size);
Expand Down Expand Up @@ -772,7 +772,7 @@ abstract contract LandBaseToken is IErrors, ILandToken, ERC721BaseToken {
owner = address(uint160(owner1x1));
operatorEnabled = (owner1x1 & OPERATOR_FLAG) == OPERATOR_FLAG;
} else {
owner = _ownerOfQuad(3, (x * 3) / 3, (y * 3) / 3);
owner = _ownerOfQuad(3, x, y);
operatorEnabled = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ abstract contract OperatorFiltererUpgradeable is Context {
/// @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();
// Allow spending tokens from addresses with balance
// Allow spending tokens from addresses with balance (from == _msgSender())
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from != _msgSender()) {
Expand Down
4 changes: 1 addition & 3 deletions packages/land/contracts/registry/LandMetadataBase.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol";

/// @title LandMetadataBase
/// @author The Sandbox
/// @custom:security-contact [email protected]
/// @notice Store information about the lands (premiumness and neighborhood)
abstract contract LandMetadataBase is AccessControlEnumerableUpgradeable {
abstract contract LandMetadataBase {
/// @notice the base token id used for a batch operation is wrong
/// @param tokenId the id of the token
error InvalidBaseTokenId(uint256 tokenId);
Expand Down

1 comment on commit c711ced

@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.