Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of Easy Order Visibility and Incomplete SellOrder Struct Limits Buyer Information and Accessibility

Description

To buy an order a buyer need to provide the seller address and order index to specify the order he wants to buy. But currently there's no way to easily view the s_userToSellOrders mapping to get info on a sellers orders. So it's hard for a buyer to fetch the array index of an order they want to buy. Moreover, the current SellOrder struct doesn't provide info of what NFT tokenId and address is the selling token a share of. So there's no possible way for a buyer to know what particular NFT tokenId shares are they purchasing.

struct SellOrder {
address seller;
address erc20Address;
uint256 price;
uint256 amount;
}

Tools Used

Manual Review

Recommendations

  • Make a getter function to return the array of sell orders of a particular seller

function getSellOrders(address seller) external view returns (SellOrder[] memory) {
return s_userToSellOrders[seller];
}
  • Add more information to the SellOrder struct

struct SellOrder {
address seller;
address erc20Address;
uint256 price;
uint256 amount;
+ address nft;
+ uint256 tokenId;
}
Updates

Lead Judging Commences

fishy Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.