Skip to content

Commit 3fa55dd

Browse files
authored
fix: convert to number and compare slots (#56)
* fix: convert to number and compare slots * fix: new snapshot
1 parent 203414e commit 3fa55dd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/foundry/__snapshots__/storage-diff.spec.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ exports[`compareStorageLayouts > should generate the correct output 1`] = `
77
-| _balances | 0 | 0 | mapping(address => uint256) | 32 |
88
+| _balances | 0 | 0 | mapping(address => struct BaseAaveToken.DelegationAwareBalance) | 32 |
99
| _allowances | 0 | 1 | mapping(address => mapping(address => uint256)) | 32 |
10-
| ______gap | 0 | 10 | uint256[50] | 1600 |
1110
| _totalSupply | 0 | 2 | uint256 | 32 |
1211
| _name | 0 | 3 | string | 32 |
1312
| _symbol | 0 | 4 | string | 32 |
1413
| ______DEPRECATED_OLD_ERC20_DECIMALS | 0 | 5 | uint8 | 1 |
1514
-| _votingSnapshots | 0 | 6 | mapping(address => mapping(uint256 => struct GovernancePowerDelegationERC20.Snapshot)) | 32 |
1615
+| __________DEPRECATED_GOV_V2_PART | 0 | 6 | uint256[3] | 96 |
16+
-| _votingSnapshotsCounts | 0 | 7 | mapping(address => uint256) | 32 |
17+
-| _aaveGovernance | 0 | 8 | contract ITransferHook | 20 |
18+
| lastInitializedRevision | 0 | 9 | uint256 | 32 |
19+
| ______gap | 0 | 10 | uint256[50] | 1600 |
1720
| assets | 0 | 60 | mapping(address => struct AaveDistributionManager.AssetData) | 32 |
1821
| stakerRewardsToClaim | 0 | 61 | mapping(address => uint256) | 32 |
1922
| stakersCooldowns | 0 | 62 | mapping(address => struct IStakedTokenV2.CooldownSnapshot) | 32 |
@@ -25,21 +28,18 @@ exports[`compareStorageLayouts > should generate the correct output 1`] = `
2528
-| DOMAIN_SEPARATOR | 0 | 67 | bytes32 | 32 |
2629
| _nonces | 0 | 68 | mapping(address => uint256) | 32 |
2730
| _admins | 0 | 69 | mapping(uint256 => address) | 32 |
28-
-| _votingSnapshotsCounts | 0 | 7 | mapping(address => uint256) | 32 |
2931
| _pendingAdmins | 0 | 70 | mapping(uint256 => address) | 32 |
3032
-| ______gap | 0 | 71 | uint256[8] | 256 |
3133
+| _votingDelegatee | 0 | 71 | mapping(address => address) | 32 |
3234
+| _propositionDelegatee | 0 | 72 | mapping(address => address) | 32 |
3335
+| ______gap | 0 | 73 | uint256[6] | 192 |
3436
| _cooldownSeconds | 0 | 79 | uint256 | 32 |
35-
-| _aaveGovernance | 0 | 8 | contract ITransferHook | 20 |
3637
| _maxSlashablePercentage | 0 | 80 | uint256 | 32 |
3738
| _currentExchangeRate | 0 | 81 | uint216 | 27 |
3839
| inPostSlashingPeriod | 27 | 81 | bool | 1 |
3940
-| _exchangeRateSnapshotsCount | 28 | 81 | uint32 | 4 |
4041
-| _exchangeRateSnapshots | 0 | 82 | mapping(uint256 => struct IStakedAaveV3.ExchangeRateSnapshot) | 32 |
4142
+| ______DEPRECATED_FROM_STK_AAVE_V3 | 0 | 82 | uint256[1] | 32 |
4243
| ghoDebtToken | 0 | 83 | contract IGhoVariableDebtTokenTransferHook | 20 |
43-
| lastInitializedRevision | 0 | 9 | uint256 | 32 |
4444
\`\`\`"
4545
`;

src/foundry/storage-diff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function compareStorageArrays(
8080
if (a.slot === b.slot) {
8181
return a.offset - b.offset;
8282
}
83-
return a.slot.localeCompare(b.slot);
83+
return Number(a.slot) - Number(b.slot);
8484
});
8585

8686
return changes;

0 commit comments

Comments
 (0)