Platform: Code4rena
Start Date: 06/06/2023
End Date: 14/06/2023
Period: 8 days
Status: Completed
Pot Size: $60,500 USDC
Participants: 50
Reporter: PaperParachute
Judge: gzeon
Id: 246
League: ETH
auditor0517 | 1/50 | $9,090.03 | 3 | 2 | 0 | 1 | 0 | 0 | 0 | 0 |
dirk_y | 2/50 | $8,787.84 | 3 | 1 | 0 | 1 | 0 | 0 | 0 | Grade B |
ktg | 3/50 | $7,540.46 | 4 | 1 | 0 | 1 | 0 | - | 0 | Grade B |
0xnev | 4/50 | $3,407.68 | 3 | 1 | 0 | 1 | 0 | 0 | 0 | Grade A |
Toshii | 5/50 | $3,075.56 | 3 | 1 | 0 | 2 | 0 | 0 | 0 | 0 |
kutugu | 6/50 | $3,069.12 | 3 | 1 | 0 | 0 | 0 | Grade B | 0 | Grade A |
rvierdiiev | 7/50 | $2,702.90 | 2 | 0 | 0 | 2 | 0 | 0 | 0 | 0 |
T1MOH | 8/50 | $2,628.75 | 2 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
0xSmartContract | 9/50 | $730.13 | 3 | 0 | 0 | 0 | 0 | Grade A | Grade B | Grade A |
libratus | 10/50 | $565.79 | 3 | 0 | 0 | 1 | 0 | Grade B | 0 | Grade A |
Auditor per page
✨ All participating wardens are encouraged to submit an Analysis prior to the closing date. Guidelines and FAQ can be found here.
Automated findings output for the audit can be found here.
Note for C4 wardens: Anything included in the automated findings output is considered a publicly known issue and is ineligible for awards.
The results of the slither report and acknowledged findings from our Spearbit audit are out of scope for this audit contest.
Llama is a governance system for onchain organizations. It uses non-transferable NFTs to encode access control, features programmatic control of funds, and includes a modular framework to define action execution rules.
The video explainer provides a high-level overview of the Llama system and the docs describe the core components.
File | SLOC | Description and Coverage | Libraries |
---|---|---|---|
Contracts (11) | |||
src/LlamaExecutor.sol 👥 | 15 | The exit point of a Llama instance. It calls the target contract during action execution., 100.00% | |
src/LlamaPolicyMetadataParamRegistry.sol | 38 | Parameter Registry contract for onchain SVG colors and logos, 100.00% | |
src/strategies/LlamaAbsoluteQuorum.sol | 38 | A Llama strategy that has an absolute threshold for approvals/disapprovals and the action creator can approve or disapprove their own actions., 90.91% | @openzeppelin/* solmate/* |
src/strategies/LlamaAbsolutePeerReview.sol Σ | 42 | A Llama strategy that has an absolute threshold for approvals/disapprovals and the action creator cannot approve or disapprove their own actions., 100.00% | @openzeppelin/* solmate/* |
src/LlamaPolicyMetadata.sol | 75 | Utility contract to compute llama policy metadata., 100.00% | @openzeppelin/* solady/* |
src/strategies/LlamaRelativeQuorum.sol | 151 | A Llama strategy in which approval/disapproval thresholds are specified as percentages of total supply and action creators are allowed to cast approvals or disapprovals on their own actions., 100.00% | @openzeppelin/* solmate/* |
src/LlamaFactory.sol 🧮 🌀 | 157 | Factory for deploying new Llama instances., 100.00% | @openzeppelin/* |
src/llama-scripts/LlamaGovernanceScript.sol | 161 | A script that allows users to aggregate common calls on the core and policy contracts., 53.45% | |
src/accounts/LlamaAccount.sol 🖥 💰 👥 | 187 | This contract can be used to hold assets for a Llama instance., 100.00% | @openzeppelin/* |
src/LlamaPolicy.sol Σ | 260 | An ERC721 contract where each token is non-transferable and has roles assigned to create, approve and disapprove actions., 100.00% | solady/* |
src/LlamaCore.sol 💰 🧮 🔖 🌀 | 448 | Manages the action process from creation to execution., 100.00% | @openzeppelin/* |
Abstracts (4) | |||
src/llama-scripts/LlamaBaseScript.sol | 12 | A template for creating new llama scripts., - | |
src/llama-scripts/LlamaSingleUseScript.sol | 15 | A template script for scripts that should only be run once., - | |
src/lib/ERC721NonTransferableMinimalProxy.sol Σ | 96 | A modified version of Solmate's ERC721 contract., 72.22% | @openzeppelin/* |
src/strategies/LlamaAbsoluteStrategyBase.sol | 141 | A base contract for Llama strategies to inherit from with absolute approval/disapproval properties., 86.00% | @openzeppelin/* solmate/* |
Libraries (2) | |||
src/lib/LlamaUtils.sol Σ | 17 | A library of helper functions used throughout the Llama codebase., 0.00% | |
src/lib/Checkpoints.sol 🖥 | 159 | A modified version of OpenZeppelin's Checkpoints.sol., 51.43% | |
Interfaces (3) | |||
src/interfaces/ILlamaAccount.sol | 5 | An interface for Llama accounts., - | |
src/interfaces/ILlamaActionGuard.sol | 7 | An interface for Llama strategies., - | |
src/interfaces/ILlamaStrategy.sol | 23 | An interface for Llama strategies., - | |
Structs (1) | |||
src/lib/Structs.sol | 37 | A file containing the structs that are used in more than one src contract throughout the Llama codebase., - | |
Other (2) | |||
src/lib/UDVTs.sol | 2 | A file containing the UDVTs used throughout the Llama codebase., - | |
src/lib/Enums.sol | 10 | A file containing the enumerables used throughout the Llama codebase., - | |
Total (over 23 files): | 2096 | 87.63% |
File | SLOC | Description and Coverage | Libraries |
---|---|---|---|
Contracts (1) | |||
src/LlamaLens.sol 🧮 | 85 | Utility contract to compute Llama contract addresses and permission IDs., 80.00% | @openzeppelin/* |
Total (over 1 file): | 85 | 80.00% |
We encourage participants to look for bugs in the following areas:
LlamaPolicy.sol
.LlamaExecutor.sol
delegatecalling scripts.LlamaAccount.sol
that could lead to unauthorized access to funds and assets held in it (Especially risks that stem from the LlamaAccount.sol
being able to delegatecall arbitrary contracts).LlamaPolicy.sol
is an NFTThe root lib/
directory (not the src/lib/
directory) and acknowledged findings from our Spearbit audit are out of scope for this audit contest.
LlamaFactory.sol
constructor will govern Llama instance deployments.foundryup && export MAINNET_RPC_URL='<YOUR_MAINNET_RPC_URL>' && git clone https://github.com/code-423n4/2023-06-llama && cd 2023-06-llama && forge test
Foundry must be installed. You can find installation instructions in the Foundry docs.
We use just to save and run a few larger, more complex commands. You can find installation instructions in the just docs. All commands can be listed by running just -l
from the repo root, or by viewing the justfile
.
You can get Solidity support for Visual Studio Code by installing the Hardhat Solidity extension.
$ git clone https://github.com/code-423n4/2023-06-llama $ cd 2023-06-llama $ forge install
Copy .env.example
and rename it to .env
. The comments in that file explain what each variable is for and when they're needed:
MAINNET_RPC_URL
variable is the only one that is required for running tests.ETHERSCAN_API_KEY
for better traces when running fork tests..env.example
file to facilitate testing.forge build
- build the projectforge test
- run testsjust deploy
- deploy and verify payload on mainnetjust -l
or see the justfile
for other commands such as dry runs.Run the following command to generate smart contract reference documentation from this project's NatSpec comments and serve those static files locally:
$ forge doc -o reference/ -b -s
Use our bash script to prevent slither from analyzing the test and script directories. Running slither .
directly will result in an AssertionError
.
$ chmod +x slither.sh $ ./slither.sh