Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Certora] remove extSloads munging #458

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions certora/applyMunging.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
diff -ruN interfaces/IMorpho.sol interfaces/IMorpho.sol
--- interfaces/IMorpho.sol 2023-08-29 09:58:51.628147127 +0200
+++ interfaces/IMorpho.sol 2023-08-29 10:15:36.946593577 +0200
@@ -292,7 +292,4 @@
/// @param authorization The `Authorization` struct.
/// @param signature The signature.
function setAuthorizationWithSig(Authorization calldata authorization, Signature calldata signature) external;
-
- /// @notice Returns the data stored on the different `slots`.
- function extSloads(bytes32[] memory slots) external view returns (bytes32[] memory);
}

diff -ruN libraries/MarketParamsLib.sol libraries/MarketParamsLib.sol
--- libraries/MarketParamsLib.sol 2023-08-29 09:59:37.937583556 +0200
+++ libraries/MarketParamsLib.sol 2023-08-29 10:16:10.519752188 +0200
Expand All @@ -22,28 +12,3 @@ diff -ruN libraries/MarketParamsLib.sol libraries/MarketParamsLib.sol
+ marketParamsId = Id.wrap(keccak256(abi.encode(marketParams)));
}
}
diff -ruN Morpho.sol Morpho.sol
--- Morpho.sol 2023-08-29 09:58:43.158169812 +0200
+++ Morpho.sol 2023-08-29 10:15:20.650012827 +0200
@@ -502,21 +502,4 @@

return maxBorrow >= borrowed;
}
-
- /* STORAGE VIEW */
-
- /// @inheritdoc IMorpho
- function extSloads(bytes32[] calldata slots) external view returns (bytes32[] memory res) {
- uint256 nSlots = slots.length;
-
- res = new bytes32[](nSlots);
-
- for (uint256 i; i < nSlots;) {
- bytes32 slot = slots[i++];
-
- assembly ("memory-safe") {
- mstore(add(res, mul(i, 32)), sload(slot))
- }
- }
- }
}
1 change: 1 addition & 0 deletions certora/specs/Blue.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getTotalSupplyAssets(MorphoHarness.Id) external returns uint256 envfree;
function getTotalSupplyShares(MorphoHarness.Id) external returns uint256 envfree;
function getTotalBorrowAssets(MorphoHarness.Id) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueAccrueInterests.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function MathLib.mulDivDown(uint256 a, uint256 b, uint256 c) internal returns uint256 => ghostMulDivDown(a,b,c);
function MathLib.mulDivUp(uint256 a, uint256 b, uint256 c) internal returns uint256 => ghostMulDivUp(a,b,c);
function MathLib.wTaylorCompounded(uint256 a, uint256 b) internal returns uint256 => ghostTaylorCompounded(a, b);
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueExitLiquidity.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getSupplyShares(MorphoHarness.Id, address) external returns uint256 envfree;
function getBorrowShares(MorphoHarness.Id, address) external returns uint256 envfree;
function getCollateral(MorphoHarness.Id, address) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueLibSummary.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function mathLibMulDivUp(uint256, uint256, uint256) external returns uint256 envfree;
function mathLibMulDivDown(uint256, uint256, uint256) external returns uint256 envfree;
function getMarketId(MorphoHarness.MarketParams) external returns MorphoHarness.Id envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueLiveness.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getTotalSupplyAssets(MorphoInternalAccess.Id) external returns uint256 envfree;
function getTotalSupplyShares(MorphoInternalAccess.Id) external returns uint256 envfree;
function getTotalBorrowAssets(MorphoInternalAccess.Id) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueRatioMath.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getMarketId(MorphoHarness.MarketParams) external returns MorphoHarness.Id envfree;
function getVirtualTotalSupplyAssets(MorphoHarness.Id) external returns uint256 envfree;
function getVirtualTotalSupplyShares(MorphoHarness.Id) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/BlueReverts.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function owner() external returns address envfree;
function getTotalSupplyAssets(MorphoHarness.Id) external returns uint256 envfree;
function getTotalBorrowAssets(MorphoHarness.Id) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/DifficultMath.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getMarketId(MorphoHarness.MarketParams) external returns MorphoHarness.Id envfree;
function getVirtualTotalSupplyAssets(MorphoHarness.Id) external returns uint256 envfree;
function getVirtualTotalSupplyShares(MorphoHarness.Id) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/Health.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function getLastUpdate(MorphoHarness.Id) external returns uint256 envfree;
function getTotalBorrowShares(MorphoHarness.Id) external returns uint256 envfree;
function getBorrowShares(MorphoHarness.Id, address) external returns uint256 envfree;
Expand Down
1 change: 1 addition & 0 deletions certora/specs/Reentrancy.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
methods {
function extSloads(bytes32[]) external returns bytes32[] => NONDET DELETE(true);
function _.borrowRate(MorphoHarness.MarketParams marketParams, MorphoHarness.Market) external => summaryBorrowRate() expect uint256;
}

Expand Down