Skip to content

Commit

Permalink
fix(extension): init extension from factory (#527)
Browse files Browse the repository at this point in the history
* The initialization of the extension should be done within the same transaction that creates the extension, that prevents malicious users from calling extension.initialize before it gets added to the DaoRegistry.sol.
* All the extension factories were updated to initialize the extensions, and the extensions were updated to allow the any function call to happen during the initialization phase.
* Added more tests for Factories and DaoRegistry
* Reorganized DaoRegistry code, and updated the init function to save the dao payer at index 2 instead of 1. Index 1 will be used for the dao owner/creator.
* Removed the extension.initialize call from registry
* Updated Managing adapter
  • Loading branch information
fforbeck authored Mar 22, 2022
1 parent 3256cd6 commit 7f1901c
Show file tree
Hide file tree
Showing 28 changed files with 1,624 additions and 992 deletions.
5 changes: 1 addition & 4 deletions contracts/adapters/Managing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,7 @@ contract ManagingContract is IManaging, AdapterGuard, Reimbursable {
if (proposal.adapterOrExtensionAddr != address(0x0)) {
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)
IExtension(proposal.adapterOrExtensionAddr)
);
}
}
Expand Down
Loading

0 comments on commit 7f1901c

Please sign in to comment.