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

safe-global / safe-client-gateway / 18004330328

25 Sep 2025 10:16AM UTC coverage: 87.972% (-1.2%) from 89.219%
18004330328

Pull #2712

github

LucieFaire
extract complex logic to separate func

Signed-off-by: dsh <11198975+LucieFaire@users.noreply.github.com>
Pull Request #2712: feat: Contract verification analysis

3623 of 4594 branches covered (78.86%)

Branch coverage included in aggregate %.

99 of 235 new or added lines in 22 files covered. (42.13%)

57 existing lines in 9 files now uncovered.

12504 of 13738 relevant lines covered (91.02%)

525.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.27
/src/modules/safe-shield/utils/extraction.utils.ts
1
// import { Erc20Decoder } from '@/domain/relay/contracts/decoders/erc-20-decoder.helper';
2
import { Operation } from '@/domain/safe/entities/operation.entity';
2✔
3
import type { DecodedTransactionData } from '@/modules/safe-shield/entities/transaction-data.entity';
4
import type { Address } from 'viem';
5
import { getAddress } from 'viem';
2✔
6

7
/**
8
 * Extracts the contract address from a transaction.
9
 * @param tx - The transaction.
10
 * @returns The contract address or undefined if the transaction is a transfer.
11
 */
12
export function extractContract(
2✔
13
  { dataDecoded, data, to, operation }: DecodedTransactionData,
14
  //   erc20Decoder: Erc20Decoder,
15
): Address | undefined {
16
  //TODO implement
17
  // Native transfer
NEW
18
  if (
×
19
    data === '0x' ||
×
20
    !dataDecoded
21
    // || erc20Decoder.helpers.isTransfer(data)
22
  ) {
NEW
23
    return undefined;
×
24
  }
NEW
25
  if ((operation as Operation) === Operation.DELEGATE) return getAddress(to);
×
26

27
  // // ExecTransaction with no data is a transfer
28
  // if (
29
  //   dataDecoded?.method === 'execTransaction' &&
30
  //   dataDecoded?.parameters?.[2].value === '0x'
31
  // ) {
32
  //   return getAddress(dataDecoded?.parameters?.[0].value as string);
33
  // }
34

35
  // // ERC-20 transfer
36
  // if (this.erc20Decoder.helpers.isTransfer(data)) {
37
  //   return getAddress(dataDecoded?.parameters?.[0].value as string);
38
  // }
39

40
  // // ERC-20 transferFrom
41
  // if (this.erc20Decoder.helpers.isTransferFrom(data)) {
42
  //   return getAddress(dataDecoded?.parameters?.[1].value as string);
43
  // }
44
}
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