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

Storage layout check aave v2 #1275

Merged
merged 2 commits into from
Sep 7, 2022
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
43 changes: 43 additions & 0 deletions .github/workflows/ci-storage-layout-aave-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Storage layout check (Morpho-Compound)

on:
push:
branches:
- main
- dev
pull_request:

jobs:
check:
name: storage layout check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly

- name: Foundry fork cache
uses: actions/cache@v3
with:
path: |
cache
out
key: foundry-${{ hashFiles('Makefile', 'foundry.toml') }} # where fork block numbers & RPC are stored

- name: Run tests
run: make storage-layout-check
env:
PROTOCOL: aave-v2
109 changes: 109 additions & 0 deletions snapshots/.storage-layout-aave-v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

MathisGD marked this conversation as resolved.
Show resolved Hide resolved
=======================
➡ Morpho
=======================

+--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract |
+=============================================================================================================================================================+
| _initialized | bool | 0 | 0 | 1 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| _owner | address | 51 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| __gap | uint256[49] | 52 | 0 | 1568 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| _status | uint256 | 101 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| __gap | uint256[49] | 102 | 0 | 1568 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| isClaimRewardsPaused | bool | 151 | 0 | 1 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| maxSortedUsers | uint256 | 152 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| defaultMaxGasForMatching | struct Types.MaxGasForMatching | 153 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| suppliersInP2P | mapping(address => struct HeapOrdering.HeapArray) | 154 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| suppliersOnPool | mapping(address => struct HeapOrdering.HeapArray) | 155 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| borrowersInP2P | mapping(address => struct HeapOrdering.HeapArray) | 156 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| borrowersOnPool | mapping(address => struct HeapOrdering.HeapArray) | 157 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| supplyBalanceInOf | mapping(address => mapping(address => struct Types.SupplyBalance)) | 158 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| borrowBalanceInOf | mapping(address => mapping(address => struct Types.BorrowBalance)) | 159 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| userMarkets | mapping(address => bytes32) | 160 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| marketsCreated | address[] | 161 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| p2pSupplyIndex | mapping(address => uint256) | 162 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| p2pBorrowIndex | mapping(address => uint256) | 163 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| poolIndexes | mapping(address => struct Types.PoolIndexes) | 164 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| market | mapping(address => struct Types.Market) | 165 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| deltas | mapping(address => struct Types.Delta) | 166 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| borrowMask | mapping(address => bytes32) | 167 | 0 | 32 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| addressesProvider | contract ILendingPoolAddressesProvider | 168 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| aaveIncentivesController | contract IAaveIncentivesController | 169 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| pool | contract ILendingPool | 170 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| entryPositionsManager | contract IEntryPositionsManager | 171 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| exitPositionsManager | contract IExitPositionsManager | 172 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| interestRatesManager | contract IInterestRatesManager | 173 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| incentivesVault | contract IIncentivesVault | 174 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| rewardsManager | contract IRewardsManager | 175 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
|--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------|
| treasuryVault | address | 176 | 0 | 20 | contracts/aave-v2/Morpho.sol:Morpho |
+--------------------------+--------------------------------------------------------------------+------+--------+-------+-------------------------------------+

=======================
➡ RewardsManager
=======================

+----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract |
+===============================================================================================================================================================+
| _initialized | bool | 0 | 0 | 1 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| _owner | address | 51 | 0 | 20 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| __gap | uint256[49] | 52 | 0 | 1568 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| userUnclaimedRewards | mapping(address => uint256) | 101 | 0 | 32 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| localAssetData | mapping(address => struct RewardsManager.LocalAssetData) | 102 | 0 | 32 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| morpho | contract IMorpho | 103 | 0 | 20 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
|----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| pool | contract ILendingPool | 104 | 0 | 20 | contracts/aave-v2/RewardsManager.sol:RewardsManager |
+----------------------+----------------------------------------------------------+------+--------+-------+-----------------------------------------------------+

=======================
➡ Lens
=======================

+------+------+------+--------+-------+----------+
| Name | Type | Slot | Offset | Bytes | Contract |
+================================================+
+------+------+------+--------+-------+----------+