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

safe-global / safe-client-gateway / 18313008342 / 1
89%
main: 89%

Build:
DEFAULT BRANCH: main
Ran 07 Oct 2025 12:48PM UTC
Files 1925
Run time 1min
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: 90.259% (-0.05%) from 90.305%
18313008342.1

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)

4004 of 4936 branches covered (81.12%)

Branch coverage included in aggregate %.

25667 of 27937 relevant lines covered (91.87%)

260.55 hits per line

Source Files on job run-test:cov - 18313008342.1
  • Tree
  • List 1925
  • Changed 264
  • Source Changed 3
  • Coverage Changed 263
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 18313008342
  • ae453286 on github
  • Prev Job for on main (#18308010167.1)
  • Next Job for on main (#18342294527.1)
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