1

I am facing "UnimplementedFeatureError: Nested dynamic arrays not implemented here. " when I try to emit an event contains bytes [] data;

I have a fix size of data which is 65bytes but there is no supported type to put it in. so I use a dynamic bytes.

I have this event:

event SkillValidated(
        address indexed user,
        address [] validators,
        bytes [] signatures, //a signature is a 65 bytes
    );

when I emit the event I got the mentionned error. and when I change it to:

event SkillValidated(
        address indexed user,
        address [] validators,
        bytes32 [] signatures, // I lost part of signature
    );

it works!

How can I resolve the problem, have I to implement a specific type using struct?

1

Just use bytes is already a dynamic type (array of byte). In the way you declared is like you created a nested array.

http://solidity.readthedocs.io/en/v0.4.21/types.html

  • and what is the solution ? – maroodb Jun 20 '18 at 20:59
  • Using just bytes doesn't work? – mirg Jun 20 '18 at 21:05
  • what you mean by "just bytes" ? I already using bytes and doesn't work – maroodb Jun 20 '18 at 21:14
  • You're using an array of bytes. Remove [] since bytes is already an array and writing bytes[] is equal to byte[][]. While bytes is byte[]. The error seems to tell that nested array are not allowed. – mirg Jun 20 '18 at 21:31
  • I need an array of bytes not of byte. every signature is a 65bytes – maroodb Jun 20 '18 at 21:44
0

You can use a string type instead of bytes32.

  • 1
    string are expected to be utf8 compliant not very well suited for a signature (raw 65 bytes). – Ismael Jun 20 '18 at 16:35
  • 1
    strings are a dynamic arrays also – maroodb Jun 20 '18 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.