Skip to content

Commit 4c1ebac

Browse files
committed
chore: gas optimizations (OZ N-12)
Signed-off-by: Tomás Migone <[email protected]>
1 parent 3010086 commit 4c1ebac

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/horizon/contracts/data-service/extensions/DataServicePausable.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ abstract contract DataServicePausable is Pausable, DataService, IDataServicePaus
3232
}
3333

3434
/// @inheritdoc IDataServicePausable
35-
function pause() external override onlyPauseGuardian whenNotPaused {
35+
function pause() external override onlyPauseGuardian {
3636
_pause();
3737
}
3838

3939
/// @inheritdoc IDataServicePausable
40-
function unpause() external override onlyPauseGuardian whenPaused {
40+
function unpause() external override onlyPauseGuardian {
4141
_unpause();
4242
}
4343

packages/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ abstract contract DataServicePausableUpgradeable is PausableUpgradeable, DataSer
3131
}
3232

3333
/// @inheritdoc IDataServicePausable
34-
function pause() external override onlyPauseGuardian whenNotPaused {
34+
function pause() external override onlyPauseGuardian {
3535
_pause();
3636
}
3737

3838
/// @inheritdoc IDataServicePausable
39-
function unpause() external override onlyPauseGuardian whenPaused {
39+
function unpause() external override onlyPauseGuardian {
4040
_unpause();
4141
}
4242

packages/horizon/contracts/staking/HorizonStaking.sol

+2-1
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,9 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
735735
* @param _tokens The amount of tokens to add to the provision
736736
*/
737737
function _addToProvision(address _serviceProvider, address _verifier, uint256 _tokens) private {
738-
Provision storage prov = _provisions[_serviceProvider][_verifier];
739738
require(_tokens != 0, HorizonStakingInvalidZeroTokens());
739+
740+
Provision storage prov = _provisions[_serviceProvider][_verifier];
740741
require(prov.createdAt != 0, HorizonStakingInvalidProvision(_serviceProvider, _verifier));
741742
uint256 tokensIdle = _getIdleStake(_serviceProvider);
742743
require(_tokens <= tokensIdle, HorizonStakingInsufficientIdleStake(_tokens, tokensIdle));

packages/subgraph-service/contracts/libraries/LegacyAllocation.sol

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ library LegacyAllocation {
5454
) internal {
5555
require(!self[allocationId].exists(), LegacyAllocationAlreadyExists(allocationId));
5656

57-
State memory allocation = State({ indexer: indexer, subgraphDeploymentId: subgraphDeploymentId });
58-
self[allocationId] = allocation;
57+
self[allocationId] = State({ indexer: indexer, subgraphDeploymentId: subgraphDeploymentId });
5958
}
6059

6160
/**

0 commit comments

Comments
 (0)