Popcorn contest - shark's results

A multi-chain regenerative yield-optimizing protocol.

General Information

Platform: Code4rena

Start Date: 31/01/2023

Pot Size: $90,500 USDC

Total HM: 47

Participants: 169

Period: 7 days

Judge: LSDan

Total Solo HM: 9

Id: 211

League: ETH

Popcorn

Findings Distribution

Researcher Performance

Rank: 113/169

Findings: 1

Award: $35.48

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. Order of functions

Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier.

Functions should be grouped according to their visibility and ordered:

  • constructor
  • receive function (if exists)
  • fallback function (if exists)
  • external
  • public
  • internal
  • private

Source: docs.soliditylang.org/en/v0.8.17/style-guide.html#order-of-functions

  1. src/vault/adapter/beefy/BeefyAdapter.sol (public functions should be before internal functions)

2. Consider declaring constants instead of magic numbers

https://github.com/code-423n4/2023-01-popcorn/blob/main/src/vault/Vault.sol#L630

        if (_quitPeriod < 1 days || _quitPeriod > 7 days)

Instead of using magic numbers 1 days and 7 days, consider creating constant variables i.e. MIN_QUIT_PERIOD, MAX_QUIT_PERIOD.

3. Unspecific Compiler Version Pragma

A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.

For example, the version that is currently used (pragma solidity ^0.8.15;) is unspecific.

4. Use a more recent version of solidity

The current version being used is 0.8.15. However, it is considered best practice to use the latest version of solidity (currently 0.8.17). More recent versions of solidity have compiler optimizations among other things. This could help in reading and writing safe and clean code.

#0 - c4-judge

2023-02-28T23:34:17Z

dmvt 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