Skip to content

Commit

Permalink
Update on progress
Browse files Browse the repository at this point in the history
  • Loading branch information
nivcertora committed Jun 18, 2024
1 parent 2568691 commit 3b5bfd2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions certora/confs/SafeWebAuthnSignerFactory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"exclude_rule": ["createAndVerifyEQtoIsValidSignatureForSigner"],
"rule_sanity": "basic",
"solc": "solc8.23",
"solc_via_ir": false,
Expand Down
12 changes: 6 additions & 6 deletions certora/harnesses/SafeWebAuthnSignerFactoryHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ contract SafeWebAuthnSignerFactoryHarness is SafeWebAuthnSignerFactory {
magicValue = abi.decode(result, (bytes4));
}

// /**
// munge to pass the SignerCreationCantOverride rule.
// */
// function _hasNoCode(address account) internal view override returns (bool result) {
// return account.code.length > 0;
// }
/**
munge to pass the SignerCreationCantOverride rule.
*/
function _hasNoCode(address account) internal view override returns (bool result) {
return account.code.length > 0;
}
}
4 changes: 3 additions & 1 deletion certora/specs/SafeWebAuthnSignerFactory.spec
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ rule createAndGetSignerEquivalence(){

ghost mathint numOfCreation;
ghost mapping(address => uint) address_map;
ghost address signerAddress;

hook EXTCODESIZE(address addr) uint v{
require address_map[addr] == v;
}

hook CREATE2(uint value, uint offset, uint length, bytes32 salt) address v{
require(v == signerAddress);
numOfCreation = numOfCreation + 1;
address_map[v] = length;
}
Expand Down Expand Up @@ -152,7 +154,7 @@ rule createAndVerifyEQtoIsValidSignatureForSigner()
bytes signature;
bytes32 message;

address signerAddress = getSigner(e, x, y, verifier);
signerAddress = getSigner(e, x, y, verifier);
require(numOfCreation == 0);
require(hasNoCode(e, signerAddress));
require(WebAuthnHarness.castSignatureSuccess(e, message, signature));
Expand Down

0 comments on commit 3b5bfd2

Please sign in to comment.