Pieces Protocol

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

No limit on NFT dividends, and this can lead to gas attacks

Summary

Users can divide their NFTs into type(uint256).max number of pieces. This could lead to serious gas issues and a possible DOS attack if all pieces are to be listed on the protocol.

Vulnerability Details

PoC

function test_no_limit_on_sell_orders() public {
address alice = makeAddr("alice");
erc721Mock.mint(alice); // Mint mock nft to Alice
assert(erc721Mock.ownerOf(1) == alice);
// divide nft
vm.startPrank(alice);
erc721Mock.approve(address(tokenDivider), 1);
uint256 max = type(uint256).max;
console.log(max);
tokenDivider.divideNft(address(erc721Mock), 1, max);
// create sell order
ERC20Mock erc20Mock = ERC20Mock(tokenDivider.getErc20InfoFromNft(address(erc721Mock)).erc20Address);
erc20Mock.approve(address(tokenDivider), max);
tokenDivider.sellErc20(address(erc721Mock), 1e18, max);
vm.stopPrank();
}

Tools Used

  • Manual Review

  • Foundry

Recommendations

The protocol should set a max number of pieces that an NFT can be divided into.

Updates

Lead Judging Commences

fishy Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

yeahchibyke Submitter
8 months ago
fishy Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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