AssetManager

contract AssetManager is AragonApp, Ownable
event AssetCreated(address indexed entity, uint id)

Asset created

event AssetDeactivated(address indexed entity, uint id)

Asset deactivated

event AssetActivated(address indexed entity, uint id)

Asset activated

event AssetFrozen(address indexed entity, uint id)

Asset frozen

event AssetDefrosted(address indexed entity, uint id)

Asset defrosted

event SharesDistributed(address indexed entity, uint numReceivers)

Shares distributed

event RevenueSet(address indexed sender, uint assetId, uint amount)

Revenue set

mapping (uint => address) public assetsList

List of the assets

bytes32 constant public CREATE_ASSET_ROLE

ACL variable for asset creation

bytes32 constant public DEACTIVATE_ASSET_ROLE

ACL variable for asset deactivation

bytes32 constant public ACTIVATE_ASSET_ROLE

ACL variable for asset activation

bytes32 constant public DISTRIBUTE_SHARES_ROLE

ACL variable for shares distribution

function initialize()
public
 onlyInit

App initialization

function createAsset(uint _id, string _name, string _description, address _manager, address _rvtAddress)
external
 auth(CREATE_ASSET_ROLE)

Create an asset to the list

Parameters
  • _id – asset id

  • _name – asset name

  • _description – asset description

  • _manager – asset manager

  • _rvtAddress – RVT address manager

function activateAsset(uint _id)
external
 auth(ACTIVATE_ASSET_ROLE)

Activate an asset

Parameters
  • _id – asset id

function deactivateAsset(uint _id)
external
 auth(DEACTIVATE_ASSET_ROLE)

Deactivate an asset

Parameters
  • _id – asset id

function distributeShares(uint _id, address[] _receivers, uint[] _amounts)
external
 auth(DISTRIBUTE_SHARES_ROLE)

Distribute shares

Parameters
  • _id – asset id

  • _receivers – receivers

  • _amounts – share amounts

function setRevenue(uint _id, uint _amount)
external

Set revenue related to an asset

Parameters
  • _id – asset id

  • _amount – revenue amount

function defrostAsset(uint _id)
external

Defrost an asset

Parameters
  • _id – asset id

function getSHTAddress(uint _id)
public
view
returns (address)
Parameters
  • _id – the id to get

Return

SHT address

function getManager(uint _id)
public
view
returns (address)
Parameters
  • _id – the id to get

Return

manager address

function getAssetAddress(uint _id)
public
view
returns (address)
Parameters
  • _id – the id to get

Return

asset address