diff --git a/contracts/adapters/Manager.sol b/contracts/adapters/Manager.sol index 68b4fbace..b71a19c29 100644 --- a/contracts/adapters/Manager.sol +++ b/contracts/adapters/Manager.sol @@ -190,10 +190,21 @@ contract Manager is Reimbursable, AdapterGuard, Signatures { } if (proposal.adapterOrExtensionAddr != address(0x0)) { - dao.addExtension( - proposal.adapterOrExtensionId, - IExtension(proposal.adapterOrExtensionAddr) - ); + try + dao.addExtension( + proposal.adapterOrExtensionId, + IExtension(proposal.adapterOrExtensionAddr) + ) + {} catch { + // v1.0.6 signature + dao.addExtension( + proposal.adapterOrExtensionId, + IExtension(proposal.adapterOrExtensionAddr), + // The creator of the extension must be set as the DAO owner, + // which is stored at index 0 in the members storage. + dao.getMemberAddress(0) + ); + } } } diff --git a/contracts/core/DaoRegistry.sol b/contracts/core/DaoRegistry.sol index edba14652..5e0b94e0a 100644 --- a/contracts/core/DaoRegistry.sol +++ b/contracts/core/DaoRegistry.sol @@ -386,6 +386,15 @@ contract DaoRegistry is MemberGuard, AdapterGuard { emit ExtensionAdded(extensionId, address(extension)); } + // v1.0.6 signature + function addExtension( + bytes32, + IExtension, + address + ) external { + revert("not implemented"); + } + /** * @notice Removes an adapter from the registry * @param extensionId The unique identifier of the extension diff --git a/test/core/dao-registry.test.js b/test/core/dao-registry.test.js index f28aa07f9..0a93ba45b 100644 --- a/test/core/dao-registry.test.js +++ b/test/core/dao-registry.test.js @@ -792,7 +792,10 @@ describe("Core - DaoRegistry", () => { it("should not be possible to call addExtension without the ADD_EXTENSION permission", async () => { await expect( - this.dao.addExtension(sha3("extension1"), accounts[2]) + this.dao["addExtension(bytes32,address)"]( + sha3("extension1"), + accounts[2] + ) ).to.be.revertedWith("accessDenied"); }); diff --git a/utils/deployment-util.js b/utils/deployment-util.js index 9ad55cf5b..85deaf27c 100644 --- a/utils/deployment-util.js +++ b/utils/deployment-util.js @@ -178,7 +178,10 @@ const createExtensions = async ({ dao, factories, options }) => { ); await waitTx( - dao.addExtension(sha3(newExtension.configs.id), newExtension.address) + dao["addExtension(bytes32,address)"]( + sha3(newExtension.configs.id), + newExtension.address + ) ); info(`