diff --git a/contracts/DispatcherStorage.sol b/contracts/DispatcherStorage.sol index 5c6a203..a95b01c 100644 --- a/contracts/DispatcherStorage.sol +++ b/contracts/DispatcherStorage.sol @@ -1,14 +1,13 @@ pragma solidity ^0.4.8; -import "zeppelin-solidity/contracts/ownership/Ownable.sol"; -contract DispatcherStorage is Ownable { +contract DispatcherStorage { address public lib; function DispatcherStorage(address newLib) public { replace(newLib); } - function replace(address newLib) public onlyOwner /* onlyDAO */ { + function replace(address newLib) public /* onlyDAO */ { lib = newLib; } } diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js new file mode 100644 index 0000000..861c261 --- /dev/null +++ b/migrations/2_deploy_contracts.js @@ -0,0 +1,20 @@ +var LibInterface = artifacts.require("./LibInterface.sol"); +var DispatcherStorage = artifacts.require("./DispatcherStorage.sol"); +var Dispatcher = artifacts.require("./Dispatcher.sol"); +var TheContract = artifacts.require("./TheContract.sol"); + +module.exports = function(deployer) { + deployer.deploy(LibInterface) + .then(() => { + return deployer.deploy(DispatcherStorage, LibInterface.address)}) + .then(() => { + Dispatcher.unlinked_binary = Dispatcher.unlinked_binary.replace( + '0x1111222233334444555566667777888899990000', + DispatcherStorage.address + ); + return deployer.deploy(Dispatcher)}) + .then(() => { + deployer.link(Dispatcher, TheContract).then(() => { + return deployer.deploy(TheContract)}) + }); +}; \ No newline at end of file diff --git a/truffle.js b/truffle.js index 99ea54b..45fdcc1 100644 --- a/truffle.js +++ b/truffle.js @@ -1,4 +1,3 @@ -require('babel-polyfill'); module.exports = { networks: {