Skip to content

Commit

Permalink
fix: address PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
adhusson committed Oct 30, 2024
1 parent e997f43 commit 02d514d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/certora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc
sudo mv solc-static-linux /usr/local/bin/solc-0.8.24
- name: Verify ${{ matrix.conf }} specification
run: certoraRun certora/confs/${{ matrix.conf }}.conf
Expand Down
4 changes: 2 additions & 2 deletions certora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This folder contains the [CVL](https://docs.certora.com/en/latest/docs/cvl/index
- [CompoundV3MigrationBundlerV2](../src/migration/CompoundV3MigrationBundlerV2.sol)
- [EthereumBundlerV2](../src/ethereum/EthereumBundlerV2.sol)

## Getting Started
## Getting started

To verify a specification, run the command `certoraRun Spec.conf` where `Spec.conf` is one of the configuration files in [`certora/confs`](confs).

Expand All @@ -19,7 +19,7 @@ You must have set the `CERTORAKEY` environment variable to a valid Certora key.
## Overview

Bundler methods used during a bundle execution have the `protected` modifier. This modifier ensures that:
- An initiator has been set, and
- an initiator has been set;
- the caller is the bundle initiator or the Morpho contract.

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.
Expand Down
1 change: 1 addition & 0 deletions certora/confs/AaveV2MigrationBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/migration/AaveV2MigrationBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "AaveV2MigrationBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/AaveV3MigrationBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/migration/AaveV3MigrationBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "AaveV3MigrationBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/AaveV3OptimizerMigrationBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/migration/AaveV3OptimizerMigrationBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "AaveV3OptimizerMigrationBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/ChainAgnosticBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/chain-agnostic/ChainAgnosticBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "ChainAgnosticBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/CompoundV2MigrationBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/migration/CompoundV2MigrationBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "CompoundV2MigrationBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/CompoundV3MigrationBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/migration/CompoundV3MigrationBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "CompoundV3MigrationBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
1 change: 1 addition & 0 deletions certora/confs/EthereumBundlerV2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"src/ethereum/EthereumBundlerV2.sol"
],
"solc": "solc-0.8.24",
"verify": "EthereumBundlerV2:certora/specs/Protected.spec",
"rule_sanity": "basic",
"server": "production",
Expand Down
5 changes: 2 additions & 3 deletions certora/specs/Protected.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ rule protectedWithSetInitiator(method f, env e, calldataarg data) filtered {
f -> !f.isView && !f.isFallback && f.selector != sig:multicall(bytes[]).selector
}
{
require e.msg.sender != initiator();
require e.msg.sender != MORPHO();
f@withrevert(e,data);
assert lastReverted;
bool reverted = lastReverted;
assert e.msg.sender != initiator() && e.msg.sender != MORPHO() => reverted;
}

0 comments on commit 02d514d

Please sign in to comment.