How to write interfaces in Sophia

Greetings Everyone,

Can someone please point me or tell me how to write interfaces for contracts to standardize operations. For e.g a fungible token (I am aware of AEX9) but the implementations can be compromised.

I saw this in docs inside this title https://aeternity-sophia.readthedocs.io/en/latest/contracts/#splitting-code-over-multiple-files

Please let me know any solution to including interfaces in Contracts in such a way that all methods should be required to be defined in the child contract.

This is a nice resource and looks very close to what I want to do but don’t know exactly how to add those interfaces in that way (described above) https://github.com/mradkov/aeternity-fungible-token/tree/master/contracts

3 Likes

Currently there is NO support in the sophia compiler for contract interfaces, contract polymorphism or parametrized contracts. Perhaps in the near future we might address this issue CC: @radrow

6 Likes

Ok, thank you.

1 Like

Currently contract interfaces are useful only to define contract types for remote calls (so you know the types of entrypoints). There are plans for contract inheritance, but it is not prioritized.

1 Like

got it, thanks

1 Like