Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Sep 24, 2024
1 parent 5befe24 commit b6b5397
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions contracts/src/P256BatchDelegation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@ contract P256BatchDelegation is MultiSendCallOnly {
/// @param calls - The calls to execute.
/// @param signature - The P256 signature over the calls: `p256.sign(keccak256(nonce ‖ calls))`.
/// @param delegateIndex - The index of the delegate public key to use.
function execute(
bytes memory calls,
P256.Signature memory signature,
uint32 delegateIndex
) public {
function execute(bytes memory calls, P256.Signature memory signature, uint32 delegateIndex) public {
bytes32 digest = keccak256(abi.encodePacked(nonce++, calls));
if (!P256.verify(digest, signature, delegates[delegateIndex]))
if (!P256.verify(digest, signature, delegates[delegateIndex])) {
revert InvalidSignature();
}
multiSend(calls);
}

Expand All @@ -79,14 +76,7 @@ contract P256BatchDelegation is MultiSendCallOnly {
uint32 delegateIndex
) public {
bytes32 challenge = keccak256(abi.encodePacked(nonce++, calls));
if (
!WebAuthnP256.verify(
challenge,
metadata,
signature,
delegates[delegateIndex]
)
) revert InvalidSignature();
if (!WebAuthnP256.verify(challenge, metadata, signature, delegates[delegateIndex])) revert InvalidSignature();
multiSend(calls);
}
}

0 comments on commit b6b5397

Please sign in to comment.