-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Certora/niv/Orgenazie-Files
Organize project setup files
- Loading branch information
Showing
20 changed files
with
173 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"assert_autofinder_success": true, | ||
"files": [ | ||
"modules/passkey/contracts/SafeWebAuthnSignerProxy.sol", | ||
"modules/passkey/contracts/SafeWebAuthnSignerSingleton.sol", | ||
"certora/harnesses/ERC20Like/DummyWeth.sol", | ||
"certora/harnesses/Utilities.sol", | ||
"modules/passkey/contracts/libraries/P256.sol" | ||
], | ||
"link": [ | ||
"SafeWebAuthnSignerProxy:_VERIFIERS=P256", | ||
"SafeWebAuthnSignerProxy:_SINGLETON=SafeWebAuthnSignerSingleton" | ||
], | ||
"java_args": [ | ||
" -ea -Dlevel.setup.helpers=info" | ||
], | ||
"msg": "sanity_with_all_default_summaries", | ||
"process": "emv", | ||
"prover_args": [ | ||
" -verifyCache -verifyTACDumps -testMode -checkRuleDigest -callTraceHardFail on" | ||
], | ||
"packages":[ | ||
"@safe-global=node_modules/@safe-global", | ||
"@account-abstraction=node_modules/@account-abstraction" | ||
], | ||
"solc": "solc8.23", | ||
"solc_via_ir": false, | ||
"optimistic_loop": true, | ||
"loop_iter": "6", | ||
"optimistic_hashing": true, | ||
"prover_version": "master", | ||
"server": "production", | ||
"verify": "SafeWebAuthnSignerProxy:certora/specs/SafeWebAuthnSignerProxy.spec" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"assert_autofinder_success": true, | ||
"files": [ | ||
"certora/harnesses/WebAuthnHarness.sol", | ||
"certora/harnesses/ERC20Like/DummyWeth.sol", | ||
"certora/harnesses/Utilities.sol", | ||
], | ||
"java_args": [ | ||
" -ea -Dlevel.setup.helpers=info" | ||
], | ||
"msg": "sanity_with_all_default_summaries", | ||
"process": "emv", | ||
"prover_args": [ | ||
" -verifyCache -verifyTACDumps -testMode -checkRuleDigest -callTraceHardFail on" | ||
], | ||
"packages":[ | ||
"@safe-global=node_modules/@safe-global", | ||
"@account-abstraction=node_modules/@account-abstraction" | ||
], | ||
"solc": "solc8.23", | ||
"solc_via_ir": false, | ||
"optimistic_loop": true, | ||
"optimistic_hashing": true, | ||
"prover_version": "master", | ||
"server": "production", | ||
"verify": "WebAuthnHarness:certora/specs/WebAuthn.spec" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
pragma solidity ^0.8.0; | ||
|
||
import {P256, WebAuthn} from "../../modules/passkey/contracts/libraries/WebAuthn.sol"; | ||
|
||
contract WebAuthnHarness { | ||
|
||
function castSignature(bytes calldata signature) internal pure returns (bool isValid, WebAuthn.Signature calldata data){ | ||
return WebAuthn.castSignature(signature); | ||
} | ||
|
||
function encodeClientDataJson( | ||
bytes32 challenge, | ||
string calldata clientDataFields | ||
) public pure returns (string memory clientDataJson){ | ||
return WebAuthn.encodeClientDataJson(challenge, clientDataFields); | ||
} | ||
|
||
function encodeSigningMessage( | ||
bytes32 challenge, | ||
bytes calldata authenticatorData, | ||
string calldata clientDataFields | ||
) public view returns (bytes memory message) { | ||
return WebAuthn.encodeSigningMessage(challenge, authenticatorData, clientDataFields); | ||
} | ||
|
||
function checkAuthenticatorFlags( | ||
bytes calldata authenticatorData, | ||
WebAuthn.AuthenticatorFlags authenticatorFlags | ||
) public pure returns (bool success){ | ||
return WebAuthn.checkAuthenticatorFlags(authenticatorData, authenticatorFlags); | ||
} | ||
|
||
function verifySignature( | ||
bytes32 challenge, | ||
bytes calldata signature, | ||
WebAuthn.AuthenticatorFlags authenticatorFlags, | ||
uint256 x, | ||
uint256 y, | ||
P256.Verifiers verifiers | ||
) public view returns (bool success) { | ||
return WebAuthn.verifySignature(challenge, signature, authenticatorFlags, x, y, verifiers); | ||
} | ||
|
||
function verifySignature( | ||
bytes32 challenge, | ||
WebAuthn.Signature calldata signature, | ||
WebAuthn.AuthenticatorFlags authenticatorFlags, | ||
uint256 x, | ||
uint256 y, | ||
P256.Verifiers verifiers | ||
) public view returns (bool success) { | ||
return WebAuthn.verifySignature(challenge, signature, authenticatorFlags, x, y, verifiers); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import "ERC20/erc20cvl.spec"; | ||
import "ERC20/WETHcvl.spec"; | ||
import "ERC721/erc721.spec"; | ||
import "ERC1967/erc1967.spec"; | ||
import "PriceAggregators/chainlink.spec"; | ||
import "PriceAggregators/tellor.spec"; | ||
|
||
import "spec_utils/problems.spec"; | ||
import "spec_utils/unresolved.spec"; | ||
import "spec_utils/optimizations.spec"; | ||
|
||
import "spec_utils/generic.spec"; // pick additional rules from here | ||
|
||
use builtin rule sanity filtered { f -> f.contract == currentContract } | ||
|
||
use builtin rule hasDelegateCalls filtered { f -> f.contract == currentContract } | ||
use builtin rule msgValueInLoopRule; | ||
use builtin rule viewReentrancy; | ||
use rule privilegedOperation filtered { f -> f.contract == currentContract } | ||
use rule timeoutChecker filtered { f -> f.contract == currentContract } | ||
use rule simpleFrontRunning filtered { f -> f.contract == currentContract } | ||
use rule noRevert filtered { f -> f.contract == currentContract } | ||
use rule alwaysRevert filtered { f -> f.contract == currentContract } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import "ERC20/erc20cvl.spec"; | ||
import "ERC20/WETHcvl.spec"; | ||
import "ERC721/erc721.spec"; | ||
import "ERC1967/erc1967.spec"; | ||
import "PriceAggregators/chainlink.spec"; | ||
import "PriceAggregators/tellor.spec"; | ||
|
||
import "spec_utils/problems.spec"; | ||
import "spec_utils/unresolved.spec"; | ||
import "spec_utils/optimizations.spec"; | ||
|
||
import "spec_utils/generic.spec"; // pick additional rules from here | ||
|
||
use builtin rule sanity filtered { f -> f.contract == currentContract } | ||
|
||
use builtin rule hasDelegateCalls filtered { f -> f.contract == currentContract } | ||
use builtin rule msgValueInLoopRule; | ||
use builtin rule viewReentrancy; | ||
use rule privilegedOperation filtered { f -> f.contract == currentContract } | ||
use rule timeoutChecker filtered { f -> f.contract == currentContract } | ||
use rule simpleFrontRunning filtered { f -> f.contract == currentContract } | ||
use rule noRevert filtered { f -> f.contract == currentContract } | ||
use rule alwaysRevert filtered { f -> f.contract == currentContract } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.