@oceanprotocol/keeper-contracts
Version:
Integration of SEAs, DID and OceanToken in Solidity
97 lines (75 loc) • 1.97 kB
Markdown
# library: EpochLibrary
Documentation:
```
Epoch Library
Ocean Protocol Team
* Implementation of Epoch Library.
For an arbitrary Epoch, this library manages the life
cycle of an Epoch. Usually this library is used for
handling the time window between conditions in an agreement.
For more information about Epoch checkout the below link
https://github.com/oceanprotocol/OEPs/issues/119
TODO: update to the OEP link
```
## Structs
### public Epoch
Members:
* uint256 timeLock
* uint256 timeOut
* uint256 blockNumber
### public EpochList
Members:
* mapping(bytes32 => struct EpochLibrary.Epoch) epochs
* bytes32[] epochIds
## Functions
### internal create
Documentation:
```
create creates new Epoch
_self is the Epoch storage pointer
_timeLock value in block count (can not fulfill before)
_timeOut value in block count (can not fulfill after)
```
Parameters:
* struct EpochLibrary.EpochList _self
* bytes32 _id
* uint256 _timeLock
* uint256 _timeOut
### external isTimedOut
Documentation:
```
isTimedOut means you cannot fulfill after
_self is the Epoch storage pointer
true if the current block number is gt timeOut
```
Parameters:
* struct EpochLibrary.EpochList _self
* bytes32 _id
### external isTimeLocked
Documentation:
```
isTimeLocked means you cannot fulfill before
_self is the Epoch storage pointer
true if the current block number is gt timeLock
```
Parameters:
* struct EpochLibrary.EpochList _self
* bytes32 _id
### public getEpochTimeOut
Documentation:
```
getEpochTimeOut
_self is the Epoch storage pointer
uint256 of EpochTimeOut
```
Parameters:
* struct EpochLibrary.Epoch _self
### public getEpochTimeLock
Documentation:
```
getEpochTimeLock
_self is the Epoch storage pointer
uint256 of EpochTimeLock
```
Parameters:
* struct EpochLibrary.Epoch _self