A little query #3408
-
contract storageFactory{
simpleStorage public simpleStorage;
function createSimpleStorageContract() public {
simpleStorage = new simpleSorage(); // For the new keyword solidity knows we are going to deploy new simpleStorage contract
}
} I am very new in Solidity, in few lecture i have seen we can use arbitrary word/name as type of a variable, am i right? To be more clear like different types are uint,string etc., I am asking can we use any word/name as a type of any variable as we used |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@imhacek Nope, we cannot use any word for type, here it is a contract name And also if your contract name is |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
@imhacek Nope, we cannot use any word for type, here it is a contract name
simpleStorage
, it means we are declaring a variable of that contract type.And also if your contract name is
simpleStorage
then you should update it toSimpleStorage
because contract names starts with capital letter.