@oceanprotocol/keeper-contracts
Version:
Integration of SEAs, DID and OceanToken in Solidity
107 lines (89 loc) • 2.54 kB
Markdown
# contract: EscrowReward
Documentation:
```
Escrow Reward
Ocean Protocol Team
* Implementation of the Escrow Reward.
* The Escrow reward is reward condition in which only
can release reward if lock and release conditions
are fulfilled.
For more information, please refer the following link:
https://github.com/oceanprotocol/OEPs/issues/133
TODO: update the OEP link
```
## Events
### Fulfilled
Parameters:
* bytes32 _agreementId
* address _receiver
* bytes32 _conditionId
* uint256 _amount
## Functions
### external initialize
Documentation:
```
initialize init the
contract with the following parameters
_owner contract's owner account address
_conditionStoreManagerAddress condition store manager address
_tokenAddress Ocean token contract address
```
Parameters:
* address _owner
* address _conditionStoreManagerAddress
* address _tokenAddress
### public hashValues
Documentation:
```
hashValues generates the hash of condition inputs
with the following parameters
_amount token amount to be locked/released
_receiver receiver's address
_sender sender's address
_lockCondition lock condition identifier
_releaseCondition release condition identifier
bytes32 hash of all these values
```
Parameters:
* uint256 _amount
* address _receiver
* address _sender
* bytes32 _lockCondition
* bytes32 _releaseCondition
### external fulfill
Documentation:
```
fulfill escrow reward condition
fulfill method checks whether the lock and
release conditions are fulfilled in order to
release/refund the reward to receiver/sender
respectively.
_agreementId agreement identifier
_amount token amount to be locked/released
_receiver receiver's address
_sender sender's address
_lockCondition lock condition identifier
_releaseCondition release condition identifier
condition state (Fulfilled/Aborted)
```
Parameters:
* bytes32 _agreementId
* uint256 _amount
* address _receiver
* address _sender
* bytes32 _lockCondition
* bytes32 _releaseCondition
### private _transferAndFulfill
Documentation:
```
_transferAndFulfill transfer tokens and
fulfill the condition
_id condition identifier
_receiver receiver's address
_amount token amount to be locked/released
condition state (Fulfilled/Aborted)
```
Parameters:
* bytes32 _id
* address _receiver
* uint256 _amount