Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 6.62 KB

File metadata and controls

101 lines (71 loc) · 6.62 KB

Summary of ExecTransactionOnBehalf Contract

Overview

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.

Unit Tests

Here is the detailed list of all the test methods in the ExecTransactionOnBehalf unit test contract:

  1. testCan_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_LEAD
  2. testCannot_ExecTransactionOnBehalf_ROOT_SAFE_as_EOA_is_TARGETS_LEAD
  3. testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree
  4. testRevertWhenTryingToExecOnBehalfNotAuthorised
  5. testCannot_ExecTransactionOnBehalf_SAFE_LEAD_as_SAFE_is_TARGETS_ROOT
  6. testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_DifferentTree
  7. testRevertWhenTryingToExecOnBehalfIfNotAuthorised
  8. testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_WithDifferentRoles
  9. testCannot_ExecTransactionOnBehalf_SAFE_as_SAFE_is_TARGETS_ROOT
  10. testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_ViaSubSafe
  11. testRevertWhenTryingToExecOnBehalfWithoutRequiredRole
  12. testCan_ExecTransactionOnBehalf_ROOT_SAFE_as_SAFE_is_TARGETS_ROOT_SameTree_AfterRoleUpdate
  13. testCanExecTransactionOnBehalfOfChildRootSafeViaRootSafeWithMultipleEOAs
  14. testCanExecTransactionOnBehalfOfSiblingSafeViaRootSafeWithMultipleEOAs
  15. testCanExecTransactionOnBehalfOfSafeWithEOAViaOtherSafeWithMultipleEOAs
  16. testCanExecTransactionOnBehalfWithMultipleEOAs
  17. testCanExecTransactionOnBehalfOfChildSafeViaParentSafeWithMultipleEOAs
  18. testCanExecTransactionOnBehalfOfChildSafeViaRootSafeWithMultipleEOAs
  19. testCanExecTransactionOnBehalfOfSafeWithMultipleEOAs

Full Markdown Explanation

Setup Function

  • Function: setUp
  • Purpose: Deploy all necessary contracts and initialize the testing environment.
  • Details:
    • Deploys contracts with DeployHelper.deployAllContracts(60).

Test Cases

  1. 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.
  2. 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.
  3. 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.
  4. Function: testRevertWhenTryingToExecOnBehalfNotAuthorised

    • Purpose: Ensure that a transaction is reverted if the executor is not authorized.
  5. 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.
  6. 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.
  7. Function: testRevertWhenTryingToExecOnBehalfIfNotAuthorised

    • Purpose: Ensure that a transaction is reverted if the executor is not authorized.
  8. 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.
  9. 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.
  10. 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.
  11. Function: testRevertWhenTryingToExecOnBehalfWithoutRequiredRole

    • Purpose: Ensure that a transaction is reverted if the executor does not have the required role.
  12. 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.
  13. Function: testCanExecTransactionOnBehalfOfChildRootSafeViaRootSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a child root Safe via a root Safe with multiple EOAs.
  14. Function: testCanExecTransactionOnBehalfOfSiblingSafeViaRootSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a sibling Safe via a root Safe with multiple EOAs.
  15. Function: testCanExecTransactionOnBehalfOfSafeWithEOAViaOtherSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a Safe with an EOA via another Safe with multiple EOAs.
  16. Function: testCanExecTransactionOnBehalfWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a Safe with multiple EOAs.
  17. Function: testCanExecTransactionOnBehalfOfChildSafeViaParentSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a child Safe via a parent Safe with multiple EOAs.
  18. Function: testCanExecTransactionOnBehalfOfChildSafeViaRootSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a child Safe via a root Safe with multiple EOAs.
  19. Function: testCanExecTransactionOnBehalfOfSafeWithMultipleEOAs

    • Purpose: Validate that a transaction can be executed on behalf of a Safe with multiple EOAs.

Conclusions

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.