We should make whatever decoding approach we come up with mirror what it looks like in tenderly.
Right now the tryStorageLayoutLookup function has the following function signature:
function tryStorageLayoutLookup(string memory _contractName, bytes32 _slot, bytes32 _oldValue, bytes32 _newValue)
internal
view
returns (DecodedSlot memory decoded_)
In reality, many changes can occur in a single slot, so we could change this function to return an array:
function tryStorageLayoutLookup(string memory _contractName, bytes32 _slot, bytes32 _oldValue, bytes32 _newValue)
internal
view
returns (DecodedSlot[] memory decoded_)
right now, if we detected a slot that is shared, we don't try to decode it. Completing this issue would require being able to decode these shared slots:
if (isSlotShared(layout, _slot)) {
return DecodedSlot({kind: "", oldValue: "", newValue: "", summary: "", detail: ""});
}