Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Feature) - Replaces createProxy with createProxyWithNonce method no safe creation#1630

Merged
Agupane merged 8 commits intodevelopmentfrom
feature/1577-use-proxy-creation-create2
Nov 19, 2020
Merged

(Feature) - Replaces createProxy with createProxyWithNonce method no safe creation#1630
Agupane merged 8 commits intodevelopmentfrom
feature/1577-use-proxy-creation-create2

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Nov 18, 2020

Closes #1577 by:

  • Replacing the createProxy method with createProxyWithNonce that lets us add some salt for randomizing the created safeAddress

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Nov 18, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 23 0
Ignored 2 N/A
  • Result: ✅ success

  • Annotations: 23 total


[warning] @typescript-eslint/explicit-module-boundary-types

Require explicit return and argument types on exported functions' and classes' public class methods


Report generated by eslint-plus-action

@Agupane Agupane self-assigned this Nov 18, 2020
@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/volta/app

Copy link
Contributor

@fernandomg fernandomg left a comment

Choose a reason for hiding this comment

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

I'm finding quite odd that we are calculating the randomSalt value twice during the creation of the Safe.

I think we should pass the value as a parameter to the functions.

@Agupane
Copy link
Contributor Author

Agupane commented Nov 18, 2020

I'm finding quite odd that we are calculating the randomSalt value twice during the creation of the Safe.

I think we should pass the value as a parameter to the functions.

Yes make sense, I updated the code to do that

.encodeABI()

return proxyFactoryMaster.methods.createProxy(safeMaster.options.address, gnosisSafeData)
return proxyFactoryMaster.methods.createProxyWithNonce(safeMaster.options.address, gnosisSafeData, safeCreationSalt)
Copy link
Contributor

Choose a reason for hiding this comment

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

DO you know if all the proxyFactory versions have this method implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm I'm not sure, @rmeissner could you confirm please?

Copy link
Contributor

@fernandomg fernandomg Nov 18, 2020

Choose a reason for hiding this comment

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

We are getting that info from the @gnosis.pm/safe-contracts package. I think it's safe to assume that that method will be available.

Copy link
Contributor

Choose a reason for hiding this comment

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

our proxy factory always exposes this method ;)

)
}

export default Layout
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason to remove default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, I disagreed with some points and some others are interesting.
But I think we should all agreed on this because right now almost all the project is making use of default export.

If we define to start using named exports always, we should define a linter rule. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep it's a good idea for me

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1630--safereact.review.gnosisdev.com/rinkeby/app

@Agupane Agupane merged commit 486bb4b into development Nov 19, 2020
@Agupane Agupane deleted the feature/1577-use-proxy-creation-create2 branch November 19, 2020 12:19
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use proxy creation with create2

5 participants