Truffle upgrades upgrading to the same implementation address

Hi guys,
Im having some minor issue while use truffle upgrades plugin. Everytime I deploy my smart contracts the deploy proxy points to the same implementation address, is there a way to point to a new implmentation address with every deploy proxy call ?

:1234: Code to reproduce


:computer: Environment

If the same implementation was already deployed on the network before, the plugin will reuse the same implementation address when deploying additional proxies (because the implementation contract itself is immutable so there is no need to deploy additional copies).

is there a way to turn this of ? and should it deploy the same implementation contracts even when the source is changed ? in my case iv'e updated the implementation contract to include a new event. However the old implementation contract is still being deployed

To clarify, as long as the implementation contract bytecode is the same as what was previously deployed, it will reuse it. See Upgrade contract without changes to storage layout - #2 by ericglau

If you change the implementation contract, it should deploy the new one.

Are you using a real network or a local development network? (If using a local development network, note that Truffle could reuse the same address if the network was reset after a previous run).

im deploying on mumbai network (matic test_net) ... weird, the bytecode should have changed honestly since im including a new emit.

Try recompiling the contracts using truffle compile --all first.

If you still encounter the issue, can you enable debug using export DEBUG=@openzeppelin:upgrades:* and run the deploy proxy again, then provide the output? If possible, please also share what your Truffle script looks like.

1 Like