From e84e917f794b0d59f4f1d8ca72a1bdea3df03f8a Mon Sep 17 00:00:00 2001 From: Bogdan Kovtun Date: Fri, 15 Oct 2021 01:40:15 +0300 Subject: [PATCH] Use temp variable for usedSigningKeys for gas saving --- contracts/0.4.24/nos/NodeOperatorsRegistry.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/0.4.24/nos/NodeOperatorsRegistry.sol b/contracts/0.4.24/nos/NodeOperatorsRegistry.sol index b14969e79..bc12ca570 100644 --- a/contracts/0.4.24/nos/NodeOperatorsRegistry.sol +++ b/contracts/0.4.24/nos/NodeOperatorsRegistry.sol @@ -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); } }