@oceanprotocol/keeper-contracts
Version:
Integration of SEAs, DID and OceanToken in Solidity
80 lines (64 loc) • 2.01 kB
Markdown
# contract: ThresholdCondition
Documentation:
```
Threshold Condition
Ocean Protocol Team
* Implementation of the Threshold Condition
*
Threshold condition acts as a filter for a set of input condition(s) in which sends
a signal whether to complete the flow execution or abort it. This type of conditions
works as intermediary conditions where they wire SEA conditions in order to support
more complex scenarios.
```
## Functions
### external initialize
Documentation:
```
initialize init the
contract with the following parameters
this function is called only once during the contract
initialization.
_owner contract's owner account address
_conditionStoreManagerAddress condition store manager address
```
Parameters:
* address _owner
* address _conditionStoreManagerAddress
### public hashValues
Documentation:
```
hashValues generates the hash of condition inputs
with the following parameters
inputConditions array of input conditions IDs
threshold the required number of fulfilled input conditions
bytes32 hash of all these values
```
Parameters:
* bytes32[] inputConditions
* uint256 threshold
### external fulfill
Documentation:
```
fulfill threshold condition
the fulfill method check whether input conditions are
fulfilled or not.
_agreementId agreement identifier
_inputConditions array of input conditions IDs
threshold the required number of fulfilled input conditions
condition state (Fulfilled/Aborted)
```
Parameters:
* bytes32 _agreementId
* bytes32[] _inputConditions
* uint256 threshold
### private canFulfill
Documentation:
```
canFulfill check if condition can be fulfilled
_inputConditions array of input conditions IDs
threshold the required number of fulfilled input conditions
true if can fulfill
```
Parameters:
* bytes32[] _inputConditions
* uint256 threshold