Skip to content

Commit

Permalink
fix: convert to number and compare slots (#56)
Browse files Browse the repository at this point in the history
* fix: convert to number and compare slots

* fix: new snapshot
  • Loading branch information
sendra authored Feb 6, 2025
1 parent 203414e commit 3fa55dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/foundry/__snapshots__/storage-diff.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ exports[`compareStorageLayouts > should generate the correct output 1`] = `
-| _balances | 0 | 0 | mapping(address => uint256) | 32 |
+| _balances | 0 | 0 | mapping(address => struct BaseAaveToken.DelegationAwareBalance) | 32 |
| _allowances | 0 | 1 | mapping(address => mapping(address => uint256)) | 32 |
| ______gap | 0 | 10 | uint256[50] | 1600 |
| _totalSupply | 0 | 2 | uint256 | 32 |
| _name | 0 | 3 | string | 32 |
| _symbol | 0 | 4 | string | 32 |
| ______DEPRECATED_OLD_ERC20_DECIMALS | 0 | 5 | uint8 | 1 |
-| _votingSnapshots | 0 | 6 | mapping(address => mapping(uint256 => struct GovernancePowerDelegationERC20.Snapshot)) | 32 |
+| __________DEPRECATED_GOV_V2_PART | 0 | 6 | uint256[3] | 96 |
-| _votingSnapshotsCounts | 0 | 7 | mapping(address => uint256) | 32 |
-| _aaveGovernance | 0 | 8 | contract ITransferHook | 20 |
| lastInitializedRevision | 0 | 9 | uint256 | 32 |
| ______gap | 0 | 10 | uint256[50] | 1600 |
| assets | 0 | 60 | mapping(address => struct AaveDistributionManager.AssetData) | 32 |
| stakerRewardsToClaim | 0 | 61 | mapping(address => uint256) | 32 |
| stakersCooldowns | 0 | 62 | mapping(address => struct IStakedTokenV2.CooldownSnapshot) | 32 |
Expand All @@ -25,21 +28,18 @@ exports[`compareStorageLayouts > should generate the correct output 1`] = `
-| DOMAIN_SEPARATOR | 0 | 67 | bytes32 | 32 |
| _nonces | 0 | 68 | mapping(address => uint256) | 32 |
| _admins | 0 | 69 | mapping(uint256 => address) | 32 |
-| _votingSnapshotsCounts | 0 | 7 | mapping(address => uint256) | 32 |
| _pendingAdmins | 0 | 70 | mapping(uint256 => address) | 32 |
-| ______gap | 0 | 71 | uint256[8] | 256 |
+| _votingDelegatee | 0 | 71 | mapping(address => address) | 32 |
+| _propositionDelegatee | 0 | 72 | mapping(address => address) | 32 |
+| ______gap | 0 | 73 | uint256[6] | 192 |
| _cooldownSeconds | 0 | 79 | uint256 | 32 |
-| _aaveGovernance | 0 | 8 | contract ITransferHook | 20 |
| _maxSlashablePercentage | 0 | 80 | uint256 | 32 |
| _currentExchangeRate | 0 | 81 | uint216 | 27 |
| inPostSlashingPeriod | 27 | 81 | bool | 1 |
-| _exchangeRateSnapshotsCount | 28 | 81 | uint32 | 4 |
-| _exchangeRateSnapshots | 0 | 82 | mapping(uint256 => struct IStakedAaveV3.ExchangeRateSnapshot) | 32 |
+| ______DEPRECATED_FROM_STK_AAVE_V3 | 0 | 82 | uint256[1] | 32 |
| ghoDebtToken | 0 | 83 | contract IGhoVariableDebtTokenTransferHook | 20 |
| lastInitializedRevision | 0 | 9 | uint256 | 32 |
\`\`\`"
`;
2 changes: 1 addition & 1 deletion src/foundry/storage-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function compareStorageArrays(
if (a.slot === b.slot) {
return a.offset - b.offset;
}
return a.slot.localeCompare(b.slot);
return Number(a.slot) - Number(b.slot);
});

return changes;
Expand Down

0 comments on commit 3fa55dd

Please sign in to comment.