I am learning about importing contracts and noticed with the following contract there is an external interface function with no code block. Where does this code come from?
function version() external view returns (uint256);
abichainlinkinterfacessolidity
I am learning about importing contracts and noticed with the following contract there is an external interface function with no code block. Where does this code come from?
function version() external view returns (uint256);
Best Answer
This is the interface definition in Solidity docs
One way to know the source code is know a address of an interface deployed on a network which has its code verified.
Talking specifically about the
AggregatorV3Interface.sol
, there are one implementation for each data feed, for example:is the data feed ETH/USD on Ethereum testnet Kovan network.
If you go to the implementation address 0x9326BFA02ADD2366b30bacB125260Af641031331 on Kovan, you will find the source code.
Check it out the Data Feeds API Reference for more information about the AggregatorV3Interface and the addresses of Ethereum Data Feeds.