Assessment reports>STFX>Threat Models>createNewStf

Function: createNewStf(StfSpot _stf)

Creates a new STF and stores the information about it. A salt is picked based on the hash of tokens, period, and block timestamp/number/chainid.

Inputs

  • _stf

    • Control: Full, struct can be set by any caller. fundDeadline is hardcoded.

    • Constraints: Fundraising period must be at least 15 minutes and smaller than maxFundraisingPeriod. baseToken and depositToken must be whitelisted. Called cannot already be a manager.

    • Impact: Creates a new STF and occupies a mapping slot based on the salt that refers to the parameters. The caller becomes the manager of the STF.

Branches and code coverage (including function calls)

Intended branches

  • Successfully creates a new STF.

Negative behavior

  • Existing manager tries to create a new STF.

  • Fundraising period is out of bounds.

  • The baseToken / depositToken pair is not whitelisted.

Zellic © 2024Back to top ↑