• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 18193076841
89%
main: 89%

Build:
Build:
LAST BUILD BRANCH: feat/evm-revert-decoding
DEFAULT BRANCH: main
Ran 02 Oct 2025 12:39PM UTC
Jobs 1
Files 963
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Oct 2025 12:29PM UTC coverage: 89.158% (-0.05%) from 89.208%
18193076841

Pull #2730

github

katspaugh
feat: Allow transaction proposals for Safe mastercopy migrations

Enables transaction proposals (safeTxHash calculation) for Safes with unsupported mastercopies when they are migrating to official L2 singletons.

## Problem

Safes with unsupported base contracts have `version: null` in the Transaction Service API response. This causes `getSafeTxHash()` to fail with "Safe version is required", preventing any transaction proposals including migration transactions.

## Solution

### Version Detection from Migration Transactions

When `Safe.version` is `null`, the system now attempts to detect the target version from migration transactions:

1. **Direct changeMasterCopy (v1.0.0-1.2.0)**
   - Self-call to `changeMasterCopy(newMastercopy)`
   - Extracts target mastercopy and looks up its version

2. **Delegate call to SafeToL2Migration (v1.3.0+)**
   - Delegate call to official `SafeToL2Migration` contract
   - Decodes `migrateToL2(l2Singleton)` function
   - Validates migration contract is official
   - Extracts L2 singleton and looks up its version

The detected version is then used for safeTxHash calculation via EIP-712 typed data hashing.

## Changes

### Core Logic
- **src/domain/common/utils/safe.ts**
  - `getSafeTxHash()` - handles null version by detecting migration
  - `detectVersionFromMigrationTransaction()` - orchestrates detection
  - `detectDirectMigration()` - handles changeMasterCopy pattern
  - `detectDelegateMigration()` - handles migrateToL2 pattern

- **src/domain/common/utils/deployments.ts**
  - Added `getSafeToL2MigrationDeployments()` helper
  - Added `getVersionFromMastercopy()` - reverse lookup version from address

### Supporting Code
- **src/domain/contracts/decoders/safe-to-l2-migration-decoder.helper.ts**
  - New decoder for SafeToL2Migration contract
  - Decodes `migrateToL2(l2Singleton)` function

### Tests
- **src/domain/common/utils/__tests__/safe.spec.ts**
  - 8 new tests for null version migration scenarios
  - Tests both... (continued)
Pull Request #2730: feat: Allow migration from unsupported to supported Safe mastercopies

3824 of 4708 branches covered (81.22%)

Branch coverage included in aggregate %.

77 of 93 new or added lines in 5 files covered. (82.8%)

1 existing line in 1 file now uncovered.

12763 of 13896 relevant lines covered (91.85%)

528.06 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
85.71
-14.29% src/domain/contracts/decoders/safe-decoder.helper.ts
6
90.08
-8.28% src/domain/common/utils/safe.ts
9
0.0
src/domain/contracts/decoders/safe-to-l2-migration-decoder.helper.ts

Uncovered Existing Lines

Lines Coverage ∆ File
1
90.68
0.58% src/domain/relay/limit-addresses.mapper.ts
Jobs
ID Job ID Ran Files Coverage
1 run-test:cov - 18193076841.1 02 Oct 2025 12:39PM UTC 1925
90.25
GitHub Action Run
Source Files on build 18193076841
  • Tree
  • List 963
  • Changed 264
  • Source Changed 6
  • Coverage Changed 264
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #18193076841
  • Pull Request #2730
  • PR Base - main (#18192642063)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc