Methods

Methods

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

Read Operations

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

Pass a Component address in this function for it to retrieve its key.

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

Pass a key in this function for it to retrieve the array of the Component addresses corresponding to the key's history.

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

Pass multiple keys in this function for it to retrieve, for each key, the array of the addresses of the Components corresponding to the key's history.

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

Pass a Component key in this function for it to retrieve the Component's address.

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

Pass multiple Component keys in this function for it to retrieve, for each key, its address.

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

Pass a Component address in this function for it to retrieve whether the address corresponds to an active Component (true) or an inactive one (false).

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

Pass a key in this function for it to retrieve whether the key corresponds to an active Component (true) or an inactive one (false).

Write Operations

function set(Component calldata) external returns(address replacedComponentAddress);

Pass a component struct to add it to a Organization. If the key passed in the struct is already attached to a Component, that Component will be replaced with the new one.

The output function returns the address of the new Component.

function batchSet(Component[] calldata) external returns (address[] memory replacedComponentAddresses);

Pass multiple component structs to add them to a Organization. If a key passed in a struct is already attached to a Component, that Component will be replaced with the new one.

The output function returns the addresses of the new Components.

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

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

Last updated