SimpleStorage Data Type in StorageFactory.sol #713
-
For this code in the StorageFactory.sol file:
I don't understand the "SimpleStorage" data type. From the previous lesson, we created a struct called "People" and defined it. We then initialized an array for it. But in the StorageFactory.sol, SimpleStorage isn't a defined variable, (or is it?) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @maxdporter well this is an object, as you know we have created the first contract called |
Beta Was this translation helpful? Give feedback.
Hello @maxdporter well this is an object, as you know we have created the first contract called
SimpleStorage
, and now in ourStorageFactory
we import it withimport "./SimpleStorage.sol";
so we can use that contract as a data type (actually is an object) . If you want to know more about OOP (object oriented programming) in solidity check this article: https://medium.com/coinmonks/solidity-and-object-oriented-programming-oop-191f8deb8316