Skip to content

Inconsistent Handling of Multi-Condition ACCs Without Boolean Operator #810

@VDD2004

Description

@VDD2004

Is there an existing issue for this?

  • I have searched the existing issues

SDK version

7.0.8

Lit Network

DatilDev

Description of the bug/issue

When using multi-condition ACCs without explicitly specifying a boolean operator between conditions, the behavior differs between the two encryption interfaces:

  • litNodeClient.encrypt/decrypt: Multi-condition ACCs without an operator are implicitly treated as an "and" condition, and the functions work as expected.
  • @lit-protocol/encryption (encryptUint8Array, encryptString, decryptToFile, etc.): The same multi-condition ACCs trigger an InvalidParamType error stating:

    Invalid params: Invalid boolean Access Control Conditions

Severity of the bug

Low as there is a clear solution; it did not cause any impact on my integration

Steps To Reproduce

  1. Run in any environment
  2. Use litNodeClient.encrypt with the ACCs; no error
  3. Decrypt using litNodeClient.decrypt -> successful decryption
  4. Use encryptUint8Array; Invalid params error

Link to code

const sameAddressACCs = [
  {
    contractAddress: "",
    standardContractType: "",
    method: "",
    chain: "ethereum",
    parameters: [":userAddress"],
    returnValueTest: {
      comparator: "=",
      value: ethersWallet.address
    }
  }
];

const timeACCs = [
  {
    contractAddress: "ipfs://QmbBPZu1Fijm1UWuh53yuy5fBKWwiygpsspX9xd83QgNgo",
    standardContractType: "LitAction",
    chain: "ethereum",
    method: "checkCurrentTime",
    parameters: ["00:00", "23:59"],
    returnValueTest: {
      comparator: "=",
      value: "true"
    }
  }
];

const multiConditionACCs = [
  ...sameAddressACCs,
  // {operator: "and"},
  ...timeACCs
];

Anything else?

No response

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