Skip to content

Commit

Permalink
[#312] Remove SafeWebAuthnSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Apr 11, 2024
1 parent 6526d9a commit 8304ebd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 55 deletions.
48 changes: 0 additions & 48 deletions modules/passkey/contracts/SafeWebAuthnSigner.sol

This file was deleted.

21 changes: 18 additions & 3 deletions modules/passkey/contracts/SafeWebAuthnSignerProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ import {IP256Verifier} from "./interfaces/IP256Verifier.sol";
* @dev A proxy contract that points to SafeWebAuthnSigner singleton.
*/
contract SafeWebAuthnSignerProxy {
uint256 internal immutable X;
uint256 internal immutable Y;
IP256Verifier internal immutable VERIFIER;
/**
* @notice The X coordinate of the P-256 public key of the WebAuthn credential.
*/
uint256 public immutable X;

/**
* @notice The Y coordinate of the P-256 public key of the WebAuthn credential.
*/
uint256 public immutable Y;

/**
* @notice The P-256 verifier used for ECDSA signature validation.
*/
IP256Verifier public immutable VERIFIER;

/*
* @notice The singleton contract address.
*/
address internal immutable SINGLETON;
constructor(address implementation, uint256 x, uint256 y, address verifier) {
SINGLETON = implementation;
Expand Down
6 changes: 3 additions & 3 deletions modules/passkey/contracts/SafeWebAuthnSignerSingleton.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;

import {SignatureValidatorProxy} from "./base/SignatureValidatorProxy.sol";
import {SignatureValidator} from "./base/SignatureValidator.sol";
import {IP256Verifier} from "./interfaces/IP256Verifier.sol";
import {WebAuthn} from "./libraries/WebAuthn.sol";
/**
* @title WebAuthn Safe Signature Validator Singleton
* @dev A contract that represents a WebAuthn signer.
* @custom:security-contact bounty@safe.global
*/
contract SafeWebAuthnSignerSingleton is SignatureValidatorProxy {
contract SafeWebAuthnSignerSingleton is SignatureValidator {
/**
* @inheritdoc SignatureValidatorProxy
* @inheritdoc SignatureValidator
*/
function _verifySignature(
bytes32 message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ERC1271} from "../libraries/ERC1271.sol";
* @dev A interface for smart contract Safe owners that supports multiple ERC-1271 `isValidSignature` versions.
* @custom:security-contact bounty@safe.global
*/
abstract contract SignatureValidatorProxy {
abstract contract SignatureValidator {
/**
* @dev Validates the signature for the given data.
* @param data The signed data bytes.
Expand Down

0 comments on commit 8304ebd

Please sign in to comment.