How to properly export a contract abi to reuse it in another contract?

Hey @fuel! You can structure your project by creating an interface folder that contains the ABIs for all necessary contracts. The directory layout would look something like this:

Project/
        ├── contracts/
        │   ├── AMM/
        │   │   └── main.sw
        │   └── Exchange/
        │       └── main.sw
        └── libraries/
            ├── interface.sw
            └── data_structures.sw

A prime example of this structure in action is the AMM project found in the sway applications repository. In this project, all ABIs are organized within a separate libraries folder and imported as required.

Specifically, in the AMM contract, which utilizes both interfaces, you can see this import process in action. The relevant code can be found here. This approach streamlines the workflow by ensuring that changes are centralized and don’t need to be duplicated across multiple locations.