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

feat: UniversalFactory #139

Merged
merged 23 commits into from
May 20, 2022
Merged

feat: UniversalFactory #139

merged 23 commits into from
May 20, 2022

Conversation

YamenMerhi
Copy link
Member

@YamenMerhi YamenMerhi commented Apr 15, 2022

What does this PR introduce?

  • This PR introduces a new contract UniversalFactory that should be used to deploy contracts deterministically.
    This contract gives the ability to deploy normal and EIP 1167 minimal proxy contracts, with the ability to specify if the contract should be initialized or not by passing the initializeCallData bytes.
    Deploying and initializing in one tx eliminate the risk of an initialize race (someone initializing before the right deployer).
    If the UniversalFactory is deployed using nick's method on several chains, given the same salt and the same parameters, the contract created will have the same address on each chain.

This method is especially useful for UniversalProfiles, where you will have the ability to reproduce the same UniversalProfile at the same address on each chain you deploy to.

@YamenMerhi YamenMerhi requested a review from CJ42 April 15, 2022 14:27
Copy link
Member

@CJ42 CJ42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments

contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
contracts/Factories/UniversalFactory.sol Outdated Show resolved Hide resolved
@YamenMerhi YamenMerhi requested a review from CJ42 April 27, 2022 08:45
Copy link
Member

@CJ42 CJ42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments.

The Solidity linter in the CI also picked up some warnings to either fix or disable in the contract.

.github/workflows/build-lint-test.yml Outdated Show resolved Hide resolved
tests/Factories/UniversalFactory.test.ts Outdated Show resolved Hide resolved
tests/Factories/UniversalFactory.test.ts Outdated Show resolved Hide resolved
tests/Factories/UniversalFactory.test.ts Outdated Show resolved Hide resolved
tests/Factories/UniversalFactory.test.ts Outdated Show resolved Hide resolved
tests/Factories/UniversalFactory.test.ts Outdated Show resolved Hide resolved
@frozeman
Copy link
Member

frozeman commented May 2, 2022

we need tests as well, do we have some?

Copy link
Member

@CJ42 CJ42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI seems to not be running anymore.

@YamenMerhi YamenMerhi merged commit 3164d9a into develop May 20, 2022
@YamenMerhi YamenMerhi deleted the feat/UniversalFactory branch May 20, 2022 08:35
CJ42 added a commit that referenced this pull request Aug 14, 2023
…o-58-Refactor-function-_fallbackLSP17Extendable-to-enable-to-run-code-after-this-function-is-called_Jean

fix: (C4 #139) refactor `_fallbackLSP17Extendable` function to enable to run code after it is called + prevent potential solc bug "storage write removal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants