Skip to content

Commit 97994c8

Browse files
committed
chore: try with snippet of solidity
1 parent 1b63d2f commit 97994c8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

certora/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,61 @@ For more details, see the description of the specification below or the descript
88

99
The Morpho Blue protocol allows users to take out collateralized loans on ERC20 tokens.
1010

11+
```solidity
12+
rule supplyAccruesInterest(env e, MorphoHarness.MarketParams marketParams, uint256 assets, uint256 shares, address onBehalf, bytes data) {
13+
// Safe require because timestamps cannot realistically be that large.
14+
require e.block.timestamp < 2^128;
15+
16+
storage init = lastStorage;
17+
18+
accrueInterest(e, marketParams);
19+
supply(e, marketParams, assets, shares, onBehalf, data);
20+
storage afterBoth = lastStorage;
21+
22+
supply(e, marketParams, assets, shares, onBehalf, data) at init;
23+
storage afterOne = lastStorage;
24+
25+
assert afterBoth == afterOne;
26+
}
27+
```
28+
1129
### Transfers
30+
1231
Token transfers are verified to behave as expected for the most common implementations, in particular the transferred amount is the amount passed as input.
1332
Morpho Blue uses a transfer library to handle different tokens, including tokens that do not strictly respect the standard, in particular, when the return value on transfer and transferFrom function are missing, such as for the USDT token. This is difficult for the prover, so a summary is used to ease the verification of rules that rely on the transfer of tokens. This summary is verified to behave as expected in the Transfer.spec file.
1433

1534
### Markets
35+
1636
Markets on Morpho Blue depend on a pair of assets, the borrowable asset that is supplied and borrowed, and the collateral asset.
1737
Markets are independent, which means that loans cannot be impacted by loans from other markets.
1838
Positions of users are also independent, so loans cannot be impacted by loans from other users.
1939
The accounting of the markets has been verified (such as the total amounts), as well as the fact that only market with enabled parameters are created.
2040

2141
### Supply
42+
2243
When supplying on Morpho Blue, interest is earned over time, and the distribution is implemented through a shares mechanism.
2344
Shares increase in value as interest is accrued.
2445

2546
### Borrow
47+
2648
To borrow on Morpho Blue, collateral must be deposited.
2749
Collateral tokens remain idle, as well as any borrowable token that has not been borrowed.
2850

2951
### Liquidation
52+
3053
To ensure proper collateralization, a liquidation system is put in place.
3154
In the absence of accrued interest, for example when creating a new position or when interacting multiple times in the same block, a position cannot be made unhealthy.
3255

3356
### Authorization
57+
3458
Morpho Blue also defines a sound authorization system where users cannot modify positions of other users without proper authorization (except when liquidating).
3559

3660
### Safety
61+
3762
Other safety properties are verified, particularly regarding reentrancy attacks and about input validation and revert conditions.
3863

3964
### Liveness
65+
4066
Other liveness properties are verified as well, in particular it is always possible to exit a position without concern for the oracle.
4167

4268
## Folder and File Structure

0 commit comments

Comments
 (0)