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

safe-global / safe-smart-account / 9780230154
94%

Build:
DEFAULT BRANCH: main
Ran 03 Jul 2024 03:00PM UTC
Jobs 1
Files 34
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

03 Jul 2024 02:59PM UTC coverage: 93.017% (+0.1%) from 92.899%
9780230154

push

github

web-flow
Add Safe to L2 Setup Contract (#759)

This PR introduces a setup contract that can be called from the `Safe`
setup function in order to automatically promote a Safe at setup time if
the code is executing on an L2. Namely, this allows the Safe Proxy
factory to use a single singleton and initializer for all chains, but
end up with different `singleton`s depending on the chain ID.

The expected use of this contract is to use the standard proxy factory:

```solidity
Safe l1Singleton;
SafeL2 l2Singleton;
SafeToL2Setup l2Setup;

proxyFactory.createProxyWithNonce(
    address(l1Singleton),
    abi.encodeCall(
        l1Singleton.setup,
        (
            owners,
            threshold,
            address(l2Setup),
            abi.encodeCall(l2Setup.setupToL2, address(l2Singleton)),
            fallbackHandler,
            paymentToken,
            payment,
            paymentReceiver
        )
    ),
    saltNonce
)
```

On L1 (i.e. Ethereum Mainnet where `chainId == 1`), you would end up
with a Safe where `safe.singleton == l1Singleton` and on any other
chains, you would end up with `safe.singleton == l2Singleton`. This
would happen _before_ the first transaction.

---------

Co-authored-by: Mikhail <16622558+mmv08@users.noreply.github.com>

266 of 304 branches covered (87.5%)

Branch coverage included in aggregate %.

12 of 12 new or added lines in 1 file covered. (100.0%)

400 of 412 relevant lines covered (97.09%)

97.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-$ - 9780230154.1 03 Jul 2024 03:00PM UTC 0
93.02
GitHub Action Run
Source Files on build 9780230154
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #9780230154
  • 8f80a837 on github
  • Prev Build on main (#9710052157)
  • Next Build on main (#10010897109)
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