Skip to content

Commit

Permalink
Use temp variable for usedSigningKeys for gas saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Psirex committed Oct 14, 2021
1 parent e6bbd40 commit e84e917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/0.4.24/nos/NodeOperatorsRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ contract NodeOperatorsRegistry is INodeOperatorsRegistry, IsContract, AragonApp
uint64 totalSigningKeys = operators[operatorId].totalSigningKeys;
uint64 usedSigningKeys = operators[operatorId].usedSigningKeys;
if (totalSigningKeys != usedSigningKeys) { // write only if update is needed
operators[operatorId].totalSigningKeys = operators[operatorId].usedSigningKeys; // discard unused keys
operators[operatorId].totalSigningKeys = usedSigningKeys; // discard unused keys
emit NodeOperatorTotalKeysTrimmed(operatorId, totalSigningKeys - usedSigningKeys);
}
}
Expand Down

0 comments on commit e84e917

Please sign in to comment.