# Using interface to call functions from other contracts

By [N00b21337](https://paragraph.com/@n00b21337) · 2023-01-12

---

I wanted to define interface usage once and then run it in few functions, not define it in each one, so to do that I have first define MainContract as Main and then through constructor I assign it a address of this other contract and later I can just use this other contract methods as in checkOther function

    interface MainContract {
        function checkDisplay() external view returns (string memory);
    }
    contract second {
         MainContract Main;
    
        constructor(address _interface) {
          Main = MainContract(_interface);
        }
    
        function checkOther() public view returns (string memory) {
          return Main.checkDisplay();
        }
    }

---

*Originally published on [N00b21337](https://paragraph.com/@n00b21337/using-interface-to-call-functions-from-other-contracts)*
