superchain-ops icon indicating copy to clipboard operation
superchain-ops copied to clipboard

tryStorageLayoutLookup in AccountAccessParser should be able to handled tightly packed variables

Open blmalone opened this issue 1 year ago • 0 comments

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: ""});
            }

blmalone avatar Apr 17 '25 18:04 blmalone