locked
Unable to deploy in SOL file in Azure Block Chain workbench because of version issue RRS feed

  • Question

  • When trying to deploy an application in Azure block chain workbench, I am getting version error.

    Tried to make necessary changes but again get some other error.

    If possible, please help in downward version support or modifying the solidity file to latest version.

    Error details :-

    {"Errors":["FileRegistry.sol:46:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:58:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:71:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:152:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:161:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:172:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n","FileRegistry.sol:180:5: ParserError: The state mutability modifier \"constant\" was removed in version 0.5.0. Use \"view\" or \"pure\" instead.\n    constant\r\n    ^------^\n"],"Warnings":[]}

    Tuesday, April 28, 2020 3:51 PM

All replies

  • Need response for being able to deploy the SOL file through downward compatibility?

    Or guide me how to change the solidity file to new version code.

    Wednesday, April 29, 2020 12:16 PM
  • Hi Randhir_kumar348,

    The function modifier "constant" has been deprecated in solidity 0.5.0. We would suggest you to use "view" or "pure" instead. You can use view in case the function reads storage data and pure in case the function is only concerned with data passed in or defined in its scope and does not read storage data.

    Let us know if you have any further questions.

    Thanks


    Microsoft Azure Blockchain Team


    Tuesday, May 5, 2020 7:55 AM
  • Hello Team,

    Thanks for the response. This is one of issue because of lower version of Solidity file.

    I already worked on making changes to the issue, one by one, for all the issues came because of deprecated code and made almost more than 30-35 times changes but it finally reached to another issue which I was not able to fix.

    So, I would request to understand if it is possible to have backward supportability.

    Regards,

    Randhir

    Tuesday, May 5, 2020 9:40 AM
  • Hello Randhir_kumar348,

    You can interface with contracts written for solidity versions prior to 0.5.0 by defining interfaces for them as mentioned here: https://solidity.readthedocs.io/en/latest/050-breaking-changes.html#interoperability .

    Let us know if this answers your question.

    Thanks



    Microsoft Azure Blockchain Team

    Friday, May 8, 2020 5:48 AM