Assessment reports>AccountRecoveryModule>Threat Model>replaceGuardian

Function: replaceGuardian(byte[32] guardian, byte[32] newGuardian, uint48 validUntil, uint48 validAfter)

This function can be used to replace a guardian.

Inputs

  • guardian

    • Control: Arbitrary.

    • Constraints: Must be already present.

    • Impact: The guardian to be removed.

  • newGuardian

    • Control: Arbitrary.

    • Constraints: Must not be zero.

    • Impact: The guardian to be added.

  • validUntil

    • Control: Arbitrary.

    • Constraints: Must not be in the past and before validAfter.

    • Impact: Time until the new guardian will be active.

  • validAfter

    • Control: Arbitrary.

    • Constraints: Must be in the future (respecting the security delay).

    • Impact: Time from which the new guardian will be active.

Branches and code coverage

Intended branches

  • Removes the old guardian and adds the new one.

Negative behavior

  • Reverts if guardian was not set.

  • Reverts if the old and new guardians are the same.

  • Reverts if newGuardian is zero.

  • Reverts if the time frame is invalid.

Zellic © 2024Back to top ↑