Methods

The operations that can be performed on the subDAOManager contract are listed below.

Read Operations

function keyOf(address subdaoAddress) external view returns(bytes32);

Pass a subDAO address and retrieve its key.

function history(bytes32 key) external view returns(address[] memory subdaosAddresses);

Pass a subDAO key and retrieve the array of the addresses corresponding to its history.

function batchHistory(bytes32[] calldata keys) external view returns(address[][] memory subdaosAddresses);

Pass multiple subDAO keys and retrieve, for each key, the array of the addresses corresponding to its history.

function get(bytes32 key) external view returns(address subdaoAddress);

Pass a subDAO key and retrieve its address.

function list(bytes32[] calldata keys) external view returns(address[] memory subdaosAddresses);

Pass multiple subDAO keys and retrieve, for each key, its address.

function exists(address subject) external view returns(bool);

Pass a subDAO address and retrieve if it corresponds to an existing subDAO (true) or not (false).

function keyExists(bytes32 key) external view returns(bool);

Pass a subDAO key and retrieve if it corresponds to an existing subDAO (true) or not (false).

Write Operations

function set(bytes32 key, address location, address newHost) external returns(address replacedSubdaoAddress);

Pass a SubDAOEntry struct to link it to, replace it in or un-link it from the subDAOManager.

To link, the key parameter must be a new one that does not correspond to any other subDAO already registered in the subDAO Manager, and the location must be passed as the smart contract address of the new subDAO.

To un-link, the key parameter must be the one that corresponds to the subDAO you want to un-link, and the location address must be passed as address(0).

To replace, the key parameter must be the one that corresponds to the subDAO you want to replace; the location must be passed as the contract address of the new subDAO; and the newHost must be passed as the new host address of the replaced subDAO.

The output function returns the address of the newly linked subDAO.

function batchSet(SubDAOEntry[] calldata) external returns (address[] memory replacedSubdaoAddresses);

You can pass multiple SubDAOEntry structs to link them to, replace them in or un-link them from the subDAO Manager.

The output function returns the addresses of the new linked subDAOs.

See above for how to pass the parameters.

function submit(bytes32 key, bytes calldata payload, address restReceiver) external payable returns(bytes memory response);

This function allows an authorized Component to ask the SubDAO Manager to call a SubDAO (bytes32 key), passing specific parameters (payload). If the SubDAO sends the SubDAO Manager some tokens etc., a restReceiver can be specified to receive them. The SubDAO Manager uses a call function to perform the interaction with the SubDAO smart contract (key).

Last updated