This repository was archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 357
Support Circles Safes in frontend on xDai #1636
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
921b039
partial imp
nicosampler 517ddd9
remove unused type
nicosampler dc1b0b9
fix web3 issue
nicosampler 6ff7b92
update settings
nicosampler e8c11ce
get masterCopy Address from backend
nicosampler 86b3979
Merge branch 'development' into issue-1578
nicosampler 1ae38ac
fix prettier errors
nicosampler 8a40e2b
fix #1558
nicosampler 518b162
Merge branch 'issue-1578' of github.com:gnosis/safe-react into issue-…
nicosampler 311db32
ignore types contracts
nicosampler 9234330
Merge branch 'development' into issue-1578
ea8a99d
Fix Circles typo
8c761ae
Change Circles detect logic
ddb0bc6
Merge remote-tracking branch 'origin/development' into issue-1578
nicosampler 4aef1d0
Merge branch 'development' into issue-1578
35a4348
Use sameAddress to compare mastercopy addresses
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| !.eslintrc.js | ||
| build | ||
| config | ||
| contracts | ||
| /config | ||
| /contracts | ||
| flow-typed | ||
| flow-typed/npm | ||
| migrations | ||
| node_modules | ||
| public | ||
| scripts | ||
| src/assets | ||
| src/config | ||
| src/types/contracts | ||
| test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,5 +11,5 @@ export default { | |
| rinkeby, | ||
| xdai, | ||
| energy_web_chain, | ||
| volta | ||
| volta, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ const mainnet: NetworkConfig = { | |
| decimals: 18, | ||
| logoUri: EtherLogo, | ||
| }, | ||
| } | ||
| }, | ||
| } | ||
|
|
||
| export default mainnet | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import axios from 'axios' | ||
| import { getTxServiceUrl } from 'src/config' | ||
| import memoize from 'lodash.memoize' | ||
|
|
||
| export enum MasterCopyDeployer { | ||
| GNOSIS = 'Gnosis', | ||
| CIRCLES = 'Circles', | ||
| } | ||
|
|
||
| type MasterCopyFetch = { | ||
| address: string | ||
| version: string | ||
| } | ||
|
|
||
| export type MasterCopy = { | ||
| address: string | ||
| version: string | ||
| deployer: MasterCopyDeployer | ||
| deployerRepoUrl: string | ||
| } | ||
|
|
||
| const extractMasterCopyInfo = (mc: MasterCopyFetch): MasterCopy => { | ||
| const isCircles = mc.version.toLowerCase().includes(MasterCopyDeployer.CIRCLES.toLowerCase()) | ||
| const dashIndex = mc.version.indexOf('-') | ||
|
|
||
| const masterCopy = { | ||
| address: mc.address, | ||
| version: !isCircles ? mc.version : mc.version.substring(0, dashIndex), | ||
| deployer: !isCircles ? MasterCopyDeployer.GNOSIS : MasterCopyDeployer.CIRCLES, | ||
| deployerRepoUrl: !isCircles | ||
| ? 'https://github.com/gnosis/safe-contracts/releases' | ||
| : 'https://github.com/CirclesUBI/safe-contracts/releases', | ||
| } | ||
| return masterCopy | ||
| } | ||
|
|
||
| export const fetchMasterCopies = memoize( | ||
| async (): Promise<MasterCopy[] | undefined> => { | ||
| const url = `${getTxServiceUrl()}/about/master-copies/` | ||
| try { | ||
| const res = await axios.get<{ address: string; version: string }[]>(url) | ||
| return res.data.map(extractMasterCopyInfo) | ||
| } catch (error) { | ||
| console.error('Fetching data from master-copies errored', error) | ||
| } | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // | ||
| // | ||
|
|
||
| // Code of the safe v1.0.0 | ||
| const proxyCodeV10 = | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why shouldn't we use the simple coma here
, ?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.
it was prettier who changed it