PartyDAO contest - PaludoX0's results

A protocol for buying, using, and selling NFTs as a group.

General Information

Platform: Code4rena

Start Date: 12/09/2022

Pot Size: $75,000 USDC

Total HM: 19

Participants: 110

Period: 7 days

Judge: HardlyDifficult

Total Solo HM: 9

Id: 160

League: ETH

PartyDAO

Findings Distribution

Researcher Performance

Rank: 47/110

Findings: 2

Award: $117.71

🌟 Selected for report: 0

šŸš€ Solo Findings: 0

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/distribution/TokenDistributor.sol#L352 uint128 fee = supply * args.feeBps / 1e4, better to be written as uint128 fee = (supply * args.feeBps) / 1e4; in order to give priority to moltiplication and avoid loosing roundings

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/distribution/TokenDistributor.sol#L327 Since emergency functions can be disabled only, it would be better to disable for one or more party, not only for all. It could be that some parties are still immature and emergency functions are still needed.

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/distribution/TokenDistributor.sol#L379 There's no check that _storedBalances[balanceId] > amount, If not function revert with underflow error but it would be better to set an error/event message

#0 - HardlyDifficult

2022-10-06T21:36:07Z

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/distribution/TokenDistributor.sol#L28 Booleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents replace the bits taken up by the boolean, and then write back. The values being non-zero value makes deployment a bit more expensive, but in exchange the refund on every call will be lower in amount. Use following variables and constant to WRITE /READ variable uint256 feeClaimed; Ā  Ā  uint256 private constant _WAS_FEE_NOT_CLAIMED = 1; Ā  Ā  uint256 private constant _WAS_FEE_CLAIMED = 2;

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/crowdfund/CollectionBuyCrowdfund.sol#L62 In order to save gas hosts.length to be saved in a temporary variable

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/crowdfund/Crowdfund.sol#L180 In order to save gas contributors.length to be saved in a temporary variable

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/crowdfund/Crowdfund.sol#L300 In order to save gas preciousToken.length to be saved in a temporary variable

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