-
Notifications
You must be signed in to change notification settings - Fork 357
(Feature) - Replaces createProxy with createProxyWithNonce method no safe creation #1630
Changes from all commits
534f4f2
1f262f3
594a330
e9d2b1a
25cfa93
2595d07
81aff37
d596aee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,12 @@ import Block from 'src/components/layout/Block' | |
| import Heading from 'src/components/layout/Heading' | ||
| import Row from 'src/components/layout/Row' | ||
| import { initContracts } from 'src/logic/contracts/safeContracts' | ||
| import Review from 'src/routes/open/components/ReviewInformation' | ||
| import { Review } from 'src/routes/open/components/ReviewInformation' | ||
| import SafeNameField from 'src/routes/open/components/SafeNameForm' | ||
| import { SafeOwnersPage } from 'src/routes/open/components/SafeOwnersConfirmationsForm' | ||
| import { | ||
| FIELD_CONFIRMATIONS, | ||
| FIELD_CREATION_PROXY_SALT, | ||
| FIELD_SAFE_NAME, | ||
| getOwnerAddressBy, | ||
| getOwnerNameBy, | ||
|
|
@@ -40,6 +41,7 @@ type InitialValuesForm = { | |
| owner0Name?: string | ||
| confirmations: string | ||
| safeName?: string | ||
| safeCreationSalt: number | ||
| } | ||
|
|
||
| const useInitialValuesFrom = (userAccount: string, safeProps?: SafeProps): InitialValuesForm => { | ||
|
|
@@ -51,6 +53,7 @@ const useInitialValuesFrom = (userAccount: string, safeProps?: SafeProps): Initi | |
| [getOwnerNameBy(0)]: ownerName || 'My Wallet', | ||
| [getOwnerAddressBy(0)]: userAccount, | ||
| [FIELD_CONFIRMATIONS]: '1', | ||
| [FIELD_CREATION_PROXY_SALT]: Date.now(), | ||
| } | ||
| } | ||
| let obj = {} | ||
|
|
@@ -68,6 +71,7 @@ const useInitialValuesFrom = (userAccount: string, safeProps?: SafeProps): Initi | |
| ...obj, | ||
| [FIELD_CONFIRMATIONS]: threshold || '1', | ||
| [FIELD_SAFE_NAME]: name, | ||
| [FIELD_CREATION_PROXY_SALT]: Date.now(), | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -92,7 +96,7 @@ type LayoutProps = { | |
| safeProps?: SafeProps | ||
| } | ||
|
|
||
| const Layout = (props: LayoutProps): React.ReactElement => { | ||
| export const Layout = (props: LayoutProps): React.ReactElement => { | ||
| const { onCallSafeContractSubmit, safeProps } = props | ||
|
|
||
| const provider = useSelector(providerNameSelector) | ||
|
|
@@ -139,5 +143,3 @@ const Layout = (props: LayoutProps): React.ReactElement => { | |
| </> | ||
| ) | ||
| } | ||
|
|
||
| export default Layout | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason to remove default?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, check this: https://basarat.gitbook.io/typescript/main-1/defaultisbad
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, I disagreed with some points and some others are interesting. If we define to start using named exports always, we should define a linter rule. wdyt?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep it's a good idea for me |
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;)