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
toAssetStatus.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
.