diff --git a/certora/confs/OnlyExplicitPayerCanLoseTokens.conf b/certora/confs/OnlyExplicitPayerCanLoseTokens.conf index 8178a56ff..3fa5e11c3 100644 --- a/certora/confs/OnlyExplicitPayerCanLoseTokens.conf +++ b/certora/confs/OnlyExplicitPayerCanLoseTokens.conf @@ -19,6 +19,7 @@ "-depth 5", "-mediumTimeout 30", "-timeout 7200", + "-sanitySolverTimeout 3600", "-destructiveOptimizations twostage", "-havocAllByDefault true" ], diff --git a/src/periphery/EcrecoverAuthorizer.sol b/src/periphery/EcrecoverAuthorizer.sol index 00823226a..2a875d1f0 100644 --- a/src/periphery/EcrecoverAuthorizer.sol +++ b/src/periphery/EcrecoverAuthorizer.sol @@ -42,7 +42,8 @@ contract EcrecoverAuthorizer is IEcrecoverAuthorizer { authorization.authorizer, authorization.authorized, authorization.isAuthorized, - authorization.nonce + authorization.nonce, + signer ); IMidnight(MIDNIGHT) diff --git a/src/periphery/interfaces/IEcrecoverAuthorizer.sol b/src/periphery/interfaces/IEcrecoverAuthorizer.sol index e20e94f2c..38bf60063 100644 --- a/src/periphery/interfaces/IEcrecoverAuthorizer.sol +++ b/src/periphery/interfaces/IEcrecoverAuthorizer.sol @@ -32,7 +32,12 @@ interface IEcrecoverAuthorizer { /// EVENTS /// event SetIsAuthorized( - address indexed caller, address indexed authorizer, address indexed authorized, bool isAuthorized, uint256 nonce + address indexed caller, + address indexed authorizer, + address indexed authorized, + bool isAuthorized, + uint256 nonce, + address signer ); /// STORAGE GETTERS /// diff --git a/test/EcrecoverAuthorizerTest.sol b/test/EcrecoverAuthorizerTest.sol index fd68da741..4b08143ba 100644 --- a/test/EcrecoverAuthorizerTest.sol +++ b/test/EcrecoverAuthorizerTest.sol @@ -58,7 +58,7 @@ contract EcrecoverAuthorizerTest is BaseTest { Signature memory sig = signAuthorization(auth, borrower); vm.expectEmit(); - emit IEcrecoverAuthorizer.SetIsAuthorized(address(this), borrower, lender, true, auth.nonce); + emit IEcrecoverAuthorizer.SetIsAuthorized(address(this), borrower, lender, true, auth.nonce, borrower); ecrecoverAuthorizer.setIsAuthorized(auth, sig); @@ -69,7 +69,7 @@ contract EcrecoverAuthorizerTest is BaseTest { sig = signAuthorization(auth, borrower); vm.expectEmit(); - emit IEcrecoverAuthorizer.SetIsAuthorized(address(this), borrower, lender, false, auth.nonce); + emit IEcrecoverAuthorizer.SetIsAuthorized(address(this), borrower, lender, false, auth.nonce, borrower); ecrecoverAuthorizer.setIsAuthorized(auth, sig); @@ -91,6 +91,20 @@ contract EcrecoverAuthorizerTest is BaseTest { assertEq(ecrecoverAuthorizer.nonce(borrower), 1); } + function testEcrecoverAuthorizerEventEmitsSigner() public { + vm.startPrank(borrower); + midnight.setIsAuthorized(address(ecrecoverAuthorizer), true, borrower); + midnight.setIsAuthorized(otherBorrower, true, borrower); + vm.stopPrank(); + + Authorization memory auth = makeAuthorization(borrower, lender, true); + Signature memory sig = signAuthorization(auth, otherBorrower); + + vm.expectEmit(); + emit IEcrecoverAuthorizer.SetIsAuthorized(address(this), borrower, lender, true, auth.nonce, otherBorrower); + ecrecoverAuthorizer.setIsAuthorized(auth, sig); + } + function testEcrecoverAuthorizerInvalidSignature() public { Authorization memory auth = makeAuthorization(borrower, lender, true); Signature memory sig = signAuthorization(auth, lender); // wrong signer