safe-global / safe-core-sdk

The Safe{Core} SDK allows builders to add account abstraction functionality into their apps.
https://docs.safe.global/sdk/overview
MIT License
242 stars 177 forks source link

fix(protocol-kit): considering the `SafeVersion` in the `isL1Contract` check in `SafeBaseContract` #878

Closed DaniSomoza closed 1 week ago

DaniSomoza commented 1 week ago

What it solves

This PR updates the logic used to determine if a contract is L1 or L2 version. Previously, the check only considered if the chainId was mainnet or if it was manually flagged as an isL1SafeSingleton=true by the user.

Now we also considers whether the Safe version does not have the SAFE_L2_CONTRACTS feature (safeVersion >= 1.3.0)

How this PR fixes it

    const isL1Contract =
      safeDeploymentsL1ChainIds.includes(chainId) ||
      isL1SafeSingleton ||
      !hasSafeFeature(SAFE_FEATURES.SAFE_L2_CONTRACTS, safeVersion)
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9599068430

Details


Totals Coverage Status
Change from base Build 9594154831: 0.0%
Covered Lines: 783
Relevant Lines: 933

💛 - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9610349188

Details


Totals Coverage Status
Change from base Build 9594154831: 0.0%
Covered Lines: 783
Relevant Lines: 933

💛 - Coveralls