ERC725Alliance / erc725.js

Package to interact with ERC725 smart contracts
Apache License 2.0
38 stars 29 forks source link

Allow to encode 0x for empty values #442

Open monapasan opened 5 months ago

monapasan commented 5 months ago

I'm submitting a...

It's not possible to remove a value at a certain index. When I run this:

const encoded = Erc725.encodeData([
    {
      keyName: 'LSP12IssuedAssets[]',
      totalArrayLength: previousIssuedAssets.length - 1,
      startingIndex: removedIndex,
      value: ['0x'],
    },
  ]);

I am receiving the following error: An error occurred during the verification process Error: Address: "0x" is an invalid address.

On top of this I am unable to set lsp12IssuedAssetsMap to null:

const dataToEncode = {
    keyName: `LSP12IssuedAssetsMap:<address>`,
    dynamicKeyParts: assetAddress, // Dynamic part of the key (token's address)
    value: ["0x"], // Assuming interface ID and index
  };

I am receiving the following error: An error occurred during the verification process Error: Can not encode tuple key value: 0x. Expecte array of length: 2

ps. also there is a type in the error message.