You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: certora/README.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -210,10 +210,32 @@ The `canWithdrawCollateralAll` rule ensures that in the case where the account h
210
210
211
211
## Protection against common attack vectors
212
212
213
+
Other common and known attack vectors are verified to not be possible on the Morpho Blue protocol.
214
+
213
215
### Reentrancy
214
216
217
+
Reentrancy is a common attack vector that happen when a call to a contract allows, when in a temporary state, to call the same contract again.
218
+
The state of the contract usually refers to the storage variables, which can typically hold values that are meant to be used only after the full execution of the current function.
219
+
The Morpho Blue contract is verified to not be vulnerable to this kind of reentrancy attack thanks to the rule `reentrancySafe`.
220
+
215
221
### Extraction of value
216
222
223
+
The Morpho Blue protocol uses a conservative approach to handle arithmetic operations.
224
+
Rounding is done such that potential (small) errors are in favor of the protocol, which ensures that it is not possible to extract value from other users.
225
+
226
+
The rule `supplyWithdraw` handles the simple scenario of a supply followed by a withdraw, and has the following check.
227
+
228
+
```solidity
229
+
assert withdrawnAssets <= suppliedAssets;
230
+
```
231
+
232
+
The rule `withdrawLiquidity` is more general and defines `owedAssets` as the assets that are owed to the user, rounding in favor of the protocol.
233
+
This rule has the following check to ensure that no more than the owed assets can be withdrawn.
234
+
235
+
```solidity
236
+
assert withdrawnAssets <= owedAssets;
237
+
```
238
+
217
239
# Folder and file structure
218
240
219
241
The [`certora/specs`](./specs) folder contains the following files:
@@ -249,5 +271,5 @@ It requires having set the `CERTORAKEY` environment variable to a valid Certora
249
271
You can pass arguments to the script, which allows you to verify specific properties. For example, at the root of the repository:
0 commit comments