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

safe-global / safe-client-gateway / 18313008342
89%

Build:
DEFAULT BRANCH: main
Ran 07 Oct 2025 12:48PM 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

07 Oct 2025 12:42PM UTC coverage: 89.164% (-0.04%) from 89.202%
18313008342

push

github

web-flow
feat: Allow migration from unsupported to supported Safe mastercopies (#2730)

* 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__/s... (continued)

3852 of 4745 branches covered (81.18%)

Branch coverage included in aggregate %.

38 of 50 new or added lines in 3 files covered. (76.0%)

12835 of 13970 relevant lines covered (91.88%)

521.04 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
93.48
-4.88% src/domain/common/utils/safe.ts
9
0.0
src/domain/contracts/decoders/safe-to-l2-migration-decoder.helper.ts
Jobs
ID Job ID Ran Files Coverage
1 run-test:cov - 18313008342.1 07 Oct 2025 12:48PM UTC 1925
90.26
GitHub Action Run
Source Files on build 18313008342
  • Tree
  • List 963
  • Changed 264
  • Source Changed 3
  • Coverage Changed 263
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #18313008342
  • ae453286 on github
  • Prev Build on main (#18308010167)
  • Next Build on main (#18342294527)
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