multiple runs on 02-update-front-end.js creates multiple addresses, with the most recent address at the last index with this code snippet:
contractAddresses[network.config.chainId.toString()].push(raffle.address)
This code snippet: const raffleAddress = chainId in contractAddresses ? contractAddresses[chainId][0] : null refers to the first index not the most recent address @PatrickAlphaC
instead, we can overwrite the contractAddress.json with the most recent address with this code snippet:
contractAddresses[network.config.chainId.toString()]=raffle.address This overwrites the array with the most recently deployed address
Thanks @PatrickAlphaC @stevegee1
multiple runs on 02-update-front-end.js creates multiple addresses, with the most recent address at the last index with this code snippet: contractAddresses[network.config.chainId.toString()].push(raffle.address)
This code snippet: const raffleAddress = chainId in contractAddresses ? contractAddresses[chainId][0] : null refers to the first index not the most recent address @PatrickAlphaC
instead, we can overwrite the contractAddress.json with the most recent address with this code snippet:
contractAddresses[network.config.chainId.toString()]=raffle.address This overwrites the array with the most recently deployed address Thanks @PatrickAlphaC @stevegee1