-
In the StorageFactory contract, we store the SimpleStorage contracts we create in an array. We then create a function to set the favoriteNumber of a contract a specified index like this:
Why not achieve the same result like this:
It's mentioned that we an Address and ABI is needed in order to interact with a contract so is that simply to help us get used to working with addresses when the accessed contract is not stored in an array within the current contract or is there some other reason/benefit to doing it that way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @OmranK yes as you said we need a address and ABI, and also it's used to create a new SimpleStorage object from the address. And the: simpleStorageArray[_simpleStorageIndex])).store(_simpleStorageNumber) just takes the the array the have on of Storage Factory. |
Beta Was this translation helpful? Give feedback.
Hello @OmranK yes as you said we need a address and ABI, and also it's used to create a new SimpleStorage object from the address. And the: simpleStorageArray[_simpleStorageIndex])).store(_simpleStorageNumber) just takes the the array the have on of Storage Factory.