Assessment reports>AccountRecoveryModule>Threat Model>initForSmartAccount

Function: initForSmartAccount(byte[32][] guardians, TimeFrame[] timeFrames, uint8 recoveryThreshold, uint48 securityDelay)

This function configures the recovery module for a smart account. Can only be called if the module is not already configured for the account.

Inputs

  • guardians

    • Control: Arbitrary.

    • Constraints: Length must match timeFrames; entries must be unique and nonzero.

    • Impact: Identifies the guardians.

  • timeFrames

    • Control: Arbitrary.

    • Constraints: Length must match guardians; entries must be valid.

    • Impact: Specifies the start and end time when each guardian is active.

  • recoveryThreshold

    • Control: Arbitrary.

    • Constraints: Must be at most guardians.length.

    • Impact: Number of guardians required to submit a recovery request.

  • securityDelay

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Security delay before a recovery request is effective.

Branches and code coverage

Intended branches

  • Configures the module for the smart account (caller).

Negative behavior

  • Reverts if the module was already initialized.

  • Reverts if the array arguments' lengths are mismatched.

  • Reverts if recovery threshold is too high.

  • Reverts if recovery threshold is zero.

  • Reverts if the guardians are not unique.

  • Reverts if a guardian is zero.

  • Reverts if a time frame is invalid or expired.

Zellic © 2024Back to top ↑