-
I don’t fully understand the structure or usage of the contract addresses constant. Why do we need an array of addresses for each chain? Is it in case we create more contracts? Then how do we know the index of a particular contract we want to use? Or does the front end assume we only have one contract, and the array is to store the addresses of previous versions of the contract we've deployed on a given chain? Then why does the LotteryEntrance component use the first element in the array when the 02-update-front-end deployment script pushes the new address into the array (making it the last element) - wouldn’t we want to use the most recent version of the contract? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
"Why do we need an array of addresses for each chain?" As you mentioned, it is to index each address in case we deploy multiple contracts on the same network. "wouldn’t we want to use the most recent version of the contract?" I agree with this one - not sure why we are not using the recent one? As it defeats the purpose of indexing every address - the only plausible reason is that we are supposed to hardcode it and change it explicitly. Cheers |
Beta Was this translation helpful? Give feedback.
"Why do we need an array of addresses for each chain?" As you mentioned, it is to index each address in case we deploy multiple contracts on the same network.
"wouldn’t we want to use the most recent version of the contract?" I agree with this one - not sure why we are not using the recent one? As it defeats the purpose of indexing every address - the only plausible reason is that we are supposed to hardcode it and change it explicitly. Cheers