Updating a live smart contract

Viewed 2851

If I have a smart contract that has the addresses of some other smart contracts hardcoded inside it. E.g. maybe my contract has the addresses of some external yield farming vaults that it periodically deposits some balances to.

Now lets say that I want to update that list of addresses and remigrate it without upsetting the operation of the current contract.. what is the best way to do it ?

1 Answers

Ethereum bytecode is immutable, so the simple answer is: You can't update the hardcoded addresses. You'll have to create a new contract and this time save the addresses into variables that you can update later.

Related