I am learning SmartContract development on Ethereum with Solidity and I would highly appreciate your help to understand this one basic thing:
KittyInterface as a contract has no parameters, just one function:
contract KittyInterface {
function getKitty(uint256 _id) external view returns (
bool isGestating,
bool isReady,
uint256 cooldownIndex,
uint256 nextActionAt,
uint256 siringWithId,
uint256 birthTime,
uint256 matronId,
uint256 sireId,
uint256 generation,
uint256 genes
);
}
But then it gets initialized like this, giving one parameter (ckAddress).
address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
KittyInterface kittyContract = KittyInterface(ckAddress);
So my question is:
What happens when we call KittyInterface(ckAddress); when the contract has no parameters to take, but only a function? Where does the "ckAddress" go?
Is the address taken to write/connect to the blockchain? Or is it given to the first function of the contract?
It works, there are no errors, but I struggle to understand it.
It is part of the Cryptozombie-Course, so I cannot debug it.
Can anybody please help me understand?