Platform: Code4rena
Start Date: 06/06/2023
Pot Size: $60,500 USDC
Total HM: 5
Participants: 50
Period: 8 days
Judge: gzeon
Id: 246
League: ETH
Rank: 36/50
Findings: 1
Award: $48.22
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xnev
Also found by: 0xSmartContract, K42, QiuhaoLi, VictoryGod, dirk_y, joestakey, ktg, kutugu, libratus, mahdirostami, neko_nyaa, peanuts, xuwinnie
This is the first time we participate in a contest on a governance system. While this does pose certain difficulties in understanding the system - it is a great learning experience, and we are also lucky to have the contest 2 days longer than usual contests with the same prize pool (perhaps because the contest goes through a weekend).
The first step is to understand what we're auditing. A governance is basically an entity, that consists of many people, who generally takes the following actions:
A good example to contextualize a governance is https://snapshot.org/, a lightweight governance platform, although it does not enforce permissions as strictly as Llama does due to its offchain nature.
With the picture of the governance clear, an oversimplified way to explain a Llama instance is "a very customizable multisig". This gives a good hint on what we're supposed to look for in the audit: Focus on permissions.
Thus we focus quite rigorously on permission checks, whether they're sufficient, and whether there are entrypoints that can bypass those.
For the purposes of an audit, we take the following approach:
There should not be centralization risks here due to its nature as a governance system.
A centralization risk would be a H/M issue, given that this system is all about permissions, and the purpose of the system itself is to improve decentralization within a governance. A centralization risk in this context can be defined as a single entity holding more power than it should in the governance, unless the governance itself by design has a single controlling person/entity.
The highlight of the codebase lies in the documentation and naming:
The lowlight lies in the inconsistency:
LlamaCore
is the only entrypoint for any user-initiated transactions (aside from Factory and Lens), it doesn't have an interface.
LlamaAbsoluteQuorum
and LlamaAbsolutePeerReview
inherits LlamaAbsoluteStrategyBase
. However, LlamaRelativeQuorum
does not. This creates an inconsistency, especially when considering the Strategy Base has all functions marked as virtual, which are meant for overriding.We also find it helpful that the sponsors provide previous audit's report with all the issues fixed/acknowledged, as well as highlighting special area of focuses in the contest README. They are very much help in contextualizing what was likely the main the area of focus in the previous audit, as well as what the sponsors are looking for in a contest-based auditing model as C4.
LlamaCore
with documentations, as with any existing interfaces.18 hours
#0 - c4-judge
2023-07-02T15:53:42Z
gzeon-c4 marked the issue as grade-b