diff --git a/contracts/WeiTable.sol b/contracts/WeiTable.sol index 437f679..0007a47 100644 --- a/contracts/WeiTable.sol +++ b/contracts/WeiTable.sol @@ -187,7 +187,7 @@ contract WeiTable is IWeiReceiver, Ownable { return (e.balanceOnMomentReceived/e.totalWeiNeeded) + 1; } } else if((e.isPeriodic) && (e.isSlidingAmount)) { - return 1 + ((block.timestamp - e.momentReceived) / (e.periodHours * 3600 * 1000)); + return 1 + ((block.timestamp - e.momentCreated) / (e.periodHours * 3600 * 1000)); } else { return 1; } diff --git a/contracts/ether/WeiExpense.sol b/contracts/ether/WeiExpense.sol index 37cfbf3..219c603 100644 --- a/contracts/ether/WeiExpense.sol +++ b/contracts/ether/WeiExpense.sol @@ -153,7 +153,7 @@ contract WeiExpense is IWeiReceiver, IDestination, Ownable { return (balanceAtMomentReceived / totalWeiNeed) + 1; } } else if((isPeriodic) && (isSlidingAmount)) { - return 1 + ((block.timestamp - momentReceived) / (periodHours * 3600 * 1000)); + return 1 + ((block.timestamp - momentCreated) / (periodHours * 3600 * 1000)); }else { return 1; }