The ExecTransactionOnBehalf
contract tests the execution of transactions on behalf of various roles and Safes within the Palmera Module. The contract is designed to ensure that all significant actions, such as setting up organizations and safes and executing transactions, are performed correctly. This document provides an overview of the various unit tests implemented in the contract to verify these functionalities.
Here is the detailed list of all the test methods in the ExecTransactionOnBehalf
unit test contract:
testCan_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_LEAD
testCannot_ExecTransactionOnBehalf_ROOT_SAFE_as_EOA_is_TARGETS_LEAD
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree
testRevertWhenTryingToExecOnBehalfNotAuthorised
testCannot_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_ROOT
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_DifferentTree
testRevertWhenTryingToExecOnBehalfIfNotAuthorised
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_WithDifferentRoles
testCannot_ExecTransactionOnBehalf_SAFE_as_SAFE_is_TARGETS_ROOT
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_ViaSubSafe
testRevertWhenTryingToExecOnBehalfWithoutRequiredRole
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_AfterRoleUpdate
testCanExecTransactionOnBehalfOfChildRootSafeViaRootSafeWithMultipleEOAs
testCanExecTransactionOnBehalfOfSiblingSafeViaRootSafeWithMultipleEOAs
testCanExecTransactionOnBehalfOfSafeWithEOAViaOtherSafeWithMultipleEOAs
testCanExecTransactionOnBehalfWithMultipleEOAs
testCanExecTransactionOnBehalfOfChildSafeViaParentSafeWithMultipleEOAs
testCanExecTransactionOnBehalfOfChildSafeViaRootSafeWithMultipleEOAs
testCanExecTransactionOnBehalfOfSafeWithMultipleEOAs
- Function:
setUp
- Purpose: Deploy all necessary contracts and initialize the testing environment.
- Details:
- Deploys contracts with
DeployHelper.deployAllContracts(60)
.
- Deploys contracts with
-
Function:
testCan_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_LEAD
- Purpose: Validate that a transaction can be executed on behalf of a Safe lead when the target is another Safe lead in the same organization.
-
Function:
testCannot_ExecTransactionOnBehalf_ROOT_SAFE_as_EOA_is_TARGETS_LEAD
- Purpose: Ensure that a transaction cannot be executed on behalf of a root Safe by an EOA when the target is a Safe lead.
-
Function:
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree
- Purpose: Validate that a transaction can be executed on behalf of a root Safe when the target Safe is a child in the same hierarchical tree.
-
Function:
testRevertWhenTryingToExecOnBehalfNotAuthorised
- Purpose: Ensure that a transaction is reverted if the executor is not authorized.
-
Function:
testCannot_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_ROOT
- Purpose: Ensure that a transaction cannot be executed on behalf of a Safe lead when the target is a root Safe.
-
Function:
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_DifferentTree
- Purpose: Validate that a transaction can be executed on behalf of a root Safe when the target Safe is in a different hierarchical tree.
-
Function:
testRevertWhenTryingToExecOnBehalfIfNotAuthorised
- Purpose: Ensure that a transaction is reverted if the executor is not authorized.
-
Function:
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_WithDifferentRoles
- Purpose: Validate that a transaction can be executed on behalf of a root Safe when the target Safe is a child in the same hierarchical tree, with different roles.
-
Function:
testCannot_ExecTransactionOnBehalf_SAFE_as_SAFE_is_TARGETS_ROOT
- Purpose: Ensure that a transaction cannot be executed on behalf of a Safe when the target is a root Safe.
-
Function:
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_ViaSubSafe
- Purpose: Validate that a transaction can be executed on behalf of a root Safe via a sub Safe when the target Safe is in the same hierarchical tree.
-
Function:
testRevertWhenTryingToExecOnBehalfWithoutRequiredRole
- Purpose: Ensure that a transaction is reverted if the executor does not have the required role.
-
Function:
testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_AfterRoleUpdate
- Purpose: Validate that a transaction can be executed on behalf of a root Safe when the target Safe is a child in the same hierarchical tree, after a role update.
-
Function:
testCanExecTransactionOnBehalfOfChildRootSafeViaRootSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a child root Safe via a root Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfOfSiblingSafeViaRootSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a sibling Safe via a root Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfOfSafeWithEOAViaOtherSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a Safe with an EOA via another Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfOfChildSafeViaParentSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a child Safe via a parent Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfOfChildSafeViaRootSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a child Safe via a root Safe with multiple EOAs.
-
Function:
testCanExecTransactionOnBehalfOfSafeWithMultipleEOAs
- Purpose: Validate that a transaction can be executed on behalf of a Safe with multiple EOAs.
The ExecTransactionOnBehalf
contract ensures that the functionality for executing transactions on behalf of different roles and Safes within the Palmera Module is robust and secure. By testing various scenarios, including authorized and unauthorized executions, these tests validate the correctness and security of the transaction execution process.