So I created 2 contracts where the first one will be the app logic contract and the other one is the database contract. So I tried to "truffle compile" my contract but receive DeclarationError.

here is the sample code of my modifier function

modifier requireRegisteredAirlines()
    require(flightSuretyData.checkAirlineRegistered(msg.sender) == true, "Caller is not registered Airline");                                       //calling the registered airline from data contract

So the flightSuretyData is my database smart contract in the same folder. and the checkAirlineRegistered is the function in that contract. down here is the error I received

enter image description here

Did I leave anything?

  • Can you please show more of your code? – Shane Fontaine Mar 2 at 5:03
  • Ok I have found the problem, it is because I overlooked the "import" on top of my contract to import contract – Muhammad Raffiq Mohd Khalil Mar 2 at 16:00

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.