Skip to content

Commit

Permalink
📝 owners: document length parameter usage
Browse files Browse the repository at this point in the history
addresses quantstamp EXA-S-5
  • Loading branch information
cruzdanilo committed Jul 4, 2024
1 parent 85e82f4 commit ee3450b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ MultiOwnerPluginIntegration:test_userOpValidation_owner_standardExecute() (gas:
MultiOwnerPluginTest:testFuzz_isValidSignature_ContractOwner(bytes32) (runs: 256, μ: 110067, ~: 110067)
MultiOwnerPluginTest:testFuzz_isValidSignature_ContractOwnerWithEOAOwner(bytes32) (runs: 256, μ: 120381, ~: 120381)
MultiOwnerPluginTest:testFuzz_isValidSignature_EOAOwner(string,bytes32) (runs: 256, μ: 130741, ~: 130734)
MultiOwnerPluginTest:testFuzz_isValidSignature_PasskeyOwner(bytes32) (runs: 256, μ: 365504, ~: 365652)
MultiOwnerPluginTest:testFuzz_isValidSignature_PasskeyOwner(bytes32) (runs: 256, μ: 365665, ~: 365612)
MultiOwnerPluginTest:testFuzz_runtimeValidationFunction_BadFunctionId(uint8) (runs: 256, μ: 9747, ~: 9747)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_BadFunctionId(uint8) (runs: 256, μ: 10744, ~: 10744)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_ContractOwner((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)) (runs: 256, μ: 130908, ~: 130897)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_ContractOwnerWithEOAOwner((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)) (runs: 256, μ: 144523, ~: 144512)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_EOAOwner(string,(address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)) (runs: 256, μ: 138777, ~: 138780)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_PasskeyOwner((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)) (runs: 256, μ: 373691, ~: 373630)
MultiOwnerPluginTest:testFuzz_userOpValidationFunction_PasskeyOwner((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)) (runs: 256, μ: 373660, ~: 373608)
MultiOwnerPluginTest:test_eip712Domain() (gas: 35438)
MultiOwnerPluginTest:test_isValidSignature_failMalformedAddress() (gas: 15544)
MultiOwnerPluginTest:test_isValidSignature_failWithOutOfBounds() (gas: 12319)
Expand Down
2 changes: 2 additions & 0 deletions src/OwnersLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ library OwnersLib {
return false;
}

/// @dev The search is bounded by the `length` argument and can read dirty data if `length` is not set correctly.
function contains(PublicKey[MAX_OWNERS] memory keys, PublicKey memory owner, uint256 length)
internal
pure
Expand All @@ -54,6 +55,7 @@ library OwnersLib {
return false;
}

/// @dev The search is bounded by the `length` argument and can read dirty data if `length` is not set correctly.
function find(PublicKey[MAX_OWNERS] memory keys, PublicKey memory owner, uint256 length)
internal
pure
Expand Down

0 comments on commit ee3450b

Please sign in to comment.