Skip to content

Commit

Permalink
Merge pull request #918 from thesandboxgame/land-and-tunnel-audit/N-1…
Browse files Browse the repository at this point in the history
…6-inconsistent-use-of-named-return-values

Land and tunnel audit / N-16
  • Loading branch information
capedcrusader21 committed May 30, 2023
2 parents 6ce5d6a + ef05b41 commit 22f4bb1
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/solc_0.5/Land/erc721/ERC721BaseTokenV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ contract ERC721BaseTokenV2 is ERC721Events, SuperOperatorsV2, MetaTransactionRec
function isApprovedForAll(address owner, address operator)
external
view
returns (bool isOperator)
returns (bool)
{
return _operatorsForAll[owner][operator] || _superOperators[operator];
}
Expand Down
4 changes: 2 additions & 2 deletions src/solc_0.5/Land/erc721/LandBaseTokenV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ contract LandBaseTokenV3 is ERC721BaseTokenV2 {
uint256 layer,
uint256 x,
uint256 y
) internal pure returns (uint256 quadId) {
quadId = layer + x + y * GRID_SIZE;
) internal pure returns (uint256) {
return layer + x + y * GRID_SIZE;
}

function _ownerOfQuad(
Expand Down
2 changes: 1 addition & 1 deletion src/solc_0.5/contracts_common/Libraries/AddressUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pragma solidity 0.5.9;

library AddressUtils {

function toPayable(address _address) internal pure returns (address payable _payable) {
function toPayable(address _address) internal pure returns (address payable) {
return address(uint160(_address));
}

Expand Down
2 changes: 1 addition & 1 deletion src/solc_0.8/common/BaseWithStorage/ERC2771Handler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract contract ERC2771Handler {
return forwarder == _trustedForwarder;
}

function getTrustedForwarder() external view returns (address trustedForwarder) {
function getTrustedForwarder() external view returns (address) {
return _trustedForwarder;
}

Expand Down
4 changes: 2 additions & 2 deletions src/solc_0.8/common/BaseWithStorage/ERC721BaseTokenV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ contract ERC721BaseTokenV2 is ContextUpgradeable, IERC721Upgradeable, WithSuperO
/// @param owner The address of the owner.
/// @param operator The address of the operator.
/// @return isOperator The status of the approval.
function isApprovedForAll(address owner, address operator) external view override returns (bool isOperator) {
function isApprovedForAll(address owner, address operator) external view override returns (bool) {
return _operatorsForAll[owner][operator] || _superOperators[operator];
}

Expand Down Expand Up @@ -422,7 +422,7 @@ contract ERC721BaseTokenV2 is ContextUpgradeable, IERC721Upgradeable, WithSuperO
address from,
address to,
uint256 id
) internal view returns (bool isMetaTx) {
) internal view returns (bool) {
(address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id);
address msgSender = _msgSender();
require(owner != address(0), "NONEXISTENT_TOKEN");
Expand Down
4 changes: 2 additions & 2 deletions src/solc_0.8/polygon/child/land/PolygonLandBaseTokenV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ abstract contract PolygonLandBaseTokenV2 is IPolygonLand, Initializable, ERC721B
uint256 layer,
uint256 x,
uint256 y
) internal pure returns (uint256 quadId) {
quadId = layer + x + y * GRID_SIZE;
) internal pure returns (uint256) {
return layer + x + y * GRID_SIZE;
}

function _checkOwner(
Expand Down
2 changes: 1 addition & 1 deletion src/solc_0.8/polygon/child/land/PolygonLandTunnelV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ contract PolygonLandTunnelV2 is
emit Deposit(to, size, x, y, data);
}

function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address sender) {
function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address) {
return ERC2771Handler._msgSender();
}

Expand Down
2 changes: 1 addition & 1 deletion src/solc_0.8/polygon/child/land/PolygonLandV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract PolygonLandV2 is PolygonLandBaseTokenV2, ERC2771Handler, OperatorFilter
_trustedForwarder = trustedForwarder;
}

function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address sender) {
function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address) {
return ERC2771Handler._msgSender();
}

Expand Down
2 changes: 1 addition & 1 deletion src/solc_0.8/polygon/root/land/LandTunnelV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ contract LandTunnelV2 is
}
}
function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address sender) {
function _msgSender() internal view override(ContextUpgradeable, ERC2771Handler) returns (address) {
return ERC2771Handler._msgSender();
}
Expand Down

1 comment on commit 22f4bb1

@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

83.44%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/solc_0.8.15/common/BaseWithStorage/ERC2771
   ERC2771HandlerUpgradeable.sol44.44%25%60%44.44%23, 27, 30, 39, 39, 39–40, 42
src/solc_0.8.15/common/OperatorFilterer
   IOperatorFilterRegistry.sol100%100%100%100%
   UpdatableOperatorFiltererUpgradeable.sol9.30%5.56%25%9.52%23–24, 24, 24–25, 27, 27, 27–28, 30, 38, 38, 38, 42, 42, 42–44, 46, 46, 46–47, 50, 55, 55, 55–56, 56, 56–57, 60, 68, 68, 68–69, 71
src/solc_0.8.15/raffle
   DanceFight.sol100%100%100%100%
   FistOfTheNorthStar.sol100%100%100%100%
   GenericRaffle.sol68.13%51.67%58.62%81.72%188–194, 225–228, 252–258, 265–266, 269, 288–289, 307, 336, 347, 347, 347–349, 358, 380, 389, 398, 409, 420, 431, 442, 453, 465, 565, 574, 625–626, 629, 632
   HellsKitchen.sol100%100%100%100%
   MadBalls.sol100%100%100%100%
   Rabbids.sol100%100%100%100%
src/solc_0.8/Game
   GameBaseToken.sol89.56%75%100%95.60%139–140, 142–143, 189–190, 193–194, 213, 216–217, 231, 248, 251, 266, 286, 352, 415, 420, 436, 441–442, 442, 442–443, 485–486, 507–508, 510, 547, 618, 81
   GameMinter.sol95.83%75%100%100%77
   GameV1.sol100%100%100%100%
src/solc_0.8/OperatorFilterer/contracts
   OperatorFilterRegistrant.sol66.67%50%100%66.67%19–20
src/solc_0.8/OperatorFilterer/contracts/upgradeable
   DefaultOperatorFiltererUpgradeable.sol0%100%0%0%13
   OperatorFiltererUpgradeable.sol90.24%88.89%100%89.47%46–47, 56–57
src/solc_0.8/OperatorFilterer/interfaces
   IOperatorFilterRegistry.sol100%100%100%100%
src/solc_0.8/Sand
   SandBaseToken.sol100%100%100%100%
src/solc_0.8/StarterPack
   PurchaseValidator.sol94.87%80%100%100%29, 37
   StarterPackV2.sol92.67%80%95.65%99.07%108–111, 309, 378, 67–72, 84
src/solc_0.8/Utils
   Batch.sol97.62%50%100%100%34
src/solc_0.8/asset
   AssetAttributesRegistry.sol67.41%56.52%83.33%71.43%103, 103, 103, 109, 109, 109–112, 112, 112–113, 116, 118–119, 121, 123, 151–152, 160–161, 169–171, 185, 200–201, 201, 201–202, 202, 202–203, 205, 205, 205–206, 228, 232, 67, 69–70
   AssetMinter.sol89.18%81.25%87.50%94.34%113, 117, 137, 137, 137, 141–142, 226, 235, 248, 285, 287, 415, 44–46, 53–54
   AssetSignedAuctionWithAuth.sol80%67.86%84.62%88.73%109, 111, 193, 202, 211, 240, 249, 258, 272, 298, 303, 307–308, 311–312, 316, 346–347, 347, 347, 351–352, 352, 352, 377, 89
   AssetUpgrader.sol82.47%65.63%84.62%92.31%113–114, 122, 127, 168, 192–193, 195, 222, 224, 232, 76–77, 96–97
src/solc_0.8/asset/libraries
   AssetHelper.sol0%0%0%0%16–17, 17, 17–18, 18, 18–19, 35–38, 40, 47, 49, 51, 59–60, 62, 65–67, 67, 67–72, 72, 72–74, 78, 86, 88–90, 90, 90–91, 94
   ERC1155ERC721Helper.sol100%100%100%100%
src/solc_0.8/assetERC1155
   AssetBaseERC1155.sol81.61%68.37%83.72%88.76%110, 112, 133, 152, 152, 152–153, 179, 190, 196, 216, 218, 263, 301, 301, 301–304, 317–318, 339, 355, 355, 355–356, 358, 367, 369–370, 390, 437, 447–449, 449, 449–450, 452, 491, 544, 554, 580, 588, 600, 81–84, 91
   AssetERC1155.sol74.23%50%81.25%91.11%115, 122, 131, 143, 143, 143–144, 160–161, 243, 46–48, 51, 70–72, 74, 93–95, 99
src/solc_0.8/assetERC721
   BaseERC721.sol70.27%50%78.95%75.68%120–123, 195, 195, 195–196, 198, 203, 207, 51, 65–66, 79–80, 88–89
src/solc_0.8/bundleSandSale
   PolygonBundleSandSale.sol89.58%67.39%100%100%128, 140, 151, 170–172, 198–201, 208, 210, 244, 271, 93
src/solc_0.8/catalyst
   CatalystV1.sol95%50%100%100%66
   CollectionCatalystMigrations.sol0%0%0%0%32–35, 41, 41, 41–43, 45, 51, 51, 51–52, 61–62, 62, 62–64, 64, 64–66, 66, 66, 69–70, 70, 70, 75–76, 78
   DefaultAttributes.sol100%100%100%100%
   GemsCatalystsRegistry.sol94.33%86.96%95.83%98.59%249, 253, 271, 36–37, 54, 70
   GemV1.sol91.67%50%100%100%34
src/solc_0.8/catalyst/interfaces
   ICatalyst.sol100%100%100%100%
   ICollectionCatalystMigrations.sol100%100%

Please sign in to comment.