lukso-network / docs

LUKSO technical documentation
https://docs.lukso.tech
Apache License 2.0
30 stars 62 forks source link

[DOC] setDataBatch instead of setData #721

Closed Heisenburgirs closed 11 months ago

Heisenburgirs commented 11 months ago

Link to doc page: https://docs.lukso.tech/learn/expert-guides/key-manager/grant-permissions#step-1---initialize-erc725js

Below code is an array of keys and values:

const data = erc725.encodeData([
    // the permission of the beneficiary address
    {
      keyName: 'AddressPermissions:Permissions:<address>',
      dynamicKeyParts: beneficiaryAddress,
      value: beneficiaryPermissions,
    },
    // the new list controllers addresses (= addresses with permissions set on the UP)
    // + the incremented `AddressPermissions[]` array length
    {
      keyName: 'AddressPermissions[]',
      value: [...controllers, beneficiaryAddress],
    },
  ]);

Yet we're passing arrays of keys and values to setData.

// step 3.3 - send the transaction
  await myUniversalProfile.methods.setData(
    data.keys,
    data.values,
  ).send({
    from: myEOA.address,
    gasLimit: 300_000,
  });

setData needs to be changed to setDataBatch. Also, at the end of the page it's called "data", but before it's called "permissionData".

Hugoo commented 11 months ago

Thanks! Fixed ;)