Probably this is not possible, but I still have to ask.
Let me follow the example created in truffle init
. It contains a contract called MetaCoin.sol
. Say,
- I have deployed it on the network (the first version of it).
- Then I have extended it with a
foo()
method. - Now I want to deploy a new modified version of the contract with the same name MetaCoin but the new code of it. Is there a way of doing it?
As the hint there is a contract called Migrations.sol
which has a method called upgrade()
:
function upgrade(address new_address) restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
that sets a new address for the code of the contract. Is there a better way of doing versioning or upgrades (deploy rollouts) of the coins code?
new()
as in..You can use this method to deploy a completely new instance of a contract onto the network.
Maybe I simply misunderstand the whole instances thing.