I am learning to code in solidity and stuck with view functions. I am trying to return values taken dynamically in a structure using view function. Is there a way to do it is solidity? I tried it but it always throws an error "invalid opcode" or if I use loops it gives warnings like unreachable code.

  • 1
    Please provide your code example so that the community can help you. – Sergi Juanati Mar 3 at 7:38
  • Can you post the snippet that leads to invalid opcode? – hrkrshnn Mar 3 at 18:36

Your Answer

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

Browse other questions tagged or ask your own question.