@@ -14,7 +14,7 @@ import "./ICuration.sol";
14
14
* @dev Allows curators to signal on subgraph deployments that might be relevant to indexers by
15
15
* staking Graph Tokens (GRT). Additionally, curators earn fees from the Query Market related to the
16
16
* subgraph deployment they curate.
17
- * A curators stake goes to a curation pool along with the stakes of other curators,
17
+ * A curators deposit goes to a curation pool along with the deposits of other curators,
18
18
* only one such pool exists for each subgraph deployment.
19
19
* The contract mints Graph Signal Tokens (GST) according to a bonding curve for each individual
20
20
* curation pool where GRT is deposited.
@@ -27,13 +27,13 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
27
27
// 100% in parts per million
28
28
uint32 private constant MAX_PPM = 1000000 ;
29
29
30
- // Amount of signal you get with your minimum token stake
31
- uint256 private constant SIGNAL_PER_MINIMUM_STAKE = 1 ether ;
30
+ // Amount of signal you get with your minimum token deposit
31
+ uint256 private constant SIGNAL_PER_MINIMUM_DEPOSIT = 1e18 ; // 1 signal as 18 decimal number
32
32
33
33
// -- Events --
34
34
35
35
/**
36
- * @dev Emitted when `curator` staked `tokens` on `subgraphDeploymentID` as curation signal.
36
+ * @dev Emitted when `curator` deposited `tokens` on `subgraphDeploymentID` as curation signal.
37
37
* The `curator` receives `signal` amount according to the curation pool bonding curve.
38
38
*/
39
39
event Signalled (
@@ -69,28 +69,28 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
69
69
address _governor ,
70
70
address _token ,
71
71
uint32 _defaultReserveRatio ,
72
- uint256 _minimumCurationStake
72
+ uint256 _minimumCurationDeposit
73
73
) external onlyImpl {
74
74
Governed._initialize (_governor);
75
75
BancorFormula._initialize ();
76
76
77
77
token = IGraphToken (_token);
78
78
defaultReserveRatio = _defaultReserveRatio;
79
- minimumCurationStake = _minimumCurationStake ;
79
+ minimumCurationDeposit = _minimumCurationDeposit ;
80
80
}
81
81
82
82
/**
83
83
* @dev Accept to be an implementation of proxy and run initializer.
84
84
* @param _proxy Graph proxy delegate caller
85
85
* @param _token Address of the Graph Protocol token
86
86
* @param _defaultReserveRatio Reserve ratio to initialize the bonding curve of CurationPool
87
- * @param _minimumCurationStake Minimum amount of tokens that curators can stake
87
+ * @param _minimumCurationDeposit Minimum amount of tokens that curators can deposit
88
88
*/
89
89
function acceptProxy (
90
90
GraphProxy _proxy ,
91
91
address _token ,
92
92
uint32 _defaultReserveRatio ,
93
- uint256 _minimumCurationStake
93
+ uint256 _minimumCurationDeposit
94
94
) external {
95
95
// Accept to be the implementation for this proxy
96
96
_acceptUpgrade (_proxy);
@@ -100,7 +100,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
100
100
_proxy.admin (), // default governor is proxy admin
101
101
_token,
102
102
_defaultReserveRatio,
103
- _minimumCurationStake
103
+ _minimumCurationDeposit
104
104
);
105
105
}
106
106
@@ -132,19 +132,23 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
132
132
}
133
133
134
134
/**
135
- * @dev Set the minimum stake amount for curators.
136
- * @notice Update the minimum stake amount to `_minimumCurationStake `
137
- * @param _minimumCurationStake Minimum amount of tokens required stake
135
+ * @dev Set the minimum deposit amount for curators.
136
+ * @notice Update the minimum deposit amount to `_minimumCurationDeposit `
137
+ * @param _minimumCurationDeposit Minimum amount of tokens required deposit
138
138
*/
139
- function setMinimumCurationStake (uint256 _minimumCurationStake ) external override onlyGovernor {
140
- require (_minimumCurationStake > 0 , "Minimum curation stake cannot be 0 " );
141
- minimumCurationStake = _minimumCurationStake;
142
- emit ParameterUpdated ("minimumCurationStake " );
139
+ function setMinimumCurationDeposit (uint256 _minimumCurationDeposit )
140
+ external
141
+ override
142
+ onlyGovernor
143
+ {
144
+ require (_minimumCurationDeposit > 0 , "Minimum curation deposit cannot be 0 " );
145
+ minimumCurationDeposit = _minimumCurationDeposit;
146
+ emit ParameterUpdated ("minimumCurationDeposit " );
143
147
}
144
148
145
149
/**
146
- * @dev Set the fee percentage to charge when a curator withdraws stake .
147
- * @param _percentage Percentage fee charged when withdrawing stake
150
+ * @dev Set the fee percentage to charge when a curator withdraws GRT tokens .
151
+ * @param _percentage Percentage fee charged when withdrawing GRT tokens
148
152
*/
149
153
function setWithdrawalFeePercentage (uint32 _percentage ) external override onlyGovernor {
150
154
// Must be within 0% to 100% (inclusive)
@@ -175,9 +179,9 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
175
179
}
176
180
177
181
/**
178
- * @dev Stake Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.
182
+ * @dev Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.
179
183
* @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal
180
- * @param _tokens Amount of Graph Tokens to stake
184
+ * @param _tokens Amount of Graph Tokens to deposit
181
185
* @return Signal minted
182
186
*/
183
187
function mint (bytes32 _subgraphDeploymentID , uint256 _tokens )
@@ -187,16 +191,16 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
187
191
{
188
192
address curator = msg .sender ;
189
193
190
- // Need to stake some funds
191
- require (_tokens > 0 , "Cannot stake zero tokens " );
194
+ // Need to deposit some funds
195
+ require (_tokens > 0 , "Cannot deposit zero tokens " );
192
196
193
197
// Transfer tokens from the curator to this contract
194
198
require (
195
199
token.transferFrom (curator, address (this ), _tokens),
196
- "Cannot transfer tokens to stake "
200
+ "Cannot transfer tokens to deposit "
197
201
);
198
202
199
- // Stake tokens to a curation pool reserve
203
+ // Deposit tokens to a curation pool reserve
200
204
return _mint (curator, _subgraphDeploymentID, _tokens);
201
205
}
202
206
@@ -245,7 +249,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
245
249
}
246
250
247
251
/**
248
- * @dev Check if any Graph tokens are staked for a SubgraphDeployment.
252
+ * @dev Check if any GRT tokens are deposited for a SubgraphDeployment.
249
253
* @param _subgraphDeploymentID SubgraphDeployment to check if curated
250
254
* @return True if curated
251
255
*/
@@ -309,9 +313,9 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
309
313
310
314
// Init curation pool
311
315
if (curationPool.tokens == 0 ) {
312
- newTokens = newTokens.sub (minimumCurationStake );
313
- curTokens = minimumCurationStake ;
314
- curSignal = SIGNAL_PER_MINIMUM_STAKE ;
316
+ newTokens = newTokens.sub (minimumCurationDeposit );
317
+ curTokens = minimumCurationDeposit ;
318
+ curSignal = SIGNAL_PER_MINIMUM_DEPOSIT ;
315
319
reserveRatio = defaultReserveRatio;
316
320
}
317
321
@@ -424,7 +428,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
424
428
* @dev Deposit Graph Tokens in exchange for signal of a curation pool.
425
429
* @param _curator Address of the staking party
426
430
* @param _subgraphDeploymentID Subgraph deployment from where the curator is minting
427
- * @param _tokens Amount of Graph Tokens to stake
431
+ * @param _tokens Amount of Graph Tokens to deposit
428
432
* @return Signal minted
429
433
*/
430
434
function _mint (
@@ -436,7 +440,10 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration, Governed {
436
440
437
441
// If it hasn't been curated before then initialize the curve
438
442
if (! isCurated (_subgraphDeploymentID)) {
439
- require (_tokens >= minimumCurationStake, "Curation stake is below minimum required " );
443
+ require (
444
+ _tokens >= minimumCurationDeposit,
445
+ "Curation deposit is below minimum required "
446
+ );
440
447
441
448
// Initialize
442
449
curationPool.reserveRatio = defaultReserveRatio;
0 commit comments