Assessment reports>STFX>Threat Models>cancelVault

Function: cancelVault(byte[32] salt)

Cancels a vault. Can only be called by the admin or the manager of the STF. When an admin calls it, the cancellation is successful if there is nothing raised within the endTime or if the fundDeadline has passed. The manager can close it at any point if totalRaised is 0 or if fundDeadline has passed. A successful call to this function changes the status of the STF to one of the various cancellation reasons CANCELLED_*.

The function also frees the manager from being a manager, letting them open up a new STF in the future.

Inputs

  • salt

    • Control: Full.

    • Constraints: Must be a valid salt such that it fetches a valid STF struct, and that STF must have status NOT_OPENED.

    • Impact: Identifier for an STF, of which it deletes the stf.manager from isManagingFund and zeros out its fundDeadline and endTime, plus setting the stf.status to a cancellation reason.

Branches and code coverage (including function calls)

Intended branches

  • Admin cancels with zero raise.

  • Admin cancels with no fill.

  • Manager cancels with zero raise.

  • Manager cancels with generic reason.

Negative behavior

  • Called on opened STF.

  • Called by nonmanager/nonadmin.

  • Called by admin before fundDeadline.

Zellic © 2024Back to top ↑