diff --git a/.gas-snapshot b/.gas-snapshot index 5f45805b..39460e4e 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -5,9 +5,9 @@ EnforcerTest:testFailRateEnforcerMaxRate() (gas: 783780) EnforcerTest:testFailRateEnforcerMaxRateAndMaxCarryRate() (gas: 783645) EnforcerTest:testRateEnforcerBasic() (gas: 903898) EnforcerTest:testTermEnforcerBasic() (gas: 976160) -TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecall() (gas: 964589) -TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 867112) -TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 913906) +TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecall() (gas: 964597) +TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 867128) +TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 913922) TestCustodian:testCannotLazyMintTwice() (gas: 76569) TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 66833) TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 72328) @@ -50,11 +50,11 @@ TestLoanCombinations:testLoanSimpleInterestEnglishFixed() (gas: 701464) TestLoanManager:testGenerateOrder() (gas: 998199) TestLoanManager:testGenerateOrderInvalidSender() (gas: 12986) TestLoanManager:testSupportsInterface() (gas: 7003) -TestNewLoan:testBuyNowPayLater() (gas: 1144531) -TestNewLoan:testNewLoanERC721CollateralDefaultTerms2():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 974985) -TestNewLoan:testNewLoanERC721CollateralDefaultTermsRefinance() (gas: 635547) -TestNewLoan:testSettleLoan() (gas: 1240937) -TestRepayLoan:testRepayLoan() (gas: 698757) +TestNewLoan:testBuyNowPayLater() (gas: 1144517) +TestNewLoan:testNewLoanERC721CollateralDefaultTerms2():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 974971) +TestNewLoan:testNewLoanERC721CollateralDefaultTermsRefinance() (gas: 635551) +TestNewLoan:testSettleLoan() (gas: 1240923) +TestRepayLoan:testRepayLoan() (gas: 698749) TestStarLiteUtils:testEncodeReceivedWithRecipient() (gas: 17955) TestStarLiteUtils:testSpentToReceived() (gas: 17708) TestStarLiteUtils:testValidateSaltOpt(address,bytes32) (runs: 256, μ: 26479, ~: 26479) diff --git a/src/originators/Originator.sol b/src/originators/Originator.sol index cfbecdc1..6a1d9d9d 100644 --- a/src/originators/Originator.sol +++ b/src/originators/Originator.sol @@ -75,6 +75,8 @@ abstract contract Originator is Ownable { event CounterUpdated(); + event HashInvalidated(bytes32 hash); + modifier onlyLoanManager() { if (msg.sender != address(LM)) { revert NotLoanManager(); @@ -219,6 +221,7 @@ abstract contract Originator is Ownable { if (details.offer.salt != bytes32(0)) { if (!usedHashes[contextHash]) { usedHashes[contextHash] = true; + emit HashInvalidated(contextHash); } else { revert InvalidOffer(); }