Assessment reports>Spectral Modelers>Threat Model>registerModeler

Function: registerModeler(address _modeler, string _modelCommitment, uint256 _stakedAmount)

This facilitates the registration of a modeler.

Inputs

  • _modeler

    • Control: Fully controlled by the caller.

    • Constraints: Checked that the modeler is not already registered.

    • Impact: The modeler to be registered.

  • _modelCommitment

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The model commitment of the modeler.

  • _stakedAmount

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The amount of tokens staked by the modeler.

Branches and code coverage

Intended branches

  • Assumed most parameters are checked by the calling function. Currently not directly enforced or mentioned in the code.

  • Assumed that the necessary stakedAmount has been already transferred.

  • Add the new entry in the modelers mapping.

  • Append the modeler to the modelerAddresses array.

Negative behavior

  • Should not be callable by anyone other than the competition contract.

  • Should not allow calling this while the contract is paused.

Zellic © 2024Back to top ↑