diff --git a/.github/workflows/ci-storage-layout-aave-v2.yml b/.github/workflows/ci-storage-layout-aave-v2.yml new file mode 100644 index 000000000..055e40d43 --- /dev/null +++ b/.github/workflows/ci-storage-layout-aave-v2.yml @@ -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 diff --git a/snapshots/.storage-layout-aave-v2 b/snapshots/.storage-layout-aave-v2 new file mode 100644 index 000000000..64bf082ef --- /dev/null +++ b/snapshots/.storage-layout-aave-v2 @@ -0,0 +1,109 @@ + +======================= +➡ 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 | ++================================================+ ++------+------+------+--------+-------+----------+