1

I just upgraded my code to Solidity 0.5 and am trying to use the truffle framework with it. I did update my code in Remix and installed truffle@beta so that it can use v5.

The problem I have is that I am unable to compile my code with truffle. I get this error message:

UnimplementedFeatureError: Encoding type "struct Contract.MyStruct memory" not yet implemented.

What could the problem be as the code does work properly with remix?

Edit: The line of code I typed that gets me to this error after I access my contract folder via the terminal is:

truffle compile

It doesn't give me a line number for where the error is from in my contract but I have functions that return a struct which with Solidity 0.5 need the memory keyword.

  • Ever occurred to you that you should post the line of code which yields this error? – goodvibration Dec 3 '18 at 17:46
  • 1
    So I manage to fix it. After googling the problem again I found these two links: ethereum.stackexchange.com/questions/63149/… and ethereum.stackexchange.com/questions/63149/…. The problem ended up coming from having functions that an inherited contract will be using that returned a struct. I just deleted these functions for now and it seems to work. – Emul Dec 4 '18 at 10:58
  • @Emul - Please add this as an answer (and accept it - though you might have to wait 48 hours to accept your own answer). – Richard Horrocks Dec 4 '18 at 11:44
2

I managed to fix the problem. After googling the problem again I found these two links: Nested structs that are part of a mapping broken in Solidity 0.5.0? and Nested structs that are part of a mapping broken in Solidity 0.5.0? which sent me in the right direction.

The problem ended up coming from having functions that an inherited contract will be using that returned a struct (which now with Solidity 0.5 must be in memory). I just deleted these functions for now and inputted the information directly in the inherited contract. It now works.

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.