Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extensions) - initialize extension from factory #527

Merged
merged 1 commit into from
Mar 22, 2022
Merged

Conversation

fforbeck
Copy link
Contributor

@fforbeck fforbeck commented Mar 18, 2022

Proposed Changes

  • 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 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
  • Considering the initialize call with be triggered in the same tx that creates cloned extension it can't be called by another user.
  • The initialize function reverts if called more than once
  • 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 one will be used for the dao owner/creator
  • Removed the extension.initialize call from registry
  • Updated Managing adapter

@fforbeck fforbeck force-pushed the trb-17 branch 4 times, most recently from 84f8b95 to 1a3e571 Compare March 18, 2022 17:15
@fforbeck fforbeck changed the title WIP fix(extensions) - initialize extension from factory Mar 18, 2022
@fforbeck fforbeck force-pushed the trb-17 branch 4 times, most recently from 149be2e to ebb86b0 Compare March 18, 2022 19:22
@codecov
Copy link

codecov bot commented Mar 18, 2022

Codecov Report

Merging #527 (02df6e7) into master (3256cd6) will increase coverage by 0.86%.
The diff coverage is 98.31%.

❗ Current head 02df6e7 differs from pull request most recent head d081068. Consider uploading reports for the commit d081068 to get more accurate results

@@            Coverage Diff             @@
##           master     #527      +/-   ##
==========================================
+ Coverage   84.72%   85.59%   +0.86%     
==========================================
  Files          52       52              
  Lines        1859     1867       +8     
  Branches      443      438       -5     
==========================================
+ Hits         1575     1598      +23     
+ Misses        284      269      -15     
Impacted Files Coverage Δ
contracts/adapters/Managing.sol 100.00% <ø> (ø)
contracts/core/DaoRegistry.sol 97.83% <96.22%> (+8.05%) ⬆️
contracts/extensions/bank/Bank.sol 80.85% <100.00%> (ø)
contracts/extensions/bank/BankFactory.sol 100.00% <100.00%> (ø)
...racts/extensions/erc1155/ERC1155TokenExtension.sol 97.22% <100.00%> (-0.04%) ⬇️
...xtensions/erc1155/ERC1155TokenExtensionFactory.sol 100.00% <100.00%> (ø)
contracts/extensions/erc1271/ERC1271.sol 100.00% <100.00%> (ø)
contracts/extensions/erc1271/ERC1271Factory.sol 100.00% <100.00%> (ø)
contracts/extensions/executor/Executor.sol 100.00% <100.00%> (ø)
contracts/extensions/executor/ExecutorFactory.sol 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3256cd6...d081068. Read the comment docs.

@fforbeck fforbeck self-assigned this Mar 18, 2022
@fforbeck fforbeck requested a review from adridadou March 18, 2022 21:14
@fforbeck fforbeck added the fix important fix label Mar 18, 2022
@fforbeck fforbeck marked this pull request as ready for review March 18, 2022 21:14
@fforbeck fforbeck force-pushed the trb-17 branch 2 times, most recently from fafb988 to 061a8ce Compare March 21, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix important fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants