Skip to content

Commit 8603571

Browse files
committed
docs: add README.md & docs, fix workflow file
1 parent 54b0694 commit 8603571

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

.github/workflows/certora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
wget https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux
4343
chmod +x solc-static-linux
44-
sudo mv solc-static-linux /usr/local/bin/solc-0.8.24
44+
sudo mv solc-static-linux /usr/local/bin/solc
4545
4646
- name: Verify ${{ matrix.conf }} specification
4747
run: certoraRun certora/confs/${{ matrix.conf }}.conf

certora/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Bundlers Formal Verification
2+
3+
This folder contains the [CVL](https://docs.certora.com/en/latest/docs/cvl/index.html) specification and verification setup for the following bundler contracts:
4+
5+
- [AaveV2MigrationBundlerV2](../src/migration/AaveV2MigrationBundlerV2.sol)
6+
- [AaveV3MigrationBundlerV2](../src/migration/AaveV3MigrationBundlerV2.sol)
7+
- [AaveV3OptimizerMigrationBundlerV2](../src/migration/AaveV3OptimizerMigrationBundlerV2.sol)
8+
- [ChainAgnosticBundlerV2](../src/chain-agnostic/ChainAgnosticBundlerV2.sol)
9+
- [CompoundV2MigrationBundlerV2](../src/migration/CompoundV2MigrationBundlerV2.sol)
10+
- [CompoundV3MigrationBundlerV2](../src/migration/CompoundV3MigrationBundlerV2.sol)
11+
- [EthereumBundlerV2](../src/ethereum/EthereumBundlerV2.sol)
12+
13+
## Getting Started
14+
15+
To verify a specification, run the command `certoraRun Spec.conf` where `Spec.conf` is one of the configuration files in [`certora/confs`](confs).
16+
17+
You must have set the `CERTORAKEY` environment variable to a valid Certora key.
18+
19+
## Overview
20+
21+
Bundler methods used during a bundle execution have the `protected` modifier. This modifier ensures that:
22+
- An initiator has been set, and
23+
- the caller is the bundle initiator or the Morpho contract.
24+
25+
The `Protected.spec` file checks that all bundler functions, except noted exceptions, respect the requirements of the `protected` modifier when an initiator has been set.
26+
27+
## Verification architecture
28+
29+
### Folders and file structure
30+
31+
The [`certora/specs`](specs) folder contains the following files:
32+
33+
- [`Protected.spec`](specs/Protected.spec) checks that all methods except noted exceptions respect the `protected` modifier when an initiator has been set.
34+
35+
The [`certora/confs`](confs) folder contains a configuration file for each deployed bundler.

certora/specs/Protected.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ methods {
88
}
99

1010

11-
rule protectedMethodsComplete(method f, env e, calldataarg data) filtered {
11+
// Check that all methods except those noted below comply with the `protected` modifier when an initiator has been set.
12+
rule protectedWithSetInitiator(method f, env e, calldataarg data) filtered {
13+
// Do not check view functions.
14+
// Do not check the fallback function.
15+
// Do not check multicall, which is used to start a new bundle.
1216
f -> !f.isView && !f.isFallback && f.selector != sig:multicall(bytes[]).selector
1317
}
1418
{

0 commit comments

Comments
 (0)