-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Safe multisig badge on governance addresses + oracle router governor row #796
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
Merged
kanvgupta
merged 7 commits into
development
from
feature/lite-94-discuss-safe-compatibility
Aug 12, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d99c2ed
feat: show Safe multisig badge on governance addresses and oracle rou…
kasperpawlowski f4d5e38
fix: move safe badge left of address, drop owners list from tooltip
kasperpawlowski 7bdd0f2
fix: address review findings on safe detection probes
kasperpawlowski b29d966
fix: type owner-list test fixtures as addresses
kasperpawlowski b5d8cd3
fix: describe safe owner threshold instead of claiming universal sign…
kasperpawlowski 6adf4f9
fix: reject safe self-ownership in probe validation
kasperpawlowski 0b1bd50
chore: bump SDK to 2.0.0
Seranged 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
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,33 @@ | ||
| /** | ||
| * Minimal fragments for probing Safe (ex Gnosis Safe) smart accounts. | ||
| * | ||
| * `masterCopy()` is not a regular function on the Safe singleton — Safe proxy | ||
| * contracts (v1.1.1+) special-case the `0xa619486e` selector in their fallback | ||
| * and return the singleton address stored at slot 0 without delegating. An | ||
| * `eth_call` against any Safe proxy therefore answers it, while EOAs return | ||
| * empty data and non-Safe contracts revert or return garbage that fails | ||
| * decoding. | ||
| */ | ||
| export const safeAccountAbi = [ | ||
| { | ||
| type: 'function', | ||
| name: 'masterCopy', | ||
| inputs: [], | ||
| outputs: [{ name: 'masterCopy', type: 'address' }], | ||
| stateMutability: 'view', | ||
| }, | ||
| { | ||
| type: 'function', | ||
| name: 'getThreshold', | ||
| inputs: [], | ||
| outputs: [{ name: 'threshold', type: 'uint256' }], | ||
| stateMutability: 'view', | ||
| }, | ||
| { | ||
| type: 'function', | ||
| name: 'getOwners', | ||
| inputs: [], | ||
| outputs: [{ name: 'owners', type: 'address[]' }], | ||
| stateMutability: 'view', | ||
| }, | ||
| ] as const |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
| <script setup lang="ts"> | ||
| const { address } = defineProps<{ address: string }>() | ||
|
|
||
| const { safeInfo } = useSafeAddressInfo(() => address) | ||
|
|
||
| // Describes the configured owner threshold only — enabled Safe modules can | ||
| // execute without owner confirmations, and the probe does not inspect them. | ||
| const tooltipText = computed(() => { | ||
| if (!safeInfo.value) return '' | ||
| const { threshold, owners, version } = safeInfo.value | ||
| return `This address is a Safe smart account (v${version}) configured with a ${threshold}-of-${owners.length} owner threshold.` | ||
| }) | ||
|
|
||
| const ariaLabel = computed(() => { | ||
| if (!safeInfo.value) return 'Safe multisig' | ||
| const { threshold, owners } = safeInfo.value | ||
| return `Safe multisig: ${threshold} of ${owners.length} owner threshold` | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <UiHoverPreviewTooltip | ||
| v-if="safeInfo" | ||
| title="Safe multisig" | ||
| :text="tooltipText" | ||
| :aria-label="ariaLabel" | ||
| > | ||
| <span class="flex items-center gap-4 text-content-secondary"> | ||
| <SvgIcon | ||
| class="!w-14 !h-14" | ||
| name="safe" | ||
| /> | ||
| <span class="text-p5">({{ safeInfo.threshold }}/{{ safeInfo.owners.length }})</span> | ||
| </span> | ||
| </UiHoverPreviewTooltip> | ||
| </template> | ||
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
50 changes: 50 additions & 0 deletions
50
components/entities/vault/overview/VaultOverviewAddressValue.vue
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,50 @@ | ||
| <script setup lang="ts"> | ||
| import { getExplorerLink } from '~/utils/block-explorer' | ||
| import { getSpecialAddressLabel } from '~/utils/special-addresses' | ||
| import { shortenAddress } from '~/utils/string-utils' | ||
|
|
||
| const { address, checkSafe = false } = defineProps<{ | ||
| address: string | ||
| /** | ||
| * Probe the address for being a Safe multisig and render the badge. | ||
| * Enable only for governance-related addresses — token/vault/IRM rows are | ||
| * known contracts and would just waste probes. | ||
| */ | ||
| checkSafe?: boolean | ||
| }>() | ||
|
|
||
| const { chainId } = useEulerAddresses() | ||
| const { copyToClipboard } = useClipboardCopy() | ||
|
|
||
| const explorerLink = computed(() => getExplorerLink(address, chainId.value, true)) | ||
| const displayLabel = computed(() => getSpecialAddressLabel(address) || shortenAddress(address)) | ||
|
|
||
| const onCopyClick = () => { | ||
| copyToClipboard(address).catch(() => {}) | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="flex gap-4 items-center"> | ||
| <SafeAccountBadge | ||
| v-if="checkSafe" | ||
| :address="address" | ||
| /> | ||
| <NuxtLink | ||
| :to="explorerLink" | ||
| class="text-accent-600 underline cursor-pointer hover:text-accent-500" | ||
| target="_blank" | ||
| > | ||
| {{ displayLabel }} | ||
| </NuxtLink> | ||
| <button | ||
| class="text-content-muted cursor-pointer outline-none hover:text-content-secondary active:text-content-primary" | ||
| @click="onCopyClick" | ||
| > | ||
| <SvgIcon | ||
| class="!w-18 !h-18" | ||
| name="copy" | ||
| /> | ||
| </button> | ||
| </div> | ||
| </template> |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.