@@ -8,6 +8,7 @@ import "@openzeppelin/contracts/proxy/Clones.sol";
8
8
9
9
import "../bancor/BancorFormula.sol " ;
10
10
import "../upgrades/GraphUpgradeable.sol " ;
11
+ import "../utils/TokenUtils.sol " ;
11
12
12
13
import "./CurationStorage.sol " ;
13
14
import "./ICuration.sol " ;
@@ -242,18 +243,12 @@ contract Curation is CurationV1Storage, GraphUpgradeable {
242
243
_updateRewards (_subgraphDeploymentID);
243
244
244
245
// Transfer tokens from the curator to this contract
245
- // This needs to happen after _updateRewards snapshot as that function
246
+ // Burn the curation tax
247
+ // NOTE: This needs to happen after _updateRewards snapshot as that function
246
248
// is using balanceOf(curation)
247
- IGraphToken graphToken = graphToken ();
248
- require (
249
- graphToken.transferFrom (curator, address (this ), _tokensIn),
250
- "Cannot transfer tokens to deposit "
251
- );
252
-
253
- // Burn withdrawal fees
254
- if (curationTax > 0 ) {
255
- graphToken.burn (curationTax);
256
- }
249
+ IGraphToken _graphToken = graphToken ();
250
+ TokenUtils.pullTokens (_graphToken, curator, _tokensIn);
251
+ TokenUtils.burnTokens (_graphToken, curationTax);
257
252
258
253
// Update curation pool
259
254
curationPool.tokens = curationPool.tokens.add (_tokensIn.sub (curationTax));
@@ -306,7 +301,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable {
306
301
}
307
302
308
303
// Return the tokens to the curator
309
- require (graphToken (). transfer (curator, tokensOut), " Error sending curator tokens " );
304
+ TokenUtils. pushTokens (graphToken (), curator, tokensOut );
310
305
311
306
emit Burned (curator, _subgraphDeploymentID, tokensOut, _signalIn);
312
307
0 commit comments