Pieces Protocol

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

Multiple checks for owner of the nft in `TokenDivider::divideNft` function.

Description

`TokenDivider::divideNft` function checks for owner of thr nft before perform anything, As the modifier refers only owner of the nft can call the `divideNft` function.
But the function is checking for owner twice shown in code below.
```javascript
@> function divideNft(address nftAddress, uint256 tokenId, uint256 amount) onlyNftOwner(nftAddress, tokenId) onlyNftOwner(nftAddress ,tokenId) external {
```

Impact

The `divideNft` function will check twise for owner of the nft.

Recommendations

The `onlyNftOwner` modifier should only be called or required once in the function call.
```diff
- function divideNft(address nftAddress, uint256 tokenId, uint256 amount) onlyNftOwner(nftAddress, tokenId) onlyNftOwner(nftAddress ,tokenId) external {
+ function divideNft(address nftAddress, uint256 tokenId, uint256 amount) onlyNftOwner(nftAddress, tokenId) onlyNftOwner(nftAddress ,tokenId) external {
```
Updates

Lead Judging Commences

fishy Lead Judge 5 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.