@@ -76,7 +76,7 @@ library Allocation {
76
76
uint256 tokens ,
77
77
uint256 accRewardsPerAllocatedToken ,
78
78
uint256 createdAtEpoch
79
- ) external returns (State memory ) {
79
+ ) internal returns (State memory ) {
80
80
require (! self[allocationId].exists (), AllocationAlreadyExists (allocationId));
81
81
82
82
State memory allocation = State ({
@@ -104,54 +104,54 @@ library Allocation {
104
104
* @param self The allocation list mapping
105
105
* @param allocationId The allocation id
106
106
*/
107
- function presentPOI (mapping (address => State) storage self , address allocationId ) external {
107
+ function presentPOI (mapping (address => State) storage self , address allocationId ) internal {
108
108
State storage allocation = _get (self, allocationId);
109
109
require (allocation.isOpen (), AllocationClosed (allocationId, allocation.closedAt));
110
110
allocation.lastPOIPresentedAt = block .timestamp ;
111
111
}
112
112
113
113
/**
114
- * @notice Update the accumulated rewards pending to be claimed for an allocation
114
+ * @notice Update the accumulated rewards per allocated token for an allocation
115
115
* @dev Requirements:
116
116
* - The allocation must be open
117
117
* @param self The allocation list mapping
118
118
* @param allocationId The allocation id
119
+ * @param accRewardsPerAllocatedToken The new accumulated rewards per allocated token
119
120
*/
120
- function clearPendingRewards (mapping (address => State) storage self , address allocationId ) external {
121
+ function snapshotRewards (
122
+ mapping (address => State) storage self ,
123
+ address allocationId ,
124
+ uint256 accRewardsPerAllocatedToken
125
+ ) internal {
121
126
State storage allocation = _get (self, allocationId);
122
127
require (allocation.isOpen (), AllocationClosed (allocationId, allocation.closedAt));
123
- allocation.accRewardsPending = 0 ;
128
+ allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken ;
124
129
}
125
130
126
131
/**
127
- * @notice Close an allocation
132
+ * @notice Update the accumulated rewards pending to be claimed for an allocation
128
133
* @dev Requirements:
129
134
* - The allocation must be open
130
135
* @param self The allocation list mapping
131
136
* @param allocationId The allocation id
132
137
*/
133
- function close (mapping (address => State) storage self , address allocationId ) external {
138
+ function clearPendingRewards (mapping (address => State) storage self , address allocationId ) internal {
134
139
State storage allocation = _get (self, allocationId);
135
140
require (allocation.isOpen (), AllocationClosed (allocationId, allocation.closedAt));
136
- allocation.closedAt = block . timestamp ;
141
+ allocation.accRewardsPending = 0 ;
137
142
}
138
143
139
144
/**
140
- * @notice Update the accumulated rewards per allocated token for an allocation
145
+ * @notice Close an allocation
141
146
* @dev Requirements:
142
147
* - The allocation must be open
143
148
* @param self The allocation list mapping
144
149
* @param allocationId The allocation id
145
- * @param accRewardsPerAllocatedToken The new accumulated rewards per allocated token
146
150
*/
147
- function snapshotRewards (
148
- mapping (address => State) storage self ,
149
- address allocationId ,
150
- uint256 accRewardsPerAllocatedToken
151
- ) internal {
151
+ function close (mapping (address => State) storage self , address allocationId ) internal {
152
152
State storage allocation = _get (self, allocationId);
153
153
require (allocation.isOpen (), AllocationClosed (allocationId, allocation.closedAt));
154
- allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken ;
154
+ allocation.closedAt = block . timestamp ;
155
155
}
156
156
157
157
/**
0 commit comments