Open Hugoo opened 6 months ago
It seems that there is an encoding issue for the following:
ERC725.decodeData( [ { keyName: "LSP18RoyaltiesRecipients", value: "0x001c24871b3dbf969fdccf9d9beee0b56bdaef2a73a6eb885c5900001388", }, ], [ { name: "LSP18RoyaltiesRecipients", key: "0xc0569ca6c9180acc2c3590f36330a36ae19015a19f4e85c28a7631e3317e6b9d", keyType: "Singleton", valueType: "(bytes4,address,uint32)[CompactBytesArray]", valueContent: "(Bytes4,Address,Number)", }, ] );
Returns:
{ key: '0xc0569ca6c9180acc2c3590f36330a36ae19015a19f4e85c28a7631e3317e6b9d', name: 'LSP18RoyaltiesRecipients', value: [ [ '0x24871b3d', '0xbF969fdCCf9D9bEEe0b56bdaEF2a73a6eb885C59', 5000 ] ] }
The encoding is wrong
ERC725.encodeData( [ { keyName: "LSP18RoyaltiesRecipients", value: [ "0x24871b3d", "0xbF969fdCCf9D9bEEe0b56bdaEF2a73a6eb885C59", "5000", ], }, ], [ { name: "LSP18RoyaltiesRecipients", key: "0xc0569ca6c9180acc2c3590f36330a36ae19015a19f4e85c28a7631e3317e6b9d", keyType: "Singleton", valueType: "(bytes4,address,uint32)[CompactBytesArray]", valueContent: "(Bytes4,Address,Number)", }, ] );
{ keys: ['0xc0569ca6c9180acc2c3590f36330a36ae19015a19f4e85c28a7631e3317e6b9d'], values: ['0x24871b3dbf969fdccf9d9beee0b56bdaef2a73a6eb885c591388'] }
Expected value:
0000
❌ 0x%%%%24871b3dbf969fdccf9d9beee0b56bdaef2a73a6eb885c59%%%%1388 ✅ 0x001c24871b3dbf969fdccf9d9beee0b56bdaef2a73a6eb885c5900001388
Version 0.27.0 couldn't properly parse tuples with CompactBytesArray:
0.27.0
error: Could not encode 4200. Value type uint32)[CompactBytesArray is unknown
It gets uint32 as uint32)[CompactBytesArray ...
uint32
uint32)[CompactBytesArray
It seems that there is an encoding issue for the following:
✅ decodeData
Returns:
❌ encodeData
The encoding is wrong
Returns:
Expected value:
0000
for the utin32Related to: