ILM_PC_RecurringPayments_v1.sol
Last updated
Last updated
Returns the length of an epoch.
Returns
epochLength
uint256
Length of an epoch in a uint timestamp.
Returns the RecurringPayment instance with id id
.
Parameters
id
uint256
The id of the RecurringPayment to return.
Returns
<none>
RecurringPayment
RecurringPayment with id id
.
Returns total list of RecurringPayment ids.
List is in ascending order.
Returns
<none>
uint256[]
List of RecurringPayment ids.
Returns the id of previous RecurringPayment.
Parameters
id
uint256
The id of the RecurringPayment to return.
Returns
prevId
uint256
The id of previous RecurringPayment.
Returns whether RecurringPayment with id id
exists.
Parameters
id
uint256
The id of the RecurringPayment to test.
Returns
<none>
bool
True if RecurringPayment with id id
exists, false otherwise.
Calculates the epoch from a given uint timestamp.
Calculation is: timestamp divided by epochLength.
Parameters
timestamp
uint256
A timestamp in a uint format.
Returns
epoch
uint256
Epoch in which timestamp belongs to.
Calculates the current epoch.
Calculation is: block.timestamp divided by epochLength.
Returns
epoch
uint256
Epoch in which current timestamp (block.timestamp) belongs to.
Calculates a future epoch x epochs from now.
Calculation is: current epoch + X epochs in the future = futureEpoch.
Parameters
xEpochsInTheFuture
uint256
How many epochs from the current epoch.
Returns
futureEpoch
uint256
Epoch in the future.
Adds a recurring payment to the manager.
a new id is created for each Payment.
Parameters
amount
uint256
Amount of tokens send to the recipient address.
startEpoch
uint256
Epoch in which the payment starts. Use getEpochFromTimestamp() or getCurrentEpoch() to get the appropriate epoch.
recipient
address
Recipient address that should receive tokens.
Returns
id
uint256
Id of the newly created recurring payment.
Removes a recurring Payment.
Parameters
prevId
uint256
Id of the previous recurring payment in the payment list.
id
uint256
Id of the recurring payment that is to be removed.
Triggers the start of the due payments for all recurring payment orders.
See trigger() but enables you to determine which ids you want to trigger payment ordes for.
this is to being able to bypass the unlikely event of having a runOutOfGas error for the normal trigger function.
Parameters
startId
uint256
: id of start position of the recurring payments that should be triggered.
endId
uint256
: id of end position of the recurring payments that should be triggered.
Event emitted when a new recurring payment added.
Parameters
recurringPaymentId
uint256
The id of the RecurringPayment.
amount
uint256
The amount of tokens that should be sent to the recipient address.
startEpoch
uint256
The epoch in which the payment starts.
lastTriggeredEpoch
uint256
The epoch in which the payment was last triggered.
recipient
address
The recipient address that should receive tokens.
Event emitted when a recurring payment was removed.
Parameters
recurringPaymentId
uint256
The id of the RecurringPayment.
Event emitted when a recurring payment was triggered.
Parameters
currentEpoch
uint256
The current epoch.
Event emitted when the epoch length is set.
Parameters
epochLength
uint256
The epoch length.
Given RecurringPayment id is invalid.
Start epoch cant be placed before the current epoch.
Given EpochLength is invalid.
Given startId is not position before endId.
Struct that holds the information of a RecurringPayment.
Properties
amount
uint256
The amount of tokens that will be paid out upon triggering the RecurringPayment.
startEpoch
uint256
The epoch in which the RecurringPayment should start.
lastTriggeredEpoch
uint256
When was the last epoch this RecurringPayment was triggered.
recipient
address
The recipient address that should receive tokens.