@@ -20,9 +20,7 @@ Funds flows with different origin and destiny:
20
20
| Lock | Stake | slash |
21
21
| Lock | Wallet | slashAndUnstake |
22
22
23
- ### initialize
24
-
25
- This is used by the Staking Factory when creating a new proxy. See deployment section for more details.
23
+ ### constructor
26
24
27
25
- ** Actor:** Deployer account
28
26
- ** Inputs:**
@@ -47,7 +45,6 @@ Stakes `_amount` tokens, transferring them from `msg.sender`
47
45
- ** _ data:** Used in Staked event, to add signalling information in more complex staking applications
48
46
- ** Authentication:** Open
49
47
- ** Pre-flight checks:**
50
- - Checks that contract has been initialized
51
48
- Checks that amount is not zero
52
49
- ** State transitions:**
53
50
- Transfers tokens from sender to contract
@@ -65,7 +62,6 @@ Stakes `_amount` tokens, transferring them from `msg.sender`, and assigns them t
65
62
- ** _ data:** Used in Staked event, to add signalling information in more complex staking applications
66
63
- ** Authentication:** Open
67
64
- ** Pre-flight checks:**
68
- - Checks that contract has been initialized
69
65
- Checks that amount is not zero
70
66
- ** State transitions:**
71
67
- Transfers tokens from sender to contract
@@ -83,7 +79,6 @@ Unstakes `_amount` tokens, returning them to the user
83
79
- ** _ data:** Used in Unstaked event, to add signalling information in more complex staking applications
84
80
- ** Authentication:** Open
85
81
- ** Pre-flight checks:**
86
- - Checks that contract has been initialized
87
82
- Checks that amount is not zero
88
83
- ** State transitions:**
89
84
- Transfers tokens from contract to sender
@@ -99,8 +94,6 @@ Get the token used by the contract for staking and locking
99
94
- ** Outputs:**
100
95
- Address of the staking token
101
96
- ** Authentication:** Open
102
- - ** Pre-flight checks:**
103
- - Checks that contract has been initialized
104
97
105
98
106
99
### supportsHistory
@@ -123,8 +116,6 @@ Get last time `_user` modified its staked balance
123
116
- ** Outputs:**
124
117
- Last block number when account’s balance was modified
125
118
- ** Authentication:** Open
126
- - ** Pre-flight checks:**
127
- - Checks that contract has been initialized
128
119
129
120
130
121
### totalStakedForAt
@@ -138,8 +129,6 @@ Get the total amount of tokens staked by `_user` at block number `_blockNumber`
138
129
- ** Outputs:**
139
130
- The amount of tokens staked by the account at the given block number
140
131
- ** Authentication:** Open
141
- - ** Pre-flight checks:**
142
- - Checks that contract has been initialized
143
132
144
133
145
134
### totalStakedAt
@@ -152,8 +141,6 @@ Get the total amount of tokens staked by all users at block number `_blockNumber
152
141
- ** Outputs:**
153
142
- The amount of tokens staked at the given block number
154
143
- ** Authentication:** Open
155
- - ** Pre-flight checks:**
156
- - Checks that contract has been initialized
157
144
158
145
159
146
### totalStakedFor
@@ -166,8 +153,6 @@ Get the amount of tokens staked by `_user`
166
153
- ** Outputs:**
167
154
- The amount of tokens staked by the given account
168
155
- ** Authentication:** Open
169
- - ** Pre-flight checks:**
170
- - Checks that contract has been initialized
171
156
172
157
### totalStaked
173
158
@@ -177,8 +162,6 @@ Get the total amount of tokens staked by all users
177
162
- ** Outputs:**
178
163
- The total amount of tokens staked by all users
179
164
- ** Authentication:** Open
180
- - ** Pre-flight checks:**
181
- - Checks that contract has been initialized
182
165
183
166
184
167
## Locking interface
@@ -195,35 +178,10 @@ It creates a new lock, so the lock for this manager cannot exist before.
195
178
- ** _ data:** Used in ` NewLockManager ` event and to parametrize logic for the lock to be enforced by the manager
196
179
- ** Authentication:** Open. Implicitly, sender must be staking owner.
197
180
- ** Pre-flight checks:**
198
- - Checks that contract has been initialized
199
- - Checks that allowance input is not zero
200
- - Checks that lock didn’t exist before
201
- - ** State transitions:**
202
- - Sets allowance for the pair owner-manager to the given amount
203
- - Calls lock manager callback
204
-
205
- ### allowManagerAndLock
206
-
207
- Lock ` _amount ` staked tokens and assign ` _lockManager ` as manager with ` _allowance ` allowed tokens and ` _data ` as data, so they can not be unstaked
208
-
209
- - ** Actor:** Staking user (owner)
210
- - ** Inputs:**
211
- - ** _ amount:** The amount of tokens to be locked
212
- - ** _ lockManager:** The manager entity for this particular lock
213
- - ** _ allowance:** Amount of tokens that the manager can lock
214
- - ** _ data:** Used in ` NewLockManager ` event and to parametrize logic for the lock to be enforced by the manager
215
- - ** Authentication:** Open. Implicitly, sender must be staking owner.
216
- - ** Pre-flight checks:**
217
- - Checks that contract has been initialized
218
181
- Checks that allowance input is not zero
219
182
- Checks that lock didn’t exist before
220
- - Checks that amount input is not zero
221
- - Checks that user has enough unlocked tokens available
222
- - Checks that amount is not greater than allowance
223
183
- ** State transitions:**
224
184
- Sets allowance for the pair owner-manager to the given amount
225
- - Sets the amount of tokens as locked by the manager
226
- - Increases the total amount of locked tokens balance for the user
227
185
- Calls lock manager callback
228
186
229
187
@@ -237,7 +195,6 @@ Transfer `_amount` tokens to `_to`’s staked balance
237
195
- ** _ amount:** Number of tokens to be transferred
238
196
- ** Authentication:** Open. Implicitly, sender must be staking owner.
239
197
- ** Pre-flight checks:**
240
- - Checks that contract has been initialized
241
198
- Checks that amount input is not zero
242
199
- Checks that user has enough unlocked tokens available
243
200
- ** State transitions:**
@@ -254,7 +211,6 @@ Transfer `_amount` tokens to `_to`’s external balance (i.e. unstaked)
254
211
- ** _ amount:** Number of tokens to be transferred
255
212
- ** Authentication:** Open. Implicitly, sender must be staking owner.
256
213
- ** Pre-flight checks:**
257
- - Checks that contract has been initialized
258
214
- Checks that amount input is not zero
259
215
- Checks that user has enough unlocked tokens available
260
216
- ** State transitions:**
@@ -273,7 +229,6 @@ Transfer `_amount` tokens from `_from`'s lock by `msg.sender` to `_to`
273
229
- ** _ amount:** Number of tokens to be transferred
274
230
- ** Authentication:** Open. Implicitly, sender must be lock manager.
275
231
- ** Pre-flight checks:**
276
- - Checks that contract has been initialized
277
232
- Check that owner’s lock is enough
278
233
- Checks that amount input is not zero
279
234
- ** State transitions:**
@@ -293,7 +248,6 @@ Transfer `_amount` tokens from `_from`'s lock by `msg.sender` to `_to`’s exter
293
248
- ** _ amount:** Number of tokens to be transferred
294
249
- ** Authentication:** Open. Implicitly, sender must be lock manager
295
250
- ** Pre-flight checks:**
296
- - Checks that contract has been initialized
297
251
- Check that owner’s lock is enough
298
252
- Checks that amount input is not zero
299
253
- ** State transitions:**
@@ -315,7 +269,6 @@ Transfer `_transferAmount` tokens from `_from`'s lock by `msg.sender` to `_to`,
315
269
- ** _ slashAmount:** Number of tokens to be transferred
316
270
- ** Authentication:** Open. Implicitly, sender must be lock manager
317
271
- ** Pre-flight checks:**
318
- - Checks that contract has been initialized
319
272
- Check that owner’s lock is enough
320
273
- Checks that unlock amount input is not zero
321
274
- Checks that slash amount input is not zero
@@ -336,7 +289,6 @@ Increase allowance in `_allowance` tokens of lock manager `_lockManager` for use
336
289
- ** _ allowance:** Amount of allowed tokens increase
337
290
- ** Authentication:** Open. Implicitly, sender must be staking owner.
338
291
- ** Pre-flight checks:**
339
- - Checks that contract has been initialized
340
292
- Checks that lock exists (i.e., it has a previous allowance)
341
293
- Checks that amount input is not zero
342
294
- ** State transitions:**
@@ -353,7 +305,6 @@ Decrease allowance in `_allowance` tokens of lock manager `_lockManager` for use
353
305
- ** _ allowance:** Amount of allowed tokens decrease
354
306
- ** Authentication:** Only owner or lock manager
355
307
- ** Pre-flight checks:**
356
- - Checks that contract has been initialized
357
308
- Checks that amount input is not zero
358
309
- Checks that lock exists (i.e., it has a previous allowance)
359
310
- Checks that final allowed amount is not less than currently locked tokens
@@ -364,16 +315,14 @@ Decrease allowance in `_allowance` tokens of lock manager `_lockManager` for use
364
315
365
316
### lock
366
317
367
- Increase locked amount by ` _amount ` tokens for user ` _user ` by lock manager ` _lockManager `
318
+ Increase locked amount by ` _amount ` tokens for user ` _user ` by lock manager ` msg.sender `
368
319
369
- - ** Actor:** Staking user (owner) or lock manager
320
+ - ** Actor:** Lock manager
370
321
- ** Inputs:**
371
322
- ** _ user:** Owner of locked tokens
372
- - ** _ lockManager:** The manager entity for this particular lock
373
323
- ** _ amount:** Amount of locked tokens increase
374
324
- ** Authentication:** Only owner or lock manager
375
325
- ** Pre-flight checks:**
376
- - Checks that contract has been initialized
377
326
- Checks that amount input is not zero
378
327
- Checks that user has enough unlocked tokens available
379
328
- Checks that lock has enough allowance
@@ -392,7 +341,6 @@ Decrease locked amount by `_amount` tokens for user `_user` by lock manager `_lo
392
341
- ** _ amount:** Amount of locked tokens decrease
393
342
- ** Authentication:** Only owner or lock manager
394
343
- ** Pre-flight checks:**
395
- - Checks that contract has been initialized
396
344
- Checks that amount input is not zero
397
345
- Checks that lock exists (i.e., it has a previous allowance)
398
346
- Checks that user has enough unlocked tokens available
@@ -412,28 +360,12 @@ Unlock `_user`'s lock by `_lockManager` so locked tokens can be unstaked again
412
360
- ** _ lockManager:** The manager entity for this particular lock
413
361
- ** Authentication:** Only owner or lock manager
414
362
- ** Pre-flight checks:**
415
- - Checks that contract has been initialized
416
363
- Checks that lock exists (i.e., it has a previous allowance)
417
364
- If sender is owner and there were locked tokens, checks that manager allows to unlock
418
365
- ** State transitions:**
419
366
- Decreases owner’s total locked amount by currently locked tokens for this lock manager
420
367
- Deletes lock for this pair of owner and lock manager
421
368
422
- ### setLockManager
423
-
424
- Change the manager of ` _user ` 's lock from ` msg.sender ` to ` _newLockManager `
425
-
426
- - ** Actor:** Lock manager
427
- - ** Inputs:**
428
- - ** _ user:** Owner of lock
429
- - ** _ newLockManager:** New lock manager
430
- - ** Authentication:** Open. Implicitly, sender must be lock manager
431
- - ** Pre-flight checks:**
432
- - Checks that contract has been initialized
433
- - Checks that lock exists
434
- - ** State transitions:**
435
- - Assigns lock to new manager
436
-
437
369
### getTotalLockedOf
438
370
439
371
Get total amount of locked tokens for ` _user `
0 commit comments