@@ -186,7 +186,7 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
186186 /**
187187 * @dev Check if the caller is the slasher.
188188 */
189- modifier onlySlasher {
189+ modifier onlySlasher () {
190190 require (slashers[msg .sender ] == true , "!slasher " );
191191 _;
192192 }
@@ -976,10 +976,10 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
976976
977977 // -- Collect protocol tax --
978978 // If the Allocation is not active or closed we are going to charge a 100% protocol tax
979- uint256 usedProtocolPercentage =
980- (allocState == AllocationState.Active || allocState == AllocationState.Closed)
981- ? protocolPercentage
982- : MAX_PPM;
979+ uint256 usedProtocolPercentage = (allocState == AllocationState.Active ||
980+ allocState == AllocationState.Closed)
981+ ? protocolPercentage
982+ : MAX_PPM;
983983 uint256 protocolTax = _collectTax (graphToken, queryFees, usedProtocolPercentage);
984984 queryFees = queryFees.sub (protocolTax);
985985
@@ -1114,17 +1114,16 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
11141114 // Creates an allocation
11151115 // Allocation identifiers are not reused
11161116 // The assetHolder address can send collected funds to the allocation
1117- Allocation memory alloc =
1118- Allocation (
1119- _indexer,
1120- _subgraphDeploymentID,
1121- _tokens, // Tokens allocated
1122- epochManager ().currentEpoch (), // createdAtEpoch
1123- 0 , // closedAtEpoch
1124- 0 , // Initialize collected fees
1125- 0 , // Initialize effective allocation
1126- _updateRewards (_subgraphDeploymentID) // Initialize accumulated rewards per stake allocated
1127- );
1117+ Allocation memory alloc = Allocation (
1118+ _indexer,
1119+ _subgraphDeploymentID,
1120+ _tokens, // Tokens allocated
1121+ epochManager ().currentEpoch (), // createdAtEpoch
1122+ 0 , // closedAtEpoch
1123+ 0 , // Initialize collected fees
1124+ 0 , // Initialize effective allocation
1125+ _updateRewards (_subgraphDeploymentID) // Initialize accumulated rewards per stake allocated
1126+ );
11281127 allocations[_allocationID] = alloc;
11291128
11301129 // Mark allocated tokens as used
@@ -1134,8 +1133,7 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
11341133 // Used for rewards calculations
11351134 subgraphAllocations[alloc.subgraphDeploymentID] = subgraphAllocations[
11361135 alloc.subgraphDeploymentID
1137- ]
1138- .add (alloc.tokens);
1136+ ].add (alloc.tokens);
11391137
11401138 emit AllocationCreated (
11411139 _indexer,
@@ -1207,8 +1205,7 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
12071205 // Used for rewards calculations
12081206 subgraphAllocations[alloc.subgraphDeploymentID] = subgraphAllocations[
12091207 alloc.subgraphDeploymentID
1210- ]
1211- .sub (alloc.tokens);
1208+ ].sub (alloc.tokens);
12121209
12131210 emit AllocationClosed (
12141211 alloc.indexer,
@@ -1310,10 +1307,9 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
13101307 uint256 delegatedTokens = _tokens.sub (delegationTax);
13111308
13121309 // Calculate shares to issue
1313- uint256 shares =
1314- (pool.tokens == 0 )
1315- ? delegatedTokens
1316- : delegatedTokens.mul (pool.shares).div (pool.tokens);
1310+ uint256 shares = (pool.tokens == 0 )
1311+ ? delegatedTokens
1312+ : delegatedTokens.mul (pool.shares).div (pool.tokens);
13171313
13181314 // Update the delegation pool
13191315 pool.tokens = pool.tokens.add (delegatedTokens);
0 commit comments