Tuesday, February 21, 2023

108/365: Contract Interfaces

Smart contracts are constantly interacting with each other. One way to achieve this is with inheritance, where your contract descends from another and can access any of the internal methods. Otherwise, to interact with another contract you first define an interface. The interface tells the compiler what functions the other contract has, along with their parameters and return types. In Solidity, you can return multiple pieces of data from one function which is somewhat strange to me. Regardless, once your interface is defined you point towards the other contract's address on the blockchain and you now have access to their public and external methods. 

No comments:

Post a Comment

190: Sablier

 The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...