Canto Identity Subprotocols contest - Kresh's results

Subprotocols for Canto Identity Protocol.

General Information

Platform: Code4rena

Start Date: 17/03/2023

Pot Size: $36,500 USDC

Total HM: 10

Participants: 98

Period: 3 days

Judge: leastwood

Total Solo HM: 5

Id: 223

League: ETH

Canto Identity Subprotocols

Findings Distribution

Researcher Performance

Rank: 48/98

Findings: 2

Award: $34.80

QA:
grade-b
Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

22.7749 USDC - $22.77

Labels

bug
grade-b
QA (Quality Assurance)
Q-05

External Links

Improper Error Names

Description

https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-namespace-protocol/src/Namespace.sol#L91 https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-namespace-protocol/src/Tray.sol#L196 https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-namespace-protocol/src/Tray.sol#L204 https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-namespace-protocol/src/Tray.sol#L120 Considering how these errors could be reached, their names (TokenNotMinted and TrayNotMinted) are improper. Namespace and Tray contracts have burn functions, therefore NFTs could be minted and then transfered to address(0) (burned), and therefore the errors could be reached for minted NFTs. (it is not the same for Bio and ProfilePicture, because Solmate's implementation have a restriction to transfer to address(0) without burn, so the errors are not achievable for minted ones)

Replace NotMinted with NotExist into error names.

Improper Error Names

Description

Bio, ProfilePicture and Namespace contracts use Solmate's ERC721 implementation, but Tray contract use ERC721A without any significant reason. It violates the homogeneity of the contracts.

Use either Solmate's implementation or ERC721A.

Improper Error Names

Description

https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-pfp-protocol/src/ProfilePicture.sol#L103 It is written that there is no sense to reset nftID, but it still happens. But moreover, there is twice no sense for "reseting" because a real nftID could also be 0, then it also wouldn't mean at least "reset".

Remove this line.

#0 - c4-judge

2023-04-11T05:45:52Z

0xleastwood marked the issue as grade-b

Useless check

Description

https://github.com/code-423n4/2023-03-canto-identity/blob/077372297fc419ea7688ab62cc3fd4e8f4e24e66/canto-bio-protocol/src/Bio.sol#L60 (i > 0 && (i + 1) % 40 == 0) has a check i > 0 which is not needed, because when i = 0, then 1 % 40 != 0

Replace (i > 0 && (i + 1) % 40 == 0) with ((i + 1) % 40 == 0)

#0 - c4-judge

2023-04-10T23:54:47Z

0xleastwood marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter