            function verifyAccountProof(hasher, _account, _ptr) -> ptr, storageRootHash, _stateRoot {
...
                    require(eq(shr(224, calldataload(ptr)), 0x05080000), "InvalidAccountCompressedFlag")
//contracts/scroll/ScrollVerifierHooks.sol

    function walkTree(
        bytes32 key,
        bytes memory encodedProof,
        bytes32 rootHash,
        uint256 leafSize
    ) internal view returns (bytes32 keyHash, bytes32 h, bytes memory v, bool exists) {
...
            } else if (nodeType == NODE_LEAF) {
                if (v.length != leafSize) revert InvalidProof();
                // NOTE: leafSize is >= 33
                if (uint8(v[leafSize - 33]) != 32) revert InvalidProof(); // InvalidKeyPreimageLength
                bytes32 temp;
                assembly {
                    temp := mload(add(v, 33))
                }
                //@audit check for nodeType and nodeKey(keyhash), no check on compressed flag (starting offset v + 65)
|>              if (temp == keyHash) {
                    assembly {
                        temp := mload(add(v, leafSize))
                    }
                    if (temp != key) revert InvalidProof(); // InvalidKeyPreimage
                    exists = true;
...
//contracts/scroll/ScrollVerifierHooks.sol
    function verifyAccountState(
        bytes32 stateRoot,
        address account,
        bytes memory encodedProof
    ) external view returns (bytes32 storageRoot) {
        (bytes32 keyHash, bytes32 leafHash, bytes memory leaf, bool exists) = walkTree(
            bytes20(account),
            encodedProof,
            stateRoot,
            230
        ); // flags = 0x05080000
        if (leafHash == 0) return NOT_A_CONTRACT;
        bytes32 temp;
        bytes32 amount;
        bytes32 codeHash;
        assembly {
            //@audit the hash starts after compressed flag (starting at v + 65) so compressed flag is not checked against leafHash either.
|>          temp := mload(add(leaf, 69)) // nonce||codesize||0
            amount := mload(add(leaf, 101))
            storageRoot := mload(add(leaf, 133))
            codeHash := mload(add(leaf, 165))
        }
        bytes32 h = poseidonHash2(storageRoot, poseidonHash1(codeHash), 1280);
        h = poseidonHash2(poseidonHash2(temp, amount, 1280), h, 1280);
        assembly {
            temp := mload(add(leaf, 197))
        }
        h = poseidonHash2(h, temp, 1280);
        h = poseidonHash2(keyHash, h, 4);
        if (leafHash != h) revert InvalidProof(); // InvalidAccountLeafNodeHash
        if (codeHash == NULL_CODE_HASH || !exists) storageRoot = NOT_A_CONTRACT;
    }
