Assessment reports>Cove>Threat Model>addAsset

Function: addAsset(address asset)

This function adds assets to the asset registry.

Inputs

  • asset

    • Control: Fully controlled by the caller.

    • Constraints: Cannot be the zero address.

    • Impact: The asset to add to the registry.

Branches and code coverage

Intended branches

  • Add asset to _assetList.

  • Emit an AddAsset event.

  • Set indexPlusOne to the length of _assetList plus one.

  • Set status to AssetStatus.ENABLED.

  • Set the bit in enabledAssets corresponding to the index of the asset to 1.

Negative behavior

  • Should not allow adding the same asset twice.

  • Should not allow adding the zero address.

  • Should not allow adding more than _MAX_ASSETS assets.

  • Caller needs to have MANAGER_ROLE.

Zellic © 2025Back to top ↑