Skip to content

tryStorageLayoutLookup in AccountAccessParser should be able to handled tightly packed variables #909

@blmalone

Description

@blmalone

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions