This allows to manage different contracts (Token, Collaborator, etc.) with one registry. The registry serves as main source for all contracts and versions. Versions are independently deployed and added to the registry. From there the proxy contract's implementation can be upgraded to the new version. Currently no access control is implemented.
15 lines
499 B
JavaScript
15 lines
499 B
JavaScript
var Token = artifacts.require('./Token2.sol');
|
|
var Registry = artifacts.require('./upgradeable/Registry');
|
|
var UpgradeabilityProxy = artifacts.require('./upgradeable/UpgradeabilityProxy');
|
|
|
|
module.exports = function(deployer) {
|
|
deployer.deploy(Token).then(function(t) {
|
|
return Token.deployed();
|
|
}).then(function(token) {
|
|
Registry.deployed().then(function(registry) {
|
|
console.log('Token address: ', Token.address);
|
|
registry.addVersion('Token', Token.address);
|
|
});
|
|
})
|
|
};
|