Methods

Methods

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

Read Operations

1
function keyOf(address componentAddress) external view returns(bytes32);
Copied!
Pass a Component address in this function for it to retrieve its key.
1
function history(bytes32 key) external view returns(address[] memory componentsAddresses);
Copied!
Pass a key in this function for it to retrieve the array of the Component addresses corresponding to the key's history.
1
function batchHistory(bytes32[] calldata keys) external view returns(address[][] memory componentsAddresses);
Copied!
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.
1
function get(bytes32 key) external view returns(address componentAddress);
Copied!
Pass a Component key in this function for it to retrieve the Component's address.
1
function list(bytes32[] calldata keys) external view returns(address[] memory componentsAddresses);
Copied!
Pass multiple Component keys in this function for it to retrieve, for each key, its address.
1
function isActive(address subject) external view returns(bool);
Copied!
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).
1
function keyIsActive(bytes32 key) external view returns(bool);
Copied!
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

1
function set(Component calldata) external returns(address replacedComponentAddress);
Copied!
Pass a component struct to add it to a Guild. 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.
1
function batchSet(Component[] calldata) external returns (address[] memory replacedComponentAddresses);
Copied!
Pass multiple component structs to add them to a Guild. 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.
1
function submit(address location, bytes calldata payload, address restReceiver) external payable returns(bytes memory response);
Copied!
This function allows an authorized Component to ask a Guild to call another contract (address location), passing specific parameters (payload). If the contract sends the Guild 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).