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

safe-global / safe-modules / 6979715187
85%

Build:
DEFAULT BRANCH: master
Ran 24 Nov 2023 10:38AM UTC
Jobs 1
Files 3
Run time 1s
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

24 Nov 2023 10:37AM UTC coverage: 100.0%. Remained the same
6979715187

push

github

web-flow
[4337] User Operation with Custom Singleton Signers (#159)

Fixes #148 

This PR introduces an E2E test using the official bundler where we
deploy a Safe that uses a custom (and silly 🤪) signing scheme over
ERC-1271. Specifically, the signing scheme is deployed as a singleton
contract that can be shared by multiple Safes using a `mapping(safe =>
data)` to differentiate between signers. In theory, this could be
adapted to, for example, checking a signature using P256 curve in order
to integrate with WebAuthn, and is meant to “prove” that the Safe with
the ERC-4337 module would work with existing WebAuthn signer
implementations.

The actual implementation is a little convoluted for a few reasons.
Namely, ERC-4337 only allows a **single** `CREATE2` per user operation
that **MUST** result in the `userOp.sender` account. Because of this,
deploying ad-hoc signers in the `Safe.setup` call is not possible, and
we have instead opted for a “singleton signer” pattern, where the logic
for verifying signatures is shared and a mapping is used to store
per-Safe context relevant to signature verification.

Additionally, In order for this to work with ERC-4337, a staked factory
is needed (as accessing associated storage for user operations with
`initCode` require a factory). Unfortunately, staked factories add all
kinds of complexities:
- Currently, the staked factory contract is quite dumb (can only stake,
but can’t unstake). A full staked factory contract requires us to iron
out some requirements and make a proper implementation with
documentation and tests (out of scope for this PR and issue, and a
non-trivial amount of work)
- Staking is determined per bundler, so while some amount of stake may
be sufficient for a bundler, it may not be sufficient for all (which
adds additional off-chain management dependencies).

**For these reasons, I would recommend exploring #149**.

22 of 22 branches covered (100.0%)

Branch coverage included in aggregate %.

29 of 29 relevant lines covered (100.0%)

19.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6979715187.1 24 Nov 2023 10:38AM UTC 3
100.0
GitHub Action Run
Source Files on build 6979715187
  • Tree
  • List 3
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 6d26f341 on github
  • Prev Build on master (#6967652298)
  • Next Build on master (#7003971952)
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

© 2025 Coveralls, Inc