so I'm working with two contracts in one remix file and I'm slightly confused.
I know this works (I've seen it used before)
NonFungibleToken public nft;
function setNFTAddress(address addr) onlyOwner{
nft = NonFungibleToken(addr);
}
But can someone explain to me the syntax behind using
nft = NonFungibleToken(addr);
specifically the
NonFungibleToken(addr);
part. Why does passing in the address to NonfungibleToken work? Wouldn't this just call the default function in NonFungibleToken? Another way to phrase this is: Why are there "()" after nonfungibletoken?
Maybe I'm confused on what
NonFungibleToken public nft;
is actually doing.