@@ -8,6 +8,7 @@ import {IPreApproveAction} from 'interfaces/actions-builders/IPreApproveAction.s
88import {ISetEmergencyCallerAction} from 'interfaces/actions-builders/ISetEmergencyCallerAction.sol ' ;
99import {ISetEmergencyTriggerAction} from 'interfaces/actions-builders/ISetEmergencyTriggerAction.sol ' ;
1010import {ISimpleActions} from 'interfaces/actions-builders/ISimpleActions.sol ' ;
11+ import {ICreateX} from 'interfaces/external/ICreateX.sol ' ;
1112import {IntegrationEthereumBase} from 'test/integration/ethereum/IntegrationEthereumBase.sol ' ;
1213
1314contract IntegrationCanonGuardManageActions is IntegrationEthereumBase {
@@ -566,4 +567,50 @@ contract IntegrationCanonGuardManageActions is IntegrationEthereumBase {
566567 // Assert that the WETH has been collected
567568 assertEq (WETH.balanceOf (address (SAFE_PROXY)), _safeWETHBalanceBefore + 1 ether);
568569 }
570+
571+ function test_CanonGuardDeploymentNonce () public {
572+ vm.startPrank (address (SAFE_PROXY));
573+
574+ // Deploy the CanonGuard contract through the factory with a non-used nonce
575+ canonGuardFactory.createCanonGuard (
576+ address (SAFE_PROXY),
577+ 1 ,
578+ address (MULTI_SEND_CALL_ONLY),
579+ SHORT_TX_EXECUTION_DELAY,
580+ LONG_TX_EXECUTION_DELAY,
581+ TX_EXPIRY_DELAY,
582+ MAX_APPROVAL_DURATION,
583+ makeAddr ('emergencyTrigger ' ),
584+ makeAddr ('emergencyCaller ' )
585+ );
586+
587+ // Re-deploy the CanonGuard contract through the factory with the same nonce, should revert
588+ vm.expectRevert (abi.encodeWithSelector (ICreateX.FailedContractCreation.selector , address (CREATE_X)));
589+ canonGuardFactory.createCanonGuard (
590+ address (SAFE_PROXY),
591+ 1 ,
592+ address (MULTI_SEND_CALL_ONLY),
593+ SHORT_TX_EXECUTION_DELAY,
594+ LONG_TX_EXECUTION_DELAY,
595+ TX_EXPIRY_DELAY,
596+ MAX_APPROVAL_DURATION,
597+ makeAddr ('emergencyTrigger ' ),
598+ makeAddr ('emergencyCaller ' )
599+ );
600+
601+ // Deploy the CanonGuard contract through the factory with a new nonce
602+ canonGuardFactory.createCanonGuard (
603+ address (SAFE_PROXY),
604+ 2 ,
605+ address (MULTI_SEND_CALL_ONLY),
606+ SHORT_TX_EXECUTION_DELAY,
607+ LONG_TX_EXECUTION_DELAY,
608+ TX_EXPIRY_DELAY,
609+ MAX_APPROVAL_DURATION,
610+ makeAddr ('emergencyTrigger ' ),
611+ makeAddr ('emergencyCaller ' )
612+ );
613+
614+ vm.stopPrank ();
615+ }
569616}
0 commit comments