Skip to content

Commit

Permalink
Merge pull request #86 from gnosisguild/fix-module-select
Browse files Browse the repository at this point in the history
Fix Roles v1 detection in module select
  • Loading branch information
jfschwarz authored Feb 16, 2024
2 parents 4877fbf + e29b1c8 commit c671dae
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion extension/src/browser/ProvideProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
} from 'react'
import { decodeSingle, encodeMulti, encodeSingle } from 'react-multisend'

import { ChainId, MULTI_SEND_ADDRESS } from '../chains'
import { MULTI_SEND_ADDRESS } from '../chains'
import {
ForkProvider,
useTenderlyProvider,
Expand Down
2 changes: 1 addition & 1 deletion extension/src/components/Address/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Address: React.FC<Props> = ({
const displayAddress = shortenAddress(checksumAddress)

return (
<Box rounded className={cn(className, classes.container)}>
<Box rounded className={cn(classes.container, className)}>
<div className={classes.address}>{displayAddress}</div>
<Box rounded className={classes.blockieContainer}>
{address && <Blockie address={address} className={classes.blockies} />}
Expand Down
2 changes: 1 addition & 1 deletion extension/src/components/BlockButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = React.DetailedHTMLProps<
>

const BoxButton: React.FC<Props> = ({ className, ...rest }) => (
<button className={cn(className, classes.button)} {...rest} />
<button className={cn(classes.button, className)} {...rest} />
)

export default BoxButton
2 changes: 1 addition & 1 deletion extension/src/components/BoxButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = React.DetailedHTMLProps<
>

const BlockButton: React.FC<Props> = ({ className, ...rest }) => (
<button className={cn(className, classes.button)} {...rest} />
<button className={cn(classes.button, className)} {...rest} />
)

export default BlockButton
2 changes: 1 addition & 1 deletion extension/src/components/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = React.DetailedHTMLProps<

const IconButton: React.FC<Props> = ({ className, danger, ...rest }) => (
<button
className={cn(classes.button, className, { [classes.danger]: danger })}
className={cn(classes.button, { [classes.danger]: danger }, className)}
{...rest}
/>
)
Expand Down
2 changes: 1 addition & 1 deletion extension/src/components/Tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
}

const Tag: React.FC<Props> = ({ head, children, color, className }) => (
<div className={cn(className, classes.container, classes[color])}>
<div className={cn(classes.container, classes[color], className)}>
{head && <div className={classes.head}>{head}</div>}
{children && <div className={classes.body}>{children}</div>}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ button.removeButton:hover {
}

.modifyButton {
position: absolute;
position: absolute !important;
top: var(--spacing-4);
right: var(--spacing-4);
background: none;
Expand Down
6 changes: 5 additions & 1 deletion extension/src/connections/useZodiacModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useEffect, useState } from 'react'
import { validateAddress } from '../utils'
import { useConnection } from './connectionHooks'
import { ChainId, RPC } from '../chains'

Check warning on line 16 in extension/src/connections/useZodiacModules.ts

View workflow job for this annotation

GitHub Actions / tests

'RPC' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 16 in extension/src/connections/useZodiacModules.ts

View workflow job for this annotation

GitHub Actions / tests

'RPC' is defined but never used. Allowed unused vars must match /^_/u
import { getReadOnlyProvider } from '../providers/readOnlyProvider'

const SUPPORTED_MODULES = [
KnownContracts.DELAY,
Expand Down Expand Up @@ -44,7 +45,7 @@ export const useZodiacModules = (

useEffect(() => {
if (!chainId) return
const provider = new JsonRpcBatchProvider(RPC[chainId as ChainId], chainId)
const provider = getReadOnlyProvider(chainId as ChainId)

setLoading(true)
setError(false)
Expand Down Expand Up @@ -93,6 +94,9 @@ async function fetchModules(

const implementationAddress = mastercopyAddress || moduleAddress

// 'roles' is the old name for roles_v1 is still configured as an alias in the zodiac package for backwards compatibility
if (type === KnownContracts.ROLES) type = KnownContracts.ROLES_V1

if (!type) {
// Not a proxy to one of our master copies. It might be a custom deployment.
// We try to detect selectors from byte code and match them against the ABIs of known Zodiac modules.
Expand Down

0 comments on commit c671dae

Please sign in to comment.