diff --git a/certora/mutations/017_accountId_encoding_corruption.patch b/certora/mutations/017_accountId_encoding_corruption.patch new file mode 100644 index 0000000..0befdf6 --- /dev/null +++ b/certora/mutations/017_accountId_encoding_corruption.patch @@ -0,0 +1,13 @@ +diff --git a/contracts/vault/Accounts.sol b/contracts/vault/Accounts.sol +index 3066e7d..ae138ae 100644 +--- a/contracts/vault/Accounts.sol ++++ b/contracts/vault/Accounts.sol +@@ -50,7 +50,7 @@ library Accounts { + ) internal pure returns (AccountId) { + bytes32 left = bytes32(bytes20(holder)); + bytes32 right = bytes32(uint256(uint96(discriminator))); +- return AccountId.wrap(left | right); ++ return AccountId.wrap(left & right); + } + + /// Extracts the account holder and the discriminator from the the account id diff --git a/certora/mutations/018_duration_calculation_order_inversion.patch b/certora/mutations/018_duration_calculation_order_inversion.patch new file mode 100644 index 0000000..b27d50d --- /dev/null +++ b/certora/mutations/018_duration_calculation_order_inversion.patch @@ -0,0 +1,12 @@ +diff --git a/contracts/Timestamps.sol b/contracts/Timestamps.sol +index 945eced..3132942 100644 +--- a/contracts/Timestamps.sol ++++ b/contracts/Timestamps.sol +@@ -65,6 +65,6 @@ library Timestamps { + Timestamp start, + Timestamp end + ) internal pure returns (Duration) { +- return Duration.wrap(Timestamp.unwrap(end) - Timestamp.unwrap(start)); ++ return Duration.wrap(Timestamp.unwrap(start) - Timestamp.unwrap(end)); + } + } diff --git a/certora/mutations/019_period_calculation_round_up.patch b/certora/mutations/019_period_calculation_round_up.patch new file mode 100644 index 0000000..aac56d6 --- /dev/null +++ b/certora/mutations/019_period_calculation_round_up.patch @@ -0,0 +1,13 @@ +diff --git a/contracts/Periods.sol b/contracts/Periods.sol +index 189fb02..a54c439 100644 +--- a/contracts/Periods.sol ++++ b/contracts/Periods.sol +@@ -20,7 +20,7 @@ contract Periods { + function _periodOf(Timestamp timestamp) internal view returns (Period) { + return + Period.wrap( +- Timestamp.unwrap(timestamp) / Duration.unwrap(_secondsPerPeriod) ++ (Timestamp.unwrap(timestamp) + Duration.unwrap(_secondsPerPeriod) - 1) / Duration.unwrap(_secondsPerPeriod) + ); + } +